Disclosure of Invention
In view of the above technical problems, the present invention provides a current driving technical solution that has a small output current ripple, thereby reducing motor noise and reducing power consumption of a power supply.
The technical scheme adopted by the invention for solving the technical problems is as follows:
according to an aspect of the present invention, there is provided a PWM current driving method using a dynamic hybrid decay mode, the method comprising the steps of:
setting the period of the square wave signal and the charging current threshold value in the period of the square wave signal;
charging the motor to a charging current threshold;
controlling the current passing through the motor to quickly attenuate until the current passing through the motor quickly attenuates to a dynamic discharge current threshold;
the current through the motor is controlled to decay slowly until the period of the square wave signal is over.
As an alternative of the above technical solution of the present invention, in the current period of the square wave signal, the charging current threshold and the dynamic discharging current threshold are set according to the requirements of the user on the precision and the relative error of the motor current.
As an alternative of the above technical scheme of the invention, the dynamic discharge current threshold is set to be 90% -99% of the charging current threshold.
As an alternative of the above technical solution of the present invention, in the next period of the square wave signal, if the set charging current threshold is greater than the charging current threshold in the previous period of the square wave signal, the motor is charged to the larger charging current threshold.
As a further improvement of the above technical solution of the present invention, if the charging time of the motor exceeds one period of the square wave signal, the charging time of the motor is continued to the next period of the square wave signal.
As a further improvement of the above technical solution of the present invention, in the next period of the square wave signal, if the set charging current threshold is smaller than the charging current threshold in the previous period of the square wave signal, and the current passing through the motor at the beginning of the next period is larger than the charging current threshold, the motor is controlled to charge only in the blanking time, and then the current passing through the motor is controlled to decay rapidly.
As a preferable scheme of the above technical solution of the present invention, a blanking time is set at the beginning of the charging and the current fast decay, and the blanking time is greater than a dead time of switching between the upper tube and the lower tube of the full bridge circuit and less than a period of the square wave signal.
As a further improvement of the above technical solution of the present invention, if the time for the current to decay rapidly exceeds one period of the square wave signal, the time for the current to decay rapidly is continued to the next period of the square wave signal.
As a further improvement of the technical scheme, a filter is arranged at each conversion point of the quick attenuation of the charging conversion current and the quick attenuation of the current to the slow attenuation of the current.
According to another aspect of the present invention, there is provided a PWM current driving apparatus employing a dynamic hybrid decay mode, the apparatus including:
a memory for storing an application program; and
a processor for running the application to perform the steps of:
setting the period of the square wave signal and the charging current threshold value in the period of the square wave signal;
charging the motor to a charging current threshold;
controlling the current passing through the motor to quickly attenuate until the current passing through the motor quickly attenuates to a dynamic discharge current threshold;
the current through the motor is controlled to decay slowly until the period of the square wave signal is over.
Compared with the prior art, the invention has the following beneficial technical effects:
according to the invention, after the motor is charged to the charging current threshold, the current passing through the motor is controlled to be quickly attenuated to the dynamic discharging current threshold, and then the current is controlled to be slowly attenuated, so that the ripple wave of the output current can be ensured to be smaller, and the noise of the motor can be reduced and the power consumption of the power supply can be reduced;
the invention defines a dynamic discharge current threshold, namely the invention can control the time of fast attenuation and slow attenuation in mixed attenuation by detecting the charging current of the motor in real time, which is different from the fixed time of fast attenuation and slow attenuation in the traditional mixed attenuation mode, therefore, the method of the invention can be suitable for systems externally connected with different motors;
in the invention, if the set charging current threshold is smaller than the charging current threshold in the previous period of the square wave signal, the motor can be controlled to be charged only in blanking time, and then the current passing through the motor is controlled to be quickly attenuated, so that the delay time before the turn-off is defined after the current charging is stopped, and the current-limiting fault condition before the turn-off can be ignored by a system using the method, thereby improving the fault tolerance of the system;
the invention arranges a filter at each switching point of current change, which can avoid current detection error caused by external noise.
Detailed Description
The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
In the conventional hybrid decay mode, the times of both the fast decay and the slow decay are fixed. Under the condition that the charging current threshold value is increased as shown in fig. 1, when the charging current of the motor reaches the set charging current threshold value, the discharging mode is entered, namely, the slow attenuation is entered first, and then the square wave signal period f is selectedCHOPThe last 1us into a fast decay. When the charging current threshold is reduced, as shown in fig. 2, forced charging is performed for a blanking time, then the current passing through the motor is controlled to rapidly and rapidly decay until the end of a period of the square wave signal, and then the processes of reciprocating charging, slow decay and rapid decay are performed. In the fast decay process of fig. 2, since the relative error between the magnitude of the current discharge and the peak value of the charging current is not confirmed, it is possible that the discharge slope is large, and the current ripple is large. In addition, the conventional hybrid attenuation mode fixes the time or proportion of the rapid attenuation, and if different motor loads are externally connected, the current ripple of the motor has a large difference, and when the current ripple is large, the noise of the motor also becomes large.
In one aspect, according to an embodiment of the PWM current driving method using the dynamic hybrid decay mode of the present invention, the method may include the steps of:
setting the period f of a square wave signalCHOPA charging current threshold value Itrip in the period of the square wave signal;
charging the motor to a charging current threshold Itrip;
the current through the motor is controlled to decay rapidly until the current through the motor decays rapidly to the dynamic discharge current threshold, which may be set according to the user's requirements for precision and relative error of the motor current as a preferred embodiment. As an alternative embodiment of this embodiment, when the relative error between the dynamic discharge current threshold and the charging current threshold exceeds the error threshold T, the current of the motor is switched from fast decay to slow decay, and as a preferred embodiment, T is set to 1% to 10%, i.e. the dynamic discharge current threshold may be set to 90% to 99% of the magnitude of the charging current threshold, and more preferably, the dynamic discharge current threshold may be set to 95% of the magnitude of the charging current threshold;
the current through the motor is controlled to decay slowly until the period of the square wave signal is over. The current regulation process of this embodiment can be as shown in fig. 3, and the start-stop time of the charging, fast-fading and slow-fading of the present invention is not limited by the high and low levels of the square wave signal, but only relates to the magnitude of the charging current threshold Itrip and the dynamic discharging current threshold. Also, in this dynamic hybrid damping mode, the power consumed is greatly reduced.
According to another embodiment of the present invention, based on the above embodiment, as shown in fig. 4, in the next period of the square wave signal, if the set charging current threshold is greater than the charging current threshold in the previous period of the square wave signal, the motor is directly charged to the larger charging current threshold, the current passing through the motor is controlled to be rapidly attenuated to the dynamic discharging current threshold, and then the current passing through the motor is controlled to be slowly attenuated until the period of the square wave signal is over. When the new period of the square wave signal is reached, the charging and discharging processes are recycled.
As a further improvement of the above embodiment of the present invention, as shown in fig. 5, if the charging time of the motor exceeds one period of the square wave signal, the charging time of the motor is extended to the next period of the square wave signal, and then the fast attenuation and the slow attenuation are performed.
According to another embodiment of the present invention, which includes the basic steps of the first embodiment, and based on the first embodiment, as shown in fig. 6, in the next period of the square wave signal, a blanking time can be set at the beginning of the charging and the current fast decay, and the blanking time is greater than the dead time of the full bridge circuit switching between the upper and lower tubes and less than the period of the square wave signal. For example, if the set charging current threshold is smaller than the charging current threshold in the previous period of the square wave signal, the motor is controlled to be charged in a blanking time (blanking time), then the current passing through the motor is controlled to be rapidly attenuated to the dynamic discharging current threshold, and then the current passing through the motor is controlled to be slowly attenuated until the period of the square wave signal is ended. When the new period of the square wave signal is reached, the charging and discharging processes are recycled. In this embodiment, even if the charging current threshold set in the next period is smaller than the charging current threshold in the previous period of the square wave signal, the short-time charging process in the blanking time can be added at the beginning of the period, because the current of the motor at this time is still higher than the charging current threshold, so that the delay time before the shutdown is defined after the current charging is stopped, and the current-limiting fault condition before the shutdown can be ignored by the system using the method, thereby improving the fault tolerance of the system. Preferably, the charge blanking time is set to 1-4 us, more preferably to 1.25 us. The blanking time for the rapid decay of the current may be set to 1-4 us, and more preferably may be set to 2.81 us.
As a further improvement of the above embodiment of the present invention, as shown in fig. 7, if the time for the current to decay rapidly exceeds one period of the square wave signal, the time for the current to decay rapidly is extended to the next period of the square wave signal, and then slow decay is performed. When the new period of the square wave signal is reached, the charging and discharging processes are recycled.
According to another embodiment of the present invention, which includes the basic steps of the first embodiment, and on the basis of the first embodiment, as shown in fig. 8, in order to avoid a current detection error caused by external noise, a filter may be disposed at each transition point where the charging transition current rapidly attenuates, the current rapidly attenuates, and the transition current slowly attenuates, and the filter filters and performs noise prevention processing on a detection signal of the transition point. After the current passing through the motor is compared with the charging current threshold value, a detection signal of rapid attenuation of the charging current can be generated; after the current passing through the motor is compared with the dynamic discharge current threshold value, a detection signal that the current is quickly attenuated and the current is slowly attenuated can be generated. The time delay of the filter can be set to be 300-600 ns, and preferably to be 365 ns.
It is to be noted that the various embodiments and further developments of the inventive method can be combined and/or coupled with each other. For example, in the next period of the square wave signal, when the set charging current threshold is larger and/or smaller than the charging current threshold in the previous period of the square wave signal, a filter may be provided at each switching point of the current variation.
On the other hand, according to an embodiment of the present invention, the PWM current driving apparatus employing the dynamic hybrid decay mode may include:
a memory for storing an application program; and
a processor for running the application to perform the steps of:
setting the period of the square wave signal and the charging current threshold value in the period of the square wave signal;
charging the motor to a charging current threshold;
controlling the current passing through the motor to quickly attenuate until the current passing through the motor quickly attenuates to a dynamic discharge current threshold;
the current through the motor is controlled to decay slowly until the period of the square wave signal is over.
As a preferred implementation of the above embodiment, the device may be integrated within the motor drive chip.
To better illustrate how the current driving method of the present invention is implemented, the present invention is described below with reference to specific devices. Please refer to a schematic diagram of the driving principle of the PWM driving current in each embodiment of the present invention as shown in fig. 9, wherein: the micro control unit can be a single chip microcomputer, sends a direction signal and a mode signal to the PWM logic control unit, namely sets a current subdivision mode and a charging current direction required by output by the micro control unit, and sets a voltage value of V _ ref through resistance voltage division or an external power supply;
the oscillator sets the period of the square wave signal;
setting a charging current threshold DAC _ OUT in a square wave signal period by the digital-to-analog converter;
the PWM logic control unit sets the output to be in a charging state, detects a feedback voltage sense generated by the current I _ load output by the motor M through an external sensing resistor R _ sense, and feeds the voltage sense back to the input end of the current comparator to be compared with a charging current threshold DAC _ OUT. If the comparison result shows that the current I _ load output by the motor M is smaller than the charging current threshold DAC _ OUT, the motor is charged to the charging current threshold, then a discharging start signal DISCHARGE and a rapid attenuation end signal FASTDECAY are generated, the current passing through the motor is controlled to be rapidly attenuated, and the motor current is discharged. Further, the voltage sense across the sensing resistor R _ sense is fed back to the input of the current comparator to be compared with the dynamic discharge current threshold ADAC _ OUT, and the value of the dynamic discharge current threshold ADAC _ OUT is set to 95% DAC _ OUT. In this way, the current through the motor can be controlled to decay rapidly until the current through the motor decays rapidly to the dynamic discharge current threshold, and then controlled to decay slowly until the period of the square wave signal ends, after which a new charging period begins.
In the above embodiment, the feedback signal sense sent to the current comparator may be the voltage on the external power resistor R _ sense, and if there is no external power resistor, the detected feedback signal sense may also be the on voltage of the power down tube in the full bridge circuit.
Further, in the above embodiment, the DISCHARGE start signal DISCHARGE, the fast decay end signal FASTDECAY and the clock signal clock generated by the oscillator are processed by the PWM logic control unit to generate four logic control signals NA1, NA2, NB1 and NB 2; the four logic control signals NA1, NA2, NB1 and NB2 pass through the output front-stage driving unit to generate driving signals DRV _ NA1, DRV _ NA2, DRV _ NB1 and DRV _ NB2 of four power tubes of a full-bridge circuit; the peak value and the direction of the current I _ load on the external motor coil are controlled by controlling the on and off of the four power tubes of the full-bridge circuit.
Among them, as an exemplary embodiment, a PWM logic control unit embodying the present invention may be as shown in fig. 10. Wherein the period f of the square wave signalCHOPThe charging state is started, the feedback signal sense is compared with the charging current threshold DAC _ OUT, and when the sense slowly rises to the DAC _ OUT level, the discharging start signal DISCHARGE is generated, and the output is rapidly attenuated from the charging current. In this rapid discharge state, the sense voltage is negative and the magnitude of the sense signal can be compared to a dynamic discharge threshold value ADAC _ OUT, which is preferably set to 95% DAC _ OUT. When the feedback signal sense slowly drops to the ADAC _ OUT level, a fast decay end signal FASTDECAY is generated, transitioning the output from fast current decay to slow current decay. In this slow discharging state, the feedback signal sense is compared with the GND zero level, in order to avoid that when the set charging threshold is small, the load current is small, and the current may become zero or reverse in the slow decay mode. If the level of the feedback signal sense is detected to be equal to zero level, the zero-crossing detection signal OUT _ Z is generated, which will affect the four logic control signals NA1, NA2, NB1 and NB2 to make them all become low level, and the output enters high impedance state until the next fCHOPThe cycle restarts at the charging state.
Further, in order to avoid noise interference, the blanking time is set for both charging and rapid discharging. The charge blanking time may be set to 1-4 us, preferably 1.25us, the fast discharge blanking time may be set to 1-4 us,and preferably may be set to 2.81 us. In order to avoid current detection errors caused by external noise, a filter can be arranged at each switching point of quick attenuation of charging switching current and quick attenuation of current to slow attenuation of current, and the filter carries out filtering and noise prevention processing on a detection signal of the switching point. The time delay of the filter can be set to be 300-600 ns, and preferably to be 365 ns. Fig. 11 shows an exemplary embodiment of the PWM drive timing designed when the dynamic hybrid decay mode is employed in the present invention. Wherein SDDTDead time for slow decay, FDDTIn order to quickly attenuate the dead time, certain dead time is reserved for the upper pipe and the lower pipe when each state is switched, so that the upper pipe and the lower pipe are prevented from being communicated.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.