Motor control method and device based on H bridge, electronic equipment and storage medium
The H-bridge-based motor control method addresses the inefficiencies of PWM drive by dividing the motor into quadrants and using a triangular wave current to manage electromagnetic interference, enhancing efficiency and reducing costs.
Patent Information
- Application Number
- CN202411014713.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-10
AI Technical Summary
Conventional brushless motor uniform speed control using PWM drive mode suffers from electromagnetic interference and high voltage resistance requirements, leading to high costs and low efficiency.
A motor control method based on an H-bridge that divides the motor into quadrants and uses a triangular wave current driven by an H-bridge circuit, adjusting the duration of the current in each quadrant to maintain uniform speed while reducing electromagnetic interference and discharge reverse electromotive force.
Improves motor driving efficiency and reduces the cost of uniform speed control by effectively managing electromagnetic interference and optimizing current direction and duration.
Smart Images

Figure CN119109360A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor technology, and in particular to a motor control method, device, electronic equipment and storage medium based on an H-bridge. Background Art
[0002] Conventional brushless motor uniform speed control generally adopts PWM drive mode, which has two disadvantages: the first disadvantage is that the high-frequency carrier controls the speed by adjusting the PWM duty cycle, which is easy to generate electromagnetic interference; the second disadvantage is that the hard switching technology driving mode has high requirements on the voltage resistance of the switch tube. This also leads to high cost of uniform speed control of the motor and low motor drive efficiency. Summary of the invention
[0003] The present invention provides a motor control method, a device, an electronic device and a storage medium based on an H-bridge, so as to improve the driving efficiency of the motor and reduce the cost of the motor uniform speed control.
[0004] According to one aspect of the present invention, a motor control method based on an H-bridge is provided, wherein the motor is divided into a first quadrant, a second quadrant, a third quadrant and a fourth quadrant according to magnetic poles, and each quadrant of the motor includes four stages; in each quadrant, the control method includes:
[0005] In the delay stage, a preset voltage threshold and a reverse electromotive force of the motor are obtained, the quadrant in which the motor is currently located is determined according to the reverse electromotive force, and the commutation time of the motor is determined according to the quadrant in which the motor is currently located, the reverse electromotive force and the preset voltage threshold;
[0006] In the driving stage, the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located is turned on during the commutation time to increase the driving current of the motor;
[0007] In the discharge stage, the H-bridge circuit is controlled to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor;
[0008] The driving current in the driving stage and the driving current in the discharge stage form a triangular wave current to drive the motor; and the duration of the triangular wave current is calculated based on the effective driving current of the motor and the mechanical period of the motor.
[0009] Optionally, the step of calculating the duration of the triangular wave current according to the effective drive current of the motor and the mechanical period of the motor comprises:
[0010]
[0011] Wherein, Ir is the effective drive current; T is the mechanical period of the motor; K1 and K2 are constants related to the motor itself; Tr is the duration of the triangular wave current.
[0012] Optionally, the step of obtaining the effective driving current of the motor includes:
[0013] Obtaining the current function of the motor in each interval;
[0014] Integrate the current function of the motor in each interval to obtain the effective drive current of the motor. Optionally, the step of determining the current quadrant of the motor according to the back electromotive force includes:
[0015] If the back electromotive force is greater than zero, the motor is in the first quadrant or the third quadrant;
[0016] If the back electromotive force is less than zero, the motor is in the second quadrant or the fourth quadrant.
[0017] Optionally, the step of determining the commutation time of the motor according to the back electromotive force and the preset voltage threshold comprises:
[0018] Obtaining the absolute value of the back electromotive force;
[0019] The time when the absolute value of the back electromotive force reaches the preset voltage threshold in the quadrant where the motor is currently located is used as the commutation time.
[0020] Optionally, the duration of the driving phase is proportional to the duration of the discharging phase.
[0021] Optionally, after the step of controlling the H-bridge circuit to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor, the method further includes:
[0022] Obtaining the induced current generated by the reverse electromotive force of the motor;
[0023] If the induced current generated by the back electromotive force of the motor is zero, the motor discharge is completed, and the motor enters the next quadrant for driving.
[0024] Optionally, before the step of obtaining the back electromotive force of the motor, the method further includes:
[0025] Whether to control the motor to rotate at a constant speed is determined according to the speed threshold and the current speed of the motor.
[0026] Optionally, in the driving phase, a correction algorithm is used to correct the duration of the driving phase, and the correction algorithm includes:
[0027] Obtaining a set speed of the motor, an actual speed of the motor, and an effective drive current of the motor in the previous quadrant;
[0028] Calculating a speed error of the motor according to a set speed of the motor and an actual speed of the motor;
[0029] Calculating an error time according to a speed error of the motor;
[0030] Calculating a corrected duration of the driving phase based on the error time and a PID algorithm;
[0031] The actual rotational speed of the electric machine is calculated based on the corrected duration of the driving phase.
[0032] According to another aspect of the present invention, there is also provided a motor control device based on an H-bridge, the motor control device based on the H-bridge comprising:
[0033] an acquisition module, used for acquiring a preset voltage threshold and a back electromotive force of the motor, determining the current quadrant of the motor according to the back electromotive force, and determining the commutation time of the motor according to the current quadrant of the motor, the back electromotive force and the preset voltage threshold;
[0034] A driving module, used for turning on the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located during the commutation time, so as to increase the driving current of the motor;
[0035] A discharge module, used for controlling the H-bridge circuit to discharge the reverse electromotive force of the motor, so as to reduce the driving current of the motor;
[0036] The driving current in the driving stage and the driving current in the discharge stage form a triangular wave current to drive the motor; and the duration of the triangular wave current is related to the duration of the driving stage.
[0037] According to another aspect of the present invention, there is also provided an electronic device, the electronic device comprising:
[0038] at least one processor or at least one application specific integrated circuit; and
[0039] A memory communicatively connected to the processor or the ASIC; wherein,
[0040] The memory stores a computer program that can be executed by the at least one processor or at least one dedicated integrated circuit, and the computer program is executed by the at least one processor or at least one dedicated integrated circuit so that the at least one processor or at least one dedicated integrated circuit can execute the H-bridge based motor control method described in any of the above embodiments.
[0041] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores control instructions, and the control instructions are used to enable a processor or a dedicated integrated circuit to implement the H-bridge-based motor control method described in any of the above embodiments when executed.
[0042] The embodiment of the present invention divides the motor into four quadrants according to the magnetic poles of the stator in the motor, and controls the speed of the motor by changing the duration of the triangular wave current in each quadrant, thereby realizing the uniform speed operation of the motor. Compared with the prior art, the embodiment of the present invention enables the driving current of the motor to act on the flat top area of the induced electromotive force, and the current direction of the motor in the driving stage and the discharge stage is consistent, and the induced electromotive force is discharged while the motor is effectively driven, which is conducive to avoiding the influence of electromagnetic interference on the motor, improving the driving efficiency of the motor, and reducing the cost of the uniform speed control of the motor.
[0043] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a schematic diagram of motor quadrant division provided by an embodiment of the present invention;
[0046] Figure 2 is a flow chart of a motor control method based on an H-bridge provided in an embodiment of the present invention;
[0047] Figure 3 is a schematic diagram of a reverse electromotive force of a motor provided by an embodiment of the present invention;
[0048] Figure 4 is a schematic diagram of a motor based on an H-bridge circuit provided by an embodiment of the present invention;
[0049] Figure 5 is a waveform diagram of an effective motor driving current provided by an embodiment of the present invention;
[0050] Figure 6 is a waveform diagram of the voltage at both ends of a motor provided by an embodiment of the present invention;
[0051] Figure 7is a flow chart of an effective driving current acquisition method provided by an embodiment of the present invention;
[0052] Figure 8 is a flow chart of another motor control method based on an H-bridge provided in an embodiment of the present invention;
[0053] Fig. 9 is a flow chart of another motor control method based on an H-bridge provided in an embodiment of the present invention;
[0054] Fig.10 is a flow chart of another motor control method based on an H-bridge provided in an embodiment of the present invention;
[0055] Fig.11 is a flow chart of a correction algorithm provided by an embodiment of the present invention;
[0056] Fig.12 is a schematic diagram of a correction algorithm provided by an embodiment of the present invention;
[0057] Fig.13 is a schematic diagram of a motor control device based on an H-bridge provided in an embodiment of the present invention;
[0058] Fig.14 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0061] An embodiment of the present invention provides a motor control method based on an H-bridge. This embodiment can be applied to uniform speed control of a motor, and the method can be performed by a motor control device based on an H-bridge, which can be implemented in the form of hardware and / or software, and can be configured in a motor based on an H-bridge circuit. Figure 1 Schematic diagram of motor quadrant division provided by an embodiment of the present invention. Figure 1 The motor is divided into the first quadrant, the second quadrant, the third quadrant and the fourth quadrant according to the magnetic pole. Among them, the first quadrant I and the third quadrant III correspond to the S pole of the motor permanent magnet, and the second quadrant II and the fourth quadrant IV correspond to the N pole of the electrode permanent magnet.
[0062] Figure 2 is a flow chart of a motor control method based on an H-bridge provided by an embodiment of the present invention. Each quadrant of the motor includes four stages; Figure 2 , the methods for controlling the motor uniform speed in each quadrant include:
[0063] S110, delay stage, obtaining a preset voltage threshold and a reverse electromotive force of the motor, determining the current quadrant of the motor according to the reverse electromotive force, and determining the commutation time of the motor according to the current quadrant of the motor, the reverse electromotive force and the preset voltage threshold.
[0064] Specifically, when the coil of the motor rotates in the magnetic field, it cuts the magnetic flux lines and generates an induced electromotive force. The direction of the induced electromotive force is opposite to the direction of the current that makes the coil rotate, which weakens the motor power electromotive force. This electromotive force is the reverse electromotive force of the motor. When the motor runs in different quadrants, the direction of the power electromotive force required for the motor operation is also different. This also means that when the motor enters a different quadrant, the direction of the power electromotive force applied to the motor needs to be switched. Therefore, when the motor enters a new quadrant, it is necessary to determine the quadrant the motor is currently in and the commutation time. Figure 3 Schematic diagram of the reverse electromotive force of a motor provided by an embodiment of the present invention. Figure 3 , the back electromotive force of the motor reflects the excitation state of the motor. The back electromotive force of the motor is proportional to the motor speed. When the motor speed is low, the rotor flux of the motor changes slowly and the back electromotive force of the motor is small; when the motor speed is high, the rotor flux of the motor changes quickly and the back electromotive force of the motor is large.
[0065] S120, driving stage, turning on the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located during the commutation time to increase the driving current of the motor.
[0066] Figure 4 It is a schematic diagram of a motor based on an H-bridge circuit provided in an embodiment of the present invention. Figure 5is a waveform diagram of an effective motor driving current provided by an embodiment of the present invention. Figure 4 and Figure 5 Specifically, the H-bridge circuit includes a first bridge arm 100, a second bridge arm 200, a third bridge arm 300 and a fourth bridge arm 400. In the delay phase a, the effective driving current of the motor is zero; in the driving phase b, the first bridge arm 100 and the fourth bridge arm 400 of the H-bridge circuit are turned on to provide driving current for the motor, a vector torque is generated inside the motor, and the motor rotates.
[0067] S130, in the discharge stage, the H-bridge circuit is controlled to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor.
[0068] Specifically, combined Figure 4 and Figure 5 Specifically, in the discharge phase c, the third bridge arm 300 and the fourth bridge arm 400 of the H-bridge circuit are turned on to discharge the reverse electromotive force inside the motor. At this time, the vector torque generated by the discharge current of the motor is consistent with the rotation direction, the motor continues to rotate, and the rotation direction of the motor in the discharge phase c is consistent with the rotation direction of the motor in the driving phase b. In addition, after the discharge phase c ends, the motor enters the commutation phase d, at which time all the bridge arms of the H-bridge circuit are closed.
[0069] The driving current in the driving phase b and the driving current in the discharge phase c form a triangular wave current to drive the motor; the duration of the triangular wave current is calculated based on the effective driving current of the motor and the mechanical period of the motor.
[0070] The mechanical cycle of the motor is the time it takes for the motor to rotate at a constant speed, that is, the time it takes for the motor to traverse the first quadrant I, the second quadrant II, the third quadrant III, and the fourth quadrant IV. The duration of the triangular wave current is proportional to the speed of the motor. In other words, the uniform speed control of the motor can be achieved by changing the duration of the triangular wave current. The longer the duration of the triangular wave, the faster the motor speed. On the contrary, the shorter the duration of the triangular wave, the slower the motor speed.
[0071] The embodiment of the present invention divides the motor into four quadrants according to the magnetic poles of the stator in the motor, and controls the speed of the motor by changing the duration of the triangular wave current in each quadrant, thereby realizing the uniform speed operation of the motor. Compared with the prior art, the embodiment of the present invention enables the driving current of the motor to act on the flat top area of the induced electromotive force, and the current direction of the motor in the driving stage b and the discharge stage c is consistent, and the induced electromotive force is discharged while the motor is effectively driven, which is conducive to avoiding the influence of electromagnetic interference on the motor, improving the driving efficiency of the motor, and reducing the cost of the uniform speed control of the motor.
[0072] Based on the above embodiment, optionally, the step of calculating the duration of the triangular wave current according to the effective drive current of the motor and the mechanical period of the motor includes:
[0073]
[0074] Among them, Ir is the effective drive current; T is the mechanical period of the motor; K1 and K2 are constants related to the motor itself; Tr is the duration of the triangular wave current.
[0075] Specifically, through the physical characteristics of the motor's induced electromotive force and magnetic flux, it can be concluded that as long as a vector torque in the same direction as the speed is applied to the motor, the motor can be controlled to run at a constant speed. The following is a detailed description of the duration of the above triangular wave current and the speed of the motor:
[0076] M=F×r ; (2)
[0077] Among them, M is the motor torque; F is the motor vector force; r is the position vector from the motor rotation shaft to the force point.
[0078] F=n×B×L×I; (3)
[0079] Among them, F is the motor vector force; B is the electromagnetic induction intensity of the motor winding; n is the number of motor winding turns; L is the inductance of the motor winding; I is the motor drive current.
[0080] According to formula (1) and formula (2), it can be deduced that:
[0081] M=n×B×L×I×r; (3)
[0082] Among them, M is the motor torque; n is the number of motor winding turns; B is the electromagnetic induction intensity of the motor winding; L is the inductance of the motor winding; I is the motor drive current; r is the position vector from the motor rotating shaft to the force point.
[0083] According to Ohm's law, the voltage applied to the motor is related to the impedance of the motor and the drive current of the motor. Figure 6 is a waveform diagram of the voltage across the motor provided by an embodiment of the present invention. The voltage applied to the motor is as follows Figure 6 As shown. Due to the existence of the back electromotive force in the motor, when calculating the drive current of the motor, the influence of the back electromotive force in the motor on the calculation of the drive current of the motor should be taken into account.
[0084] I=(U–Er) / R; (4)
[0085] Among them, I is the motor driving current; U is the voltage applied to the motor across the H-bridge; Er is the induced electromotive force of the motor; and R is the overall impedance of the motor.
[0086] Er=n×B×L×V; (5)
[0087] Among them, Er is the induced electromotive force of the motor; n is the number of turns of the motor winding; B is the electromagnetic induction intensity of the motor winding; L is the inductance of the motor winding; V is the speed of the motor.
[0088] According to formula (3), formula (4) and formula (5), it can be deduced that:
[0089]
[0090] Among them, M is the motor torque; n is the number of motor turns; L is the inductance of the motor winding; R is the overall impedance of the motor; r is the position vector from the motor shaft to the point of application; U is the voltage applied to the motor at both ends of the H bridge; V is the speed of the motor.
[0091] According to formula (4) and formula (5), we can deduce:
[0092] I=(U–n×B×L×V) / R; (7)
[0093] Among them, I is the motor drive current; U is the voltage applied to the motor at both ends of the H bridge; B is the electromagnetic induction intensity of the motor winding; L is the inductance of the motor winding; V is the speed of the motor; R is the overall impedance of the motor.
[0094] According to formula (3) and formula (6), it can be seen that the motor drive current is proportional to the motor speed, and the other quantities in the formula are constants related to the motor itself. Integrate the other quantities in formula (3) and formula (6) except the motor drive current and the motor speed. Therefore, formula (3) and formula (6) can be equivalent to:
[0095]
[0096] Among them, I is the motor driving current; V is the motor speed; K1 is a constant related to the motor itself.
[0097] According to the above derivation, as long as the motor is given a constant current, the motor can be guaranteed to run at a constant speed. However, the motor has a magnetic saturation problem during operation. Therefore, in the driving stage b and the discharge stage c, a driving method with an approximate triangular current waveform is adopted. The effective driving current of the motor is approximate in the first quadrant I, the second quadrant II, the third quadrant III and the fourth quadrant IV. Figure 5 , integrating the current in one quadrant gives the effective drive current of the motor.
[0098] The current of the motor in each phase in each quadrant:
[0099]
[0100] Among them, k1 and k2 are the slopes of the motor drive current; x1 and x2 are the durations of the motor drive current.
[0101] Integrate the motor current at each stage in each quadrant:
[0102]
[0103] Among them, f(x) is the current in each stage in each quadrant; T is the mechanical period of the motor.
[0104] According to formula (9) and formula (10), it can be deduced that:
[0105]
[0106] Among them, T1 is the end time of the delay phase; T2 is the end time of the drive phase; T3 is the end time of the discharge phase; T4 is the end time of the commutation phase; T is the mechanical period of the motor; k is the effective drive current slope. It should be noted that the effective drive current slope is the scalar of the current slope of the motor drive phase b. The direction of the current slope of the motor discharge phase c is opposite to that of the motor drive phase b, but the scalar size of the slope is the same. In formula (11), the effective drive current slope is a scalar.
[0107] According to the physical characteristics of the motor itself, the slope of the motor driving current in the driving phase b and the discharge phase c is approximately the same. Therefore, it can be known that the duration of the driving phase b is the same as the duration of the discharge phase c. From this, it can be deduced that:
[0108] T2-T1=T3-T2; (12)
[0109] Among them, T1 is the end time of the delay phase; T2 is the end time of the driving phase; T3 is the end time of the discharge phase.
[0110] According to formula (11) and formula (12), we can see that as long as we control the duration of driving phase b, we can obtain an effective driving current that can control the motor's uniform speed. According to formula (11), formula (12) and formula (8), we can derive formula (1).
[0111] Figure 7 is a flow chart of an effective driving current acquisition method provided by an embodiment of the present invention. Based on the above embodiments, optionally, refer to Figure 7 , the steps of obtaining the effective driving current of the motor include:
[0112] S210, obtaining the current function of the motor in each interval.
[0113] Specifically, refer to Figure 5 As shown in formula (9), the current of the motor in the delay phase a and the commutation phase d is zero, and the current of the motor in the driving phase b and the discharge phase c is a linear function.
[0114] S220, integrating the current function of the motor in each interval to obtain an effective driving current of the motor.
[0115] Specifically, by integrating the current function of the motor in each interval, the total charge of the motor in the interval can be obtained. Through integral calculation, we can determine the current contribution of the motor at each moment, so as to have a more comprehensive understanding of the current characteristics of the motor. The integration method helps to evaluate the effective drive current of the motor. The effective drive current refers to the current part that is actually used to generate torque and drive the load during the operation of the motor. By integrating the current function, we can capture the cumulative effect of the current over time, so as to better understand the current demand of the motor under different working conditions. The specific integration process can be referred to formula (11).
[0116] Figure 8 is a flow chart of another motor control method based on H bridge provided by an embodiment of the present invention. Based on the above embodiments, optionally, refer to Figure 8 , the steps of determining the current quadrant of the motor based on the back electromotive force include:
[0117] S111, obtaining the reverse electromotive force of the motor;
[0118] S112, determine whether the reverse electromotive force is greater than zero; if so, execute S1113; if not, execute S1114.
[0119] Specifically, combined Figure 1 and Figure 3 , the magnitude of the back electromotive force of the motor is different in different quadrants, that is, the direction of the back electromotive force is related to the quadrant the motor is in. When the back electromotive force of the motor is greater than zero, it indicates that the motor is in the first or third quadrant; when the back electromotive force of the motor is less than zero, it indicates that the motor is in the second or fourth quadrant.
[0120] S1113. The motor is in the first quadrant or the third quadrant.
[0121] S1114. The motor is in the second quadrant or the fourth quadrant.
[0122] After determining the quadrant in which the motor is located, the bridge arm corresponding to the quadrant needs to be turned on to drive the motor. That is, after determining the quadrant in which the motor is currently located according to the back electromotive force, the commutation time of the motor needs to be determined. The step of determining the commutation time of the motor according to the back electromotive force and the preset voltage threshold includes:
[0123] S115. Obtain the absolute value of the reverse electromotive force.
[0124] Specifically, the absolute value of the back electromotive force can be obtained by performing absolute value calculation on the acquired value of the back electromotive force.
[0125] S116. The time when the absolute value of the back electromotive force reaches a preset voltage threshold in the quadrant where the motor is currently located is used as the commutation time.
[0126] Specifically, the absolute value of the reverse electromotive force is compared with a preset voltage threshold. When the absolute value of the reverse electromotive force is equal to the preset voltage threshold, the current time is used as the commutation time and the driving phase is immediately entered.
[0127] Fig. 9 is a flow chart of another motor control method based on H bridge provided by an embodiment of the present invention. Based on the above embodiments, optionally, refer to Fig. 9 , after the step of controlling the H-bridge circuit to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor, the method further includes:
[0128] S140, obtaining the induced current generated by the reverse electromotive force of the motor.
[0129] Specifically, the back electromotive force of the motor characterizes the quadrant in which the motor is located.
[0130] S150, determine whether the induced current generated by the reverse electromotive force of the motor is zero; if so, execute S160; if not, continue to execute S130.
[0131] Specifically, the motor needs to be completely discharged before the motor switches quadrants, that is, the induced current generated by the reverse electromotive force of the motor is zero.
[0132] S160, the motor discharge is completed, and the motor enters the next quadrant for driving.
[0133] Fig.10 is a flow chart of another motor control method based on H bridge provided by an embodiment of the present invention. Based on the above embodiments, optionally, refer to Fig.10 , before the step of obtaining the reverse electromotive force of the motor, it also includes:
[0134] S170: Determine whether to control the motor to rotate at a constant speed according to the speed threshold and the current speed of the motor.
[0135] Specifically, the speed threshold is the motor speed required by the user. In practical applications, the speed threshold can be set according to actual needs, and this embodiment does not limit this.
[0136] Fig.11 It is a flowchart of a correction algorithm provided by an embodiment of the present invention. Fig.12 is a schematic diagram of a correction algorithm provided by an embodiment of the present invention. Based on the above embodiments, optionally, in combination with Fig.11 and Fig.12 , in the driving phase, the duration of the driving phase is corrected using a correction algorithm, the correction algorithm includes:
[0137] S310, obtaining the set speed of the motor, the actual speed of the motor, and the effective drive current of the motor in the previous quadrant.
[0138] For example, the set speed Vref and the actual speed Vu(t) of the motor can be obtained by a sensor. In addition, the effective drive current of the motor in the upper quadrant needs to be measured to understand the working state of the motor.
[0139] S320: Calculate the speed error of the motor according to the set speed of the motor and the actual speed of the motor.
[0140] Specifically, the set speed Vref and actual speed Vu(t) of the motor are compared, and the difference between the two, i.e., the speed error Ve(t), is calculated. This error can be used to evaluate the performance of the motor and the accuracy of the control system.
[0141] S330, calculating the error time according to the speed error of the motor.
[0142] Specifically, the error time Te(t) of the motor is calculated according to the speed error Ve(t) of the motor and formula (1).
[0143] S340, calculating the correction duration of the driving phase according to the error time and the PID algorithm.
[0144] Specifically, the correction duration Tu(t) of the driving phase b is calculated by a PID (proportional-integral-derivative) algorithm. The PID algorithm is a commonly used control algorithm that can adjust the output of the motor according to the error time Te(t) to achieve more precise control.
[0145] S350: Calculate the actual rotation speed of the motor according to the corrected duration of the driving phase.
[0146] Specifically, the effective drive current of the motor at this time is calculated according to the motor speed error and formula (1). Since the motor speed is proportional to the effective drive current, the actual motor speed Vu(t) can be obtained based on the effective drive current of the motor.
[0147] Fig.13 Schematic diagram of a motor control device based on an H-bridge provided by an embodiment of the present invention. Fig.13 , the H-bridge based motor control device comprises:
[0148] The acquisition module 110 is used to obtain a preset voltage threshold and a back electromotive force of the motor, determine the current quadrant of the motor according to the back electromotive force, and determine the commutation time of the motor according to the current quadrant of the motor, the back electromotive force and the preset voltage threshold.
[0149] The driving module 120 is used to turn on the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located during the commutation time, so as to increase the driving current of the motor.
[0150] The discharge module 130 is used to control the H-bridge circuit to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor.
[0151] The driving current in the driving stage and the driving current in the discharge stage form a triangular wave current driving motor; the duration of the triangular wave current is related to the duration of the driving stage.
[0152] Fig.14 is a schematic diagram of an electronic device provided by an embodiment of the present invention. The electronic device is intended to represent various forms of computing devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computing devices. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0153] like Fig.14 As shown, Fig.14An exemplary structure of an electronic device 10 is given, and the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM), etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0154] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0155] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an H-bridge-based motor control method.
[0156] In some embodiments, the H-bridge based motor control method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the H-bridge based motor control method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the H-bridge based motor control method in any other appropriate manner (e.g., by means of firmware).
[0157] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0158] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0159] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0160] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0161] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0162] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0163] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0164] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A motor control method based on H-bridge, characterized in that: The motor is divided into a first quadrant, a second quadrant, a third quadrant and a fourth quadrant according to the magnetic poles, and each quadrant of the motor includes four stages; the control method in each quadrant includes: In the delay stage, a preset voltage threshold and a back electromotive force of the motor are obtained, the quadrant in which the motor is currently located is determined according to the back electromotive force, and the commutation time of the motor is determined according to the quadrant in which the motor is currently located, the back electromotive force and the preset voltage threshold; In the driving stage, the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located is turned on during the commutation time to increase the driving current of the motor; In the discharge stage, the H-bridge circuit is controlled to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor; The driving current in the driving stage and the driving current in the discharge stage form a triangular wave current to drive the motor; and the duration of the triangular wave current is calculated based on the effective driving current of the motor and the mechanical period of the motor.
2. The motor control method based on H-bridge according to claim 1, characterized in that: The step of calculating the duration of the triangular wave current according to the effective drive current of the motor and the mechanical period of the motor comprises: Wherein, Ir is the effective drive current; T is the mechanical period of the motor; K1 and K2 are constants related to the motor itself; Tr is the duration of the triangular wave current.
3. The motor control method based on H-bridge according to claim 1, characterized in that: The step of obtaining the effective driving current of the motor comprises: Obtaining the current function of the motor in each interval; The current function of the motor in each interval is integrated to obtain the effective driving current of the motor.
4. The motor control method based on H-bridge according to claim 1, characterized in that: The step of determining the current quadrant of the motor according to the back electromotive force comprises: If the back electromotive force is greater than zero, the motor is in the first quadrant or the third quadrant; If the back electromotive force is less than zero, the motor is in the second quadrant or the fourth quadrant.
5. The motor control method based on H-bridge according to claim 1, characterized in that: The step of determining the commutation time of the motor according to the back electromotive force and the preset voltage threshold comprises: Obtaining the absolute value of the back electromotive force; The time when the absolute value of the back electromotive force reaches the preset voltage threshold in the quadrant where the motor is currently located is used as the commutation time.
6. The motor control method based on H-bridge according to claim 1, characterized in that: The duration of the driving phase is proportional to the duration of the discharge phase.
7. The motor control method based on H-bridge according to claim 1, characterized in that: After the step of controlling the H-bridge circuit to discharge the reverse electromotive force of the motor so as to reduce the driving current of the motor, the method further includes: Obtaining the induced current generated by the reverse electromotive force of the motor; If the induced current generated by the back electromotive force of the motor is zero, the motor discharge is completed, and the motor enters the next quadrant for driving.
8. The motor control method based on H-bridge according to claim 1, characterized in that: Before the step of obtaining the back electromotive force of the motor, the method further includes: Whether to control the motor to rotate at a constant speed is determined according to the speed threshold and the current speed of the motor.
9. The motor control method based on H-bridge according to claim 1, characterized in that: During the driving phase, a correction algorithm is used to correct the duration of the driving phase, and the correction algorithm includes: Obtaining a set speed of the motor, an actual speed of the motor, and an effective drive current of the motor in the previous quadrant; Calculating a speed error of the motor according to a set speed of the motor and an actual speed of the motor; Calculating an error time according to a speed error of the motor; Calculating a corrected duration of the driving phase based on the error time and a PID algorithm; The actual rotational speed of the electric machine is calculated based on the corrected duration of the driving phase.
10. A motor control device based on an H-bridge, characterized in that: include: an acquisition module, used for acquiring a preset voltage threshold and a back electromotive force of the motor, determining the current quadrant of the motor according to the back electromotive force, and determining the commutation time of the motor according to the current quadrant of the motor, the back electromotive force and the preset voltage threshold; A driving module, used for turning on the bridge arm of the H-bridge circuit corresponding to the quadrant in which the motor is currently located during the commutation time, so as to increase the driving current of the motor; A discharge module, used for controlling the H-bridge circuit to discharge the reverse electromotive force of the motor, so as to reduce the driving current of the motor; The driving current in the driving stage and the driving current in the discharge stage form a triangular wave current to drive the motor; and the duration of the triangular wave current is related to the duration of the driving stage.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor or at least one application specific integrated circuit; and A memory communicatively connected to the processor or the ASIC; wherein, The memory stores a computer program that can be executed by the at least one processor or at least one dedicated integrated circuit, and the computer program is executed by the at least one processor or at least one dedicated integrated circuit so that the at least one processor or at least one dedicated integrated circuit can execute the H-bridge based motor control method described in any one of claims 1-9.
12. A readable storage medium, characterized in that: The readable storage medium stores control instructions, and the control instructions are used to enable a processor or a dedicated integrated circuit to implement any one of claims 1-9 of the H-bridge-based motor control method when executed.
Citation Information
Cited By
Electronic control unit (ECU) metal oxide semiconductor (MOS) tube protection circuit for coping with induced electromotive force generated by pushing vehicle door by external force, control method and microcontroller
CN121077442A
