Square-wave brushless motor control principle and implementation steps
a. Square wave control theory based on
square wave control is also called the six steps control, in an electrical cycle, motor only six states, or six kinds of stator current state (Six kinds of switch state three-phase bridge arm)。 Each of the current state can be regarded as the synthesis of a direction vector torque, six vector regularly, step by step by step conversion, vector rotation determines the motor direction of rotation (Clockwise or counterclockwise), will follow the synchronous motor rotor rotation. In the square wave control, mainly to control two quantities, one is the motor rotor position corresponding to the state of open tube, a Hall, Hall information to obtain the rotor position, there is no sensor, brushless motor from the counter electromotive force information to obtain the rotor position, thus decided to open tube state; The second is the PWM duty cycle control, by controlling the duty ratio to control the size of the current size, so as to control torque and speed. 2. Square wave algorithm implementation steps
Hall square wave control:
1. Read the AD value of busbar current sampling, calculation of busbar current
2. Current loop calculation should give the PWM duty cycle, control the size of current for a given current
3. Read hall, according to the state of hall relation with three-phase bridge arm open tube array and get the corresponding state of open tube, each hall jump tallied for three-phase bridge arm state switching time point (Also known as the commutation point)。
4. Hall between adjacent state sector for a one 6 of the power cycle, which is 60 & deg; Use timer can record & 60 deg; Sector time, thus the current frequency is calculated, and motor speed is obtained.
5. With current loop as the inner ring, the speed loop as the outer ring, motor closed-loop control, such as Hall square wave control block diagram. For Hall square wave control, the motor starts, knew the motor rotor position, directly using Hall state vector torque to pull, can start the motor, and can be directly into the closed loop control.
3. BEMF square wave control:
1. Read the AD value of busbar current sampling, calculation of busbar current.
2. Current loop calculation should give the PWM duty cycle, control the size of current for a given current
3. Maintain a state of open tube (That maintain a direction vector orientation), positioning, and then according to certain frequency change open tube state, and according to the law of change of frequency. To switch the electric frequency, and then switch to the counter electromotive force model.
4. Timer interrupt to read with a high frequency phase comparator output state, if the phase comparator output level flip, shows the opposite electromotive force produced zero, at this point, the reading time base timer D count value, save, and then clear the timer D, D and configure the timer compare register 0 comparison values, open timer timing starts D, until PWMD0 interrupt, change the switch tube in the interrupt status, which is found zero delay & 30 deg; Electric Angle and commutation.
5. With current loop as the inner ring, the speed loop as the outer ring, motor closed-loop control, for BEMF square wave control, the motor starts, don't know the motor rotor position, so need to use synchronous start motor, stator current according to the given size and frequency drive motor rotor, and then the motor to achieve switching frequency, can switch to counter electromotive force mode to run the motor, speed and current closed-loop control and running.