This design uses SPMC75F2413A as the controller of this system design. SPMC75F2413A is a new member of μ'nSPTM series products and a 16-bit microcontroller newly launched by Lingyang Technology. In this design, the pulse signal is generated by SPMC75F2413, and the drive circuit uses the two-phase stepper motor dedicated driver SLA7042M produced by Allergo to form the stepper motor drive circuit, and the actuator is a two-phase hybrid stepper motor.
1 Stepper motor acceleration and deceleration control principle
S-curve acceleration and deceleration changes the traditional three-stage acceleration and deceleration process into a seven-stage acceleration and deceleration process, forming an S shape, as shown in Figure 1. The acceleration section consists of the acceleration section (T1), the uniform acceleration section (T2), and the deceleration section (T3); the deceleration section consists of the acceleration and deceleration section (T5), the uniform deceleration section (T6), and the deceleration and deceleration section (T7); and the uniform speed section is (T4).
In the control system of the stepper motor, when an electric pulse signal is given, the stepper motor rotates an angle or moves forward one step. If the input pulse number N is given, its frequency is f within the specified time T. The frequency f of the driving pulse changes with time t:
Where fm is the maximum continuous frequency of the stepper motor, and τ is the time constant that determines the speed of the acceleration. It can be determined by experiments in actual work. The speed at which the system reaches a uniform speed and the time it takes for the system to reach the maximum speed are known.
This system uses the microcontroller timer interrupt method to control the speed of the stepper motor. When controlling the speed, it actually continuously changes the size of the timer load value.
The speed-up process is processed discretely, and the acceleration time is fixed as T=T1+T2+T3 in the design. For the convenience of explanation, T2=0. At this time, the acceleration section changes from 3 to 2, namely the acceleration section and the deceleration section. T is divided into 40 time periods of equal time, that is, the acceleration time T1 is divided into 20 equal parts, and the acceleration and deceleration time T3 is divided into 20 equal parts. The interval time between two speed changes is △t=T/40, and the frequency of each gear can be calculated by formula (1), and the number of steps performed by the stepper motor at each frequency can also be calculated.
2 System Hardware Design
Figure 2 is a block diagram of the system hardware design.
In Figure 2, SPMC75F2413A is a
The 16-bit microcontroller of the series products. The operating speed is 0-24 MHz within the operating voltage range of 4.5-5.5 V, with 2 K words of SRAM and 32 K words of flash ROM; IOA~IOD4 groups of 64-bit programmable I/O ports, 5 general-purpose 16-bit timers/counters. The system uses IOB0~IOB3 bits of the IOB port of S17MC75F2413A as the output port of the control signal, and IOB4 bit as the input port of the photoelectric sensor.
Stepper motors are easy to interface with digital circuits, but the signal energy of general digital circuits is far from enough to drive the motor. Therefore, a matching driver must be used to drive the stepper motor. The driver tells the motor how many microsteps to run by providing a specific excitation current to the motor windings. When the stepper motor runs in full-step mode, it coincides with the mechanical design characteristics of the motor. At this time, the stator and rotor teeth are perfectly aligned, the current flowing through the winding is the largest, and the step angle is also the largest. As the number of subdivisions increases, the step angle decreases accordingly.
The system uses the driver SLA7042M produced by Allergo, which essentially uses digital input to control the output current. Its two internal 4-bit shift registers receive the motor phase information and excitation current ratio data input by the SerialData pin respectively. The first bit of the 4-bit shift register first loads the phase information, then serially loads the lowest bit, the second lowest bit, and finally the highest bit of the excitation current ratio data. The driving circuit is shown in Figure 3.
3 System Software Design
The frequency of each frequency range and the number of steps taken by the stepper motor in the range can be calculated by formula (1), and the frequencies of the 40 ranges and the number of steps taken in each range are stored in two array variables respectively. The system software program first determines whether the stepper motor can reach the maximum speed. When the number of steps of the stepper motor is small, the stepper motor cannot reach the maximum speed and the speed will begin to decrease. At this time, the number of steps and frequency that can be achieved by increasing the speed, and the number of steps and frequency that can be achieved by decreasing the speed should be calculated first. The deceleration process is exactly the opposite of the acceleration process, that is, the data stored in the two arrays are output in the opposite order. Figure 4 is the software flow of the S-curve acceleration and deceleration of the stepper motor.
4 Conclusion
Using the Sunplus SPMC75F2413A microcontroller, the S-curve acceleration and deceleration method is used to effectively control the step loss and overshoot phenomenon that is easy to occur during the start and stop of the stepper motor. This control method is effective and practical, and has been verified in the CNC cutting system, and the results are stable and feasible.
Previous article:Register operation method
Next article:Application of Single Chip Microcomputer in AC Induction Motor System
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- TMS320C2X/C5X Application Register Rules
- TI - MCU - MSP430 User Guide 12 -> GPIO
- Capacitor Basics---RC Filtering
- Stimulus — Formal requirements modeling and analysis tool
- PADS drawing board
- Precautions for using LCD screen
- Bluenrg-2N Development
- How to deal with abnormal usage of JTAG header
- Looking for an AM receiver chip that can demodulate the aviation frequency band
- Initial trial of the Pingtouge development board: HELLO WORLD output