1 Introduction
This project is an intelligent medicine delivery car for the 2021 e-sports title F.
2.Team introduction
The three members are senior students majoring in telecommunications, measurement and control, etc.
3.Project analysis
The task is as shown in the figure
Basic requirements
Basic item analysis: First of all, the basic item is a single trolley. The trolley cannot use wheat wheels or tracks. There are size requirements. Our solution is two driving wheels plus one universal wheel support, and the size is as compact as possible; to follow the line , here we use a belt The infrared tracking module of the MCU (the seven-channel infrared tracking module used by the slave car can also meet the requirements), adds a serial port gyroscope to close the steering loop; for digital recognition , I tried openmv, and finally used k210 , which has a high frame rate; Due to height restrictions, two k210s are installed on the main vehicle for identification; other peripherals include LCD screens, micro switches (equivalent to buttons, detecting medicines), three-color LEDs, Bluetooth modules, etc.
Featured item: It lies in the collaboration between the two vehicles. The slave vehicle uses a k210 and seven-channel infrared tracking. Others are the same as the master vehicle. The main focus is on the software part.
4. Schematic circuit analysis
Power supply section
Use xl4015 as power supply for servo
5V voltage output uses tps5430
3V3 uses tps7333. The two chips supply power to peripherals and MCU respectively.
Other peripherals, basic button LED buzzer dialing, lead to all serial ports, lead to spare IO, 4-way motor drive interface is reserved, connected to the motor drive board, the battery is powered by two 18650 cells.
The motor driver uses the BTN7960 solution.
5. PCB design analysis
The power supply part is relatively concentrated, with many GND vias for heat dissipation, the upper serial port and the lower motor interface, and the right side is connected to the input of the motor driver board.
Motor driver board
6. Physical display
7.Assembly of works
Car bottom plate (one motor hole is missing, it does not affect it)
The top plate and lens fixing parts are laser cut from 5mm acrylic.
The battery uses two 18650 cells. The battery box is fixed between the bottom motor and the universal wheel with hot melt glue, and two boards are fixed on the board.
Note that the motor must use a high line speed!
8.Programming
The main car function is as above, the front is LCD refresh and gyroscope initialization, and the back is the departure and return functions.
(control.c)
Departure function, the task is to obtain the delivery target number, distinguish the basic or performance items, here judge whether the return value is received through the Bluetooth serial port, and initialize the array.
(control.c)
The two parts include near, middle and far end distribution, both of which are traveling side by side. When traveling to a cross, it is judged whether it matches the target number, and the cross passed by and the direction forward on this cross (such as forward, left and right turns) are recorded. This is recorded here The path is used as a basis when returning.
Initialize cross record
Near-end delivery of basic items
Basic items mid-end and remote end, see notes for details
Send information to the slave vehicle while turning
For the processing of the information returned by k210, please note that 210 may misjudge, especially when the full number is not seen, it must be read multiple times for processing.
Cross judgment function, including the judgment of T word when returning. (The seven-channel infrared used by the slave car has different detection functions)
left and right turn function
endpoint detection function
Return function (part)
Is there any drug test loaded?
(isr.c)
Motion control and serial port related stuff are also in isr.c
It’s an old template, the main functions are probably in the above
visual part
The following three digital recognition solutions have been tried:
(1) Use openmv to perform template matching on different digital images. This solution is the simplest and can be implemented using the routines that come with openmv. The disadvantage is that the detection accuracy is low;
(2) Use jetson nano to run the yolov3 network for identification. This solution has higher detection accuracy, but there are two problems. The first is that the detection speed is only a few frames per second. The second is that adding the nano to the power supply will increase the weight of the car. Not conducive to the control of the entire vehicle;
(3) Use k210 to run the yolov2-tiny network for detection. This solution not only has high detection accuracy and high detection speed, but also has ready-made solutions;
After trying three options, we finally decided to adopt the third option, using k210 for digital recognition.
1. Collection of data sets
In order to ensure the accuracy of recognition, the camera is first fixed on the car, and then the data set is collected. Since the car is looking at the numbers head-on during actual movement, there may sometimes be a certain tilt, so we only need to take the correct picture. Digital pictures are enough. In order to facilitate the collection of photos, I wrote a data collection program by referring to online tutorials. Almost 300 pictures were collected at different distances and angles . Later, because the numbers 6 and 8, and 4 and 7 were easily recognized incorrectly, 100 pictures were collected based on these numbers for data enhancement.
2. Labeling of data sets
Use the labelImg-master visualization program to label the data set.
3. Data division and training
The first is to configure the computer environment. You can use the environment configuration executable program that comes with Mx-yolo for one-click configuration. Install the corresponding python and its dependent libraries, cuda, and cudnn. It is very convenient. There may be errors during the installation process. , usually it is a network problem, which is solved after changing the source.
After configuring the computer environment, select the yolov2 MobileNet network, adjust Batch_size to 8, Alpha to 0.75 , train 150 times, and then use GPU to train for about 20 minutes. If the training is successful, the model file of yolov2.tflite will be obtained .
4. Model deployment and prediction
Convert the trained model yolov2.tflite file into the yolov2.kmodel file, then place it in the root directory of the SD card, and then call the camera through the following k210 program for real-time recognition of numbers. Then the recognition results are transmitted to the microcontroller in real time through serial communication.
5. Recognition effect display
The recognition success rate is close to 100% .
9. Summary
Sufficient materials must be prepared, plans must be determined early, and team members must work on multiple lines in parallel to improve efficiency. The control idea should be clear. The program should be written first and then perfected. Write more comments.
10. Attachments
Demonstration video: [21 Electronic Competition F Title Works Display-Bilibili] https://b23.tv/j76tiI9
See attachment for code etc.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet