Design of electric vehicle seesaw based on 51 single chip microcomputer

Publisher:人妙果华Latest update time:2012-07-16 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

This design was made for participating in an electronic design competition. It solves the problem of the operation and control of electric vehicles on a seesaw. The system structure is relatively simple and the control is relatively accurate.

2. System solution design, comparison and demonstration

According to the basic requirements of the topic, the design task is mainly to complete the stable driving of the electric vehicle along the specified path within the specified time, and to have the function of maintaining balance, and at the same time process and display the relevant data during the trip. In order to complete the corresponding functions, the system can be divided into the following basic modules: motor drive module, tracking line detection module, balance state detection module, information display module. See Figure 1

Figure 1 System block diagram

2.1 Tracking line detection module

The principle of detecting black tracking lines on the road surface: light is irradiated to the road surface and reflected. Due to the different reflection coefficients of black lines and white paper, the sensor can generate high and low levels according to the intensity of the received reflected light, and finally judge whether it reaches the black line or deviates from the runway through the single-chip microcomputer.

Solution 1: The transmitting-receiving circuit composed of a visible light emitting diode and a photosensitive diode, as shown in Figure 2. This solution is low in cost and easy to make, but its disadvantage is that the ambient light source will greatly interfere with the work of the photosensitive diode. Once the external light conditions change, it is likely to cause misjudgment and missed judgment; if ultra-bright light-emitting tubes and high-sensitivity photosensitive tubes are used, certain interference can be reduced, but additional power loss will be increased.

Figure 2 Circuit of Solution 1

Solution 2: Homemade infrared probe circuit. This method is simple, cheap, and has adjustable sensitivity, but it is easily affected by the surrounding environment, especially the influence of strong light on the detection signal, which will cause system instability. In addition, time is limited, and it is cumbersome to make discrete circuits.

Solution 3: Integrated infrared probe. An integrated intermittent photoelectric switch detector can be used. It has the advantages of high integration and reliable working performance. The sensitivity of the probe can be controlled by adjusting a knob on the probe. This type of probe can also effectively prevent interference from ordinary light sources (such as fluorescent lamps, etc.). The infrared detector E3F-DS30C4 is shown in Figure 3.

Figure 3 Integrated infrared detection head

Based on the above considerations, in order to improve the accuracy of system signal acquisition and detection, we adopt scheme three.

2.2 Balance state detection module

Scheme 1: intermittent photoelectric switch. Place one on the ground at both ends of the seesaw, adjust the sensitivity so that it does not receive reflected light within a certain range to produce a low level, so that it is considered to have reached a balanced state, and the microcontroller controls the movement state of the car to make the seesaw reach dynamic balance. However, the balance control of this scheme is not sensitive and difficult to adjust. It is also necessary to use wires to transmit signals to the microcontroller, so that the car loses its independence.

Scheme 2: Use an angle sensor. This integrated chip is a dedicated horizontal inclination measurement chip with the advantages of small size, high sensitivity, simplicity, and reliability. It can highly meet the precise requirements of the balance angle of this question.

After comparing the above two schemes, Scheme 2 is obviously better than Scheme 1, so Scheme 2 is adopted. [page]

2.3 Selection of motor and its drive module

According to the time requirement of the car's full journey in the question, it can be seen that the car's driving speed is very slow. It is difficult for ordinary motors to meet this speed requirement, while DC reduction motors can meet this requirement and have a large torque, and will not be blocked on the inclined surface. Therefore, we use DC reduction motors.

There are two options for selecting drive modules: one is to use a dedicated drive chip. This chip has high integration and occupies a small space. It is mainly used in motor speed regulation, but the price is relatively high. The second is to use a crystal triode drive circuit. Since the functions required by electric vehicles are relatively simple, it can be driven by a crystal triode, so we finally decided to use the second option.

2.4 Information display module

If LED is used, the disadvantage is that it occupies too many microcontroller interfaces, displays less information, requires cyclic display, and occupies too many program resources. LCD only occupies 6 I/O lines of the microcontroller, displays a large amount of information at the same time, and flexibly displays multiple information. Therefore, we intend to use the latter.

2.5 Power supply selection

Option 1: All devices use a single power supply (5 No. 5 batteries). This power supply is relatively simple, but due to the large current when the motor starts, it will cause voltage instability, glitches and other interference. In severe cases, it may cause the microcontroller system to lose power, making it unable to complete the scheduled trip.

Option 2: Dual power supply. The motor drive power supply uses 5 No. 5 batteries (large-capacity 2.3Ah batteries), and the microcontroller and its peripheral circuit power supply uses another set of 3 No. 5 batteries (large-capacity 2.3Ah batteries). The two power supplies are completely separated. Although this is not as convenient and flexible as a single power supply, it can completely eliminate the interference caused by the motor drive and improve the system stability.
We believe that the stability and reliability of this design are more important, so we plan to adopt Option 2.

After careful demonstration and comparison, the block diagram of the electric vehicle seesaw system we finally determined is shown in Figure 4.

Figure 4 Block diagram of electric vehicle seesaw system

3. System discrete module design and working principle

3.1 Tracking line detection circuit

The model is E3F-DS30C4 integrated intermittent photoelectric switch detector. The output end of the probe has only three wires (power line, ground line, signal line). Just connect the signal line to the I/O port of the microcontroller, and then scan and detect the I/O port continuously. When it is high level, white paper is detected, and when it is low level, the black line area is detected. When the car moves forward (backward), the black line is always kept between the two sensors at the front (rear) of the car. When the car deviates from the black line, once the detector detects the black line, the microcontroller will send instructions to the control system of the car according to the pre-programmed program, and the control system will correct the path of the car. When the car returns to the track, the two detectors at the front (rear) of the car only detect white paper, then the car continues to move in a straight line, otherwise the car will continue to adjust the direction until the car returns to normal.

3.2 Balance state detection circuit

Figure 5 Voltage division comparison balance detection circuit

In the balance detection circuit, we use a high-precision angle sensor, which measures its own deviation from the horizontal angle and outputs a voltage value within a certain range. According to the requirements of the question, we analyzed that the car is considered to be in a balanced state when the swing amplitude of the seesaw is plus or minus 4 degrees. The sensitivity of this angle sensor is the highest in this range, and its output voltage is between 2.45-2.55 volts. This output voltage is compared and amplified, and then converted into a digital quantity through an A/D converter and passed into the single-chip microcomputer. However, since the entire range of variation is only 0.1 degrees, any slight interference will cause serious deviations in the measurement results. Using A/D conversion will reduce the accuracy and cause too much interference. Because it is difficult to achieve true static balance in reality, we finally decided to use a dynamic way to find balance. Therefore, we use a voltage divider circuit and a voltage comparator to make a signal circuit. According to the changes in the signal end, the car is controlled to keep the voltage output of the angle sensor between 2.45-2.55 volts. After multiple tests and careful debugging, the circuit can meet the requirements well. The balance detection circuit is shown in Figure 5.

3.3 Motor drive circuit

The motor drive circuit is shown in Figure 6. J1 in the drive circuit is connected to the motor, and MOT1 and MOT2 are connected to high and low levels to control the forward and reverse rotation of the motor, thereby controlling the forward and backward rotation of the motor and the left and right steering.


Figure 6 Motor drive circuit

4. Software design

The software structure is shown in Figure 7. (See the appendix for detailed software flow chart)[page]

Figure 7 Software structure

When powered on, the system is reset, and then the system determines the working mode. When working mode 1 or working mode 2 is selected, the system waits for 5 seconds and then enters the automatic timing operation state.

Mode 1 is the electric vehicle operation and direction adjustment program, which makes the electric vehicle run along the predetermined route, and automatically adjusts the direction after the car deviates from the track so that the car automatically returns to the predetermined route, and controls the LCD to display the running time in real time. Mode 2 is the balance detection and balance maintenance program. Under the control of this program, the car automatically finds the balance point and runs forward or reverse near the balance point, and finally reaches dynamic balance.

5. System test

5.1 Test instrument

Homemade seesaw: 1600mm long and 300mm wide, the distance between the bottom of the seesaw and the ground or table is 70mm. A 50mm wide black tracing line is drawn in the middle.

Tape measure: accuracy 1mm.

Stopwatch: accuracy 0.01s, two pieces.

5.2 Test results and analysis

5.2.1 When the seesaw is in a horizontal state, the time for a round trip is measured. The test data is shown in Table 1:

Table 1 Seesaw horizontal state detection data

Analysis: The actual measured time is different from the displayed time, which may be due to the human reaction time error.

5.2.2 Measure the time of a round trip of the seesaw in a free state. The test data is shown in Table 2:

Table 2 Seesaw round trip time test

The analysis is the same as above.

5.2.3 Seesaw balance test (weight 200g) The test results are shown in Table 3:

Table 3 Seesaw balance test

Analysis: From the above data, it can be seen that as the distance between the counterweight and end A increases, the total time required for the system to enter the equilibrium state gradually decreases, while the maximum amplitude in the equilibrium state remains basically unchanged. This is because the counterweight moves closer to the center, the torque on the fulcrum continues to decrease, and the inertia also decreases, causing the total time required for the equilibrium state to gradually decrease.

5.2.4 Wire pressing positioning test. The test data is as follows:

Table 4 Seesaw wire pressing positioning test

Analysis: In most cases, the car stops when the two front probes in the forward direction are all pressed on the positioning line. In rare cases (when the tracking line on the seesaw is curved), the car stops before the front probe touches the positioning line or even just starts running. Observe the phenomenon and analyze the cause. When the tracking line is curved, the car cannot effectively correct the excessive deviation, which may cause the two front probes to detect the black tracking line at the same time, causing the car to stop.

The test results show that this design successfully meets the requirements of the topic and has good use value.

Reference address:Design of electric vehicle seesaw based on 51 single chip microcomputer

Previous article:Axis Parts Temperature Measurement System Based on 51 Single Chip Machine
Next article:Design of ultrasonic ranging and anti-collision alarm system based on AT89C52

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号