Summary
This design introduces in detail the three-phase stepper motor control system based on single-chip microcomputer. The stepper motor is controlled by input pulse signal, that is, the total rotation angle of the motor is determined by the total number of input pulses. Therefore, the single-chip microcomputer can control the stepper motor by sending control signals to the stepper motor.
The stepper motor control system implemented by the single-chip microcomputer has the characteristics of low cost and flexible use. The system uses the 80C51 single-chip microcomputer as the main control chip to complete the control of the stepper motor rotation and LED display.
This design is mainly composed of 80C51 single-chip microcomputer, 3-phase stepper motor, 7-segment digital tube, and some other related components. It is divided into key selection working status module, stepper motor working module, LED diode display working status module and 4-digit digital tube display step number module. The system start/stop can be controlled by the switch. When the system is running, the switch is used to control the direction and make the corresponding indicator light up. The switch is also used to select the working mode. When running, the 4-digit 7-segment digital tube is used to output the number of steps. Finally, the corresponding software is designed according to the hardware diagram designed by the idea.
The circuit structure is simple, the design idea is clear, and the result of joint debugging simulation using Proteus is relatively intuitive. The simulation results have achieved the expected effect.
1 Design Task
(I) Design a three-phase reactive stepper motor pulse distributor to receive pulse input, requiring three-phase single three-beat and three-phase six-beat operation mode control (level), and forward and reverse control (level).
The system has the following functions: K0-K2 are used as the power-on mode selection keys, K0 is three-phase single three-beat, K1 is three-phase double three-beat, K2 is three-phase six-beat; K3 is start/stop control, K4 is direction control; 4-digit LED digital tube is used to display the working steps. 3 light-emitting diodes are used to display the status: the red light is on when it is forward, the yellow light is on when it is reversed, and the green light is on when it is not rotating;
2. Task Analysis
A stepper motor is an actuator that is controlled by an electrical pulse signal and converts the electrical pulse signal into a corresponding angular displacement. Each pulse signal can make the stepper motor rotate a fixed angle, which is called the step angle. Due to the control of the pulse, the angular displacement and speed of the rotor are strictly proportional to the number of input pulses and the pulse frequency.
The structure of a three-phase reactive stepper motor is shown in Figure 1.8. The motor stator has six magnetic poles, and the opposite magnetic poles are excited by the same winding. The entire motor has three windings, which are connected in a Y-shaped manner. The rotor is made of soft magnetic material and has no windings. If the winding is powered in the order of Ⅰ-Ⅱ-Ⅲ-Ⅰ-Ⅱ-Ⅲ-…, the motor rotates counterclockwise; if the winding is powered in the order of Ⅰ-Ⅲ-Ⅱ-Ⅰ-Ⅲ-Ⅱ-…, the motor rotates clockwise. This control method is called a three-phase single three-beat method. If the power-on sequence is Ⅰ-ⅠⅡ-Ⅱ-ⅡⅢ-Ⅲ-ⅢⅠ-… (counterclockwise), it is called a three-phase six-beat method.
The stepper motor control device sends out the operation mode, rotation direction and rotation angle (number of steps). The first two items are generally represented by the level, and the latter is represented by the number of pulses. The pulse distributor makes the stepper motor rotate according to the required working mode, rotation direction and number of steps according to the command (level signal and pulse) sent by the stepper motor control device. The rotation rate of the stepper motor pole is limited. If it is too fast, the motor will lose step (the motor cannot keep up with the rotation of the pole), especially in the start and stop phases of the motor, which requires pulse rate limiting measures.
(III) System hardware schematic diagram
4. System software design
To prevent the motor from losing step due to the input pulse frequency being too fast, the input pulse can be cached in the microcontroller, and then the pulse is distributed. Pay attention to the pulse rate when distributing. The pulse input module counts the cache unit by 1 when each input pulse arrives; the pulse distribution module scans the cache unit at all times. When the cache unit is not zero, the stepper motor rotates one step, and then the cache unit is reduced by 1. When it is reduced to 0, the pulse distribution stops. In order to change the three-phase level at the same time, this should be considered in the program. Asynchronous distribution of pulses may cause the motor to rotate in the wrong direction.
In order to make the motor run at the fastest speed, the pulse distribution rate should be distributed according to the trapezoidal curve, as shown in Figure 1.10. The meaning of the figure is: at the beginning (zero speed), the pulse distribution should be slow, and when the motor starts to rotate, the pulse rate will gradually increase and reach the maximum rate; when it is time to stop, it cannot stop immediately, but must first reduce the pulse rate, and finally reduce it to zero, and the motor stops.
Figure 1.10 Pulse rate distribution
2. Solution
2.1 Design ideas and solutions
This design is a control system for a three-phase stepper motor. The stepper motor control system implemented by a single-chip microcomputer has the characteristics of low cost and flexible use. This system can use a 51 single-chip microcomputer.
According to the requirements, the entire design can be roughly divided into four parts:
First, the five buttons K0~K4 select the working state of the stepper motor according to the user's needs. We connect the switch to the P1 port of the microcontroller and read the control signal we need through the high and low level states of the button switch. In terms of hardware, the switches are directly connected to the interface of the microcontroller, and the control signals are processed by querying the port signals. When designing the switch part, the influence of mechanical jitter is also taken into consideration, and a hardware method is adopted - parallel capacitors to de-jitter.
The second is a module that displays the working status of the stepper motor with three LEDs. In the design requirements, the red light is on when the stepper motor is rotating forward, the yellow light is on when it is rotating reversely, and the green light is on when it stops. In the design, the three LEDs are connected to the P3 port of the microcontroller and are controlled by the output signal of the microcontroller.
The third is the working module of the stepper motor. If we want the stepper motor to run as we want, we need to connect one end of the stepper motor to the +12V power supply and the other end to the P3 port of the microcontroller, and control it by the output signal of the microcontroller.
The fourth is the module of 4-digit digital tube displaying the number of steps. The design mainly uses the algorithm of software programming to realize the accumulation and display of the number of steps. Similarly, the 4-digit digital tube is connected to the P0 and P2 ports of the microcontroller and is controlled by the output signal of the microcontroller. The hardware uses the dynamic display connection method.
From this, we can see that we need to design a system that can select the working mode of the stepper motor through different buttons, and have LED light-emitting diodes to display the corresponding working status of the motor. In addition, the number of steps of the stepper motor can be displayed on the digital tube.
2.2 Overall design diagram
This system is mainly composed of a single-chip microcomputer, a stepper motor, a step count display module, and a working status control and display module. The overall block diagram is shown in Figure 1.
Figure 1 System overall block diagram
3 System Implementation Principles
3.1 Working Principle of Stepper Motor Control
3.1.1 Working Principle of Stepper Motor
Different driving modes of stepper motors are that when working, pulse signals are added to the three-phase windings in a certain order in turn, so as to achieve different working states. Due to different power-on sequences, there are three operating modes: three-phase single three-phase beat, three-phase double three-phase beat, and three-phase single and double six-phase beat (Note: the "three-phase" in the above "three-phase single three-phase beat" refers to the stator having three-phase windings; "beat" refers to the stator winding changing the power-on mode once; "three beats" means that power is applied three times to complete a cycle. The "double" in "three-phase double three-phase beat" means that two phase windings are powered at the same time).
1.2.1 Three-phase single three-beat operation mode: The figure on the next page shows the working principle diagram of the reactive stepper motor. If the first pulse output by the pulse distributor energizes the A-phase winding, and the B and C-phase windings are not energized, the magnetic field generated after the A-phase winding is energized will cause a reactive torque on the rotor, and the 1st and 3rd teeth of the rotor will be aligned with the stator magnetic poles, as shown in Figure (a). The second pulse arrives, energizing the B-phase winding, while the A and C-phase windings are not energized; the magnetic field generated by the B-phase winding will align the 2nd and 4th teeth of the rotor with the B-phase magnetic poles, as shown in Figure (b). Compared with Figure (a), the rotor rotates counterclockwise by an angle. After the third pulse arrives, the C-phase winding is energized, while the A and B phases are not energized. At this time, the 1st and 3rd teeth of the rotor will be aligned with the C group, and the position of the rotor is shown in Figure (c). Compared with Figure (b), it has rotated counterclockwise by another angle.
Previous article:51 single chip microcomputer generates pwm duty cycle 10khz frequency Proteus simulation program
Next article:Simple 8-key electronic keyboard program for single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- To prevent smog, don’t use this weird “Japanese portable air purifier”!
- 【Featured Q&A】Battery protection and fuel gauge design
- Please recommend a single op amp to implement a second-order or higher-order high-gain (32dB) active low-pass filter solution
- Help, about the use of Sifang Optoelectronics AM4100
- What is a good way to convert PWM to 0-10V?
- 06. Anlu SparkRoad domestic FPGA evaluation [Learning] RGB lights
- STM32 microcontroller thanks
- #include "xx.h" does not execute why
- MSP430G2553 Timer Interrupt Example
- Does anyone have an unused EFM32PG22 Dev Kit board? Can you give it to me?