Design of electric vehicle seesaw based on single chip microcomputer AT89S52

Publisher:RainbowGardenLatest update time:2013-03-07 Source: 电子科技 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
    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.

a.JPG


    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.

b.JPG


    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.

c.JPG



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).

d.JPG


    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.

Keywords:MCU Reference address:Design of electric vehicle seesaw based on single chip microcomputer AT89S52

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

MCU ADC sampling algorithm-limited de-jitter filtering method
The limiting and de-jittering filtering method is equivalent to the "limiting filtering method" + "de-jittering filtering method".    Let's look directly at the implementation of the C code #define A 200 #define N 20 // Return the difference between two integers unsigned int num_sub( unsigned int a, unsigned int b
[Microcontroller]
MCU ADC sampling algorithm-limited de-jitter filtering method
Internal structure of avr microcontroller
I have been studying microcontrollers for so long, and I feel that if I want to go deeper, I have to read assembly language, or at least understand the internal structure of the microcontroller. Below, we will take ATmega16 as an example to introduce the AVR microcontroller structure and assembly language. AVR mic
[Microcontroller]
Internal structure of avr microcontroller
Microchip Technology PIC32CZ CA MCUs Now Available at Mouser for Industrial and Automotive Security
May 7, 2024 – Mouser Electronics, an authorized global semiconductor and electronic component distributor focused on introducing new products, is now stocking Microchip Technology's PIC32CZ CA MCU. The PIC32CZ CA is a 32-bit high-performance MCU with multiple connectivity options, making it ideal for industr
[Microcontroller]
Microchip Technology PIC32CZ CA MCUs Now Available at Mouser for Industrial and Automotive Security
Square root program on single chip microcomputer
Due to work needs , I need to implement square root operation on a single chip microcomputer. Currently, most of the methods for square root are Newton's iteration method. After checking some information, I found a method that is faster than Newton's iteration method. I dare not keep it to myself, so I introduce it to
[Microcontroller]
Using event-driven mechanism in single-chip computer programming
1. Insufficient traditional MCU program development In traditional MCU programs, the structure is usually centered on "process" and "operation". The program is executed in sequence according to the specified process. The connection with peripherals is generally interrupted. All peripheral processing work is com
[Microcontroller]
Application of single chip microcomputer fuzzy control in electric rice cooker
At present, most of the rice cookers on the market use fixed power to heat, with low energy utilization and single functions, which makes it difficult to meet people's growing living needs. It is very necessary to develop a microcomputer rice cooker with complete functions, low cost, energy saving, safety and reliabili
[Microcontroller]
Application of single chip microcomputer fuzzy control in electric rice cooker
Comparison and analysis of MCU-based and ASIC-based LED thyristor dimming solutions
As a new and most potential light source, LED lighting is gaining more and more attention for its advantages of energy saving and environmental protection. With the policy encouragement of the national and local governments, China's LED lighting industry has entered an accelerated development stage, and the applicatio
[Microcontroller]
Comparison and analysis of MCU-based and ASIC-based LED thyristor dimming solutions
Microcontroller literacy: the relationship between MCS51 and 8051/8031, etc.
We always talk about 8051, 8031, and now there is 89C51 and 89s51. What is the relationship between them? MCS51 refers to the general name of a series of single- chip microcomputers produced by the American INTEL company (yes, the famous INTEL) . This series of single-chip microcomputers includes many varieties, su
[Power Management]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号