Open-loop control system of stepping motor based on single chip microcomputer

Publisher:skyshoucangLatest update time:2010-04-10 Source: 电机与控制应用 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

A stepper motor is an electromechanical actuator that converts an electrical pulse signal into a corresponding angular displacement or linear displacement. By controlling the number of input pulses, frequency, and the connection sequence of each phase winding of the stepper motor, various required operating characteristics can be obtained. Especially when used with digital equipment, it has greater advantages, so it is widely used in digital control systems.

This paper introduces the digital control system of stepper motors by single chip microcomputer. In this control system, the controller is responsible for generating pulses and sending and receiving control commands. This paper introduces the design of the controller, especially the design of the pulse generating circuit in detail.

1 System Design

The block diagram of the stepper motor open-loop control system is shown in Figure 1. The system consists of four parts: stepper motor controller, stepper motor drive power supply, stepper motor and LED status display. This article focuses on the stepper motor controller, stepper motor drive power supply and LED status display.

Stepper motor open loop control system block diagram
Figure 1 Block diagram of stepper motor open-loop control system

1.1 Stepper Motor Controller

The stepper motor controller is mainly composed of a single-chip microcomputer, a crystal oscillator circuit, an 8K RAM and a photoelectric isolation circuit (see Figure 2).


Figure 2 Stepper motor controller components

(1) Crystal oscillator circuit

The clock signal of the microcontroller is usually obtained in two circuit forms: internal oscillation mode and external oscillation mode. The internal oscillation mode is formed by connecting a crystal oscillator (referred to as crystal oscillator) or a ceramic resonator to pins XTAL1 and XTAL2. Since there is a high-gain inverting amplifier inside the microcontroller, when an external crystal oscillator is connected, a self-excited oscillator is formed and an oscillating clock pulse is generated. The external circuit of the internal oscillation mode is shown in Figure 3. The values ​​of C1 and C2 are selected as 30 pF in this system.


Figure 3 Internal oscillation circuit

(2) Photoelectric isolation circuit

The photoelectric isolation circuit composed of optical isolators is used to isolate the controller from the external drive circuit, so that changes in the external circuit will not affect or damage the control system, thereby improving the reliability of the system and enhancing the anti-interference ability. The most important parameter of the optical isolator is the current transfer ratio CTR, which is usually 0.2 to 0.9. When the input digital signal provides a certain current (5 to 10 mA), the optical isolator will output the amplified digital level.

When connecting the opto-isolator, pay attention to the signal positive and negative logic. The input and output ground wires of the opto-isolator must be separated from each other, and the input and output power supplies must be powered separately; if the same power supply is used, external interference signals may be transmitted to the system through the power supply.

(3) Storage module

The 89C51 microcontroller has only 128 Bytes of RAM on chip, but this system needs to store a lot of data, so it is necessary to expand the external RAM.

(4) Step pulse generation circuit

In the open-loop system of stepper motor using single-chip microcomputer, the frequency of CP pulse or commutation period of the control system actually controls the running speed of the stepper motor. The system can realize the speed control of stepper motor in two ways: one is delay and the other is timing.

The delay method is to call a delay subroutine after each commutation, and then execute commutation again after the delay is over. In this way, a certain frequency of CP pulses or commutation cycles can be issued repeatedly. The delay time of the delay subroutine and the time used by the commutation program are the period of the CP pulse. This method is simple, takes up few resources, and is completely implemented by software. Calling different subroutines can achieve different speeds of operation; but it takes up a long CPU time and cannot handle other tasks during operation, so it is only suitable for simpler control processes.

The timing method is to use the timer timing function in the single-chip system to generate a timing signal of any period, so as to conveniently control the period of the system output CP pulse. When the timer is started, the timer counts the system and its period from the initial value loaded; when the timer overflows, the timer generates an interrupt, and the system switches to execute the timing interrupt subroutine. The motor commutation subroutine is placed in the timing interrupt service program. The motor commutates once the timing interrupt is triggered, thereby realizing the speed control of the motor. Since there is a certain time interval from the timer loading and restarting to the timer applying for an interrupt, the timing time increases. In order to reduce this timing error and achieve accurate timing, the initial value of the reloaded count should be appropriately adjusted. The adjustment of the reloaded initial value mainly considers two factors: one is the time required for the interrupt response; the other is the time occupied by the reload initial value instruction, including other instruction factors in the interrupt service program before the reload initial value. After combining these two factors, the correction amount of the reloaded initial value of the count is taken as 8 machine cycles, that is, the timing time should be shortened by 8 machine cycles.

When the motor speed is controlled by the timer interrupt method, the timer load value is actually changed continuously. In the control process, the ideal speed increase and decrease curve is approached by the discrete method. In order to reduce the time of calculating the load value at each step, the load value required for the speed of each discrete point is solidified in the system ROM when the system is designed. The system uses the table lookup method to find the required load value during operation, which can greatly reduce the CPU time and improve the system response speed. The flow chart is shown in Figure 4.


Figure 4 Acceleration and deceleration control flow chart

1.2 Stepper Motor Drive Circuit

The stepper motor drive circuit is composed of the dedicated chips L297 and L298. The L297 single-chip stepper motor control integrated circuit is suitable for the control of bipolar two-phase stepper motors or four-phase unipolar stepper motors, and is combined with the H-bridge driver chip L298 to form a complete stepper motor fixed chopping frequency PWM constant current chopper driver.

The L297 stepper motor control integrated circuit generates a four-phase drive signal to control a bipolar two-phase stepper motor or a four-phase unipolar stepper motor. It can switch between three modes: half-step, two-phase excitation, and single-phase excitation. The outstanding feature of using L297 is that only three external input signals, clock, direction, and working mode, are required. At the same time, L297 automatically generates the motor excitation phase sequence, which reduces the burden of microprocessor control and programming. L297 has two packaging forms, DIP20 and SO20, and can be used to control integrated bridge drive circuits or drive circuits composed of discrete components.

L297 is mainly composed of a decoder, a PWM constant current chopper (2) with a fixed chopping frequency, and output logic control.

The L298 chip is a high voltage, high current, dual H-bridge power integrated circuit that can be used to drive inductive loads such as relay coils, DC motors, and stepper motors. The emitters of the lower arm transistors of each H-bridge are connected together, and the corresponding external terminals can be used to connect current detection resistors.

The stepper motor drive application circuit composed of L297 and L298 is shown in Figure 5. This circuit is a fixed chopping frequency constant current chopping drive mode, suitable for two-phase bipolar stepper motors or four-phase unipolar stepper motors, with a maximum voltage of 46 V and a current of up to 2 A per phase. Using two L298s and one L297 together can drive a two-phase stepper motor with higher power.


Figure 5 Stepper motor driver components

L297 has three working modes: half-step working mode, bidirectional excitation working mode and single excitation working mode. The phase sequence waveform of the bidirectional excitation working mode is shown in Figure 6.


Figure 6 Bidirectional excitation phase sequence waveform

When HALF / FULL of L297 is low level, if the decoder works in odd state (1, 3, 5, 7), it is bidirectional excitation working mode. In this mode, the output of the prohibition signal INH1 and INH2 is kept high level. If the decoder works in even state (2, 4, 6, 8), it is single-phase excitation mode; when HALF / FULL is high level, the decoder generates half-step working mode phase sequence, that is, 8-step Gray code timing sequence.

1. 3 LED operation status display

In this system, 74LS164 is used as the display driver with latch and serial connection, which can save I/O port resources, but SIO must be used, which makes it easy to control when sending data.

2 Conclusion

The open-loop control system of the stepper motor has the advantages of low cost, simplicity, and easy control. In this scheme, the load position has no feedback to the control circuit, so the stepper motor must respond correctly to each excitation change. If the excitation frequency is not selected properly, the motor cannot reach the new required position, and the actual load position will have a permanent error relative to the expected position of the controller, that is, "out of step" and "overshoot" phenomena will occur. Position feedback or position feedback can be used to determine the correct phase conversion to adapt to the rotor position, thereby greatly improving the performance of the stepper motor, so that more precise position control and high and stable speed can be obtained.

Keywords:MCU Reference address:Open-loop control system of stepping motor based on single chip microcomputer

Previous article:Design of brushless DC motor control system based on LPC2141
Next article:Using Delta inverter to replace CT servo to apply constant tension control

Recommended ReadingLatest update time:2024-11-16 22:55

Universal USB interface module design AVR microcontroller
1 Introduction The USB interface has become one of the main ways for peripherals to communicate with PCs due to its fast data transmission, simple connection, easy expansion, and hot-swap support. With the development of embedded systems, embedded microprocessors need to add a universal USB interface to achieve commun
[Microcontroller]
Universal USB interface module design AVR microcontroller
Design of paper jam detection system for folding machine based on 51 single chip microcomputer
1. Introduction A folding machine is a post-press equipment that folds each large printed paper into a size suitable for daily binding. The size of the paper. There are many types. It can fold the paper into four, eight, sixteen, thirty-two folds. When a paper jam occurs during the folding process, the pap
[Microcontroller]
Design of paper jam detection system for folding machine based on 51 single chip microcomputer
How many I/O lines are there in the pins of the MCS-51 series microcontrollers?
Question: How many I/O lines are there in the pins of the MCS-51 series microcontrollers? What is the relationship between them and the address bus and data bus of the microcontroller? How many bits are there in the address bus and data bus? How big is the address space that can be addressed externally?  Answer: The 8
[Microcontroller]
#single-chipcomputer#digital tube
Digital Tube The digital tube is composed of eight LED lights. Essentially, it is 8 LED lights. Schematic diagram of digital tube: ps: The two COMs are for parallel shunting and reducing the current that a single line can bear. Digital tubes are divided into common anode digital tubes and common cathode digital
[Microcontroller]
#single-chipcomputer#digital tube
PIC16F877A MCU realizes HT1621 LCD display control
Introduction: This article uses the PIC16F877A microcontroller to implement the HT1621 LCD display control. The hardware circuit has few hardware, small size, simple structure, high stability, and can accurately display the leakage, overload, undervoltage and other indications of the multi-functional fully automatic i
[Microcontroller]
PIC16F877A MCU realizes HT1621 LCD display control
51 MCU serial port control relay
There is a project in the laboratory that uses the alarm function. For example, when the temperature or stress is too high or too low, the alarm is activated, and a command is sent to the serial port to control the relay. Unfortunately, I connected the positive and negative poles in reverse last year and it burned. Re
[Microcontroller]
PIC microcontroller drives NB358 smoke alarm assembly program
;           NB358 software v1.0                  LIST      P=16F676                  INCLUDE   "16F676.INC"                  __CONFIG _CP_OFF & _WDT_ON & _BODEN & _PWRTE_ON & _XT_OSC & _MCLRE_ON & _CPD_OFF  ; *********************************  ;       Variable Define  ; *********************************  ;-----------
[Microcontroller]
Servo control of bionic robot fish based on PIC microcontroller
1. Introduction to the Bionic Robot Fish Platform: The designed and manufactured robot fish imitates the appearance of the croaker family, and the head is made of rigid plastic material. Its shape is streamlined, imitating the shape and size ratio of a real fish head. The power supply and control circuit ar
[Microcontroller]
Latest Industrial Control 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号