Design of stepper motor subdivision drive system based on A3967SLB

Publisher:平安心境Latest update time:2011-04-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This paper uses the A3967SLB serial port controller launched by Allegro as the hardware core of the stepper motor subdivision drive system, and realizes the 8-subdivision drive of the stepper motor. The serial communication design between the host computer and the stepper motor control system based on the single-chip microcomputer is discussed, and the hardware interface circuit of the single-chip microcomputer serial communication is given.
Keywords: A3967SLB; stepper motor; subdivision drive; serial communication

The stepper motor has high precision, small inertia, and no step error accumulation without losing step. It is particularly suitable for digital control positioning systems. The traditional subdivision drive circuit consists of subdivision ring distributors, amplifiers, and synthesizers. This circuit is complex to apply and has poor flexibility. This paper uses A3967SLB as a stepper motor microcontroller chip to simplify the control implementation of the stepper motor. Since the microcontroller resources are not as rich as PCs, and the human-machine interface is not as friendly as PCs, this paper adopts a master-slave structure, that is, PCs are used for management and microcontrollers are used for execution.

The drive part of the stepper motor is composed of A3967SLB

. A3967SLB is a PWM constant current control micro-step drive two-phase stepper motor dedicated driver produced by Allegro, USA. Its operating voltage can reach 30V, and the drive current can reach 750mA. One A3967SLB can drive a two-phase stepper motor and can achieve 8 subdivision drives. The PWM current control circuit inside the chip can be set to three current decay modes: slow, fast, and mixed by adding a voltage to the PFD. If the voltage at the PFD end is higher than 0.6VDD, the slow decay mode is selected. If it is lower than 0.21VDD, the fast decay mode is selected. The mixed decay mode is between the two. In addition, the A3967SLB can also provide complete protection measures, including transient voltage suppression, overheating protection, current direct current prevention, undervoltage self-locking and other functions.

There is no need to add other interface circuits between the A3967SLB and the microprocessor. The chip uses the Easy Stepper interface, which reduces 8 control lines by 2 (step length and direction). As long as the pulses for controlling the stepper motor are simply input, the built-in converter can realize the control of the stepper motor. The A3967SLB also needs some resistors and capacitors to adjust its working parameters. The entire drive circuit is very simple.

As shown in Figure 1, ms1 and ms2 are the logic input ports for selecting the subdivision resolution of the stepper motor; dir is the port for selecting the direction of the motor; reset is used to reset the initial value of the chip and shield 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 terminal; sleep is the sleep mode; sense1 and sense2 are the current detection resistors of the H bridge; ref is the reference voltage; gnd is the logic ground and power ground; rc1 and rc2 are the fixed cutoff time analog inputs of the H bridge. The maximum current limit imax is determined by the sampling resistor rs and the input reference voltage vref of the sampling comparator:

imax=vref/8rs

at89c52 has 8kb flash, 256b internal ram, 32 i/o lines, 3 16-bit timers/counters, a 6-vector two-level interrupt system, a full-duplex serial communication interface, and an oscillator and clock circuit inside the chip. It is very convenient to use. In this system, the microcontroller is mainly used to generate control pulses and communicate serially with the host computer.

Communication circuit

In the simplest RS-232 direct transmission communication system, as long as both the sender and the receiver are ready at the same time, communication can be carried out using only three signal lines: signal transmitter (TXD), signal receiver (RXD) and signal ground (GND); if data communication is carried out in response mode, four signals: request to send (RTS), clear to send (CTS) or data terminal ready (DTR), data device ready (DSR) can be used for hardware handshake. In the AT89C52 single-chip microcomputer system, the serial port lines RXD and TXD are respectively led out from P3.0 and P3.1, and converted into the level of the RS-232 interface standard through a dedicated level conversion chip, so that digital signals can be transmitted between the two through the RS-232 interface. The single-chip microcomputer can communicate data with the host through direct transmission or response handshake, but because the handshake mode 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 the direct transmission mode. 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 the MCU, the pulse control program and the serial port sending program of the upper computer. Data communication is carried out between the upper computer and the lower computer. The program of the upper computer is mainly implemented through the windows visual programming vc++.

The lower computer 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 loop of the main program to wait for the interrupt to be triggered. Receive a byte of data, ri=1, and then clear ri. When the microcontroller receives the data, the flag position is 1. Store the data in the cache into the control variable for use during control (the specific operation is to send the data frame first and then the start frame). The software control process is shown in Figure 3.

Conclusion

Combined with the stepper 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 use this method to realize the precise driving of the stepper motor control system based on A3967SLB by the host computer.

In this system, the rich software and hardware resources and powerful system functions of PC can be used to perform some data processing, display and other tasks; while the slave controller AT89C52 is used for real-time control. In addition, the system is an open structure, which is convenient for system upgrade.

Reference address:Design of stepper motor subdivision drive system based on A3967SLB

Previous article:Design of bell ringer based on ATmage8
Next article:AVR MCU GCC Programming

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号