Here is some basic information:
———————————————————————Car parameters——————————————————————————
Obstacle detection method: infrared detection (detection module power consumption 7mA)
Car model geometry dimensions: 149 x 102 x 59 (mm)
Car model wheelbase: 120 (mm)
Obstacle detection accuracy: 75 cm
Power system: 4 x 1.5 v dry batteries/4 x 1.2 v rechargeable batteries and their regulated output
Motor: DC reduction motor, 1~12V working voltage, transmission ratio: 71.2:1
Main control chip: STC89C52MCU
Other chips: LM7806 LM7805 STC11F01, etc.
—————————————————————Group Information——————————————————————————
Panelists:
Wang Taijie: Class 0804211, good at hardware, strong welding technology, sufficient hardware knowledge, responsible for the construction and debugging of the motor drive part in this production.
Sun Xuejun: Class 0904211, is good at programming, has a solid foundation in C language, and has open-minded thinking. In this production, he is responsible for debugging the program driver part.
Li Xianghua: Class 0804211, responsible for the power supply part in this production.
Group advantages:
The hardware and program are coordinated, and each person is responsible for their own module. Only the final module interface is provided, so that teammates do not have to pay attention to the internal structure of the other party's module. They only need to complete the interface connection, which greatly reduces the content that each person is responsible for and improves efficiency.
———————————————————————Production process and time—————————————————————————
April 3, 2010 (Saturday):
The team members selected and optimized the circuits of each module, built and welded the circuits, debugged each module, and determined the module interaction interface; the main control program idea was formed, and the test program was written to test the software and hardware. Finally, the modules interacted, the overall debugging was carried out, the main program was determined, and the details were finalized.
April 4, 2010 (Sunday):
Module interaction, overall debugging, and modification of main control program details; after layout, each hardware module is transferred to the vehicle body, and finally welded to form the whole vehicle. The main control program is downloaded, debugged, and finally successful.
—————————————Technical Data———————————————————
Design ideas:
In order to save the number of motors and the complexity of the circuit, the infrared obstacle avoidance car (hereinafter referred to as the car) adopts the principle of active front wheels and passive rear wheels. The front wheels are driven by dual motors and the body steering is achieved by differential method.
The detection part uses an infrared transmitting tube to emit infrared light. After encountering an obstacle, it is reflected and received by the infrared receiving tube, generating a level conversion. The level output of the infrared detection module is detected by the microcontroller I/O port to determine whether there is an obstacle ahead. After detecting an obstacle, the motor drive circuit is controlled through the microcontroller I/O port, and different voltages are output through the motor drive circuit to generate differential speeds, realize steering, and ultimately achieve the goal of obstacle avoidance.
Power module:
Considering the flexibility of the car, we abandoned the solution of using AC power. During the production and debugging process, we used 4 1.5V No. 5 Nanfu batteries. After the battery box was connected in series, a stable voltage output of 5.9~6.5V was obtained, which directly powered the motor drive circuit. However, considering that the operating voltage of the 51 microcontroller is 4.5V~5.5V, and its requirements for the operating voltage are relatively strict. In this regard, we envisioned using a voltage regulator chip based on the LM7805 voltage regulator chip to output a constant voltage of 5V. See the attached power supply circuit diagram. Since there was only one LM7806 on hand during the production, we connected an IN4007 diode in series at the output end to generate a 0.7V voltage drop, and finally obtained a stable voltage output of 5.2V~5.3V to power the microcontroller. To improve the stability of the system.
When the vehicle was finally formed, we used a 5V voltage regulator diode to stabilize the voltage for two reasons: first, it reduced the power consumption of the power circuit, and second, it reduced the production cost. Considering the unavailability of disposable dry batteries, we used a solution of connecting 4 rechargeable batteries in series through a battery box when forming the vehicle to reduce subsequent production costs. Considering the singleness of the voltage output end, we considered using a 10V voltage regulator tube to make another power output to provide working voltage for the motor, which can increase the motor power to a certain extent and increase the running speed of the vehicle.
Motor drive module:
Considering the high price of motor driver integrated chip (18~30 yuan/chip), we abandoned the solution of using motor driver chip and turned to seek discrete component analog circuit drive. After the final choice, we adopted the dual triode control switch circuit, using the sensitivity of the triode, and connecting one end of it to the I/O port of the MCU. The triode switch can be controlled by controlling the ratio of the number of 0 and 1 pulses output by the I/O port to achieve the purpose of controlling the output voltage. The drive circuit diagram is attached.
Main control program:
In order to reduce the complexity of the program, we use three I/O ports, one I/O port is used to receive the infrared part of the level conversion and detect obstacles, and the other two I/O ports are connected to the motor drive circuit, and the program is used to generate the 0 and 1 pulse quantity ratio to control the drive circuit switch. Finally, the speed difference is achieved to achieve steering and obstacle avoidance.
The main control program is as follows:
/* *****************************
Program development environment Keil uVision3Language
: CWriter
: Sun Xuejun
Time: 2010/04/04
***************************** */
/* *****************************
Main program and comments are as follows:
***************************** */
#include
#define uint unsigned int //Macro definition
#define uchar unsigned char //Macro
definitionsbit s=P3^5; //Define infrared obstacle avoidance detection portsbit
m1=P3^4; //Define motor M1 level output portsbit
m2=P3^6; //Define motor M2 level output portvoid
delay_ms(uint z); //Declare delay functionmain
() //Main function
{
uint i=0; //Initial value settingm1
=1;
m2=1;
while(1) //Infinite loop
{
if(s==0) //S=0 means there is an obstacle ahead, turn
{
for(i=0;i<5;i++)
{
m1=0;
m2=1;
delay_ms(15); //The state is maintained for 15ms
m1=1;
m2=1;
delay_ms(5); //The state is maintained for 5ms
}
}
if(s==1) //S=1 means there is no obstacle ahead and driving in a straight line
{
m1=1;
m2=1;
delay_ms(10); //The state is maintained for 10ms
}
}
}
void delay_ms(uint z) //Delay function loop nesting principle
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
/*****************************
The program is finished and after testing, it is confirmed that the program complies with the hardware and the functions achieve the expected goals.
******************************* */
————————————————————Function expansion————————————————————————————
1: The human-computer interaction of this vehicle is not strong, the vehicle speed is not displayed, the obstacle display is not obvious, and there is no turn signal prompt.
It is expected that speed measurement and LCD or digital tube display modules can be added. The display module can be attached to the vehicle body itself or be a separate module, and wireless transmission is used to send data from the vehicle body to the terminal display.
2: Add automatic tracking function
3: Add automatic braking function
4: Remote control function
--------------------complete----------------------------
Welcome to discuss, let’s learn and improve together, and welcome advice from experts!
Previous article:Digital tube display of AD conversion
Next article:Summary of Design and Production of Electronic Temperature Alarm
- 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!
- 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
- The channel for exchanging TI points for chip points has been opened. Full redemption within a limited time. The ultimate redemption is coming~
- GPIO principle of TMS320F28335
- I really need help with this strange linking error. It has been bothering me for days.
- Introduction to the working principle and characteristics of rectifier transformer
- TD1509 has large output voltage ripple
- Design of data forwarder based on MSP430F149
- [Evaluation of EC-01F-Kit, the NB-IoT development board of Anxinke] 01. Communication test
- RFID is the next gold mine for enterprise software
- Reading Common Instructions of PIC8-bit Microcontroller Assembly Language (Part 2)
- Mini Adafruit QT Py Development Board