The specific control method of stepping motor controlled by single-chip microcomputer

The specific control method of stepping motor controlled by single-chip microcomputer

(1) Pulse distribution (that is, power-on commutation control)

There are two types of pulse distribution methods: software method and hardware method. The software method is a completely software method, in accordance with the given power-on commutation sequence, the control pulse is sent to the drive circuit through the I/0 of the single-chip microcomputer. The software method is to continuously generate control pulses during the operation of the motor, which takes up a lot of CPU time and may prevent the single-chip microcomputer from performing other tasks at the same time. Therefore, the hardware method is more commonly used.

The so-called hardware method actually uses the pulse distributor chip to carry out the commutation and steering control, and the pulse distribution work is automatically completed by the pulse distributor. Therefore, the burden on the CPU is much reduced.

(2) Speed control

The speed control of the stepping motor is realized by controlling the frequency of the stepping pulse sent by the single-chip microcomputer.

The first method is to delay through software. The frequency of the output pulse can be changed by changing the length of the delay, but this method makes the CPU wait for a long time and takes up a lot of machine time, so it has no practical value.

The second method is to interrupt by timer. Perform pulse output operations in the interrupt service subroutine, and adjust the timer’s timing constant to achieve speed regulation. This method occupies less CPU time and can be implemented in various single-chip microcomputers. It is a more practical speed regulation method.

(3) Operation control

The operation control of stepping motor involves position control and acceleration and deceleration control.

①Position control. The position control of the stepping motor refers to controlling the stepping motor to drive the actuator to move from one position to another position accurately. The position control of the stepper motor is a major advantage of the stepper motor. It can achieve sufficient position accuracy without the help of a position detector but simply open-loop control, so it is widely used.

The position control of the stepper motor requires 2 parameters.

The first parameter is the current position parameter of the actuator controlled by the stepper motor, which we call the absolute position. The absolute position has a limit, and its limit is the range of the actuator movement. If it exceeds this limit, an alarm should be issued.

The second parameter is the distance from the current position to the target position. We can convert this distance into the number of steps of the stepper motor by means of conversion. This parameter is input from the outside world through the keyboard or the adjustable potentiometer knob, so the conversion work should be completed in the keyboard program or A/D conversion program.

The general method of stepper motor position control is: each step of the stepper motor, the number of steps is reduced by 1. If there is no out-of-step, when the actuator reaches the target position, the number of steps is just reduced to 0. Therefore, the number of steps is equal to 0 to determine whether to move to the target position, as a signal to stop the stepping motor.

Absolute position parameters are used as man-machine dialogue display parameters, or as important parameters for other control purposes. It is related to the steering of the stepper motor. When the stepper motor rotates forward, the absolute position increases by 1 for each step of the stepper motor; when the stepper motor reverses, the absolute position decreases by 1 with each step.

②Acceleration and deceleration control. When the stepper motor drives the actuator to move from point A to point B, it has to go through the process of speed increase, constant speed and deceleration. If the speed is increased to a given speed once at startup, the stepping motor will lose step because the startup frequency exceeds the limit startup frequency fq, which will cause it to fail to start normally. If it stops suddenly when it reaches the end point, the stepper motor will overshoot due to inertia, resulting in a decrease in position accuracy. If the speed is very slow, the stepping motor will not cause out-of-step and overshoot, but it will affect the efficiency of the actuator. Therefore, there are strict requirements for the acceleration and deceleration of the stepper motor, that is, to ensure that it can move to the specified position at the fastest speed without losing step and overshoot.

Using a single-chip microcomputer to control the acceleration and deceleration of the stepping motor is actually to change the time interval of the output clock pulse. The pulse train is gradually encrypted when the speed is increasing, and gradually sparse when it is decelerating. When the single-chip microcomputer uses the timing interrupt mode to control the speed of the motor, it is in fact constantly changing the size of the timer loading value. Generally, the discrete method is used to approach the ideal speed-up curve. In order to reduce the time for calculating the reload value at each step, the load value required by the speed of each discrete point is solidified in the EPROM of the system during system design. When the system is running, use the look-up table method to find out the required load value, thereby greatly reducing the time occupied by the CPU and improving the system response speed.