Design and decomposition of three-phase stepper motor control system based on single chip microcomputer

Publisher:skyhcgLatest update time:2020-02-16 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

[1] [2] [3] [4]
Reference address:Design and decomposition of three-phase stepper motor control system based on single chip microcomputer

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

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号