Question requirements
First of all, I am very grateful to Lichuang EDA, Wuhan Xinyuan, Chongqing Youyite, and Chuangxin Workshop for organizing this training camp.
This is my first time participating in the training camp. I originally
The functions implemented by the wind car include: button control on and off, LED gradient ambient light, 1W white LED headlight, buzzer, wind motor drive, and OLED display.
After the wind car was completed, I wondered if I could make a more advanced one. I once saw someone else’s obstacle avoidance and tracking car on station B and thought it was cool. Now is such a good opportunity, I want to use CW32F030 to DIY a self-driving car.
The final automatic car adds voltage measurement, reduction motor drive (while removing the wind motor), and infrared obstacle avoidance on the basis of the wind-powered car, achieving L5 level autonomous driving (the L5 level is suspected of being exaggerated).
Schematic diagram and PCB design instructions
Automatic car PCB family portrait:
The automatic car is composed of 4 types of PCBs. They are CW32 main control board X1, reduction motor drive & obstacle detection board X1, obstacle detection independent small board X2, and wheels X4
[1] CW32 main control board circuit refers to the sample project of this training camp, CW32 small blue board, CW main control board, and brushless motor driver board. Add, subtract and modify them as needed.
[2] The reduction motor drive & obstacle detection (directly ahead) circuit refers to the "STM32-Four-wheel drive smart car" of the oshw open source community Ji Xiaoxin, and the "Lichuang Classroom-Mini Smart Car" of OHSWHUB open source hardware.
[3] (left and right) independent small board circuits for obstacle detection are cut from [2].
【4】Car wheels, no schematic diagram.
Problems with schematic diagram and PCB:
[1] The positive and negative silk screen printing of the 5V CON on the main control board (used to connect the lithium battery) is reversed (be careful with the drawing board).
[2] PC13 of CW32 is connected to the blue LED. When writing the code, I checked the manual and found that this IO port cannot be multiplexed to the PWM output of GTIM. In the end, the ambient light only had red and green light gradients.
Software description
[GPIO] Reference code: Xinyuan official example Examples/GPIO/gpio_input_out is used for headlights, buzzers, motor driver ICs, obstacle avoidance signal status reading, buttons, etc.
[Basic timer 1] Reference code: Xinyuan official example Examples/BaseTimer is used to perform ADC conversion every certain time (0.5 seconds)
[Universal timer] Reference code: Xinyuan official example Examples/GTIM/GTIM_PWM_output is used for LED gradient ambient light
[UART] Reference code: Xinyuan official examples Examples/UART_printf is used to print information during debugging
[ADC] Reference code: Xinyuan official example Examples/ADC/ADC_sgl_sw is used for voltage measurement. The voltage value is displayed on the OLED after ADC conversion, which is the same
[IIC] Reference code: Teacher Li Fang’s example 2CW32 BLDC hall pid is used to light up the OLED screen
[Obstacle avoidance and reduction motor drive] Reference code: Jixiaoxin or OSHWHub open source hardware's "Lichuang Classroom-Mini Smart Car".
The teaching videos uploaded to Station B by the training camp (such as those by Youyite Yang Gong and Teacher Li Fang) are of great reference value.
First study each part individually and then combine them to complete the final project.
The code is not open source, all relevant reference codes are listed above.
If you also want to make a CW32 obstacle avoidance car, if you are smart and do your own research, you will definitely gain more and make a better car.
Introduction to automatic cars
【1】True suspended roof design (after adding a motor drive board to evolve into an automatic car, the bottom shell cannot be closed)
【2】38mm diameter 12-spoke, Jialichuang PCB customized exclusive wheels, full-size spare tire
【3】Dual up and down outlets, trapezoidal exhaust hole (actually a USB power supply port)
【4】Four-engine power, full-time four-wheel drive
【5】The whole car is full of LED light sources, and there are gradient ambient lights in the car.
【6】Three sets of infrared sensors, automatic obstacle avoidance driving, no driver required
【7】Full LCD instrument (0.96-inch OLED)
【8】Using domestic high-performance CW32F030C8T6 as the main control chip (Duoduo supports domestic production)
【9】Using Lichuang EDA standard printing PCB, professional printing shell and panel (Duoduo supports domestic production)
[10] Lichuang EDA, Wuhan Xinyuan, Chongqing Youyite, expert team guides development
Demo video
The original video of the automatic car exceeds the upload file size limit of 50M and is uploaded after compression. The video resolution is not high, sorry.
Automatic car original video station B link:
Upload other attachments
Tips: The works participating in the event must upload project-related program attachments to the open source platform or personal code storage cloud. The attachment can be uploaded up to 50M (please do not upload it in the Lichuang workspace, there are restrictions)