CN114629389A - Position and speed information decoding scheme of motor sine and cosine encoder - Google Patents

Position and speed information decoding scheme of motor sine and cosine encoder Download PDF

Info

Publication number
CN114629389A
CN114629389A CN202210378932.4A CN202210378932A CN114629389A CN 114629389 A CN114629389 A CN 114629389A CN 202210378932 A CN202210378932 A CN 202210378932A CN 114629389 A CN114629389 A CN 114629389A
Authority
CN
China
Prior art keywords
signal
encoder
speed
sine
software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210378932.4A
Other languages
Chinese (zh)
Inventor
林明耀
蔡沛钊
杨安晨
刘凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southeast University
Original Assignee
Southeast University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southeast University filed Critical Southeast University
Priority to CN202210378932.4A priority Critical patent/CN114629389A/en
Publication of CN114629389A publication Critical patent/CN114629389A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/14Electronic commutators
    • H02P6/16Circuit arrangements for detecting position
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • H02P21/18Estimation of position or speed
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/08Arrangements for controlling the speed or torque of a single motor
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/14Electronic commutators
    • H02P6/16Circuit arrangements for detecting position
    • H02P6/17Circuit arrangements for detecting position and for generating speed information

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

The invention discloses a decoding scheme of position and speed information of a motor sine and cosine encoder, which comprises hardware, software, a preprocessing circuit module and a signal conditioning circuit module, wherein the position encoder comprises a sine and cosine encoder and a pulse encoder, the hardware comprises hardware filtering and a hysteresis comparator, a sampling signal of an output signal of the position encoder after being filtered by the hardware is conditioned to be used as an analog signal sample of the software, and the hysteresis comparator is used for an auxiliary speed measuring link. The decoding scheme solves the problem of inaccurate position signals caused by large interference noise of analog position signals output by a motor sine and cosine encoder commonly used in the industrial automation industry through a software processing algorithm and a corresponding auxiliary hardware module, can obtain the speed signals after interference resistance, is matched with a hardware speed measuring circuit for decoding, can avoid the problems of peak and pulse caused by direct differentiation of the position signals, and can be used for rotor position angle information and speed information controlled by high performance of a motor through a complete set of decoding scheme.

Description

Position and speed information decoding scheme of motor sine and cosine encoder
Technical Field
The invention relates to the field of motor position sensor decoding, in particular to a position and speed information decoding scheme of a motor sine and cosine encoder.
Background
The motor can exert the key of high performance, and is characterized in that the high performance control method is matched, vector control and magnetic field orientation control are used as the current mainstream alternating current motor control mode, and the decoupling of a torque component and an excitation component in stator current is realized, so that the high performance control of the motor is realized. The core of high-performance control implemented by using a magnetic field orientation control technology is to acquire the position information of a magnetic pole of a motor rotor in real time to realize stator current decoupling control and the real-time rotating speed information of the rotor to realize speed closed-loop control.
In order to obtain accurate rotor electrical angle position information and the rotating speed of a motor, a position sensor is installed, and the scheme is widely applied in the industry, a sine and cosine encoder is used as one of the position sensors and is largely adopted in the aspects of a numerical control machine tool and a walking driving motor, but because the position signals output by the sine and cosine encoder are analog signals, the position sensors are easily interfered by the outside, particularly in the application occasions of the motor with large current or high power grade, and the length of a position signal wire is limited, so that the analog signals are distorted by overlong signal wires, the normal operation of the motor can be seriously influenced by the interfered position signals, and even the condition that the motor is out of control exists.
The existing sine and cosine encoder position signal decoding scheme mainly performs processing and anti-interference on hardware, hardware cost is increased, the processing on the hardware has limited inhibition on interference and noise, practical application of some existing schemes is restricted to a great extent, and meanwhile, a proper solution scheme is not provided for speed signals, so that a proper position and speed information decoding scheme of a motor sine and cosine encoder, which is cost-saving and has better performance, is provided.
Disclosure of Invention
The invention aims to provide a position and speed information decoding scheme of a motor sine and cosine encoder, which realizes that the output signal of the position encoder is processed into rotor position angle information and speed information which are used for eliminating interference and filtering noise and can be used for high-performance control of a motor through a complete set of decoding scheme.
The purpose of the invention can be realized by the following technical scheme:
the utility model provides a position speed information decoding scheme of motor sine and cosine encoder, the decoding scheme includes hardware, software, preliminary treatment and signal conditioning circuit module, and position encoder includes sine and cosine encoder and pulse coder, and the hardware includes hardware filtering and hysteresis comparator, and the sampling signal conditioning that position encoder output signal passes through hardware filtering is as the analog signal sampling of software, and the hysteresis comparator is used for doing the supplementary link that tests the speed.
Further, the decoding scheme decodes an output signal of a sine and cosine encoder:
and S1, the signal conditioning circuit module performs hardware conditioning and tracking preprocessing on the output signal of the sine and cosine position sensor.
And S2, reading the signals filtered and preprocessed by the hardware through analog sampling by software.
And S3, giving a voltage vector of a virtual angle by software, rotating the motor at a low speed in a testability manner, reading and storing the amplitudes of the Asin and Bcos signals output by the encoder by the software, determining the amplitude of the output signal of the encoder by the software by adopting a least square method with a forgetting factor, reading the maximum value and the minimum value information of the output signal of the encoder by calculating convergence, finishing an amplitude discrimination link, and providing amplitude correction for the position signal of the normal operation of the motor.
And S4, the software samples and reads the analog signal of the output signal of the encoder, the software realizes amplitude correction of the position signal by using the Asin and Bcos convergence amplitude information obtained in S3, the results after the Asin and Bcos amplitude correction are respectively Asin and Bcos, the initial calculation of the position signal is completed by combining the Asin and Bcos signals and the software arctangent calculation, the unprocessed position signal is obtained, and the unprocessed position signal is transmitted to the nonlinear differential tracking.
S5: the non-linear differential tracking algorithm realized by software performs tracking differential calculation and filtering processing on unprocessed position signals to obtain improved processed position information and speed information after interference is weakened.
Further, the decoding scheme performs an auxiliary speed measurement reference for the output signal of the sine and cosine encoder:
and S1, outputting each output signal of the sine and cosine encoder to a single double-level pulse in a trigonometric function period by using a hardware hysteresis comparator.
And S2, completing sampling of digital signals by software to perform pulse capture and time recording, detecting the interval time of the pulse signals output by the comparator by the software, calculating the current rotating speed, inputting the double-level pulse signals to a digital IO port of the single chip microcomputer, and completing the calculation of time difference in the single chip microcomputer to complete auxiliary speed measurement.
S3: and (3) comprehensively switching and calculating the software speed, and combining the auxiliary speed measurement and the differential speed measurement to obtain an accurate speed signal.
Further, the decoding scheme provides a decoding flow of other types of pulse encoders on the basis of the original decoding scheme without changing the original hardware device:
the hardware hysteresis comparator structure inputs a digital quantity signal at the front stage, the digital quantity signal is a pulse type position encoder, the accuracy of the position signal is improved by the hysteresis structure, the digital signal at the rear stage of the hysteresis is read by software, and the position signal is processed by the software.
Further, the virtual angle is set as a position angle of the motor, a voltage vector with a fixed amplitude value is set, rotation of the voltage vector with a fixed angular frequency is given, a motor rotor is forcibly pulled to run at a low speed, the position signal maximum value of a motor sine and cosine encoder is detected, multiple maximum value data are obtained, amplitude correction is carried out by using a convergence algorithm, the amplitude correction adopts an estimation method of forgetting factor least square, and the set performance index J is as follows:
Figure BDA0003591446490000031
wherein k represents the kth sampling moment, and L represents the length of a data vector, namely the number of sampling points; y (k) is a sample output vector of a system needing to be identified, the system comprises the maximum value and the minimum value of two paths of output signals obtained by sampling, phi (k) represents the system vector, theta (k) needs to be fitted with an identified variable matrix, namely an algorithm amplitude discrimination result, the newest real-time data is weighted by 1, and the data of the former k sampling periods are weighted by lambdal L-k. Thus, the least square method with forgetting factor is realized in the following form:
Figure BDA0003591446490000041
wherein, k (k) is a middle convergence matrix, and when the error vectors epsilon (k) of the two adjacent identification results are considered to meet, the convergence amplitude discrimination process is completed:
ε(k)=[ε1(k) ε2(k) ... εn(k)]T
Figure BDA0003591446490000042
further, the amplitude-corrected sine-cosine encoder output signal is subjected to angle calculation, and when the signal amplitude-corrected Bcos signal Bcos is greater than zero, the mechanical position angle θ r is arctan (Asin/Bcos); when the signal amplitude corrected Bcos signal Bcos is smaller than zero, the mechanical position angle θ r ═ arctan (Asin/Bcos) + pi.
Further, a nonlinear differential tracking system model performs denoising and tracking differential processing on the position angle after amplitude correction:
Figure BDA0003591446490000043
Figure BDA0003591446490000044
wherein the parameter R is a gain coefficient and is used for adjusting the amplitude gain of the sigmoid modification function; c is a convergence coefficient factor used for adjusting the convergence speed and the linear interval range of the modification function; θ r (t) is a mechanical position angle obtained by direct arctangent without processing; θ r1(t) is the mechanical position angle after being processed by the tracking system; ω r1(t) is the mechanical rotation speed processed by the tracking system; r is the tracking coefficient of the system. Thus, nonlinear filtered position information and tracking differential velocity information can be obtained.
Furthermore, the output signal of the sine and cosine encoder is converted into a digital quantity signal with a single double-level pulse in a trigonometric function period through a hardware hysteresis comparator, and the time difference between the rising edge of the Asin digital signal and the rising edge of the Bcos digital signal and the time difference between the falling edge of the Asin digital signal and the falling edge of the Bcos digital signal are measured.
The Asin of the output signal of the encoder is different from the Bcos by a phase angle of pi/2, the phase angle of pi/2 reflects the mechanical angle of the actual rotor position passing through pi/2, and the singlechip can capture the time difference of the pulse signal output by the comparator so as to obtain the time of the rotor passing through the mechanical angle of pi/2, thereby completing auxiliary speed measurement.
The smooth switching algorithm for the auxiliary reference speed measurement and the tracking differential speed sum has the following weighted switching function:
Figure BDA0003591446490000051
wherein, ω r2(t) is the mechanical rotation speed after the auxiliary speed measurement processing; ω r (t) is the final rotation speed.
Furthermore, the hardware hysteresis comparator structure processes the analog quantity signal output by the sine and cosine encoder, and can input the digital quantity signal of the pulse encoder at the front stage.
The input side of the hysteresis comparator is provided with a pull-up 5V power supply, the 5V power supply is connected to the input signal side of the comparator through a triode, and the triode is controlled by a single chip IO.
The invention has the beneficial effects that:
1. the decoding scheme of the invention reduces the noise interference of the output signals of the sine and cosine encoder, and obviously improves the precision of position detection;
2. the decoding scheme of the invention avoids the mode of directly differentiating the speed of the position signal by adopting a software algorithm, improves the stability and the accuracy of a speed measuring system, and weakens the speed spike and the pulsation phenomenon possibly brought by differentiating the speed;
3. the decoding scheme has better effect by adopting a scheme of decoding the position and speed signals by adopting a software algorithm, and solves the problems of increased cost and unstable processing effect of the existing scheme or the hardware filtering scheme used by the invention;
4. the decoding scheme of the invention improves the anti-interference capability and robustness of the speed measurement system by adopting a scheme of assisting speed measurement reference and tracking differential speed calculation and smoothly switching.
5. The decoding scheme of the invention can assist the speed measuring module to artificially control the speed measuring front-stage module serving as other pulse type encoders, provides input interfaces for other non sine and cosine type position sensors, and has multiple functions.
Drawings
The invention will be further described with reference to the accompanying drawings.
FIG. 1 is a schematic structural diagram of a position and velocity information decoding scheme of a sine and cosine encoder of a motor according to the present invention;
FIG. 2 is a software flowchart of the position and velocity information decoding scheme of the motor sine and cosine encoder of the present invention;
FIG. 3 is a diagram illustrating the process of software parameter identification and amplitude discrimination convergence;
FIG. 4 is a diagram of two output signals of a sine and cosine encoder with interference noise;
FIG. 5 shows the result of amplitude correction of the output signal of the encoder and the result of direct inverse tangent calculation;
FIG. 6 is a sigmoid modification function plot of nonlinear differential tracking;
FIG. 7 is a result of position information before filtering the arctangent position signal using a tracking algorithm;
FIG. 8 is a result of position information obtained after filtering the arctangent position signal using a tracking algorithm;
FIG. 9 is an enlarged time domain view of position information before the position signal is filtered by a tracking algorithm;
FIG. 10 is an enlarged time domain view of the position information after the position signal is filtered by a tracking algorithm;
FIG. 11 is a velocity information result after using direct differentiation processing on the arctangent position signal;
FIG. 12 is a velocity information result after processing an arctangent position signal using a non-linear differential algorithm;
FIG. 13 is an enlarged time domain view of velocity information after the velocity signal has been processed using direct differentiation;
FIG. 14 is an enlarged time domain view of velocity information after the velocity signal has been processed using nonlinear differential results;
FIG. 15 is a functional schematic diagram of a hardware hysteresis comparator;
fig. 16 is a graph of the switching function of the auxiliary tachometer reference to the nonlinear differential tachometer.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A decoding scheme for position and speed information of a motor sine and cosine encoder is shown in figure 1 and comprises a hardware module, a software module, a preprocessing circuit module and a signal conditioning circuit module, wherein the preprocessing of signal conditioning and tracking is realized by the output of the position encoder through the signal conditioning circuit module, and the hardware and preprocessing signals are read into the software by analog signal sampling of a single chip microcomputer.
The position encoder includes a sine and cosine encoder and a pulse encoder.
The hardware comprises hardware filtering and a hysteresis comparator, a sampling signal of an output signal of the position encoder after being filtered by the hardware is conditioned to be used as an analog signal sample of the software, and the hysteresis comparator is used for being used as an auxiliary speed measuring link.
As shown in fig. 2, the decoding scheme includes the steps of:
the method comprises the following steps: pretesting
S1: the motor is tested to rotate, a virtual angle is set as a position angle of the motor, a voltage vector with a fixed amplitude value is set to drive the motor to run at a low speed, the angle of the voltage vector is the set virtual angle, a motor rotor is forcibly pulled through the rotation of the given voltage vector, and meanwhile, an algorithm detects a position signal of a sine and cosine encoder of the motor.
S2: the software reads and stores the amplitude of Asin and Bcos signals output by the encoder, the software determines the amplitude of the output signal of the encoder by adopting a least square method with a forgetting factor, the motor rotates at a low speed testability by a voltage vector with a given virtual angle so as to judge the information of the maximum value and the minimum value output by a position signal, an amplitude discrimination link is completed, a parameter identification system is required to have the capability of real-time data iteration when the amplitude is discriminated, amplitude correction is provided for the position signal of the motor in normal operation, and in the amplitude correction method, a set performance index J is as follows:
Figure BDA0003591446490000081
wherein k represents the kth sampling moment, and L represents the length of a data vector, namely the number of sampling points; y (k) is a sample output vector of the required identification system, and the maximum value and the minimum value of two paths of output signals obtained by sampling are included in the invention; phi (k) represents a system vector; theta (k) needs to be fitted with the identified variable matrix, namely the amplitude discrimination result of the algorithm.
Unlike the performance index of ordinary least squares, the addition of exponential weights means that a time-varying weighting coefficient is applied to the data, the latest real-time data is weighted by 1, and the data of the first k sampling periods is weighted by λ L-k. Thus, the least square method with forgetting factor is realized in the following form:
Figure BDA0003591446490000082
where K (k) is an intermediate convergence matrix.
S3: in the parameter identification process of software amplitude discrimination, as shown in fig. 3, as the test rotation progresses, the identification result gradually converges to a certain value, and the error e between two adjacent identification results satisfies:
ε(k)=|θ(k)-θ(k-1)|<[0.05 0.05 0.05 0.05]T
if epsilon does not meet the requirement, the numerical value is transmitted to the step S1 for pretesting, if epsilon meets the requirement, the identification convergence and amplitude discrimination test of the software is completed, the data after amplitude discrimination is stored in the software memory, and the test is completed.
Step two: decoding
S1: when the motor actually runs, according to the amplitude convergence parameter obtained in the preprocessing, sampling of the analog signal is carried out on the conditioned encoder output signal through software, and reading of the signal is achieved.
S2: by utilizing the pretesting step, amplitude correction is performed on the encoder output signal through an algorithm, the encoder output signal actually input into software still has interference and noise after being conditioned by a sampling signal of hardware, and therefore, subsequent software algorithms are required to perform noise elimination on the signal.
S3: and (3) the software realizes amplitude correction of the position signals by using the Asin and Bcos convergence amplitude information obtained in the step one, the results of Asin and Bcos amplitude correction are respectively Asin and Bcos, the preliminary calculation of the position signals is completed by combining the Asin and Bcos signals and software arctangent calculation, unprocessed position signals are obtained, and the unprocessed position signals are transmitted to the nonlinear differential tracking.
S4, calculating the mechanical position angle of the rotor of the motor, taking an absolute sine and cosine encoder as an example (magnetic steel is additionally arranged on a rotor shaft, when the rotor passes through a mechanical period, signals Asin and Bcos are output to complete a period, and a zero calibration signal Z of an incremental encoder is not needed), and calculating the position information:
when the signal amplitude corrected Bcos signal Bcos is greater than zero, the mechanical position angle
Figure BDA0003591446490000091
When the signal amplitude corrected Bcos signal Bcos is less than zero, the mechanical position angle
Figure BDA0003591446490000092
As shown in fig. 5, the position angle information is an example convenient for visual demonstration, normalization processing is performed, due to the existence of interference and noise, a certain clutter exists in the encoder output signal after amplitude correction, and meanwhile, the pulse and transient position signal mutation exist in the position information result obtained by directly calculating the inverse tangent of the encoder output signal, so that the encoder output signal needs to be subjected to algorithmic optimization processing, so that the position signal has the pulse and the peak as small as possible.
S5, non-linear interference filtering and differential tracking processing are carried out on the unprocessed position signals by adopting a non-linear differential tracking mode to obtain improved processing position information and speed information after interference is weakened:
for the system
Figure BDA0003591446490000101
When any solution of the system satisfies the conditions that when T → ∞, z1(T) → 0, z2(T) → 0, then for any bounded multiplicative function v (T) and any constant T >0, the system
Figure BDA0003591446490000102
X1(t) satisfies
Figure BDA0003591446490000103
Designing a new differential tracking system, and realizing the tracking of v (t) by using a solution x1(t) of the system and realizing the tracking differential solving of v (t) by using a state variable x2(t), wherein a sigmoid modification function is used for the design of a nonlinear tracking function f (x1(t) -v (t), and x2 (t)/M). This function may be represented by the following sub-formula:
Figure BDA0003591446490000104
wherein the parameter R is a gain coefficient and is used for adjusting the amplitude gain of the sigmoid modification function; c is a convergence coefficient factor used for adjusting the convergence speed and the linear interval range of the modification function; sigmoid modification function for nonlinear differential tracking, the curve is shown in fig. 6.
Based on this, the nonlinear differential tracking system is designed as follows:
Figure BDA0003591446490000105
and theta r (t) is a mechanical position angle obtained by directly calculating arctangent without processing, theta r1(t) is a mechanical position angle processed by a tracking system, omega r1(t) is a mechanical rotating speed processed by the tracking system, M, r is a tracking coefficient of the system, and when r is increased, the tracking speed can be increased, but the noise suppression capability of a differential signal is weakened.
The parameter setting process for the system can comprise the following steps: as previously mentioned, adjusting C1 and C2 can adjust the convergence speed and the linear range of the tracking signal and the differential signal, generally by first coarsely adjusting the determination of C1 and C2; selecting r to adjust the overall tracking effect, taking M as a tracking coefficient of a sigmoid modification function in a differential tracking item, and adjusting M to set the differential tracking performance; and then, the integral effects of tracking and differentiation are considered through comprehensively setting R1 and R2, so that the integral performance of the system reaches the standard. In this embodiment, the parameters are selected as R100, M1000, R1 2, R2 15, C1 5, and C2 5.
In order to verify the filtering effect of de-noising and tracking differentiation of the actual position signal in the scheme of the invention, in the embodiment, the rotating speed of a motor is accelerated to 2400r/min from 0 to 1s in the experiment platform, the rotating speed in 1 s-2 s is maintained at 2400r/min, the rotating speed of the motor in 2 s-3 s is reduced to 1200r/min from 2400r/min, and the rotating speed of the motor is kept at 1200r/min after 3s, so that the actual effect of the decoding scheme of the output signal of the sine and cosine encoder is tested, and compared with the traditional scheme.
As shown in fig. 7, 8, 9 and 10, the position signals after the amplitude correction and the arctangent calculation in fig. 5 are subjected to the position information results before and after the filtering processing by adopting the tracking algorithm, and as shown in fig. 11 and 12, the speed information results obtained by using the nonlinear differential algorithm and the direct differential processing on the position signals after the amplitude correction and the arctangent calculation in fig. 5 are respectively shown in fig. 13 and 14 by scaling time axes of fig. 11 and 12 to show the speed information solving conditions under the motor acceleration dynamic condition (0-0.4s start-up acceleration) and the steady state operation (1.1 s-1.5 s steady speed operation).
The decoding scheme has a better filtering effect on actual position angle information, and compared with a speed solving mode of directly solving the difference of the angle, the tracking differential system has a better denoising effect, and compared with a speed solving mode of directly solving the difference of the inverse tangent, the tracking differential system has a better tracking and filtering effect on the position information containing noise and interference, the differential tracking performance of the algorithm is tested under the dynamic and steady conditions respectively, the tracking and differential signals have no overshoot, an ideal signal is tracked more quickly, and the tracking precision is higher.
Step three: speed observation
S1: the speed information can be acquired by the nonlinear differentiation, or the hardware hysteresis comparator can be used as a part of auxiliary speed measurement, and participates in the working process of speed information acquisition, a signal output by a sine and cosine encoder outputs a single double-level pulse in a trigonometric function period, the difference between the rising edges of the two pulses is 1/4 mechanical periods according to the principle of the sine and cosine encoder, and the time difference between the rising edge of the signal passing through the hysteresis comparator Asin and the rising edge of Bcos and the time difference between the falling edge of the signal passing through the hysteresis comparator Asin and the falling edge of Bcos can be measured according to the principle of the sine and cosine encoder and can be used as an auxiliary speed reference. The double-level pulse signal is input to a digital IO port of the single chip microcomputer.
S2: the software finishes digital signal sampling, the software performs pulse capture and time recording, the software detects the interval time of the comparator outputting pulse signals and calculates the current rotating speed, as shown in fig. 14, the Asin of the encoder output signals is different from the Bcos by a phase angle of pi/2, the Asin corresponds to a sine and cosine absolute position encoder, the phase angle of pi/2 reflects that the actual rotor position passes through a mechanical angle of pi/2, and a digital IO port of the single chip microcomputer can capture the pulse signals output by the comparator so as to obtain the time of the rotor passing through the mechanical angle of pi/2, thereby finishing auxiliary speed measurement.
S3: and (3) performing comprehensive switching calculation on the software speed, and synthesizing results of auxiliary speed measurement and differential speed measurement to complete a speed measurement function, wherein an auxiliary speed measurement result corresponding to S2 in the third step and the tracking differential speed obtained in S5 in the second step are simultaneously used as input of a speed measurement switching function, the switching function is designed based on a modified sigmoid function, the tracking differential speed measurement result is mainly adopted at a low speed, and speed observation is performed by combining the high speed and the auxiliary speed measurement to obtain an accurate speed signal.
As shown in fig. 15, the weighted switching function is:
Figure BDA0003591446490000121
wherein, ω r2(t) is the mechanical rotation speed after the auxiliary speed measurement processing; ω r (t) is the final rotation speed. The switching function takes ω r1(t) as a variable condition of a switching weight coefficient, realizes smooth weighted summation and speed switching of ω r1(t) and ω r2(t), and obtains a final rotating speed.
S4: in original decoding scheme, on the basis that does not change original hardware device, the other kinds of pulse encoder that provide decode, hardware hysteresis comparator structure, can be at preceding stage input digital quantity signal, both can be the analog signal of sine and cosine encoder output, also can be digital quantity signal (digital quantity signal is pulse encoders such as switch hall type position sensor, photoelectric type encoder), and the structure of hysteresis can improve position signal's the degree of accuracy, the existence of having avoided the spike burr makes the position misjudgement, the digital quantity output of hysteresis back stage is inputed to singlechip IO mouth equally, do position signal processing by the singlechip.
Furthermore, a pull-up 5V power supply is arranged on the input side of the hysteresis comparator, the 5V power supply is connected to the input signal side of the comparator through a triode, and the triode is controlled by a single chip IO; if the output signal of the position sensor is an open-drain output signal needing level pull-up, the triode can be controlled to be turned on through the single chip microcomputer, and normal use of the open-drain output signal is further achieved.
In the description herein, references to the description of "one embodiment," "an example," "a specific example" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed.

Claims (9)

1. The utility model provides a position speed information decoding scheme of motor sine and cosine encoder, the decoding scheme includes hardware, software, preliminary treatment and signal conditioning circuit module, and position encoder includes sine and cosine encoder and pulse coder, and the hardware includes hardware filtering and hysteresis comparator, and the sampling signal conditioning that position encoder output signal passes through hardware filtering is as the analog signal sampling of software, and the hysteresis comparator is used for doing the supplementary link that tests the speed.
2. The decoding scheme for position and speed information of a sine and cosine encoder of claim 1, wherein the decoding scheme decodes the output signal of the sine and cosine encoder:
s1, the signal conditioning circuit module performs hardware conditioning and tracking pretreatment on the output signal of the sine and cosine position sensor;
s2, reading the signals filtered and preprocessed by the hardware through analog sampling by software;
s3, giving a voltage vector of a virtual angle by software, rotating the motor at a low speed in a testability manner, reading and storing the amplitude values of the Asin and Bcos signals output by the encoder by the software, determining the amplitude value of the output signal of the encoder by the software by adopting a least square method with a forgetting factor, reading the maximum and minimum information of the output signal of the encoder by calculating and converging the output signal of the encoder, finishing an amplitude discrimination link, and providing amplitude correction for the position signal of the normal operation of the motor;
s4, the software samples and reads the analog signal of the output signal of the coder, the software realizes the amplitude correction of the position signal by using the Asin and Bcos convergence amplitude information obtained in S3, the results after the Asin and Bcos amplitude correction are respectively Asin and Bcos, the initial calculation of the position signal is completed by combining the Asin and Bcos signals and the software arc tangent calculation, the unprocessed position signal is obtained, and the unprocessed position signal is transmitted to the nonlinear differential tracking;
s5: the non-linear differential tracking algorithm realized by software carries out tracking differential calculation and filtering processing on the unprocessed position signals to obtain improved processing position information and speed information after interference is weakened.
3. The decoding scheme for position and speed information of a sine and cosine encoder of a motor according to claim 1, wherein the decoding scheme performs an auxiliary tachometer reference for an output signal of the sine and cosine encoder:
s1, outputting each path of output signal of the sine and cosine encoder to a single double-level pulse in a trigonometric function period by using a hardware hysteresis comparator;
s2, completing sampling of digital signals by software to perform pulse capture and time recording, detecting the interval time of the pulse signals output by the comparator by the software, calculating the current rotating speed, inputting the double-level pulse signals to a digital IO port of the single chip microcomputer, completing calculation of time difference in the single chip microcomputer, and completing auxiliary speed measurement;
s3: and (3) comprehensively switching and calculating the software speed, and combining the auxiliary speed measurement and the differential speed measurement to obtain an accurate speed signal.
4. The decoding scheme for position and speed information of motor sin-cos encoders according to claim 1, wherein the decoding scheme provides the decoding flow of other kinds of pulse encoders based on the original decoding scheme without changing the original hardware device:
the hardware hysteresis comparator structure inputs a digital quantity signal at the front stage, the digital quantity signal is a pulse type position encoder, the accuracy of the position signal is improved by the hysteresis structure, the digital signal at the rear stage of the hysteresis is read by software, and the position signal is processed by the software.
5. The scheme for decoding the position and speed information of the sine and cosine encoder of the motor as claimed in claim 2, wherein the virtual angle is set as the position angle of the motor, a voltage vector with a fixed amplitude is set, the rotation of the voltage vector with a fixed angular frequency is given, the rotor of the motor is forcibly pulled to run at a low speed, the position signal maximum value of the sine and cosine encoder of the motor is detected, the maximum value data of a plurality of times is obtained, the amplitude is corrected by using a convergence algorithm, the amplitude correction adopts an estimation method of forgetting factor least square, and the set performance index J is:
Figure FDA0003591446480000021
wherein k represents the kth sampling moment, and L represents the length of a data vector, namely the number of sampling points; y (k) is a sample output vector of a system needing to be identified, the invention comprises the maximum value and the minimum value of two output signals obtained by sampling, phi (k) represents the system vector, theta (k) needs to be fitted with a variable matrix of identification, namely an algorithm amplitude identification result, the newest real-time data is weighted by 1, and the data of the previous k sampling periods are weighted by lambada L-k, so that the least square method with the forgetting factor is realized in the following form:
Figure FDA0003591446480000031
wherein, k (k) is a middle convergence matrix, and when the error vectors epsilon (k) of the two adjacent identification results are considered to meet, the convergence amplitude discrimination process is completed:
ε(k)=[ε1(k) ε2(k) ... εn(k)]T
Figure FDA0003591446480000032
6. the decoding scheme for position and speed information of motor sin-cos encoder as claimed in claim 2, wherein said amplitude corrected sin-cos encoder output signal is angle calculated, when the signal amplitude corrected Bcos signal Bcos is greater than zero, the mechanical position angle θ r is arctan (Asin/Bcos); when the signal amplitude corrected Bcos signal Bcos is smaller than zero, the mechanical position angle θ r is arctan (Asin/Bcos) + pi.
7. The decoding scheme for position and velocity information of motor sin-cos encoder as claimed in claim 2, wherein said nonlinear differential tracking system model de-noizes and tracks differential processing for position angle after amplitude correction:
Figure FDA0003591446480000033
Figure FDA0003591446480000034
the parameter R is a gain coefficient and is used for adjusting the amplitude gain of the sigmoid modification function; c is a convergence coefficient factor used for adjusting the convergence speed and the linear interval range of the modification function; θ r (t) is a mechanical position angle obtained by direct arctangent without processing; θ r1(t) is the mechanical position angle after being processed by the tracking system; ω r1(t) is the mechanical rotation speed after being processed by the tracking system; r is the tracking coefficient of the system, thereby obtaining nonlinear filtered position information and tracking differentiated velocity information.
8. The position and speed information decoding scheme of the motor sine and cosine encoder as claimed in claim 3, wherein the sine and cosine encoder output signal passes through a hardware hysteresis comparator, converts an analog quantity signal output by the sine and cosine encoder into a digital quantity signal with a single double-level pulse in a trigonometric function period, and measures time differences between a rising edge of the Asin digital signal and a rising edge of the Bcos digital signal and between a falling edge of the Asin digital signal and a falling edge of the Bcos digital signal;
the Asin of the output signal of the encoder is different from the Bcos by a phase angle of pi/2, the phase angle of pi/2 reflects the mechanical angle of the actual rotor position passing through pi/2, and the singlechip can capture the time difference of the pulse signal output by the comparator so as to obtain the time of the rotor passing through the mechanical angle of pi/2 and complete auxiliary speed measurement;
the smooth switching algorithm for the auxiliary reference speed measurement and the tracking differential speed sum has the following weighted switching function:
Figure FDA0003591446480000041
wherein ω r2(t) is the mechanical rotation speed after the auxiliary speed measurement processing, and ω r (t) is the final rotation speed.
9. The scheme for decoding the position and speed information of the sine and cosine encoder of the motor as claimed in claim 4, wherein the hardware hysteresis comparator structure processes the analog quantity signal output by the sine and cosine encoder and inputs the digital quantity signal of the pulse encoder at the previous stage;
the input side of the hysteresis comparator is provided with a pull-up 5V power supply, the 5V power supply is connected to the input signal side of the comparator through a triode, and the triode is controlled by a single chip IO.
CN202210378932.4A 2022-04-12 2022-04-12 Position and speed information decoding scheme of motor sine and cosine encoder Pending CN114629389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210378932.4A CN114629389A (en) 2022-04-12 2022-04-12 Position and speed information decoding scheme of motor sine and cosine encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210378932.4A CN114629389A (en) 2022-04-12 2022-04-12 Position and speed information decoding scheme of motor sine and cosine encoder

Publications (1)

Publication Number Publication Date
CN114629389A true CN114629389A (en) 2022-06-14

Family

ID=81905932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210378932.4A Pending CN114629389A (en) 2022-04-12 2022-04-12 Position and speed information decoding scheme of motor sine and cosine encoder

Country Status (1)

Country Link
CN (1) CN114629389A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115077374A (en) * 2022-06-30 2022-09-20 中国工程物理研究院电子工程研究所 Dynamic detection device and detection method for absolute position during driving of micro-motor actuator
CN115853504A (en) * 2022-12-30 2023-03-28 北京恒泰万博石油技术股份有限公司 Continuous wave mud pulse signal simulation test device and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115077374A (en) * 2022-06-30 2022-09-20 中国工程物理研究院电子工程研究所 Dynamic detection device and detection method for absolute position during driving of micro-motor actuator
CN115853504A (en) * 2022-12-30 2023-03-28 北京恒泰万博石油技术股份有限公司 Continuous wave mud pulse signal simulation test device and method

Similar Documents

Publication Publication Date Title
CN114629389A (en) Position and speed information decoding scheme of motor sine and cosine encoder
CN101521480B (en) Resolution method and resolver for signals of rotating transformer
CN109831137B (en) Permanent magnet synchronous motor rotor position detection and initial position calibration method
CN101646922B (en) Method of detecting absolute rotational position
US9080896B2 (en) Method for analyzing signals from an angle sensor
CN108196213A (en) Zero-bit angle test device, the method and system of a kind of rotary transformer
Lee et al. Acceleration estimator for low-velocity and low-acceleration regions based on encoder position data
US8547044B2 (en) Determining the rotor angle of a synchronous machine at standstill with the aid of iterative test pulses
CN108646571B (en) High-precision position identification method for gyro frame servo system
CN109945819B (en) Method for measuring position of rotor of permanent magnet synchronous motor
CN109764897A (en) A kind of sine and cosine encoder high-speed signal acquisition and divided method and system
CN111638453A (en) Method for detecting rotating position and speed of magnetic field of servo synchronous motor
CN102045020B (en) Method for detecting position of rotor of permanent magnet motor
CN109842329A (en) Method for electric direction varying device brushless DC motor offset angular measurement
CN112880725A (en) Method for judging total pitch deviation of position sensor
CN111146980B (en) Deviation recognition and compensation method for hall sensor in different installation modes
US9065475B2 (en) Sin-Cos sensor arrangement, integrated circuit and method therefor
CN112560762B (en) Vehicle body rotation angle data processing method, device, controller and medium
CN108712116B (en) Brushless direct current motor position sensorless control method based on extreme learning machine
CN107547024B (en) No speed sensor of no bearing PMSM
Yan et al. An improved position detection method for permanent magnet linear motor using linear hall sensors
CN110086399B (en) Permanent magnet synchronous motor rotor position composite detection and starting operation method
CN205490286U (en) Servo driver
Boggarpu et al. New learning algorithm for high-quality velocity measurement from low-cost optical encoders
CN113419173A (en) Motor offline detection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination