The biggest difference between a stepper motor and other motors used for control applications is that it receives digital control signals (electrical pulse signals) and converts them into corresponding angular or linear displacement. It is itself an actuator that completes digital mode conversion. Furthermore, it allows for open-loop position control; inputting a single pulse signal yields a specified position increment. This incremental position control system significantly reduces costs compared to traditional DC control systems, requiring almost no system adjustments. The angular displacement of a stepper motor is strictly proportional to the number of input pulses and synchronized with them in time. Therefore, by controlling the number, frequency, and phase sequence of the pulses and the motor windings, the desired angle, speed, and direction can be obtained.
Stepper motors have a simple overall structure, can achieve speed regulation within a wide frequency range, their speed is not affected by the load size, they have good overload capacity, fast response, and convenient control, and can achieve rapid start-stop and forward/reverse control.
Stepper motors are digitally controlled motors. Their drive circuits operate based on control signals, converting pulse signals into angular displacement. That is, a single pulse causes the stepper motor to rotate by a specific angle, making them ideally suited for microcontroller control. Microcontroller control allows for pulse distribution to control the commutation sequence, enabling forward or reverse rotation of the stepper motor by a given operating mode and positive commutation sequence. Speed and other adjustments can be made by changing the interval between two pulses. Common 51 microcontrollers such as the AT89C2051, STC12C1052 + THB7128, or THB6064 can be used in combination.
Controlling stepper motors with timer program controllers such as the TPC4-4TD is very convenient. It uses table settings without programming and allows setting pulse frequency, pulse count, and direction control data values. It can realize various basic operating functions such as speed control, position control, length control, and timing control of stepper motors.
By employing a high-performance DSP, and using the bus voltage and motor operating current via the DSP, and implementing closed-loop current control of the stepper motor through control algorithms, precise control of the stepper motor can be achieved. Simultaneously, the control algorithm can improve vibration and noise reduction at low and medium speeds. For example, Innas' EZM series stepper drive system uses DSP control, achieving near-servo performance in the low and medium speed range.
PLC-based control. A certain number of square wave pulses are output through PIC programming to control the rotation angle of the stepper motor, thereby controlling the feed amount of the servo mechanism. The rotation speed of the stepper motor is controlled by programming the pulse frequency, which in turn controls the feed speed of the servo mechanism.
Stepper motors are controlled by electrical pulse signals, and the generation, distribution, and amplification of these electrical pulse signals are all achieved through the operation of electronic components.
1. Electronic circuit-based control system
By employing closed-loop control, high-precision microstepping and stepless speed regulation can be achieved. Closed-loop control continuously detects the rotor's position and speed directly or indirectly, and then automatically generates a pulse train through feedback and appropriate processing. This ensures that the stepper motor responds to the control signal command at each step, so that as long as the control strategy is correct, the motor will not easily lose steps.
2. PLC-based control
A PLC, also known as a programmable logic controller, is a type of computer used in industry. As a new generation of industrial controllers, PLCs are widely used in automatic control systems across various industries due to their advantages such as good versatility, strong practicality, complete hardware support, simple and easy programming, and high reliability.
3. Microcontroller-based control
A microcontroller is used to control the stepper motor, realizing a control method that combines software and hardware. Software replaces the stepper motor distributor, achieving control over the stepper motor. The system uses a microcontroller interface line to directly control the drive circuits of each phase of the stepper motor.
1. A simple and convenient application can be completed using a microcontroller and a fully integrated stepper motor driver chip. Ordinary 51 microcontrollers such as the AT89C2051 or STC12C1052 combined with chips like the THB7128 or THB6064 can be used.
2. The microcontroller determines the number of output pulses based on the input, and the stepper motor driver chip converts the output pulses into a power signal to drive the stepper motor.
3. Since each step is completed with a single pulse, the number of output pulses must take into account the microstepping level. Programs with fixed rotation steps and angles are relatively easy to write. For example, a 1.8-degree stepper motor with 2 microsteps requires 400 pulses for one revolution, only 200 pulses for half a revolution, and only 100 pulses for 90 degrees, and so on.
4. For the program, a fixed, appropriate frequency is set. A button press triggers the timer. Then, in the timer interrupt, an I/O port is inverted to output a pulse. This pulse is then stored in an accumulator variable to calculate the pulse count. A complete pulse is output by inverting the I/O port twice. In the main program, a required pulse count is set as a condition to control the timer's on/off state. The program then loops, waiting for the condition to be met.
5. Integrating control, drive, and stepper motor together is quite complicated. It's okay for small motors, but interference from large motors is a problem.
The speed of a stepper motor is mainly controlled by changing the frequency of the control pulses. However, it's crucial to pay attention to the microstepping value of the driver. For example, a full step requires 200 pulses per rotation, while a half step requires 400 pulses. Digital drivers like the EZM552 can achieve a maximum microstepping value of 512, requiring 512 * 200 = 102400 pulses per rotation. In other words, with a microstepping of 512, a motor speed of 1 rpm requires a control pulse frequency of 102400 Hz; a motor speed of 2 rpm requires a control pulse frequency of 204800 Hz.
Stepper motor speed control method:
Stepper motors can only be controlled by digital signals. When pulses are provided to the driver, if the control system sends too many pulses in a short period of time—that is, the pulse frequency is too high—it will cause the stepper motor to stall. To solve this problem, an acceleration/deceleration method must be used. That is, when the stepper motor starts, the pulse frequency should be gradually increased, and when decelerating, the pulse frequency should be gradually decreased. This is what we commonly refer to as the "acceleration/deceleration" method.
The speed of a stepper motor changes according to the input pulse signal. Theoretically, giving the driver a pulse causes the stepper motor to rotate one step angle (one microstep angle for microstepping). In practice, if the pulse signal changes too rapidly, the damping effect of the internal back electromotive force will prevent the magnetic reaction between the rotor and stator from keeping up with the signal changes, leading to stalling and missed steps. Therefore, stepper motors require a pulse frequency acceleration method during high-speed startup and a deceleration process during stopping to ensure precise positioning control. The principles of acceleration and deceleration are the same.
To illustrate with an example of acceleration: the acceleration process consists of a base frequency (lower than the highest direct starting frequency of the stepper motor) and a jump frequency (a gradually increasing frequency), forming an acceleration curve (the deceleration process is the opposite). The jump frequency refers to the frequency at which the stepper motor gradually increases from the base frequency. This frequency cannot be too high, otherwise it will cause stalling and missed steps.
Acceleration/deceleration curves are generally exponential curves or modified exponential curves, but linear or sinusoidal curves can also be used. Acceleration/deceleration control can be achieved using a microcontroller or PLC. For different loads and speeds, appropriate base frequencies and switching frequencies need to be selected to achieve the best control effect.
In software programming, the time constant of an exponential curve is calculated and stored in the computer's memory beforehand, and then selected during operation. Typically, the acceleration and deceleration time for a stepper motor is over 300ms. Using excessively short acceleration and deceleration times would make it difficult to achieve high-speed rotation for most stepper motors.