Disclosure of Invention
Aiming at the structural characteristics of the brushed direct current motor, the invention provides the integrated detection system, the integrated detection method and the integrated detection device for the rotation angle, the torque and the rotating speed value of the motor, which can conveniently and quickly obtain the accurate rotation angle, the rotating speed and the torque value of the motor and realize the detection and the driving of the relevant parameters of the motor with low cost and high integration level.
The invention is realized by adopting the following technical scheme: an integrated angular, torque and rotational speed sensing system for an electric machine, comprising:
a current sensor for detecting a current signal flowing through the motor;
a voltage sensor for detecting a voltage signal across the motor;
a controller for calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the moment
mWherein, T
m=k
2×k
tI,k
2Is a predetermined torque correction factor, k, of the electric machine
tIs the electromagnetic torque coefficient of the motor; calculating the rotation speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signal at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fIs the back electromotive force coefficient of the motor, and R is the resistance of the motor; calculating a clock frequency f from said rotational speed ω, wherein,
N
tis the number of rotor slots, N, of the motor
sThe number of pairs of electric brushes of the motor is counted;
the adaptive filter is used for forming a sinusoidal signal by the current signal through adaptive filtering according to the clock frequency f;
a comparator for converting the sinusoidal signal into a square wave signal;
wherein the controller is further configured to capture rising edges of the square wave signal, count the rising edges, and calculate a rotation angle θ of the motor according to the number of the rising edges, wherein,
the count is the number of the rising edges.
As a further improvement of the above solution, the integrated detection system further comprises:
the alternating current amplifier is used for filtering out direct current and low-frequency alternating current signals in the current signals;
the current signal received by the adaptive filter is the current signal after the alternating current signal is filtered.
As a further improvement of the above scheme, the clock frequency of the pulse signal required by the adaptive filter in the adaptive filtering is the clock frequency f multiplied by 200.
As a further improvement of the above scheme, a positive input end of the comparator receives the sinusoidal signal, a negative input end of the comparator is grounded, and an output end of the comparator outputs the square wave signal.
As a further improvement of the above scheme, the controller performs digital-to-analog conversion on the current signal, and obtains a current value curve after filtering, and correspondingly obtains a current value I at the moment; and the controller also performs digital-to-analog conversion on the voltage signal, obtains a voltage value curve after filtering, and correspondingly obtains the voltage value U at the moment.
The invention also provides an integrated detection method for the rotation angle, the torque and the rotating speed of the motor, which comprises the following steps:
step S1, receiving current signal of the current motor, calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the momentmWherein, Tm=k2×ktI,k2Is a predetermined torque correction factor, k, of the electric machinetIs the electromagnetic torque coefficient of the motor;
step S2, receiving voltage signals at two ends of the motor, calculating the rotating speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signals at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fIs the back electromotive force coefficient of the motor, and R is the resistance of the motor;
step S3, calculating a clock frequency f according to the rotation speed ω, wherein,
N
tis the number of rotor slots, N, of the motor
sThe number of pairs of electric brushes of the motor is counted;
step S4, according to the clock frequency f, the current signal is processed by self-adaptive filtering to form a sine signal;
step S5, converting the sine signal into a square wave signal;
step S6, capturing and counting the rising edges of the square wave signals, calculating the rotation angle theta of the motor according to the number of the rising edges, wherein,
count is the number of the rising edgeAnd (4) counting.
As a further improvement of the above solution, in step S1, the received current signal is first filtered to remove dc and low frequency ac signals.
As a further improvement of the above scheme, in step S4, the clock frequency of the pulse signal during adaptive filtering is the clock frequency f multiplied by 200, and the sinusoidal signal is obtained by adaptively filtering out signals with frequencies other than f.
As a further improvement of the above solution, the step S5 is implemented by using a comparator, a positive input end of the comparator receives the sinusoidal signal, a negative input end of the comparator is grounded, and an output end of the comparator outputs the square wave signal.
The invention also provides an integrated detection device for the rotation angle, the torque and the rotating speed of the motor, which adopts the integrated detection method for the rotation angle, the torque and the rotating speed of any motor; the integrated detection device includes:
the torque calculation module is used for receiving a current signal of the current-carrying motor and calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the momentmWherein, Tm=k2×ktI,k2Is a predetermined torque correction factor, k, of the electric machinetIs the electromagnetic torque coefficient of the motor;
a rotation speed calculation module for receiving voltage signals at two ends of the motor, and calculating a rotation speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signals at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fIs the back electromotive force coefficient of the motor, and R is the resistance of the motor;
a clock frequency calculation module for calculating a clock frequency f required for forming a sinusoidal signal by adaptive filtering based on the rotation speed ω, wherein,
N
tis the number of rotor slots, N, of the motor
sThe number of pairs of electric brushes of the motor is counted;
a sinusoidal signal forming module, which is used for forming a sinusoidal signal by the current signal through adaptive filtering according to a clock frequency f;
the square wave signal forming module is used for converting the sinusoidal signal into a square wave signal;
a rotation angle calculating module for capturing the rising edges of the square wave signals, counting the rising edges, and calculating the rotation angle theta of the motor according to the number of the rising edges, wherein,
the count is the number of the rising edges.
The invention synchronously detects the rotation angle, the rotation speed and the torque of the motor by using the voltage values at the two ends of the motor and the current values flowing through the motor, and reduces the use of sensors and the detection cost when realizing the function of integrally detecting the rotation angle, the rotation speed and the torque.
Example 1
Referring to fig. 1, the integrated detecting system of the present embodiment is used for detecting the rotation angle θ and the torque T of the motormAnd a rotational speed ω. The integrated detection system comprises an upper layer controller, a current signal processor and a lower layer driver. The upper layer controller includes: thecontroller 6, theCAN communication module 3, thedebugging port circuit 4 and thepower conversion circuit 5. The current signal processor comprises avoltage inversion module 8, an alternatingcurrent amplifier 7, anadaptive filter 11 and acomparator 10. The lower layer driver includes arelay control module 12, avoltage sensor 13, acurrent sensor 15, and adriving module 16.
Thecurrent sensor 15, thevoltage sensor 13, thecontroller 6, theadaptive filter 11, and thecomparator 10 are a minimum set of integrated detection systems, and thecurrent sensor 15 is used to detect a current signal of the current motor. Thevoltage sensor 13 is used to detect a voltage signal across the motor. Theadaptive filter 11 is configured to form the current signal into a sinusoidal signal by adaptive filtering according to the clock frequency f. Thecomparator 10 is used to convert the sinusoidal signal into a square wave signal.
The
controller 6 is used for calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the moment
mWherein, T
m=k
2×k
tI,k
2Is a predetermined torque correction factor, k, of the electric machine
tIs the electromagnetic torque coefficient of the motor; calculating the rotation speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signal at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fIs the back electromotive force coefficient of the motor, and R is the resistance of the motor; calculating a clock frequency f from said rotational speed ω, wherein,
N
tis the number of rotor slots, N, of the motor
sThe number of pairs of electric brushes of the motor is counted; and is further configured to capture and count rising edges of the square wave signal, and calculate a rotation angle θ of the motor according to the number of the rising edges, wherein,
the count is the number of the rising edges.
Referring to fig. 2, thecontroller 6 includes an inductor, a capacitor, a resistor, a crystal oscillator, a light emitting diode, a switch, and a main control chip. Wherein, the inductance includes: l02, L03, L2, L3, the resistance includes: RA1, RA2, RA3, RA4, RA5, RA8 and R13, wherein the capacitor comprises: CA1, CA2, CA3, CA4, CA5, CA6, CA7, CA8, CA9, CA10, CA11, CA12, CA13 and CA14, wherein the light emitting diode is DA1 and is used as a power indicator to judge whether thecontroller 6 supplies power or not, the crystal oscillator is YA1 and is used for generating an accurate clock frequency for the system, and the main control chip is MC9S12XS128 and is used for processing signals or generating corresponding instructions to control other modules to generate corresponding actions.Pin 11 of the chip MC9S12XS128 is used for outputting a clock signal required by theadaptive filter 11, and pin 11 of the chip MC9S12XS128 is used for capturing a square wave signal output by thecomparator 10.Pins 1, 2, pins 3, 4, pins 109, 110, and pins 111, 112 of the chip MC9S12XS128 are used for generating 4-way pulse signals to enable thedriving module 16 to control the motor to rotate. Thecontroller 6 is connected to thepower conversion circuit 5 and supplies +5V power through thepower conversion circuit 5.
Referring to fig. 3, theCAN communication module 3 is used for transmitting and receiving data such as a motor rotation angle value, a torque value, and a rotation speed value. The chip adopted by theCAN communication module 3 is TJA1050,pin 1 andpin 4 of the chip TJA1050 are connected to pin 104 and pin 105 of chip MC9S12XS128, respectively,pin 2 andpin 8 of the chip TJA1050 are connected to ground, andpin 2 andpin 4 of chip TJA1050 are respectively connected to two ends of capacitor C20,pin 3 andpin 5 of chip TJA1050 are respectively connected to two ends of resistor R20,pin 3 of chip TJA1050 is connected to +5V power supply,pin 3 of chip TJA1050 is grounded through capacitor C21 and capacitor C22,pin 4 andpin 5 of chip TJA1050 are connected through capacitor C20 and resistor R21,pin 6 andpin 7 of chip TJA1050 are connected through resistor R22 and capacitor C23,pin 7 andpin 6 of chip TJA1050 are connected to CAN high line and CAN low line, data on CAN bus are transmitted tocontroller 6 throughpin 4 of chip TJA1050 after differential processing, and data ofcontroller 6 is transmitted to CAN transceiver throughpin 1 of chip TJA 1050.
Referring to fig. 4, thedebug port circuit 4 is connected to thecontroller 6, and thedebug port circuit 4 is used for online debugging, application program downloading, and online updating of the program in the chip MC9S12XS128, so that changes in various parameters, register values, and memory values can be observed in real time, problems in the program can be found in time, and the period for program development and the test cost can be reduced. Thedebug port circuit 4 includes resistors RA6, RA7, a capacitor CA15, a reset switch SW, and sockets JA1,JA 2.
Referring to fig. 5, thepower conversion circuit 5 is connected to abattery 14, and thebattery 14 of the present embodiment is a battery with a voltage of + 12V. Thepower conversion circuit 5 is used for converting the +12V power of thebattery 14 into +5V power. Thepower conversion circuit 5 comprises a capacitor C1, a capacitor C4, a chip LM2575, an electrolytic capacitor C2, an electrolytic capacitor C3, a voltage stabilizing diode D00, a voltage stabilizing diode D1, a voltage stabilizing diode D2, a resistor R00, an inductor L1 and a switch S1.Pin 1 of chip LM2575 is connected withbattery 14 sequentially through zener diode D1 and switch S1, one end of capacitor C1, capacitor C4, electrolytic capacitor C2, electrolytic capacitor C3, zener diode D2 are grounded,pin 3 of chip LM2575,pin 5 of chip LM2575 are grounded, the other end of capacitor C1, electrolytic capacitor C2 are connected withpin 1, the other end of zener diode D2 is connected withpin 2, the other ends of electrolytic capacitor C3, capacitor C4 are connected with one end of resistor R00, one end of inductor L1,pin 4 of chip LM2575, the other end of inductor L1 is connected withpin 2 of chip LM2575, and resistor R00 is connected with ground through zener diode D00. Thepower conversion circuit 5 supplies +5V power to thecontroller 6, thecomparator 10, and theadaptive filter 11.
Referring to fig. 6a and 6b, thevoltage inverting module 8 is used to convert the +5V power into the-5V power, so as to provide the-5V power for theadaptive filter 11 and theac amplifier 7. Thevoltage inverting module 8 includes: capacitors C03, C04 and chip ICL 7660.
Theac amplifier 7 is used for filtering current signals of direct current and low frequency alternating current, and simultaneously amplifying the current signals. Theac amplifier 7 includes: resistors R014, R015, R019, R020, R021, R022, R023 and R024, capacitors C05, C06, C07 and C08 and a chip TLV 2272. The first-order high-pass filter circuit composed of the capacitor C05 and the resistor R021 can filter the first current signal input to the input end of the chip TLC2272 and output a third current signal. And the signal with a cut-off frequency of 8Hz, i.e. below 8Hz, of theac amplifier 7 will be filtered. The high frequency signal will be input to the chip TLC2272 through the first order high pass filter circuit for signal amplification. The first-stage amplification circuit is a left half circuit of the chip TLC2272, the values of the resistors R014 and R020 are respectively 100K omega and 500 omega, and the first-stage amplification factor is 200 times. The second-stage amplification circuit is a TLC2272 right half-side amplification circuit, the values of R015 and R023 are respectively 1K omega and 500 omega, and the second-stage amplification factor is 3 times. By means of two-stage amplification, the current signal can be amplified by 600 times in total, namely, the alternating current signal with the amplitude of 80mV can be amplified into the alternating current signal with the amplitude of 4.8V.
Theadaptive filter 11 is used to filter the current signal to a more ideal sinusoidal signal. Theadaptive filter 11 includes: the chip comprises resistors R02, R03, R04, R05, R06, R07, R08, R09, R010, R011, R012 and R013, capacitors C01 and C02 and chips LTC 1068-200. The input of apin 3 of the chip LTC1068-200 is a current signal processed by an alternatingcurrent amplifier 7, and the input of apin 21 of the chip LTC1068-200 is a pulse signal with a duty ratio of 50% and a frequency changing with the rotating speed of the motor, so that the current signal can be filtered into an ideal sinusoidal signal.
Thecomparator 10 is used for converting the sinusoidal current signal output by theadaptive filter 11 into a square wave signal. Thecomparator 10 comprises a resistor R017, a variable resistor R018, a diode D01 and a chip LM 393. The square wave signal is input to pin 17 of chip MC9S12XS128 ofcontroller 6 throughpin 1 of chip LM393 and used for counting. The set voltage threshold value can be changed by adjusting the resistance value of the variable resistor R018, so that signal loss and overlapping phenomena can be guaranteed to be as few as possible. The resistor R017 has the function of ensuring the stability of the output signal of the comparator, and the diode D01 filters out the negative half part of the sinusoidal signal and only inputs the positive half part of the sinusoidal signal.
Referring to fig. 7, therelay control module 12 is used to protect the circuit from overload. Thepower conversion circuit 5 is connected to abattery 14 through arelay control module 12. Therelay control module 12 includes: the LED driving circuit comprises resistors R73, R74, R88 and R0, capacitors C6 and C7, electrolytic capacitors C5, C38, C82 and C83, triodes Q1 and Q30, a voltage stabilizing diode D40, a light emitting diode D0, inductors L02 and L03 and a relay K1.
Referring to fig. 8, thevoltage sensor 13 is used for detecting the voltage across the motor. Thevoltage sensor 13 includes a first detection module and a second detection module. The first detection module comprises a resistor R62, a resistor R69, a capacitor C63, a diode D11 and a diode D12. One end of the resistor R62 is connected with the input end of the motor, the other end of the resistor R62 is connected with one end of the resistor R69, one end of the capacitor C63 and the output end of the diode D12, the other end of the resistor R69 is connected with the other end of the capacitor C63 and is grounded, the output end of the diode D12 is connected with thepower conversion circuit 5, the connection point of the resistor R62 and the resistor R69 is recorded as the middle end SA _ DEC of the resistor R62 and the resistor R69, the input end of the diode D11 is connected with the output end of the diode D12, and the output end of the diode.
The second detection module comprises a resistor R64, a resistor R68, a capacitor C62, a diode D8 and a diode D9. One end of the resistor R64 is connected with the output end of the motor, the other end of the resistor R64 is connected with one end of the resistor R68, one end of the capacitor C62 and the 9 output end of the diode D, and the other end of the resistor R68 is connected with the other end of the capacitor C62 and is grounded. The input end of the diode D9 is connected to thepower conversion circuit 5, the connection point between the resistor R64 and the resistor R68 is referred to as the middle end SB _ DEC of the resistor R64 and the resistor R68, the output end of the diode D8 is connected to the input end of the diode D9 and one end of the capacitor C62, and the input end of the diode D8 is grounded.
Thevoltage sensor 13 divides the voltages at the two ends of the motor by using a resistor R62, a resistor R69, a resistor R64 and a resistor R68, respectively, and thecontroller 6 obtains the voltage values at the two ends of the motor according to the potential difference between the middle ends SA _ DEC of the resistor R62 and the resistor R69, the middle ends SB _ DEC of the resistor R64 and the resistor R68.
Referring to fig. 9, thecurrent sensor 15 is used to detect the current flowing through the motor. Thecurrent sensor 15 employs a single resistance sampling circuit. Thecurrent sensor 15 includes: resistors R51, R57 and R59, capacitors C54, C84 and C85 and a chip AD 8206. The resistance value of the sampling resistor R51 is 1m omega, the voltage at two ends of the resistor R51 is used as a signal and is input into the differential mode amplification circuit chip AD8206, the voltage signal is amplified by 20 times, and the current flowing through the motor is calculated by measuring the voltage at two ends of the R51. The calculated current is input as a current signal one to pin 75 of chip MC9S12XS128 ofcontroller 6 andac amplifier 7, respectively, throughpin 5 of chip AD 8206.
Referring to fig. 10, the drivingmodule 16 is used for driving a motor to be detected, and the motor of the present embodiment adopts a dc brush motor. Thedrive module 16 includes: resistors R30, R32, R33, R34, R35, R38, R40, R41, R42, R43, R44, and R45, capacitors C29, C30, C32, C33, C35, and C37, tantalum capacitors C28, C31, C34, and C36, MOSFETs Q3, Q4, Q5, and Q6, and a driving chip a 3946. The drivingmodule 16 adopts two a3946 chips, each a3946 chip can control 2 MOSFETs, the MOSFETs are field effect transistors which can be widely used in analog circuits and digital circuits, thecontroller 6 outputs four paths of pulse driving signals to the a3946 chip through AHI, ALO, BHI, BLO pins, and the two a3946 chips drive 4 MOSFETs of the H-bridge through GHA, GLA, GHB, GLB pins, respectively. When MOSFETs Q3 and MOSFET Q6 are turned on, current flows through MOSFET Q3, the brushed dc motor, the current sensor, and MOSFET Q6 in sequence, creating a path for the motor to rotate. When mosfets q5 and mosfets q6 are turned on, current flows through mosfets q5, the brushed dc motor, the current sensor, and mosfets q4 in sequence to form a path, thereby causing the motor to rotate in the opposite direction.
The motor control device has the advantages that the driving module is arranged, the controller can be used for controlling the operation of the motor, the operation is convenient, and the relay control module is arranged and is connected with the power conversion circuit and the battery, so that the circuit is protected, the overload is prevented, and the device is safer to operate.
In summary, referring to fig. 11, when the integrated detecting system for the rotation angle, torque and rotation speed of the motor of the present embodiment works, thecontroller 6 outputs four pulse driving signals to the chip a3946 by using the pulse width modulation function thereof, and drives the motor by controlling the drivingmodule 16. Thecontroller 6 filters the voltage signal detected by thevoltage sensor 13 and the current signal one detected by thecurrent sensor 15, so as to obtain a relatively accurate voltage value and a relatively accurate current value, wherein the accurate current value is recorded as I, and the accurate voltage value is recorded as U.
Obtaining a torque value according to a torque estimation mathematical model, and recording the torque value as TmThe torque mathematical model is Tm=k2×KtI. Wherein K2 is a correction coefficient obtained by a large number of experiments, KtIs the electromagnetic torque coefficient.
Obtaining a first rotating speed value according to a rotating speed estimation mathematical model, recording the first rotating speed value as omega, and recording the rotating speed estimation mathematical model as
Wherein K1 is a correction coefficient and is obtained by a large number of experiments, K
fR is the resistance of the motor.
The
current sensor 15 inputs the detected current signal to the
ac amplifier 7 to filter out dc and low frequency ac signals, and then to the
adaptive filter 11. And obtaining a clock frequency according to the calculated motor rotating speed value I and the clock frequency model. Wherein the clock frequency model:
N
tis the number of slots of the motor rotor, N
sThe number of pairs of motor brushes is counted. Required for adaptive filtering
The frequency is input to the
adaptive filter 11 through
pin 21 of the chip LTC 1068-200. And then, outputting a pulse signal with the clock frequency to the
adaptive filter 11 by using the timer function of the
controller 6 and the
pin 11 of the chip MC9S12XS128 to obtain an ideal sinusoidal signal, and finally, inputting the sinusoidal signal to the
comparator 10 to obtain a square wave signal. The square wave signal is input to the
controller 6, the rising edge of the square wave signal is captured and counted by the input capture function of the timer of the chip MC9S12XS128, and the number of pulses is corrected by the estimated rotating speed value.
The principle of pulse number correction is shown in fig. 12, and the pulse number correction belongs to software, and the estimated rotation speed value-omega is substituted into a formula
The reference period of the pulse signal can be obtained, and then the decision basis can be obtained:
1. if the time interval of two rising edges of the signal is less than 0.8T, the signal is considered to be overlapped, and the number of pulses is not counted by the rising edges;
2. if the time interval between two rising edges of the signal is greater than 1.2T, the signal is considered to be lost, and 1 is added to the number of pulses.
Then, recording the number of the pulses as count, substituting the corrected number of the pulses into a corner estimation mathematical model to obtain a corner value, recording the corner value as theta, and recording the corner estimation mathematical model as
And a more accurate motor rotating speed value II is obtained by utilizing the rotating motor angle within the fixed time; the torque value, the first rotating speed value, the second rotating speed value and the rotating angle value are sent out by the
CAN communication module 3, and the torque value, the first rotating speed value, the second rotating speed value and the rotating angle value CAN be received and displayed by an industrial personal computer connected with the CAN communication module.
The integrated detection system for the rotation angle, the torque and the rotation speed of the motor of the embodiment can comprise software filtering of current signals, software filtering of voltage signals, a torque estimation mathematical model, a rotation speed estimation mathematical model, counting and correction of pulse signals, calculation of frequencies required by adaptive filtering and a rotation angle estimation mathematical model. The filtering of the current and voltage signals mainly adopts median filtering, namely 5 groups of data are collected each time to remove the maximum value and the minimum value, and then the average value is obtained.
In addition, specific experimental verification is carried out on the integrated detection device for the rotation angle, the torque and the rotating speed of the motor. Referring to fig. 13, 14 and 15, it can be seen that the integrated detecting device for the rotation angle, the torque and the rotation speed of the motor of the present invention has the same trend with the torque value, the rotation speed value and the rotation angle value detected by the precise sensor, and the curves are basically overlapped and the error is small.
The invention can simultaneously realize the driving of the direct current brush motor and the rapid detection of the rotation angle, the torque and the rotation speed, has simpler circuit structure, and is easy to purchase and low in cost in the market of used electronic components. The method has the characteristics of high real-time performance, high reliability, high integration level, easiness in realization, high practical value and the like.
Example 2
Referring to fig. 6, the present invention provides an integrated method for detecting a rotational angle, a torque and a rotational speed of a motor, comprising the following steps:
step S1, receiving current signal of the current motor, calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the momentmWherein, Tm=k2×ktI,k2Is a predetermined torque correction factor, k, of the electric machinetIs the electromagnetic torque coefficient of the motor. Acurrent sensor 15 may be used to detect the current signal flowing through the motor. In step S1, theac amplifier 7 first filters out dc and low frequency ac signals from the received current signal.
Step S2, receiving voltage signals at two ends of the motor, calculating the rotating speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signals at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fR is a back electromotive force coefficient of the motor, and R is a resistance of the motor. A
voltage sensor 13 may be used to detect a voltage signal across the motor.
Step S3, calculating a clock frequency f required for forming a sinusoidal signal by adaptive filtering based on the rotation speed ω, wherein,
N
tis the number of rotor slots, N, of the motor
sIs the number of brush pairs of the motor.
And step S4, forming a sinusoidal signal by the current signal through adaptive filtering according to the clock frequency f. In step S4, the clock frequency of the pulse signal during adaptive filtering is the clock frequency f multiplied by 200, and the sinusoidal signal is obtained by adaptively filtering out signals with frequencies other than f. That is, the clock frequency of the pulse signal required for the adaptive filter to perform adaptive filtering is the clock frequency f multiplied by 200.
Step S5, converting the sinusoidal signal into a square wave signal. The step S5 can be implemented by using a comparator, wherein a positive input terminal of the comparator receives the sinusoidal signal, a negative input terminal of the comparator is grounded, and an output terminal of the comparator outputs the square wave signal.
Step S6, capturing and counting the rising edges of the square wave signals, calculating the rotation angle theta of the motor according to the number of the rising edges, wherein,
the count is the number of the rising edges.
The integrated detection method of the present invention may be designed such that a computer program is injected into thecontroller 6 ofembodiment 1, and thecontroller 6 implements the functions of the integrated detection method. The integrated detection device corresponding to the integrated detection method comprises a torque calculation module, a rotating speed calculation module, a clock frequency calculation module, a sine signal forming module, a square signal forming module and a corner calculation module.
The torque calculation module is used for receiving a current signal of the current motor, and calculating the torque T of the motor at a certain moment according to the current value I of the current signal at the momentmWherein, Tm=k2×ktI,k2Is a predetermined torque correction factor, k, of the electric machinetIs the electromagnetic torque coefficient of the motor.
The rotating speed calculation module is used for receiving voltage signals at two ends of the motor, calculating the rotating speed omega of the motor at the moment according to the current value I and the voltage value U of the voltage signals at the moment, wherein,
k
1for a predetermined speed correction factor, k, of the motor
fR is a back electromotive force coefficient of the motor, and R is a resistance of the motor.
The clock frequency calculation module is used for calculating the clock frequency f required by the sinusoidal signal formed by the self-adaptive filtering according to the rotating speed omega, wherein,
N
tis the number of rotor slots, N, of the motor
sIs the number of brush pairs of the motor. And the sinusoidal signal forming module is used for forming a sinusoidal signal by the current signal through adaptive filtering according to the clock frequency f. The square wave signal forming module is used for converting the sinusoidal signal into a square wave signal. The rotation angle calculation module is used for capturing the rising edges of the square wave signals, counting the rising edges, and calculating the rotation angle theta of the motor according to the number of the rising edges, wherein,
the count is the number of the rising edges.
In this embodiment, the integrated detection method is mainly applied to the detection system inembodiment 1. The integrated detection method comprises the following steps.
Step S10: thecontroller 6 outputs four paths of pulse driving signals to thedriving module 16 by using the pulse width modulation function of the chip MC9S12XS128, so as to drive the motor to work.
Step S11: thevoltage sensor 13 detects voltage signals at both ends of the motor and feeds the voltage signals back to thecontroller 6; thecontroller 6 converts the voltage signal from a digital signal to an analog signal by using an analog-to-digital conversion function of the chip MC9S12XS128, the voltage signal converted to the analog signal is sequentially filtered by theadaptive filter 11 and thecomparator 10, and the filtered voltage signal is calculated by the chip MC9S12XS128, so that voltage values at two ends of the motor are obtained.
Step S12: thecurrent sensor 15 feeds a detected current signal I back to thecontroller 6, thecontroller 6 converts the current signal I from a digital signal to an analog signal by using an analog-to-digital conversion function of the chip MC9S12XS128, the current signal I converted into the analog signal is filtered by theadaptive filter 11 and thecomparator 10 to obtain a current signal II, and the current signal II is calculated by the chip MC9S12XS128 to finally obtain a current value flowing through the motor.
Step S13: substituting the current value into the existing torque estimation mathematical model so as to calculate the torque value output by the motor; and substituting the current value and the voltage value into the existing rotating speed estimation mathematical model to obtain a first rotating speed value of the motor.
Step S14: thecurrent sensor 15 inputs the detected current signal I into the alternatingcurrent amplifier 7, obtains a current signal III after filtering out direct current and low-frequency alternating current signals, and inputs the current signal III into theadaptive filter 11; thecontroller 6 obtains a clock frequency according to the first rotating speed value of the motor calculated in the step S3 and the existing clock frequency model, and outputs a pulse signal of the clock frequency to theadaptive filter 11 by using the timer function of thecontroller 6 and thechip MC9S12XS 128; theadaptive filter 11 obtains a sinusoidal signal according to the current signal three and the pulse signal of the clock frequency, and finally inputs the sinusoidal signal to thecomparator 10 to obtain a square wave signal.
Step S15: thecomparator 10 inputs the square wave signal into a chip MC9S12XS128 in thecontroller 6, pulse correction is performed by using a pulse number correction model, the pulse number correction model corrects the square wave signal which is distorted after passing through the alternatingcurrent amplifier 7, theadaptive filter 11 and thecomparator 10, then the rising edge of the corrected square wave signal is captured and counted by using the input capture function of the chip MC9S12XS128, and the number of the rising edge is substituted into the existing corner estimation mathematical model to obtain the corner value of the motor.
Step S16: theCAN communication module 3 is connected with an industrial personal computer, thecontroller 6 utilizes theCAN communication module 3 to send the data of the torque value, the first rotating speed value, the second rotating speed value and the angle value to the industrial personal computer, and the industrial personal computer receives and displays the data of the torque value, the first rotating speed value, the second rotating speed value and the angle value.