The electric vehicle seesaw problem to be solved in this system design requires that the electric vehicle can reach the center point C of the seesaw within the specified time and maintain balance, and then the electric vehicle reaches the end point B of the seesaw, stops and returns to the starting point A. In addition, if the seesaw is re-weighted, the electric vehicle is required to drive onto the seesaw within the specified range and achieve balance within the specified time. If another heavy object is added, the seesaw will regain balance.
1 System Design
1.1 Overall Design
This system uses a single-chip microcomputer as the main module of the control system to realize system control and signal detection. The overall block diagram of the system is shown in Figure 1. It mainly includes a single-chip microcomputer module, a motor drive module, a stepping motor, a balance detection module, a photoelectric detection module, a liquid crystal display module, and an infrared remote control module.
The system uses balance detection to determine whether the electric vehicle is in a balanced state, so that the electric vehicle stays near point C, uses the photoelectric detection module to make the electric vehicle drive to point B and stop, and uses the black line search method to make the electric vehicle move forward in a straight line and retreat from the end point B to the starting point A in a straight line. The infrared remote control starts the system, and the LCD displays the time and temperature time of each stage. Under the condition of counterweight, the black line detection method is used to make the electric vehicle smoothly drive onto the seesaw at any specified position in the specified area. This scheme uses the balance detection module to achieve system balance, and uses the black line search to adjust the body and the seesaw in the same direction. The overall design fully meets the requirements of the topic and is highly feasible.
1.2 Hardware selection
Through comparison and combining its own advantages, the AT89S52 microcontroller is finally selected as the core part of this system. This microcontroller is fully compatible with the MCS51 series and is easy to develop and debug. It has a FLASH memory on the chip and can download programs online. The various resources on the chip can fully meet the requirements of this system.
In this scheme, an ordinary reflective infrared photoelectric switch is selected to detect the black line on the seesaw. When the black line is not detected, the probe output always remains at a low level. When a black line is detected, the output immediately jumps from low level to high level. The signal sent by the infrared photoelectric switch is amplified and shaped and then sent to the microcontroller for analysis and processing, as shown in Figure 2.
In order to ensure that the car can strictly move forward and backward along the black line on the seesaw, this scheme adopts a total of 8 probes in the front and 2 probes in the back. The 8 probes in the front can keep the car completely inside the board when moving forward, and the high-precision steering makes the car strictly controlled within 4 cm from the edge of the board when moving forward; considering that the requirements for the car to move backward are relatively simple, after experiments and tests, the 2 probes in the back are sufficient to keep the car inside the board.
1.3 Software Design
1.3.1 Balance Detection Module Scheme Design
Scheme 1: Use an angle sensor to directly measure the change in the system angle. When the angle change does not exceed the specified range, it is considered to be balanced. The angle measurement is accurate, sensitive, real-time, and simple in structure.
Scheme 2: Place a small water tank filled with an appropriate amount of water on the car. When going uphill, the water body tilts. When reaching a balanced state, the water body is almost horizontal. Use a liquid level sensor to detect the liquid level to achieve system balance. This scheme is feasible, but it will increase the load of the electric vehicle. The sensitivity is not very high, and the liquid does not oscillate.
Comparing the two schemes, Scheme 1 has obvious advantages, so Scheme 1 is selected. [page]
1.3.2 Design of the drive motor scheme
Scheme 1: DC motor, that is, using H-type PWM drive circuit to drive the DC motor, changing the polarity of the motor voltage to achieve forward and reverse rotation, and PWM duty cycle to control the speed. Since it is difficult to achieve high voltage accuracy, its speed cannot reach the accuracy of this system.
Scheme 2: Stepper motor, control its steps according to the number of received pulses, and directly control the movement of the stepper motor according to the given step sequence and number of steps, which can improve accuracy and is suitable for balance state and position detection.
Compare the two schemes and choose Scheme 2.
1.3.3 Design of black line detection scheme
Scheme 1: A transmitter-receiver circuit composed of a visible light emitting diode and a photosensitive diode. The disadvantage of this scheme is that it is easily interfered by the external light source, which is easy to cause misjudgment and has low accuracy.
Scheme 2: Pulse modulated reflective infrared transmitter-receiver. The AC component modulation signal is used to reduce interference, but the duty cycle needs to be controlled and a large current is required, which is not advisable in this system.
Scheme 3: Unmodulated reflective infrared transmitter-receiver. It is less interfered by the outside world and has high sensitivity.
Comparing the three schemes, Scheme 3 has high accuracy and is significantly better than the other two schemes, so Scheme 3 is selected.
1.3.4 Design of position detection scheme
Scheme 1: From the beginning to the end, a constantan wire is placed horizontally on one side of the wooden board, and the voltage value is sampled to detect whether it has traveled to the end B of the seesaw. This scheme requires connection with the car and requires a certain conversion time.
Scheme 2: Based on the working principle of the mouse, a photoelectric encoder is used to measure whether the travel distance is close to the length of the board, or the length of the board is converted into the number of count pulses received to detect whether the electric vehicle has traveled to the end.
Comparing the two solutions, Solution 2 is simple and feasible, and has better measurement results, so Solution 2 is selected.
1.3.5 Program Design
The program needs to complete the following functions:
(1) Set different driving speeds at different stages. Different speeds must be required when the car is seeking balance on the uphill and in the middle, so as to balance the seesaw within the specified time. Use software detection and adjustment to make the car have different speeds at different stages.
(2) Integrate multiple sensors to improve measurement accuracy and ensure that the car is in a relatively stable state on the seesaw.
(3) Use software filters to eliminate the problem of unstable voltage output caused by the shaking of the car when it is moving.
The program flow is shown in Figure 3.
2 Test and error analysis
2.1 Test method
Test tools: two stopwatches (minimum accuracy is 0.1 s), tape measure (minimum accuracy is 0.01 m), digital multimeter (MASTECH MY-65).
Place the car on the A end of the seesaw, as shown in Figure 4, turn on the power, record the following time periods and observe the balance indication (hereinafter referred to as test condition 1); place the car and the counterweight at any position within the specified range, and repeat the above work (hereinafter referred to as test condition 2). Where T1 represents the time for the car to move from point A to the midpoint C; T2 represents the time for the car to find balance; T3 represents the time for the car to maintain balance; T4 represents the time for the car to move from the balance point to the end B of the seesaw; T5 represents the time for the car to stay at point B (test condition 1), and represents the time for the second counterweight to maintain balance (test
condition 2); T6 represents the time for the car to return from point B to point A; T7 represents the total travel time of the car.
2.2 Error analysis
(1) The position of the seesaw may not be level, which may cause deviation in the measured angle. Other level testers can be used to detect whether the position is level.
(2) Since the electric vehicle movement generates a certain oscillation, the measured angle has a certain deviation. The electric vehicle seat plate can be firmly welded to the vehicle body or the angle sensor can be installed on the seesaw.
(3) The seesaw surface is not rough enough, and the friction is not strong enough, which will cause the electric car to slide to a certain extent. Stick a piece of paper with a relatively large friction coefficient on the board to increase the friction.
3 Conclusion
This paper uses an angle sensor to directly measure the change of the system angle to complete the balance detection of the car. The stepper motor controlled by PWM technology is used as the main drive motor, so that the car can achieve stable and accurate balance and pass through the seesaw. After multiple test experiments, the system has met the design requirements and can complete the task well.
Previous article:Simple MCS-51 single-chip computer program instructions, addressing mode and result analysis
Next article:Summary of the precise timing programming method for C51 single-chip microcomputer timing interrupt
Recommended ReadingLatest update time:2024-11-17 07:52
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
- MicroPython driver porting for LIS2DW12 motion sensor
- The 3.3V square wave signal output by the microcontroller can be measured by the multimeter as 1.5V voltage
- Microcomputer Principles and Interface Design
- What is the relationship between the machine cycle and clock cycle of RH850?
- The highest increase is 30%, 10 IC manufacturers including ST, MediaTek, and ON Semiconductor have increased prices!
- [HC32F460 Development Board Review] 07. Hardware I2C to implement EEPROM read and write operations
- Xunwei i.MX6ULL terminator process basic exec function family
- LLAKG: Arduino automatic watering system (Episode 1: System concept and function introduction)
- Hiring embedded software engineer
- Accelerating the design of electric masks