1 Introduction
A stepper motor is an electromagnetic mechanical device that converts an electrical pulse signal into a corresponding angular displacement or linear displacement. It is an incremental drive element that outputs an input digital pulse and has the ability to start and stop quickly. However, most designers are accustomed to using logic circuits to implement complex stepper motor control. Although great results have been achieved, the implementation is costly and time-consuming. Moreover, once the circuit is formed, it is difficult to change it, so the controller has to be completely redesigned. The advanced technology and low price of microprocessors and microcomputers have created a new situation for the control of stepper motors [1]. People can completely control stepper motors with the help of software, thereby realizing a complex and low-cost control system. At the same time, they can flexibly change the control scheme by changing the program. To this end, we designed a stepper motor controller based on the 89C51 single-chip microcomputer for the glass tube heating system. The controller has the characteristics of simple circuit, good performance, low cost, and high reliability, and has achieved good results in practical applications.
2 Control System Hardware Design
2.1 Principle of glass tube heater
There is a fixture every 15° on the disc with a diameter of 400mm, which is used to place glass tubes with a diameter of 3mm and a length of 50mm-70mm. There is a flame nozzle above the disc to heat the glass tubes. First, install 24 glass tubes on the disc, start working after starting the machine and positioning, and the stepper motor starts to run. When it rotates 15°, it delays for T seconds (the size of T can be set to 3, 4, and 5. The default value of this system is 3. The time deviation can be less than 0.1 seconds through software control). When a glass tube is heated, the stepper motor rotates and moves to the next glass tube. The time used is 1 second. The positioning deviation can be less than 0.1mm through software, and then repeat the previous step. The main view of the mechanical transmission principle diagram is shown in Figure 1, and the top view is shown in Figure 2.
Figure 1 Main view of mechanical transmission principle diagram
Figure 2 Top view of mechanical transmission principle diagram [page]
2.2 MCU control system hardware design
The core of the system controller uses 89C51 single-chip microcomputer with 4K erasable program memory, which is easy to expand the system and improve the program. The four bits of P1 port are used as keyboard input control, and K1, K2, and K3 are used to control the delay state. K1 is pressed to delay for 3 seconds, K2 is pressed to delay for 4 seconds, and K3 is pressed to delay for 5 seconds. K4 controls the running direction selection and switches between clockwise and counterclockwise. The digital tube uses a serial display method to display the running status. LED1 displays the display direction selection, "-" indicates clockwise rotation, and "|" indicates counterclockwise rotation. LED2 displays the delay time, which can display three states: 3, 4, and 5. See Figure 3 for the electrical control block diagram.
Figure 3 Electrical control block diagram
3 Control system software design
3.1 Functional analysis of software implementation
The control system can set direction selection, delay time, etc. as required, and the operator can easily observe the working status of the control system.
(1) The minimum step angle of the stepper motor is 1.5°, and the number of steps per revolution is 240 steps/revolution;
(2) There is a fixture at 15° on the disk, and a total of 24 glass tubes can be placed;
(3) The time it takes for the disk to rotate 15° is 1 second;
(4) The digital display part is the delay time (can be set to 3, 4, or 5 seconds);
(5) Keep the nozzle perpendicular to the disk to reduce errors.
3.2 Main program flow chart of the control system
According to the tasks that the system should complete, the main program flow chart is designed as shown in Figure 4:
Figure 4 Main program flow chart
In Figure 4:
Left 1: One step delay of 10ms is used to find the positioning point, and then enter the normal operation state after finding the positioning point;
Left 2: Setting number, used to set 10 steps to stop and 240 steps to judge;
Left 3: Normal operation, 1 step delay 0.1s, 10 steps and then stop, delay T (T=3, 4, 5);
Left 4: 240 steps make one circle. After one circle, determine whether there is interference or lost steps. If so, find the positioning point again.
After the system starts, the port and display are initialized first, the display is cleared, the three-phase winding of the stepper motor is in a power-off state, and then the numeric keys and function keys are scanned. When the operation passes a set value of the numeric key, the set value is stored in the RAM unit in hexadecimal, and then displayed in decimal through the dynamic LED; after the operator confirms, press the left (or right) row function key, the stepper motor will drive the disk to rotate, and the delay time will be displayed through the static LED.
[page]
3.3 Design of the forward and reverse drive subroutine of the stepper motor
The stepper motor used in this system is 110BF3-15, which has a three-phase winding. There are three pulse input sequences for the three-phase winding, namely single three-beat, double three-beat, and three-phase six-beat. This system uses the double three-beat input method. The input method is controlled by software. The double three-beat control software is one of the simplest soft interfaces. First, the PA port of 8255A is used as the output port, and then the control information is sent to PA0~PA2. The corresponding I/O line is "1" (high level is valid), then the corresponding phase winding of the stepper motor is energized, and the stepper motor rotor rotates. If the rotor is required to rotate in different directions, the energization sequence of the three-phase winding is different, and the corresponding control word is also different. The double three-beat winding energization control information table is shown in Table 1[2].
From Table 1, we can see that the information string required for forward and reverse rotation is 03H→06H→05H→03H, and the power is turned on in the order of AB→BC→CA→AB. The information string required for reverse rotation is 05H→06H→03H→05H, and the power is turned on in the order of CA→BC→AB→CA.
Table 2 shows the control words (hexadecimal, the same below) of the asynchronous phase control mode of the stepper motor.
Table 1 Stepper motor phase winding power control information table
Table 2 Control words for asynchronous phase control methods
After considering the forward and reverse rotation of the stepper motor, the double three-beat control software list is as follows [3]:
DS: MOV A, #00H; Initialize PA0~PA2 to output
MOV DPTR,#0C000H;
MOVX @DPTR,A ;
MOV DPTR, #0C000H; AB phase is powered
MOV A,#03H
MOVX @DPTR,A
LCALL DELY ; adjust delay
MOV DPTR, #0C000H; BC phase is powered
MOV A,#06H
MOVX @DPTR,A
LCALL DELY ; adjust delay
MOV DPTR, #0C000H; for phase CA
MOV A,#05H
MOVX @DPTR,A
LCALL DELY ; adjust delay
DELY:MOV 0CH,#0FH ; Delay subroutine
RET[page]
The above is the forward pass electronic program of the three-phase winding of the stepper motor. The reverse pass electronic program is similar. If you want to change the motor speed, just change the value of the immediate number in the MOV 0CH, #0FH instruction. Figure 5 is the flow chart of the forward and reverse drive subroutine of the stepper motor:
Figure 5 Forward and reverse driver flow chart
4 Conclusion
The system is easy to operate, flexible in control, high in precision and good in reliability. It has met the expected design requirements, greatly reduced the intensity of physical labor and improved working conditions. In order to improve the reliability and precision of the system, corresponding anti-interference measures have been adopted in the implementation of software and hardware.
Previous article:Study on single chip digital tube and latch
Next article:FPGA Configuration Based on Single Chip Microcomputer P89C61X2
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【Silicon Labs BG22-EK4108A Bluetooth Development Evaluation】+ Development Environment Construction
- Do you know how to save power in RTOS applications?
- The problem of lower yield strength
- What you should know about the switching characteristics of Mosfet
- Understanding wireless communication technology
- Solving the Challenges of High-Speed Serial Connectivity
- Infineon Tmall flagship store offers huge discounts Part 1 - Limited cashback on a first-come, first-served basis, Double 11 special promotion!
- Good evening, experts.
- The startup method of high performance DSP in large capacity wireless transmission technology
- You may need oscilloscope information urgently, especially analog ones. You can get the information here.