s209U5atjC

Balance car

 
Overview

This project is based on Wuhan Xinyuan's MCU, model CW32F030C8T6, as the main control to achieve overall control of the balancing car.
 
The car has a series of functions such as ultrasonic following or ultrasonic obstacle avoidance, tracking, and Bluetooth control (the function is still under development, and the project can currently achieve upright balance and positioning return). The board design has reserved interfaces for all pin resources on the MCU, so that modules can be added later. Corresponding interfaces are made for OLED, Bluetooth, ultrasonic modules, and SW for layout and arrangement, and 3 buttons are also added. Function mode switching is implemented later. Then the overall power supply is currently powered by a 12V lithium battery, which can achieve a voltage drop of 12V to 5V and a voltage drop of 5V to 3.3V, to power the corresponding modules and MCU.
 
Project idea introduction:
Through the transplantation and use of the MPU6050 official DMP library, the corresponding angles of Pitch, Roll, and Yaw can be obtained, and then we can determine the mechanical median value based on this. That is, the angle during manual balancing, usually Pitch, depends on how you design and place the MPU6050. Then read the corresponding angular velocities of x, y, and z through the register introduction in the MPU6050 data sheet. Then the PD (upright loop) and PI (speed loop) are connected in series to realize PID closed-loop control of the balancing car to achieve balance and positioning recovery. A steering ring can be added to achieve straight driving.
Upright loop:
Speed ​​loop PID series connection:
The project is still being improved.
Development suggestions: Have used stm32 and can understand the principles of various peripherals and modules, and be familiar with register definitions and configuration operations, because CW32 development sometimes requires you to look at the register definitions and configuration
physical diagrams in the data manual:
The motor encoder interface design here is wrong , so you can see that I used Dupont wires to fly the wires. The schematic and PCB have been corrected now, and then there is the previous serial port 1 design. I initially thought it was PA9 and PA10 like stm32, so it was natural to use these two pins. , As a result, during previous debugging, I found that CW32 is PA8 and PA9. The schematic and PCB have been changed, so the Bin2 pin has been adjusted from PA8 to PA10. You will need to change the code by yourself. Or wait for the next version to be released and my code will be updated.
 
Communication group: 678911291
Demonstration video:
 
参考设计图片
×
Design Files
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 04:51:56

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号