With the development of modern science and technology, automatic control based on embedded systems has been widely used in industry. At present, the mechanical complexity of industrial production is getting higher and higher. Automatic control under static conditions alone can no longer meet people's requirements for measurement and control systems. Therefore, it is very necessary to study how to implement precise measurement and control of the system under dynamic conditions. This paper introduces a flat plate precision control and laser tracking system based on a free pendulum. In modern industry, this system can adapt to industrial development and be used in automated production with high complexity. During the production process, measurement and control can be completed simultaneously to improve the degree of automation of production.
1 System Structure
1.1 Overall System Structure
The overall structure of the system is shown in Figure 1. It is mainly composed of a control module, an acquisition module, a stepper motor drive module, a stepper motor, a free pendulum flat plate and a laser pen, and a debugging module. Among them, the acquisition module uses a WDD35D-4 precision potentiometer. When the free pendulum swings, the resistance of the potentiometer changes, thereby reflecting the position information of the pendulum. The control module uses the low-power single-chip MSP430F5438 as the processor. The MSP430F5438 has a built-in A/D module that can collect analog signals fed back by precision potentiometers. The stepper motor driver uses Toshiba's TB6560 chip, which is a low-power, highly integrated two-phase hybrid driver chip that drives the stepper motor to control the position of the free swing plate and laser pen. The debugging module is used for control module program download and system debugging, and is not used during normal operation.
1.2 Free pendulum mechanical structure
The free pendulum machine is mainly composed of a fixed bracket, a rotating shaft, a pendulum rod, a motor, a flat plate, and a laser pen, as shown in Figure 2(a). A precision potentiometer is connected to the free pendulum rotating shaft as a pendulum rod angle sensor, the motor is fixed at the bottom of the pendulum rod, and the flat plate is fixed on the rotating shaft of the motor. The schematic diagram of the free pendulum swing is shown in Figure 2(b). Eight one-yuan coins are placed on the flat plate. During the swing of the pendulum rod, the motor and the flat plate will also rotate with the pendulum rod. The rotation of the motor is controlled by the single-chip microcomputer to stabilize the coins on the flat plate. At the same time, a laser pen is fixed in a direction parallel to the flat plate below the flat plate. Through system control, the function of the laser pen tracking the preset target during the swing of the pendulum rod can be realized.
2 Theoretical analysis
2.1 Theory of precise control of free pendulum
Stably place 8 1-yuan coins (RMB) at the center of the plate, lift the pendulum so that the pendulum forms a certain angle θ (45°≤θ≤60°) with the bracket, and release the pendulum to let it swing freely. The precise control of the free pendulum must achieve the following goals: During the swing of the pendulum, the state
of the plate must be controlled so that the coins will not slide off the plate in 5 swing cycles, and the coins will slide away from the center of the plate as little as possible. To achieve the above goals, the motor must control the angle of the plate according to relevant parameters to ensure the force balance of the coins during the swing of the pendulum. Analyzing the swing process of the free pendulum, precise control mainly ensures that the coin remains relatively stable from the initial position of the pendulum to the perpendicularity between the plate and the pendulum (in this state, the coin can be balanced without active control). [page]
2.2 Laser Tracking Theory
The laser tracking diagram is shown in Figure 3. A target is placed vertically at a distance of 1.50 m from the free pendulum. When the pendulum is vertically stationary and the plate is horizontal, the target height is adjusted so that the laser pen spot is illuminated at the center of the target. Push the pendulum by hand, and the angle between the bracket and the pendulum is θ (θ is 30°~60°). Release the pendulum, and the system should control the plate to make the laser pen shine on the center line as much as possible within 15 s (the absolute value of the deviation is <1 cm), which is the goal of the laser tracking theory. In Figure 3, b is the line segment from the center of the plate (the laser pen fixed point) to the center of the target when the free pendulum is stationary; a is the line segment from the intersection of the angle bisector of θ and the line segment b to the laser pen fixed point; c is the line segment from the laser pen fixed point to the center of the target; γ is the angle between the line segments a and c.
In Figure 3, the angle θ between the pendulum and the bracket can be measured by the precision potentiometer on the shaft, and the converted analog voltage value is output to the single-chip microcomputer. The single-chip microcomputer converts the analog voltage value into a digital value through the built-in A/D converter and calculates the corresponding angle θ. In order for the system to realize the laser tracking function, the laser emitted by the laser pen must always hit the center of the target. Since the laser pen is fixed under the plate and parallel to the direction of the plate, we control γ to achieve the tracking function during the swing of the pendulum. Combined with geometric operations, the relationship between θ and γ is analyzed:
a=tanθ/2
b=1.5-a
c2=a2+b2-2ab cosθ
sinθ/c=sinγ/b
Angle γ is the inclination angle of the plate. Since the plate is fixed on the stepper motor shaft, the angle γ is also the angle of rotation of the stepper motor. Through the above analysis, it can be known that the realization of the system laser tracking function must satisfy the relationship between θ and γ that sin θ/c=sin γ/b. During the operation of the entire system, the microcontroller continuously receives the θ value collected by the precision potentiometer, and then performs
analysis and calculation to calculate the rotation angle γ of the stepper motor. Since the MSP430F5438 does not contain a floating-point arithmetic unit, its data processing capability is weak and it will take up a lot of CPU working time. Therefore, in the process of programming, the table lookup method is used to optimize the program. With θ as the known quantity and γ as the unknown quantity, MATLAB is used to solve and obtain the relationship between θ and γ, as shown in Table 1. During the program running process, when the microcontroller reads a θ value, the corresponding γ value can be known by looking up the table.
[page]
3 System Hardware Solution
3.1 Power Module
The power supply circuit of this system is composed of LM2596 and LM1117-3.3. The LM2596 switching voltage regulator is a step-down power management monolithic integrated circuit that can output a drive current of 3 A and has good linear and load regulation characteristics. It uses an internal oscillation frequency of 150 kHz and belongs to the second generation of switching power regulators with low power and high efficiency. LM1117-3.3 is a low voltage drop linear voltage regulator that can output a fixed 3.3 V voltage and an output current of up to 800 mA. The minimum system of the MSP430F5438 microcontroller requires a 3.3V power supply, so LM1117-3.3 is used to power the microcontroller.
3.2 Data Acquisition Module
The data acquisition module of this system uses the WDD35D-4 precision potentiometer, which consists of a resistor and a rotating (or sliding) system. When a voltage is applied between the two fixed contacts of the resistor, the position of the contact on the resistor is changed by rotating (or sliding) the system, and a voltage with a certain relationship with the position of the moving contact can be obtained between the moving contact and the fixed contact. The voltage value at both ends of the precision potentiometer is read by the built-in A/D converter of the MSP430F5438 microcontroller to realize the data acquisition function.
3.3 Control module
The MSP430F5438 microcontroller is selected for system control. During the operation of the system, the microcontroller reads the data collected by the data acquisition module through the built-in A/D converter, and then processes the data. According to the processing results, the stepper motor driver chip TB6560 is controlled, and finally the stepper motor is controlled to rotate as required. The MSP430 series microcontroller is a 16-bit microcontroller that adopts a reduced instruction set (RISC) structure, has a rich addressing mode, a large number of registers and on-chip data storage, can participate in a variety of operations, and has efficient table lookup processing instructions. MSP430F15438 is a product series based on flash memory, with integrated peripherals USB, analog comparator, DMA, hardware multiplier, RTC, USCI, 12-bit DAC, etc.
3.4 Stepper motor drive module
The stepper motor drive module adopts Toshiba's low-power, highly integrated two-phase hybrid stepper motor driver chip TB6560. Its main features are: internal integrated dual-bridge MOSFET drive, maximum withstand voltage of 40 V, and single-phase output maximum current of 3.5 A. The schematic diagram of the stepper motor drive circuit is shown in Figure 4. Pins VMA and VMB are stepper motor drive power pins. The OUT_AP, OUT AM, OUT BP, and OUT_BM pins are respectively connected to the two-phase interface of the stepper motor. When the chip input receives the input signal of the single-chip microcomputer, these four pins will execute the command of the single-chip microcomputer to make the stepper motor rotate accordingly. NFA and NFB are the detection ends of the motor A and B phase circuits, respectively, and the connected resistors are 0.2 Ω. PGNDA, PGNDB, and SGND are ground pins. The I/O port of the microcontroller MSP430F5438 is connected to the CLK, ENABLE, and CW/CWW pins of the TB6560 chip to achieve the control of the stepper motor by the microcontroller.
[page]
4 System software designSince the system has two functions and needs to run in different modes, the program design adopts the design concept of state machine. According to the different states of the encoding switch, different mode controls are entered. The specific design process is shown in Figure 5. After the program starts, the state of the encoding switch is scanned. When the system scans that the state of the encoding switch is state 1, the system executes the tablet control command; when the system scans that the state of the encoding switch is state 2, the system executes the laser tracking command.
5 System Test
5.1 Tablet Control Test
According to the design requirements, the stability of the system tablet control function is tested by direct counting method. Pull the pendulum to 60°, place 8 coins on the tablet, release the pendulum, and record the number of coins remaining on the tablet after the pendulum swings for 5 cycles. The statistical results are expressed in a histogram, as shown in Figure 6. The horizontal axis represents the average number of coins remaining each time, and the vertical axis represents the number of tests. The test shows that as the number of tests increases, the average number of coins remaining also increases, and the tablet control function tends to be stable.
5.2 Laser tracking test
According to the design requirements, the laser tracking function of the system was tested. The test plan used the method of taking the average value of multiple measurements. As shown in Figure 3, determine the position of the bull's eye on the target paper and turn on the laser pen; start the system, and observe and record the maximum distance between the red spot of the laser pen on the target paper and the bull's eye during the free swing. This maximum distance is the error of this laser tracking system. According to the above method, multiple measurements were made, and the error range and stability of the laser tracking system were obtained after statistics. The specific results are shown in Figure 7, where the horizontal axis represents the error size and the vertical axis represents the number of tests. The calculated error average is 0.13 cm. The test shows that with the increase in the number of tests, the error average gradually decreases, and the laser tracking performance is relatively stable.
Conclusion
This design is based on a free pendulum, with the MSP430F5438 microcontroller as the control core, and a precise control and laser tracking system is designed and implemented. The combination of hardware and software is achieved through MATLAB modeling. After testing, it is verified that the system can achieve precise control and laser tracking functions of a flat plate based on a single pendulum within the allowable error range.
Previous article:Methods for distinguishing ADC0804 analog ground and digital ground and eliminating interference
Next article:Design of railway signal semi-automatic blocking optical cable transmitter based on STC12C
- 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