aytwartoofyoroo

2021 Electronic Competition F Title National First Works

 
Overview

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

9SNxLsFFqxBEyrpf0oZUFV08mU1S5Sgu5maN1NZb.png

Basic requirements

Dw2vTfGYC4NELbkaT5EqcKhfVwQgbBcA1dUota88.png

4JdLInyfGqfzBlU7aCb6aOsM4WzKCgp3UNlMx6jl.png

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.

HSRyNUbV4G22TPBuCYN4zjtmTRU3EkdTKMOoK3eR.png

D8AdkBmBc0A4nadTDO4qdzEerG8htKlpChVWgy5R.png

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 

3zYzCZq5HkabPaeQwrAxfOSrMTNzcILGilksGv3J.png

Use xl4015 as power supply for servo

7d5kaa9oG88gIJtqtq0svdwJwEc1r2IuXeA6uSxS.png

5V voltage output uses tps5430

OnKBgpbbwjxgvoiwwvnaE4cGRwmdYae2r1CEzPIA.png

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.

I9qUsHJx2IchgcEV5vJQYJI2q6AdNjwvbwpsbmn7.png

The motor driver uses the BTN7960 solution.

 

5. PCB design analysis

I7U9SsUzVaKh3mf4jIu5oodjgNd8NBZW9GK4Bq4B.png

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.

odyW00dy52baEg3UvhfZoOts1cuID4W5xjNFUic0.png

Motor driver board

6. Physical display

BRqTwOx6Gk0WsNLAcnOzFHSG4oOtmiHnafUFH6Lh.jpeggWIoRzFX1XKYl1sPoImsRJAVAvpGn5GGwLefmFc5.jpeg

7.Assembly of works

IsliuZpOttbhh3ryhbAY48U2x88RfFGowL7uegl2.png

Car bottom plate (one motor hole is missing, it does not affect it)

T1WggunYGVVXIHMfEEQXUOdVOty5gGJRAMeaf1su.png

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

VWhT3wgIstTSze59tM1tQ6jpYykX8jyl5P8eCWfp.png

The main car function is as above, the front is LCD refresh and gyroscope initialization, and the back is the departure and return functions.

sjPMvvRPlsVjQdPJJar9cQi2P4B7PEikwCT7uVP4.png

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

f7Km4Z7RdRBjNaByGIqtZXCs5DO31pYHsfMRyODY.png

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

SncStkKQmk5CJ3EIaplebu1JTBLf6nNP48fdjwHn.png

Initialize cross record

NuOqS9mg8MJEEDTBPWG6d4cLBITG5Cubx8cmGURK.png

Near-end delivery of basic items

FLHffvSdoeHZtBS5DGjpt7jpr2k9j5Bd20K9oHsr.png

Basic items mid-end and remote end, see notes for details

TDNMk3fC18lUvg8xET5ZYKgGEwKGZfI5PK9olHfB.png

Send information to the slave vehicle while turning

xOedhAcvBvS9phmQgMwtkWCsifabjt40lW5MgP7z.png

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.

LXiIyd2VXzrlCEMDVKJgbiwSjldafAaRanXgVHPR.png

Cross judgment function, including the judgment of T word when returning. (The seven-channel infrared used by the slave car has different detection functions)

aruykmz8flqBfJK9L39ydBw7D3e9BcSGvMUje4FR.png

BoDsnqhg9HSW3VqhL4Ah9j36ZKo53httX1UEacsj.png

left and right turn function

iOYLxKjuuf6FIQUX8KjZcotEnxcBmos3eV23iLpp.png

endpoint detection function

cgkEb8eOk2oELIR90K6eRLMV7cCuMoFdKAQHYiWK.png

Return function (part)

4C32BJNLfV8Z4Tk6cGbGaPSZ0IKxswzVcBLOE574.png

Is there any drug test loaded?

iwI9ukN6wx9TOMn4KLnvklfucfxnkJ4weYA2go9z.png

(isr.c)

Motion control and serial port related stuff are also in isr.c

B1dFbyqDcLMN7VaRSKkqGGp3hI9TTIqdQpmalTUz.png

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.

RuU7Zv9XrMGg1roa9EcGMj3uxGpGWfC3GAhE2gZg.png

2.  Labeling of data sets

Use the labelImg-master visualization program to label the data set.

V7A4IDg80ExnrAL4gyKyELmSWnS1eZpSeLPND5bP.png

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.

6AptwHHwQEl6anl2bCjUyyhPD87yrEhs7vv8CLrS.png

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 .

ndIVlfuxAww6NqAlwGEyj6pitxVqvcCKHM5mNXQp.png

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.

OCh1XO7QwsFl2LSQtOSTPEMcAJAquLvsQPmjuNrY.png

5. Recognition effect display

The recognition success rate is close to 100% .

jL9N1t2MGlyrcAcEfmABA0nVjYHER6EU3xaeWNm8.png

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.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 13:35:00

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号