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

Figure 1.1 Working principle diagram of reactive stepper motor


When pulses continue to arrive, the stator windings are continuously connected and disconnected through the distributor according to the rule of phase A-phase-phase B-phase C-phase A phase... At this time, the rotor of the stepper motor rotates counterclockwise step by step continuously. If the rotation direction of the stepper motor is changed, as long as the order of power supply of the stator windings is changed to phase A-phase-phase C-phase-phase B-phase A, the rotor rotation direction will be changed to clockwise.


In the single three-step distribution mode, the stepper motor switches from phase A to phase B, and the rotor of the stepper motor rotates an angle, which is called one step. At this time, the angle of the rotor rotation is 30 degrees. The angle of each step of the stepper motor is called the step angle.


1.2.2

Three-phase double three-beat operation mode: two windings are energized each time, and the energization sequence is AB--BC--CA--AB... If the energization sequence is changed to AB--CA--BC--AB..., the stepper motor will reverse. In the double three-beat distribution mode, the step angle of the stepper motor is also 30 degrees


1.2.3 Three-phase single and double six-beat operation mode: The three-phase six-beat distribution mode has six power-on states in each cycle. The order of these six power-on states can be A--AB--B--BC--C--CA--A... or A-- CA--C--BC--B--AB--A... In the six-beat power-on mode, there is a moment when both windings are energized at the same time, and the position of the rotor teeth will be located in the middle of the two energized phases. In the three-phase six-beat distribution mode, the angle of each step of the rotor is only half of that in the three-phase three-beat mode, and the step angle is 15 degrees.


The prominent problem of single three-beat operation is that only one phase of the winding is energized at a time. During the conversion process, one phase of the winding is de-energized and the other phase of the winding is energized, which can easily cause loss of step. In addition, relying solely on one phase of the winding to energize the rotor has poor stability and is prone to oscillation near the equilibrium position, so it is seldom used.


The characteristic of double triple-beat operation is that two-phase windings are energized each time, and one-phase winding always remains energized during the conversion process, so the operation is stable and the step angle is the same as that of single triple-beat.


When the six-beat operation mode is switched, one phase of the winding is always energized and the step angle is small, so the working stability is good, but the power supply is more complicated and has more practical applications.


3.1.2 Start and stop control of stepper motor

Due to its electrical characteristics, the stepper motor will have a stepping feeling, that is, a sense of vibration, when it is running. In order to make the motor rotate smoothly and reduce vibration, a subdivided trapezoidal wave can be used at the rising and falling edges of the stepper motor control pulse, which can reduce the step angle of the stepper motor and improve the stability of the motor operation. When the stepper motor stops, in order to prevent the motor shaft from slipping due to inertia, a suitable locking waveform is required to generate a locking magnetic torque to lock the stepper motor shaft so that the stepper motor shaft cannot rotate freely.


3.1.3 Steering control of stepper motor

If the given working mode is positive sequence commutation, the stepper motor will rotate forward. If the excitation mode of the stepper motor is three-phase six-beat, that is, A-AB-B-BC-C-CA. If the power is commutated in reverse sequence, the motor will reverse. The other modes are similar.


3.2 Step display module principle

The step display module and the working status display module both control the on and off of the light-emitting diode LED through the output signal of the single-chip microcomputer. The LED in the step display module constitutes a digital tube, which is required to display a 4-digit decimal number, so a 4-digit digital tube is used. To control a multi-digit display circuit, field control and word control are required. The control mode is divided into static display mode and dynamic display mode. In the static display mode, each bit of the display needs to be equipped with an 8-bit output port to output the seven-segment code of the word, and an external output port is required. The dynamic display mode connects the pins of the corresponding fields of each digital tube in parallel, which is simple in circuit, reduces interfaces, and does not require external expansion. The dynamic display mode is selected here.


4 Hardware Design
4.1 System Schematic Diagram

Figure 3 System schematic diagram


The hardware connection diagram made using PROTEUS according to the design requirements is shown in Figure 3.


4.2 Hardware schematic design of each part
4.2.1 Single chip control module

The single-chip microcomputer uses the most classic 80C51, and all of its 4 I/O ports are used. P3 is connected to the stepper motor drive circuit and the working status display module, P0 and P2 are respectively connected to the field control of the digital tube in the step display and the digital tube chip selection, P1 is connected to the working status control circuit, and the clock uses the internal mode and needs an external crystal oscillator. The hardware diagram is shown in Figure 4.

Figure 4 Schematic diagram of the microcontroller module


This design uses a 12MHZ crystal oscillator, so one machine cycle is 1/12us. Based on empirical data, the two capacitors together with the crystal oscillator are set to 15PF. The VCC and GROUD of the microcontroller are hidden and automatically connected. VCC should be set to +5V.


4.2.2 Press the button to select the working status module

First, let us consider the common problem of all mechanical contact buttons when they output status, which is the button jitter problem. Due to the elastic vibration of the mechanical contacts, the button will not be immediately and stably connected when pressed, nor can it be completely disconnected at once when it is bounced. Therefore, a series of jitters will appear at the moment of key closing and disconnection, which is called button jitter interference.


This jitter may cause the switch state generated by pressing a key once to be misread by the CPU several times. In order to enable the CPU to correctly read the key state, we use the parallel capacitor de-jitter method in this design, which uses the discharge delay of the capacitor to achieve it.


As shown in Figure 5, this is the design of the only input module. One end of the 5 key switches is connected to a high level through a resistor, and the other end is all connected to the ground. The end connected to the high level is also connected to the P1 port of the microcontroller, P1.0~P1.4 respectively. When the switch is disconnected, the high level is input to the corresponding port of the microcontroller, and when the switch is closed, the port is grounded and the low level is input. Therefore, this design is effective only when the switch is disconnected. Functions of each key:

(1) K0-K2 is the working mode control switch. When KO is powered on, it is the single three-beat working mode of the stepper motor; when K1 is powered on, it is the double three-beat working mode of the stepper motor; when K2 is powered on, the stepper motor working mode is three-phase six-beat.

(2) K3 is the start/stop control switch, which controls the opening and closing of the entire system.

(3) K4 is the forward/reverse control switch, which controls the direction of the stepper motor.


Figure 5 Schematic diagram of the button module


4.2.3 Stepper Motor Working Module

Just connect the three ports of the three-phase stepper motor directly to the microcontroller P3.0~P3.2, and connect the other three ports to the +12V high level to power the stepper motor. You only need to write a control algorithm in the software to adjust the high and low levels of these three ports to control the start and stop, forward and reverse rotation, and working mode of the stepper motor. The stepper motor hardware wiring diagram is shown in Figure 6.

Figure 6 Schematic diagram of stepper motor module


4.2.4 Working status display module

The LED light-emitting diodes display the working status of the stepper motor, and they are connected to P3.3~P3.5 of the microcontroller respectively. As shown in Figure 7, the output of the microcontroller is connected to the LED cathode through an inverter, and the LED anode is connected to VCC. This can increase the current and facilitate the conduction of the diode. We can control the data of the P3 port to realize the light and dark of the LED.

Figure 7 Schematic diagram of working status display module


4.2.5 4-digit digital tube display step number module

The LED digital tube is actually composed of seven light-emitting tubes in the shape of an 8, plus a decimal point, which is 8. These segments are represented by letters a, b, c, d, e, f, g, and dp. When voltage is applied to specific segments of the digital tube, these specific segments will light up to form the words we see with our eyes. By controlling the COM terminals of each LED digital tube in turn in time-sharing, each digital tube is controlled and displayed in turn, which is dynamic drive.


The first four pins of P0 and P2 are connected to the field control of the digital tube and the chip selection of the digital tube in the step display, as shown in Figure 8. The control of the microcontroller output is mainly achieved by software algorithms.

Figure 8 Schematic diagram of digital tube display module


5. Software Design 5.1 Overall System Design


Figure 9 System flow chart


Design description: First, the digital tube display is cleared, and the single-chip computer reads the key status of the P1 port input, first determines whether it is started, if not started, the green light is on and then judged, if it is started, then judge the required motor working mode, and then read the P1 port status to determine the direction of the motor, the output control signal is forward red light, reverse yellow light, so that the stepper motor can run in the specified way, and the accumulated steps are displayed on the digital tube. Finally, check whether the state of the P1 port has changed. If it has changed, the steps are cleared and judged again, if it has not changed, it continues to rotate.

[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号