Design of Stepping Motor Control System Based on Single Chip Microcomputer

The stepper motor control system realized by single-chip microcomputer has the characteristics of low cost and flexible use, and is widely used in numerical control machine tools, robots, quantitative feed, industrial automatic control and various controllable mechanical tools with positioning requirements. The stepping motor is a digitally controlled motor that converts the pulse signal into an angular displacement. The speed and stop position of the motor depend on the frequency of the pulse signal and the number of pulses, and are not affected by the load change. In the non-overload state, according to the above linear relationship In addition, the stepper motor has only periodic error and no cumulative error, so the stepper motor is suitable for single-chip control. The stepping motor is controlled by inputting a pulse signal, that is, the total rotation angle of the motor is determined by the total number of input pulses, and the rotation speed of the motor is determined by the frequency of the pulse signal. The driving circuit of the stepping motor works according to the control signal generated by the single chip microcomputer. Therefore, the single chip microcomputer can realize the control of the stepping motor by transmitting a control signal to the stepping motor driving circuit.

1 system design principle

The stepping motor control system is mainly composed of four modules: single chip microcomputer, keyboard LED, drive/amplification and PC upper computer. The PC module is the software control part. The functions that the control system can realize: 1) Start/pause steps through the keyboard Into the motor, set the speed of the stepper motor and change the steering of the stepper motor; 2) display the stepping speed and steering and other working states through the LED tube; 3) realize the control of the three-phase or four-phase stepping motor: 4) pass The PC host computer controls the stepping motor (start and stop, speed and steering, etc.). In order to protect the hardware circuit of the single-chip control system, an overcurrent protection circuit is added between the single-chip microcomputer and the stepping motor. Figure 1 is a block diagram of the stepper motor control system.

2 system hardware circuit design

2.1 MCU module

The MCU module is mainly composed of MSP430FG4618 MCU and peripheral filtering, power management and crystal oscillator. The internal 8 KB RAM and 116 KB Flash of the MSP430FG4618 microcontroller meet the storage requirements of the control system. The P1 and P2 ports change the working state of the stepper motor according to the state of the button during the stepper motor operation to determine whether to jump into the interrupt service routine. USART module Realize the communication between the MCU and the PC host computer to realize the PC control of the stepper motor. The power management circuit provides stable 3.3 V and 5 V voltages to power the microcontroller, crystal oscillator, and drive and power amplifier circuits. The 32 kHz crystal oscillator provides the clock for the microcontroller, keyboard/display interface device 8279 and pulse distributor PMM8713; when using the USART module, the 8MHz crystal oscillator communication module needs to be turned on. Figure 2 is a block diagram of the MCU module structure.

2.2 Keyboard / LED Module

In order to realize man-machine dialogue, the system design expands the 3x4 button matrix keyboard and four 8-segment LED digital tubes, which can be directly operated directly by the control system. After the system is powered on, the start and stop of the stepping motor, the number of steps and the steering are input through the keyboard, and the speed and steering of the stepping motor are dynamically displayed by the LED tube. The input of the keyboard and the output of the LED tube are controlled by 8279, which reduces the workload of the single chip microcomputer. The 8279 programming works in the keyboard scan input mode, and has a debounce function when reading the keyboard to avoid false triggering. Figure 3 is a block diagram of the design structure of the keyboard LED module.

2.3 drive / amplification module

The control system uses a pulse splitter (also known as a logic converter) PMM8713 for stepper motor control. The device is a CMOS integrated circuit with phase output drive capability (source current or sink power) of 20 mA. It is suitable for controlling three-phase or four. Phase stepping motor, the following six kinds of excitation modes can be selected: three-phase stepping electric advance: one phase, two phases, 1-2 phase; four phase stepping electric advance: one phase, two phases, 1-2 phases. The input mode can be selected from single clock (plus direction signal) and dual clock (forward or reverse clock), with functions such as forward and reverse control, initial reset, origin monitoring, excitation mode monitoring and input pulse monitoring. The device PMM8713 is composed of clock gating, excitation mode control, excitation mode judgment and reversible ring counter. All the input terminals are equipped with Schmitt circuit, which can improve anti-interference ability. The PMM8713 output needs to be connected to the power drive circuit. The power driver PMM2101 is selected and the maximum output current is 1.4 A, which satisfies the requirements of driving the stepper motor. The drive/amplifier circuit is shown in Figure 4. The MSP430 MCU controls the start-stop, speed and steering of the stepper motor by adjusting the input pulse signals of ports 1 to 4 of the PMM8713.


3 system software design

3.1 Microcontroller program

The pulse signal is generated by the timer TIMER_A(TA) interrupt of the single-chip microcomputer, and the accurate counting of the number of steps and the number of turns of the stepping motor is realized in the response interrupt program, and the speed control is realized by PWM; the interrupt of the P1.0 port is used to turn off the TA interrupt. The program is pushed onto the stack to stop the motor; the P1.1 interrupt turns on the TA interrupt, the stack pushes into the program counter (PC), turns on the motor; the P3.1 port outputs a high level that is controlled by the PMM8713's U/D port. ; P3.0 ~ P3.7 port connected to 8279 8 data interface, when the MCU scans to the matrix keyboard with key press, use the P2 port interrupt to set TA, control start and stop, speed and steering, etc., while MCU feedback Give 8279 control LED tube display speed and steering. The program flow is shown in Figure 5.

3.2 PC host module

The PC host computer module realizes the control of the stepping motor by the PC. The USART module of the MSP430 single-chip microcomputer realizes communication with the PC host computer, and the PC sends a control command to the single-chip microcomputer through the serial port to realize motor control. The control command received by the MCU is temporarily stored in RXBUFFER, and then compared with the entry address of the interrupt program stored in the on-chip flash, and the same interrupt is entered to realize the control of the stepping motor. To operate the module, an 8 MHz crystal is required to set the baud rate for the USART module (set the baud rate to 9 600). The control software is written by VB6.0 and uses the MSComm control to implement serial communication functions. Its control software interface is shown in Figure 6.

4 system testing

In order to verify the actual working condition of the control system, the maximum static torque output by the stepping motor is measured by the energy conversion method given the output current of the PMM2101. The static characteristic curve of the relationship between the maximum static torque and the current of the stepping motor is measured by selecting the output current interval of 0.2 A. As shown in Fig. 7, the design of the control system is reasonable.

5 Conclusion

The system controls the operation of the stepping motor through the MSP430 single-chip microcomputer, and has high reliability. It can conveniently set the start/stop, rotation speed and direction of the stepping motor during the running of the motor, improve the stepping precision of the stepping motor, and can control three-phase or Four-phase stepping motor; PC operating system completely controls various operating modes of stepping motor, so that the system can be used in harsh environments, ensuring personnel safety, wide application range, simple circuit, low cost and convenient control. It has strong portability and high practical value.

All In One PC

All in one pc is a new trend for desktop type computer nowadays. What you can see at this store is Custom All In One PC. There are 19 inch all in one pc, 21.5 All In One PC, All In One PC 23.8 Inch and 27 inch all in one pc, which are the main sizes at the market. How to choose the most suitable one for special application? According to clients` feedback, 19.1 inch entry level, 21.5 inch middle and low level, 23.8 or 27 inch higher level-All In One PC I7. Some clients may worry the heat-releasing since equipped releasing fan into the back of monitor, see no releasing fences on back cover. However, totally no need worry that point, cause special back cover material and releasing holes can meet the demand of heat releasing.

You can see All In One Business Computer, All In One Gaming PC, and All In One Desktop Touch Screen series at this shop.

Any other unique design or parameters, just feel free to contact us so that can get right and value information quickly.

Believe will try our best to support you!


All In One PC,All In One Pc I7,Custom All In One Pc,All In One Pc 23.8 Inch,21.5 All In One Pc

Henan Shuyi Electronics Co., Ltd. , https://www.shuyipcs.com