With the popularity of 32-bit DSP, 32-bit processors have become the mainstream products in the control field. Compared with traditional microprocessors, they are faster, more powerful, and more resource-rich, and more in line with the pace of development. TMS320F28027 is a 32-bit DSP with the advantages of fast computing speed and high stability. This article uses TMS320F28027 to control two stepper motors, so that objects can move in a plane and draw specified curves and circles in the plane.
1. Design of the overall system solution
Figure 2 is a control block diagram of the suspension system. TMS320F28027 is used as the control chip, and L298N is used to drive two stepper motors. The stepper motor uses 42HS4813A4, with a rated current of 1.3A and a step angle of 1.8°. LCD-12864 is used to display the real-time coordinates of the controlled object. The two stepper motors are controlled to rotate forward and reverse to achieve the effect of arbitrary movement of the object in the plane.
Figure 1 Model of the suspension system
Figure 2 Suspension system control block diagram
2 Hardware Circuit Design
2.1 L298N
L298N is a high voltage, high current motor driver chip produced by ST. Figure 3 is the circuit schematic of the L298N module. The main features of this chip are: high operating voltage, the highest operating voltage can reach 46V; large output current, instantaneous peak current can reach 3A, continuous working current is 2A; contains two H-bridge high voltage and high current full bridge drivers. Use two L298N to control two stepper motors respectively. The rated current of the stepper motor is 1.3A. When two phases are connected at the same time, the current is 2.6A. L298N can meet the current requirements of 42HS4813A4 stepper motors.
Figure 3 L298N module circuit schematic
2.2 Absolute encoder
The accuracy of the absolute encoder must be higher than that of the stepper motor, so a 10-bit absolute encoder is used here. The model selected is Mini1024J, which has an accuracy of 10 bits. The advantage is that it uses non-contact Hall detection technology, and the sensor operation is not affected by dust or other debris, which overcomes the shortcomings of optical detection principles.
3 System Software Design
3.1 Geometric Relationship 1: Algorithm for Moving from Any Point to Any Point
The coordinate diagram is shown in Figure 4, with the following relationship between side length and angle:
Figure 4 Coordinate diagram
3.2 Geometric Relationship 2: Current Position Coordinate Display Algorithm
As shown in Figure 5, the following angle and side length relationships exist:
The control code is as follows:
Figure 5 Coordinate diagram
3.3 Motor position closed-loop control method
The closed-loop control block diagram of the stepper motor is shown in Figure 6. TMS320F28027 uses two timers to control the two motors respectively, and uses an absolute encoder to monitor the position and perform step-out compensation to ensure the correct position and make the curve smooth.
Figure 6 Stepper motor closed-loop control block diagram
The model of the stepper motor is 42HS4813A4. In order to prevent step loss, the minimum interval of each step of the stepper motor is 4ms, and the stepper motor is subdivided into sixteen parts by software, that is, the spacing of each step is 0.45°. The program flow chart of the motor control part is shown in Figure 7.
Figure 7 Flowchart of the program for controlling the motor
The control code is as follows:
3.4 Drawing Algorithm
By using the algorithm of geometric relationship from any point to any point, a series of position coordinates are given to the processor to control the motion trajectory of the object, as shown in Figure 8.
Figure 8 Schematic diagram of drawing a circle and selecting points
Take N points at the same interval and input them into the processor to control the coordinates of the object. When passing the points to TMS320F28027, 200 points are taken on the circle to make the circle smooth enough and eliminate jaggedness. The control code is as follows:
4 System Testing
After the system was completed, two tests were conducted, namely, drawing a circle and moving to a specified point.
The circle drawing test is to compare the actual diameter of the circle drawn with the theoretical diameter after inputting the coordinates of the center of the circle and the radius, and record the time taken to draw the circle. In this test, the coordinates of the center of the circle are (40.0cm, 40.0cm), and the input radius value is 30.0cm. The test results are listed in Table 1.
Table 1 Drawing motion test results
Among them, the test of moving to a designated point takes the origin of the coordinates as the starting point. After inputting the designated coordinates, the theoretical value and actual value of the distance from the origin to the designated point are compared, and the error distance of returning to the origin after the movement is completed is recorded, that is, whether it can accurately return to the origin. In this test, the coordinates of the origin of the movement are (0cm, 0cm), and the target coordinates are (49.0cm, 50.0cm), that is, the distance from the origin is 70.0cm. In the actual test, the movement is to (49.1cm, 49.2cm), that is, 69.5cm from the origin. The test results are listed in Table 2.
Table 2 Movement to a designated point test
It can be seen from the test results that the system has the advantages of high efficiency, stability and accuracy, which meets the experimental expectations.
Previous article:Intelligent brake control system circuit design based on DSP embedded technology
Next article:A design of fingerprint recognition system based on USB and DSP
Recommended ReadingLatest update time:2024-11-22 16:13
- Popular Resources
- Popular amplifiers
- "Cross-chip" quantum entanglement helps build more powerful quantum computing capabilities
- Why is the vehicle operating system (Vehicle OS) becoming more and more important?
- Car Sensors - A detailed explanation of LiDAR
- Simple differences between automotive (ultrasonic, millimeter wave, laser) radars
- Comprehensive knowledge about automobile circuits
- Introduction of domestic automotive-grade bipolar latch Hall chip CHA44X
- Infineon Technologies and Magneti Marelli to Drive Regional Control Unit Innovation with AURIX™ TC4x MCU Family
- Power of E-band millimeter-wave radar
- Hardware design of power supply system for automobile controller
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- USB Type-C® and USB Power Delivery: Designed for extended power range and battery-powered systems
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- STMicroelectronics IO-Link Actuator Board Brings Turnkey Reference Design to Industrial Monitoring and Equipment Manufacturers
- 【GD32E231 DIY Contest】1. USART0
- EEWORLD University - Wildfire FreeRTOS Kernel Implementation and Application Development Practical Guide
- 【ufun learning】02 Concept and preliminary circuit design 1
- 【RT-Thread Reading Notes】Reflections on RT-Thread Chapters 7-8
- DC-DC chip LM2596SX-5.0/NOPB
- STM32 timer interrupt and delay function
- Small car front-end 16W power supply design
- TI's TPS61200 boost chip can only boost voltage but not reduce voltage during actual testing. Please help.
- PCA82C250 CAN controller interface
- What topics do electronic engineers like?