The hottest stepping motor subdivision drive syste

2022-09-27
  • Detail

Design of stepping motor subdivision drive system based on A3967SLB

stepping motor has high precision, small inertia, and no step error accumulation without losing step, which is especially suitable for digital control positioning system. The traditional subdivision drive circuit is composed of subdivision loop distributor, amplifier and synthesizer. This kind of circuit has complex application and poor flexibility. In this paper, A3967SLB is used as the micro control chip of stepping motor, which simplifies the control implementation of stepping motor. Because the resources of single-chip microcomputer are not as rich as those of PC, and the man-machine interface is not as friendly as that of PC in Beijing, this paper adopts the master-slave structure, that is, PC is used for management and single-chip microcomputer is used for execution

A3967SLB constitutes the driving part of stepping motor

a3967slb is a special driver for PWM constant current control micro step driving two-phase stepping motor produced by Allegro company in the United States. Its working voltage can reach 30V and driving current can reach 750ma. One A3967SLB can drive a two-phase stepping motor, which can realize 8-segment drive. The PWM current control circuit inside the chip can be set to three current attenuation modes: slow, fast and mixed by the voltage applied to the PFD. If the voltage at the PFD end is higher than 0.6vdd, the slow attenuation mode is selected. If it is lower than 0.21vdd, select the fast attenuation mode. In between is the mixed attenuation mode. In addition, A3967SLB can also provide perfect protection measures, including suppression of transient voltage, overheating protection, prevention of direct current, undervoltage self-locking and other functions

a3967slb and microprocessor do not need to add other interface circuits. The chip adopts easy stepper interface, which reduces 8 control lines by 2 (step length and direction). As long as you simply input the pulse of the stepping motor when there is a value on the counter, its embedded converter can realize the control of the stepping motor. A3967SLB also needs some resistors and capacitors to adjust its working parameters. The whole driving circuit is very simple

as shown in Figure 1, MS1 and MS2 are logic input ports for the subdivision resolution selection of stepping motor; Dir is the selection port of motor running direction; Reset is used to reset the initial value of the chip and mask all external outputs; Step is the pulse input port; Out1a, out1b, out2a and out2b are two pairs of output ports of the H-bridge; Enable is the enable end; Sleep is sleep mode; Sense1 and sense2 are the current detection resistance of H bridge; Ref is the reference voltage; GND refers to logic ground and power ground; RC1 and RC2 are fixed cut-off time analog inputs of H-bridge. The maximum current limiting IMAX is determined by the sampling resistance Rs and the input reference voltage Vref of the sampling comparator:

imax = vref/8rs

at89c52 has 8KB flash, 256b internal RAM, 32 i/o port lines, 3 16 bit timing/counter, a 6-vector two-stage interrupt system, a full duplex serial communication interface, and on-chip oscillator and clock circuit. It is convenient to use the percentage that the minimum cross-sectional area of the test bar reduces to the original cross-sectional area after breaking. In this system, the single chip microcomputer is mainly used to generate control pulses and serial communication with the upper computer

communication circuit

in the simplest RS-232 direct transmission communication system, as long as the sending and receiving sides are prepared at the same time, only three signal lines, signal sending end (TXD), signal receiving end (RXD) and signal ground (GND), can be used for communication; If data communication is carried out in response mode, four signals, request transmission (RTs), clear transmission (CTS), data terminal preparation (DTR) and data device preparation (DSR) can be used for hardware handshake. In the AT89C52 single chip microcomputer system, the serial port lines RXD and TXD are led out from P3.0 and P3.1 respectively, and are converted to the standard level of RS-232 interface through a special level conversion chip. In this way, the digital signals between the two can be transmitted through RS-232 interface. The single chip microcomputer can communicate with the host computer through direct transmission or response handshake, but because the handshake occupies other ports, and the number of ports of the single chip microcomputer is limited, the communication between the computer and the single chip microcomputer often adopts direct transmission. The communication circuit is shown in Figure 2

software design

the design of the software part mainly includes the receiving program of the lower computer according to MCU, the pulse control program and the serial port sending program of the upper computer. Data communication between upper computer and lower computer. The program of the upper computer is mainly realized by windows visual programming VC +

but these materials are usually very sensitive to humidity and temperature. The machine program is mainly responsible for receiving the data sent by the PC and generating control pulses as required. The specific process is: first initialize the serial port to be used, then clear the P2 output port, and then enter the dead cycle of the program, waiting for the interrupt trigger. Receive one byte of data, RI = 1, and then clear RI. When the MCU receives the data, the flag position is 1. Store the data in the cache into the controlled variables for use during control (the specific operation is to send the start frame after the data frame). The software control process is shown in Figure 3

conclusion

combined with the stepping motor control system based on A3967SLB introduced above, the serial communication between PC and MCU is realized by using MSComm control in VC + + environment. The experimental results show that it is feasible and effective to drive the stepping motor control system based on A3967SLB accurately by the upper computer in this way

in this system, some data processing, display and other work can be carried out by using the rich software and hardware resources and powerful system functions of PC; The slave controller AT89C52 is used for real-time control. In addition, the system is an open structure, which is convenient for system upgrading. (end)

Copyright © 2011 JIN SHI