Lemontree

2021-Title I--Energy storage car with power generation function-Liu Tie Ox Horse Team

 
Overview
### Project Introduction This article designs an energy storage car with power generation function based on the proposition requirements of Question I of the 2021 National Electronic Design Competition. - - - ### Project function introduction This energy storage car uses STC8A8K32S4A12 as the main control chip, and the JGB37-520 drive motor as the driving structure of the car. The single-chip microcomputer main control is used to control the TB6612 and drive the car. The drive motor is equipped with a Hall sensor code disk, which can transmit parameters such as the traveling distance in real time. After the parameters are transmitted back and processed, they are displayed in real time by the OLED module. An SN04-N type metal induction proximity switch is installed on the front part of the car to detect metal coins. The entire vehicle can meet the requirements of one-button start, linear distance greater than 100cm, driving in circles and detecting metal. The test results show that the car system is stable, displays accurately, and responds sensitively, meeting the basic requirements set by the competition questions. - - -




















### Circuit explanation# 1 Scheme design and demonstration ## 1.1 Overall scheme description The energy storage car is mainly composed of six parts: microcontroller control module, motor drive module, display, power supply section, photoelectric sensor, and metal induction proximity switch. . The overall framework diagram of the system is shown in Figure 1: ![Picture 1.png] Figure 1 Example of the car control frame. The specific working process is: manually pushing the car to move quickly in the charging area. During the movement, the high reduction ratio DC motor quickly rotates to Farad capacitors are charged in parallel. After charging is completed, the farad capacitors are converted between series and parallel connections through the switch. The farad capacitors switched to series have a higher voltage value and can supply power to the entire system. After the microcontroller is powered on, it runs the program. The program is executed with a delay of 1 second. The drive module drives the traveling motor to drive the car, making the car run as a whole. The control part receives the Hall sensor to process and convert the number of pulses at the external interrupt port of the microcontroller to obtain the actual distance. value, the display module displays the distance traveled by the car in real time. The microcontroller returns the signal through the tracking sensor, calculates the offset of the car line, and then adjusts the PWM pulse wave duty cycle of the drive motor to achieve steering. This adjusts the direction of the car's travel, and then controls the overall movement of the car. sports. ## 1.2 Selection of tracking sensors Option 1: Use a camera to identify tracking, which has a long effective detection distance, high sensitivity and strong anti-interference ability. However, it is large in size, complex in programming, extremely high in power consumption, and low in cost performance. Option 2: Using a photoelectric sensor, you can use the detection surfaces of different colors to reflect light to different degrees. The different amounts of infrared light returned by the receiving tube to different detection surfaces will change its on and off, resulting in a change in the output voltage. After the voltage is amplified, the color depth is detected based on the principle of changing the level through the pull-up and pull-down circuits. Its advantages are small size, low cost, and easy signal processing. But its effective detection distance is relatively short. Option 3: Use a color sensor, based on the TCS34725 chip, which is an integrated sensor composed of an MCU and its auxiliary circuits. However, its anti-interference ability is relatively poor and requires continuous strong light irradiation for auxiliary identification. Compared with photoelectric sensors, its accuracy is not high. Since the photoelectric sensor needs to be installed on the car, the camera module is relatively bulky, and the accuracy of the color sensor is not high, so option 2 was chosen. ## 1.3 Driving motor selection plan 1: Use a DC motor with a starting voltage of 6V/12V, good speed regulation performance, relatively simple control, small size, strong overload capability, low energy consumption, superior performance, and high efficiency. It has the characteristics of small vibration, good heat dissipation effect, high power density and large selection space. Option 2: Use a stepper motor. The stepper motor adopts pulse drive, which has high controllability, easy adjustment, high conversion accuracy of quick start and stop capabilities, and flexible forward and reverse control; but it is large in size, heavy in weight, and slow in speed. It has shortcomings such as slow speed and high power consumption. At the same time, the driving capacity is limited and it is not suitable for driving small cars. After testing, due to the limited driving capability of the stepper motor, a 12V JGB37-520 was selected to drive the DC reduction motor. ## 1.4 Drive module selection plan 1: Use the L298N drive module. The L298N can directly control the motor. By setting its control level through the I/O input of the main control chip, the motor can rotate forward and reverse. It is a rotary drive with simple operation and good stability, and can meet the high current driving conditions of DC motors. Option 2: Using TB6612 driver module, high current MOSFET-H bridge structure, dual-channel circuit output, can drive 2 motors at the same time. Compared with the L298N's heat dissipation and peripheral diode freewheeling circuit, it does not require an external heat sink and has a simple peripheral circuit. It only needs an external power supply to directly drive the motor, which helps reduce the system size. To sum up, the L298N driver module does not meet the low power consumption requirements of the car. It is more appropriate to use the TB6612 driver chip and adopt option 2. ## 1.5 Main controller selection plan 1: Use STC12C5A60S2, which has the characteristics of fast upload/download speed, low price, super anti-interference, and simple programming, but has fewer functions, high relative power consumption, and high starting voltage. . Option 2: Use the STM32H750 series, which has a powerful and efficient instruction system, high performance and low power consumption. The integration level is high, the programming is relatively complicated, and the operation is complex. Option 3: Use STC8A8K32S4A12, which has a wide operating voltage tolerance and can still work normally at 2V low voltage. It has small errors, more ports, fast running speed, many built-in functional peripherals and an integrated crystal oscillator. No external crystal oscillator and reset circuit are needed. Since the STC12C5A60S2 microcontroller has a high operating voltage and cannot control the bottom layer, and the main controller of the STM32H750 series is more expensive, the STC8A8K32S4A12 chip is used. ## 1.6 Display selection plan Option 1: Use LED digital tube, which is simple to program, has high display brightness, is cheap, is easy to use, is durable, pollution-free, and has a long life. Option 2: Use LCD, which has high display quality, no electromagnetic radiation, large viewing area, wide application range, good picture effect, and digital interface. However, it is large in size and requires continuous backlighting, and has high power consumption. Option 3: Use OLED, which is smaller in size and has relatively lower power consumption. It is flexible and bendable, has a flexible panel, and has self-luminous technology. It has no ultraviolet rays, no backlight, and no heat dissipation. In order to save electricity, we decided to adopt option 3, using a 0.96-inch 7-pin OLED display. ## 1.7 Selection of metal detection sensors Option 1: Use coils for electromagnetic induction detection. The coils can have a larger induction detection area and higher sensitivity. The question requirements can be completed using one coil. However, its power consumption is huge, and the system power cannot support its normal operation. Option 2: Use the SN04-N metal proximity switch. The metal proximity switch has lower power consumption for the coil, has a wide working voltage tolerance, and can operate normally at 2.7V. However, the detection area is relatively small, and multiple detectors are needed to complete the task requirements. After comprehensive consideration and attempts, we adopted Solution 2 with lower power consumption, using three SN04-N metal proximity switches for metal detection. # 2 Theoretical Analysis and Calculation ## 2.1 Methods to Improve System Efficiency ### 2.1.1 Motor Cooperative Drive In the manual power generation area, the car uses the magnetic field of the rotor to cut the permanent magnet when the DC motor rotates to generate electromotive force. When a loop is formed, a current is generated to charge the supercapacitor. According to the law of conservation of energy, the capacitance of the farad capacitor voltage can theoretically meet the proposition requirements, but friction, 1s delay in starting and sensor losses are large, making the car's driving distance less than 100cm. The smaller the reduction ratio, the smaller the output torque and the faster the output speed. In order to improve efficiency, charging wheels and discharge wheels can be distinguished by using the difference in speed ratio. Two pairs of DC motors are used. Taking advantage of the difference in speed ratio, one pair of motors is used to store electricity and the other pair is driven to reduce power consumption. In theory, The car can travel longer. After many experiments and tests, it was calculated that using a pair of motors with a speed ratio of 80:1 to store electricity and another pair of motors with a speed ratio of 10:1 to drive would be better, allowing the energy storage car to meet the requirements of the question. ### 2.1.2 Multiple capacitors improve charging efficiency. Supercapacitors can increase capacitance when connected in parallel and reduced in series. They can compensate for the reactive power of inductive loads in the power system to increase power factor, improve voltage quality, and reduce line losses. Series-connected supercapacitors can improve the system voltage from the perspective of compensating (reducing) reactance to reduce power loss and improve the stability of the car system. As far as this question is concerned, capacitive characteristics can be used to improve charging efficiency. | | | | | | --- | --- | --- | --- | | Supercapacitor (F) | Voltage (V) | Time (S) | Distance (M) | | 2F | 2.6~4.5 | 8~17 | 0.5~1 | | 2F+2F | 4.9~6.2 | 140~155 | 1.5~3.8 | | 2F+2F+2F | 6.5~7.4 | 100~113 | 1.5~3.4 | Table 1 Different capacitance Manual charging voltage After many tests (Table 1), a single supercapacitor cannot easily maintain a 3V voltage, so two 2F supercapacitors are most suitable. The switch is used to control capacitors to be charged in parallel and discharged in series. Because the capacitors are connected in series with "high withstand voltage and low capacity", it not only ensures that the capacitor will not be easily broken down, but also allows the capacitor to reach the working voltage of most modules when used as a power supply. When capacitors are connected in parallel, they have "high capacity and low withstand voltage", and the capacitor voltage can maintain the normal operation of each module for a longer period of time. # 3 Circuit and Programming ## 3.1 Power generation circuit design The DC motor generates electromotive force and generates current for collection and storage by the farad capacitor. In order to save power and improve charging efficiency and prevent the current from flowing back to the charging motor and causing useless power consumption, a diode is added between the DC motor and the supercapacitor by taking advantage of the one-way conduction characteristics of the diode; two 5.5V 2F capacitors are selected and two 5.5V 2F capacitors are used. The hexagonal switch realizes parallel charging and series discharge. The specific power generation circuit is shown in Figure 2: ![Charging circuit.png] Figure 2 Power generation circuit design ## 3.2 The drive circuit design uses STC8A8K microcontroller with an operating voltage of 2.0V~5.5V to avoid the energy storage car from being driven while driving. The voltage drops and cannot reach the working voltage of the microcontroller, causing the car to lose control. At this time, the drive circuit diagram is shown in Figure 3: ![TB6612.png] Figure 3 Drive circuit design ## 3.3 Software design (software design) Keil uVision5 is a professional and practical C language software development system that provides compilers, , installation package and debugging tracking, its main program flow is shown in Figure 4. The software program design adopts a modular structure to facilitate analysis and function implementation, and its program is continuously modified through test results. ![Picture 2.png] Figure 4 Main program flow chart ## 3.4 System low-power design This question can only use supercapacitors as energy storage components, because each module needs to withstand a high working voltage, and the starting voltage cannot be too high , otherwise it cannot be used normally. Therefore, the lowest operating voltage and low power consumption are the main goals when selecting modules. In order to save energy and try to avoid high-power components, we chose the STC8A8K microcontroller with an operating voltage of 2.0V~5.5V. Compared with the 12864 0.96-inch OLED module that is small in size and has low power consumption, the tracking accuracy is higher. Photoelectric sensors include the SN04-N metal proximity switch, which is smaller in size and consumes less power, and the TB6612 driver chip, which consumes less power than the L298N. The grayscale sensor has 8 channels of detection. In order to pursue lower power consumption, the middle 4 channels of components are removed, lowering the voltage and reducing the load. After many attempts, the metal detection sensor uses three SN04-N type proximity switches. The asymmetric placement can further save power while completing the question. # 4 System Test ## 4.1 Basic part test plan Test instruments: digital multimeter, digital oscilloscope, tape measure Test method: After completing charging in the manual power generation area, use a digital multimeter to measure the farad capacitor voltage and record it, start with one button, and test with a digital oscilloscope Check whether the microcontroller is working normally. After discharge, use a tape measure to measure the straight-line distance L from the starting point to the end point of the energy storage car, and check whether the distance displayed by the OLED module is consistent. After the production was completed, we conducted multiple tests. The test results are as follows in Table 2: | | | | | | | | | | --- | --- | --- | --- | --- | -- - | --- | --- | | Times | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | Voltage (v) | 5.2 | 5.7 | 6.5 | 5.8 | 6 | 5.9 | 6.2 | | Distance ( m) | 3.1 | 4.8 | 5.4 | 3.6 | 5.1 | 5 | 5.3 | Table 2 Basic part test results Test result analysis: The manual charging voltage tends to a stable range, and the straight-line distance from the starting point to the end point of the car is greater than 100cm, which can basically determine that the proposition has been achieved basic requirements. ## 4.2 Use part of the test plan Test equipment: digital multimeter, digital oscilloscope Test method: After completing charging in the manual power generation area, use a digital multimeter to measure the farad capacitor voltage and record it. After placing it at the starting point of the tracking area, start it with one click and use the digital oscilloscope Test whether the microcontroller is working normally, observe whether the grayscale sensor is working normally, and record the driving distance S displayed by the OLED module. After the production was completed, we conducted multiple tests. The test results are as follows in Table 3: | | | | | | | | | | --- | --- | --- | --- | --- | -- - | --- | --- | | Times | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | Voltage (v)


6.2 | 5.9 | 5.6 | 5.5 | 6.3 | 5.3 | 5.9 | It is limited and cannot supply a stable voltage to each module. It discharges quickly and the driving distance is unstable. It is easy for the sensor to stop working before the motor. At this time, the car cannot realize the tracking function. The duty cycle control principle can be used to reduce the duty cycle to slow down the motor, making it impossible for the car to drive the motor for a longer distance when it cannot reach the working voltage of the sensor. However, the duty cycle needs to be gradually reduced to prevent the motor from being blocked due to a too large duty cycle. ## 4.3 Other functions While realizing all functions, to prevent the car from being damaged during the test, an ultrasonic module is also installed on the front of the car. At the same time, the power consumption of the ultrasonic module and the impact on the overall frame are considered, so HC is selected. -SR04 ultrasonic module. In order not to hinder the test of the straight-line driving part of the basic part, the ultrasonic wave will only be started and used after the vehicle travel distance exceeds 120CM. The ultrasonic wave is continuously transmitted and received and transmitted back to the microcontroller for processing. After converting the distance value, it is judged whether it is less than 50CM. The car Obstacle avoidance will only be triggered when the distance is less than 50CM, thus making obstacle avoidance actions possible. # 5 Conclusion This system uses the STC8A8K32S4A12 microcontroller chip as the core component, connects to the TB6612 drive module, and uses a pair of motors to make the car perform straight-line travel, tracking, metal detection, ultrasonic obstacle avoidance and other actions. Our trolley can meet the requirements of the basic part and the performance part, and runs smoothly, without slipping, and at a uniform speed. In the past few days, we encountered many problems, which were generally solved through the efforts of the group members and the help of teachers and classmates. The design competition over the past few days has enhanced practical ability and collaboration spirit, and made me understand the importance of connecting with reality. There are still some flaws in our design that need to be further improved in future designs. We sincerely ask for your criticism and correction. - - - ``` C ``` - - - ![Cover.jpg]


参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-27 01:17:31

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号