Background
In a pure electric vehicle driving system, a sine wave permanent magnet synchronous motor is generally adopted, and the sine wave permanent magnet synchronous motor has the remarkable advantages of reliable operation, small volume, light weight, less loss, high efficiency, flexible and various shapes and sizes and the like.
In the sine wave permanent magnet synchronous motor, the motor comprises a stator and a rotor, the stator surrounds the outer side of the rotor, a plurality of permanent magnet pole pairs are arranged on the rotor, the number of the permanent magnet pole pairs is 2-4 generally, a magnetic field generated by the permanent magnet pole pairs is a sine wave magnetic field, the stator comprises three-phase windings, the windings of all phases are symmetrical, the magnetic field generated by the stator and the magnetic field generated by the rotor interact with each other by applying voltage on the three-phase windings, the rotor rotates under the interaction of the magnetic fields, and therefore electric energy is converted into mechanical energy; when three-phase alternating current is introduced through a three-phase winding of the stator, the rotary armature magnetomotive force generated by the three-phase alternating current and the established armature magnetic field cut the stator winding on one hand, and induced electromotive force is generated in the stator winding; on the other hand, the rotor is dragged to rotate at a synchronous speed by electromagnetic force, and magnetic fields generated by magnetomotive force of the stator and the rotor are distributed sinusoidally along the inner circle of the stator.
Torque control is mainly adopted for controlling the sine wave permanent magnet synchronous motor, and in order to realize accurate torque control, position information of the sine wave permanent magnet synchronous motor, namely information such as three-phase current of the motor, position (and magnetic pole position of a rotor) and speed of the rotor, needs to be obtained, and calculation is carried out according to the information, so that the torque control of the sine wave permanent magnet synchronous motor is executed.
The position information of the sine wave permanent magnet synchronous motor can be acquired by a sensor such as a photoelectric encoder or a resolver. Among them, a resolver is widely used for detecting a position of a motor, and the resolver is an electromagnetic sensor, which is also called a resolver. The small AC motor is used to measure angular displacement and speed of rotating shaft of rotating object and consists of stator and rotor. The stator winding is used as the primary side of the transformer and receives the excitation voltage, and the excitation frequency is usually 400, 3000, 5000HZ and the like. The rotor winding is used as a secondary side of the transformer, and induction voltage is obtained through electromagnetic coupling.
Generally, the decoding chip is matched with the rotary transformer for use, the decoding chip acquires position detection information of the motor through serial communication, however, when the motor runs at a high speed, the serial communication has the problems of poor anti-interference capability and poor reliability, so that the accuracy and the reliability of the acquired motor position signal can be influenced, the motor driving system is used as a main power system of the pure electric vehicle, and the reduction of the accuracy and the reliability of the position signal further causes the reduction of the safety and the reliability of the pure electric vehicle.
Disclosure of Invention
The invention provides a motor position detection method, a motor position detection device and a method using the device, which are used for solving the technical problem that in the prior art, the anti-interference capability of an SPI digital signal is poor when a motor runs at a high speed in the detection of a position signal.
In order to solve the above technical problem, the present invention provides a motor position detection method, for measuring a rotor position of a motor, wherein a resolver rotor of a resolver and a rotor of the motor are coaxially and fixedly connected, a resolver stator of the resolver and a stator of the motor are coaxially and fixedly connected, the resolver outputs a resolver input signal to a decoding chip according to rotation of the rotor of the motor, the decoding chip decodes the resolver input signal to obtain an SPI digital signal and an ABZ pulse signal, and a main control chip controls the decoding chip, the motor position detection method includes:
s101, a main control chip controls a decoding chip to start motor position detection;
step S102, a decoding chip acquires a rotary transformer input signal output by a rotary transformer, generates an SPI digital signal and an ABZ pulse signal according to the rotary transformer input signal, and sends the generated SPI digital signal and the ABZ pulse signal to a main control chip;
and S103, the main control chip receives the SPI digital signal and the ABZ pulse signal generated by the decoding chip and acquires the motor position information according to the SPI digital signal or the ABZ pulse signal.
Preferably, the step S103 of acquiring the motor position information according to the SPI digital signal or the ABZ pulse signal includes:
step S1031, the main control chip judges whether the motor is in a low-speed starting stage or a high-speed running stage, and if the motor is in the low-speed starting stage, the next step S1032 is executed; if the motor is in the high-speed operation stage, the process jumps to step S1033:
step S1032, the main control chip obtains the rotor position information of the motor in a low-speed starting stage through the SPI digital signal;
and step S1033, the main control chip acquires the rotor position information of the motor in a high-speed operation stage through the ABZ pulse signal.
Preferably, the step of acquiring the rotor position information of the motor in the high-speed operation stage by the main control chip through the ABZ pulse signal comprises: an incremental interface of the main control chip counts the AB signal increment and acquires the motor position information according to the value M of the AB signal increment counting; wherein,
when the increment counting is increased when the rotor is preset to run towards the positive direction, and when the main control chip judges that the combination sequence of the AB signals is the combination sequence of the positive direction, the increment counting is increased; when the main control chip judges that the combination order is the reverse combination order, the increment count is judged to be decreased;
when the increment counting is decreased when the rotor is preset to rotate towards the positive direction, and when the main control chip judges that the combination sequence is the combination sequence of the positive direction, the increment counting is determined to be decreased; when the main control chip judges that the combination order is the reverse combination order, the increment count is judged to be increased,
preferably, the motor position information includes a rotor position angle θ and an angular velocity ω;
the specific step of acquiring the motor position information according to the value M of the AB signal increment count is as follows: determining a position angle theta according to the value M, and then determining an angular speed omega according to the position angle theta; wherein,
<math>
<mrow>
<mi>θ</mi>
<mo>=</mo>
<mn>360</mn>
<mo>×</mo>
<mfrac>
<mi>M</mi>
<mn>4096</mn>
</mfrac>
<mo>,</mo>
<mi>ω</mi>
<mo>=</mo>
<mfrac>
<mi>dθ</mi>
<mi>dt</mi>
</mfrac>
<mo>.</mo>
</mrow>
</math>
preferably, the step of judging whether the motor is in a low-speed starting stage or a high-speed running stage by the main control chip is specifically as follows:
the main control chip detects Z pulses in the ABZ pulse signals and judges whether N1Z pulses are detected within preset time T1 or not, and if the number of the Z pulses detected within preset time T1 is less than N1, the motor is judged to be in a low-speed starting stage; and if the number of the Z pulses detected in the preset time T1 is greater than or equal to N1, judging that the motor is in a high-speed operation stage.
Preferably, the step S103 further includes:
s1034, the main control chip carries out abnormity diagnosis on the motor through the ABZ pulse signal, and when the motor is judged to be abnormally operated, the main control chip sends an operation abnormity signal and controls the motor to stop operating; and when the motor is judged not to have abnormal operation, skipping to the step S1033, and continuously calculating and acquiring the position information of the motor.
Preferably, the main control chip performing abnormality diagnosis on the motor through the ABZ pulse signal includes:
the main control chip detects Z pulses in the ABZ pulse signals and judges whether the Z pulses are continuously detected in N2 electrical angle periods, and if the Z pulses are not continuously detected in N2 electrical angle periods, the motor is judged to be in fault; otherwise, judging the normal operation of the motor.
Preferably, the main control chip performing abnormality diagnosis on the motor through the ABZ pulse signal includes:
the main control chip acquires the change rate a1 of the angular velocity omega of the motor, judges whether the change rate a1 is larger than a preset change rate threshold value a0, and judges that the motor fails if the change rate a1 is larger than or equal to a preset change rate threshold value a 0; and if the change rate a1 is smaller than a preset change rate threshold value a0, judging that the motor normally runs.
In order to solve the technical problem, the invention also provides a motor position detection device, which is characterized by comprising a sensor rotary transformer for detection, a decoding chip and a main control chip; the rotary transformer comprises a rotary transformer rotor and a rotary transformer stator, the rotary transformer rotor is coaxially and fixedly connected with a rotor of the motor, the rotary transformer stator is coaxially and fixedly connected with a stator of the motor, and the rotary transformer is used for outputting a rotary transformer input signal according to the rotation induction of the motor and providing the rotary transformer input signal to the decoding chip; the decoding chip is used for acquiring the rotary transformer input signal, generating an SPI digital signal and an ABZ pulse signal according to the rotary transformer input signal and sending the generated SPI digital signal and the ABZ pulse signal to the main control chip; the main control chip is used for receiving the SPI digital signal and the ABZ pulse signal generated by the decoding chip and acquiring the motor position information according to the SPI digital signal and the ABZ pulse signal.
In order to solve the technical problem, the invention further provides a method using the motor position detection device, which comprises the step of detecting the position of the motor by using any one of the motor position detection methods.
The beneficial effects of the invention include:
in the embodiment of the invention, the main control chip receives the SPI digital signal and the ABZ pulse signal generated by the decoding chip, and obtains the motor position information according to the SPI digital signal or the ABZ pulse signal, the main control chip judges the running state of the motor, and a group of SPI digital signals or ABZ pulse signals is selected according to different running states to obtain the position information of the motor rotor of the permanent magnet synchronous motor, by adopting different position detection signals in the starting stage and the high-speed operation stage, the problem of poor anti-interference capability of the SPI digital signal when the motor runs at high speed is solved, the anti-interference capability and the reliability of the signal are improved through the ABZ pulse signal, therefore, the accuracy and the reliability of motor control are improved, in addition, the running state of the motor is diagnosed through the ABZ pulse signal, the running abnormity of the motor can be found in time, and the reliability of the motor control is further improved.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following describes a motor position detection method and a motor position detection device provided in the embodiments of the present invention in detail with reference to the accompanying drawings, and a method for using the device.
The motor position detection method provided by the embodiment of the invention detects the rotor position of the motor through the motor position detection device. Before describing the motor position detection method provided by the embodiment of the present invention, a description is first given of a motor position detection device provided by the embodiment of the present invention.
Fig. 1 is a schematic frame diagram of a motor position detecting device according to an embodiment of the present invention. As shown in fig. 1, the motor position detecting apparatus includes a sensor resolver 10 for detection, a decoding chip 20, and a main control chip 30, wherein a detection signal output line of the resolver 10 is connected to an input signal interface of the decoding chip 20, and the decoding chip 20 is connected to the main control chip 30; the resolver 10 is also a motor for detection, and the resolver 10 includes a resolver rotor and a resolver stator, where the resolver rotor is coaxial with and fixedly connected to the rotor of the motor so that the resolver rotor rotates with the rotation of the rotor of the motor, and the resolver stator is coaxial with and fixedly connected to the stator of the motor. When the rotor of the motor rotates, the stator of the motor is fixed, the stator and the rotor of the motor are coaxial with each other by taking a central shaft as the central shaft, and the rotor of the motor moves relative to the stator of the motor through the bearing support. Therefore, when the resolver rotor of the resolver 10 rotates, an induction signal is generated at the resolver stator, and thus, the resolver 10 may generate a resolver input signal according to the rotation of the motor rotor and provide the resolver input signal to the decoding chip 20; the decoding chip 20 is configured to obtain the resolver input signal, generate an SPI digital signal and an ABZ pulse signal according to the resolver input signal, and send the generated SPI digital signal and the generated ABZ pulse signal to the main control chip 30 through an output interface of the SPI digital signal and an output interface of the ABZ pulse signal, respectively; the main control chip 30 is configured to receive the SPI digital signal and the ABZ pulse signal generated by the decoding chip 20, and acquire the motor position information according to the SPI digital signal and the ABZ pulse signal.
The main control chip 30 includes an SPI serial communication interface 31 and an incremental interface 32, where the SPI serial communication interface 31 is used to send an SPI serial communication CLOCK signal (CLOCK signal) and a chip select signal (CS signal) to the decoding chip 20, the SPI serial communication interface 31 can also be used to receive an SPI digital signal sent by the SPI digital signal output interface of the decoding chip 20, and the incremental interface 32 is used to receive an ABZ pulse signal sent by the ABZ pulse signal output interface of the decoding chip 20.
Referring to fig. 2A, a flowchart of a motor position detecting method according to an embodiment of the invention is shown. As shown in fig. 2A, the motor position detection method includes:
and S101, controlling a decoding chip to start motor position detection by a main control chip.
Specifically, the main control chip transmits an SPI serial communication CLOCK signal (CLOCK signal) and a chip select signal (CS signal) to the decoding chip. When the main control chip sends the SPI serial communication clock signal and the chip selection signal to the decoding chip, the decoding chip is in a working state, otherwise, the decoding chip is in a non-working state. In the SPI serial communication, the SPI serial communication clock signal is used for synchronization in data communication, and the chip selection signal is used for starting the data communication of the SPI serial communication.
And S102, the decoding chip acquires a rotary transformer input signal output by the rotary transformer, generates an SPI digital signal and an ABZ pulse signal according to the rotary transformer input signal, and sends the generated SPI digital signal and the generated ABZ pulse signal to the main control chip.
When the motor rotor rotates, the decoding chip applies excitation to two groups of coils in the rotary transformer, so that the rotary transformer generates two groups of signals, namely a rotary-change input signal, wherein the two groups of signals are a sine carrier signal and a cosine carrier signal respectively; the rotary transformer sends the rotary input signal to the decoding chip, the decoding chip analyzes the two groups of signals to obtain an SPI digital signal and an ABZ pulse signal, and the SPI digital signal and the ABZ pulse signal are sent to the main control chip.
And S103, the main control chip receives the SPI digital signal and the ABZ pulse signal generated by the decoding chip and acquires the motor position information according to the SPI digital signal and the ABZ pulse signal.
The SPI digital signal is received through an SPI serial communication interface of the main control chip, and the ABZ pulse signal is received through an incremental interface of the main control chip. Wherein, the SPI digital signal is a position signal with 12bit resolution, and the decoding precision of the decoding chip is 2124096. The resolution of the ABZ pulse signal is 12 bits, the incremental interface counts the AB signal in increments, and the increment counting principle is to calculate the number of the AB signals collected after the Z signal is generated. The specific process of increment counting is as follows: the incremental interface counts once whenever either of the two signals AB is inverted (from high to low or low to high). Referring to fig. 3A and 3B, which are schematic diagrams of the timing and incremental count of the ABZ signal, when the rotor position is moving in the positive direction, the timing of the ABZ pulse signal is as shown in fig. 3A, and the AB incremental count is incremented; when the rotor position is operating in the reverse direction, the timing of the ABZ pulse signal is as shown in FIG. 3B, with the AB increment count decremented. Counting the corresponding increments below the timing of the three ABZ signalsNumerical values. As can be seen from fig. 3A and 3B, the combination order of the levels of the AB signals is different when the motor turns differently, for example, in fig. 3A and 3B, when the rotor is running in the positive direction, the combination order of the levels of the AB signals is: 10. 11, 01, 00; when the rotor runs in the reverse direction, the combined sequence of the levels of the AB signals is as follows: 00. 01, 11, 10; where 1 is high and 0 is low. Therefore, the main control chip can judge whether the combination order is a combination order in a forward direction or a combination order in a reverse direction according to the combination order of the levels of the AB signals, and judge whether the increment count is incremented or decremented according to the judgment result of the combination order. However, it may be preset that the AB increment count is incremented when the rotor position is operated in one of the forward direction and the reverse direction, and the AB increment count is decremented when the rotor position is operated in the other direction.
In the embodiment of the invention, when the increment counting is increased when the rotor is preset to rotate towards the positive direction, and the main control chip judges that the combination sequence is the combination sequence of the positive direction, the increment counting is increased; when the main control chip judges that the combination order is the reverse combination order, the increment count is judged to be decreased. When the increment counting is decreased when the rotor is preset to rotate towards the positive direction, and when the main control chip judges that the combination sequence is the combination sequence of the positive direction, the increment counting is determined to be decreased; when the main control chip judges that the combination sequence is the reverse combination sequence, the incremental count is judged to be increased.
In the embodiment of the invention, the AB incremental count can be adopted to increase progressively when the rotor position runs towards the positive direction, and the AB incremental count can be adopted to decrease progressively when the rotor position runs towards the negative direction. In fig. 3A and 3B, T is a period of the AB signal, T is one of 1024 electrical angle periods, the electrical angle period corresponds to a pair of magnetic poles of the motor, that is, a position relative to a stator of the motor, and a time interval between the passing of the position by the pair of magnetic poles and the passing of the position by the next pair of magnetic poles is one electrical angle period, that is, a time taken by the electrode to rotate by the pair of magnetic poles, and when the period of the AB signal is T, that is, the period of the AB signal is 1/1024 of the electrical angle period, in fig. 3A and 3B, a set of pulse count maps below a timing chart of three signals ABZ is a count value of incremental counts corresponding to the three signals ABZ, the AB incremental counts from 000 to FFF (the count value corresponding to FFF is 4095), which corresponds to exactly one electrical angle period. The Z signal is generated once in one electrical angle period, wherein the Z signal is generated by the decoding chip according to the output signal of the rotary transformer.
Referring to fig. 2B, a flowchart for acquiring the position information of the motor according to the SPI digital signal and the ABZ pulse signal according to the embodiment of the present invention is provided. As shown in fig. 2B, step S103 in fig. 2A specifically includes:
step S1031, the main control chip judges whether the motor is in a low-speed starting stage or a high-speed running stage, and if the motor is in the low-speed starting stage, the next step S1032 is executed; if the motor is in the high-speed running stage, it jumps to step S1033.
The main control chip specifically determines whether the motor is in a low-speed starting stage or a high-speed running stage:
the main control chip detects a Z pulse in the ABZ pulse signal, judges whether the motor is in a low-speed starting stage or a high-speed running stage according to the Z pulse, specifically, sets a low-speed point in advance, judges whether the motor is in the low-speed starting stage if the running speed of the motor is less than the low-speed point, and judges whether the motor is in the high-speed starting stage if the running speed of the motor is higher than the low-speed point. The main control chip can judge whether N1Z pulses are detected within a preset time T1, and if the number of the Z pulses detected within a preset time T1 is less than N1, the motor is judged to be in a low-speed starting stage; and if the number of the Z pulses detected in the preset time T1 is greater than or equal to N1, judging that the motor is in a high-speed operation stage. Where T1 and N1 are predetermined amounts set in accordance with the low speed point. Preferably, for example, the range of the low speed point may be set to 300rpm to 500rpm, if T1 is set to 1 minute, and N1 is 1 minute time, the number of Z pulses generated when the operation speed of the motor is 300rpm to 500rpm, and therefore, the corresponding N1 value is 1200-. When the low speed point is constant, the T1 setting changes, and the N1 also changes accordingly. In the above example, if T1 is set to 1 second, the corresponding N1 value is 20-34. For example, if the low speed point is set to 300rpm and T1 is set to 1 second, the corresponding N1 value is 20, and if the number of detected Z pulses in 1 second is less than 20, the motor is determined to be in the low speed starting stage; and if the number of the Z pulses detected in 1s is more than or equal to 20, judging that the motor is in a high-speed operation stage. For example, T1 has a value in the range of 0.5s to 5s, and it is further preferable that T1 is set to 1 s; n1 is a value obtained from a low speed point and T1, and N1 is in a range of 5 to 50.
And step S1032, the main control chip acquires the rotor position information of the motor in a low-speed starting stage through the SPI digital signal.
The motor is in a low-speed starting stage, wherein the SPI digital signal comprises information of a motor rotor position angle, the motor rotor position angle is determined according to a rotary transformer input signal and is a function of a decoding chip, the decoding chip can monitor the motor rotor position in real time after the rotary transformer is powered on, the motor rotor position angle is obtained according to the rotary transformer input signal, and the motor rotor position angle is sent to the main control chip. The decoding chip inputs excitation signals to the rotary transformer so as to excite two groups of coils in the rotary transformer, the rotary transformer outputs two groups of signals (rotary-variable input signals) according to the excitation signals in an induction mode, the two groups of signals are sine carrier signals and cosine carrier signals respectively, namely the rotary-variable input signals and are supplied to the decoding chip, and the decoding chip analyzes the real-time position angle according to the two groups of signals.
And step S1033, the main control chip acquires the rotor position information of the motor in a high-speed operation stage through the ABZ pulse signal.
Specifically, when the motor is in a high-speed operation stage, the incremental interface of the main control chip counts the AB signal in increments, and the motor position information is acquired according to the value M of the AB signal increment counting. Specifically, since the resolution of the ABZ pulse signal is 12 bits, the maximum value of M is smaller than 4096, and when M counts to 4096, M is automatically cleared, that is, M is M-4096; when M counts less than 0, M + 4096. The motor position information includes a rotor position angle theta and an angular velocity omega; first the position angle theta is determined from the value of M, and then the angular velocity omega is determined from the position angle theta, wherein,
<math>
<mrow>
<mi>θ</mi>
<mo>=</mo>
<mn>360</mn>
<mo>×</mo>
<mfrac>
<mi>M</mi>
<mn>4096</mn>
</mfrac>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>ω</mi>
<mo>=</mo>
<mfrac>
<mi>dθ</mi>
<mi>dt</mi>
</mfrac>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
here, since the electrical angle period corresponding to a full 4096 count is 360 degrees, the corresponding position angle θ can be obtained by counting M, and the angular velocity ω can be calculated from the rate of change of the position angle.
S1034, the main control chip carries out abnormity diagnosis on the motor through the ABZ pulse signal, and when the motor is judged to be abnormally operated, the main control chip sends an operation abnormity signal and controls the motor to stop operating; and when the motor is judged not to have abnormal operation, skipping to the step S1033, and continuously calculating and acquiring the position information of the motor.
Wherein, main control chip judges whether the motor breaks down specifically to do:
the main control chip detects Z pulses in the ABZ pulse signals and judges whether the Z pulses are continuously detected in N2 electrical angle periods, and if the Z pulses are not continuously detected in N2 electrical angle periods, the motor is judged to be in fault; otherwise, judging the normal operation of the motor. N2 is a preset amount for preventing false alarm, preferably, the value range of N2 is 5-15, and further preferably, N2 is set to be 10; and/or:
the main control chip acquires a change rate a1 of the angular velocity omega of the motor (the change rate a1 is the acceleration of the angular velocity omega, and the derivative operation is performed on the angular velocity omega to obtain a change rate a1 of the angular velocity omega), and judges whether the change rate a1 is greater than a preset change rate threshold a0, and if the change rate a1 is greater than or equal to a preset change rate threshold a0, the motor is judged to be in fault; and if the change rate a1 is smaller than a preset change rate threshold value a0, judging that the motor normally runs. The a0 is calibrated according to the actual rotating speed step limit value of the motor, when the angular speed change rate of the motor exceeds the actual rotating speed step limit value of the motor, the motor is indicated to have a fault in operation, and through proper setting of the a0, the reliability of fault detection can be ensured, and the possibility of false alarm of the fault is reduced. Preferably, the value of a0 is in the range of 1500 rpm to 1800 rpm, and for example, the value of a0 may be set to 1600 rpm.
In the embodiment of the invention, the model of the main control chip can be Yingfei 1782, and in addition, the main control chip can also be realized by other types of single-chip microcomputers.
In the embodiment of the present invention, the type of the decoding chip may be AU6802 or other decoding chips capable of generating SPI digital signals and ABZ pulse signals.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.