z6AuQ

[LiChuang Development Board] Liangshan School Balance Car (Welcome to watch my stable old dog car)

 
Overview

# _**Description**_
## Balancing car based on Liangshan School
# The uprightness of the car (PID debugging)
## The MPU6050 is used in the project to obtain the posture of the car. The uprightness of the car is divided into three loops: speed loop, upright loop, and steering loop. The speed loop PI and the upright loop PD are cascaded with each other, and the steering loop is a parallel PD.
![image.png] ## When adjusting the cascade PID, first adjust the inner loop and then the outer loop. The parallel PID can be adjusted at the same time.
## 1. When adjusting the PID, adjust the value from small to large. First adjust the upright loop Kp. When the car has high-frequency vibration, you can adjust the upright loop Kd.
## 2. When adjusting Kd, slowly increase the value until the car is almost stable (at this time you will find that the car will move in the direction of the external force when an external force is applied to it until it falls down. At this time, you need to add the speed loop for control)
## 3. Adjust the speed loop Kp to 0.005 times Ki. Adjust the speed loop until the car can return to a stable position when disturbed.
## 4. Steering ring is the same as above
## 5. Pay attention to the polarity of PID when adjusting!!! (If the polarity is wrong, it will never be adjusted properly)
## The effect of PID adjustment will be better if the host computer is used. (Using the host computer can better control the amount of PID and make the car more stable)
## 6.MPU6050 zero drift phenomenon is quite serious, and some low-pass filtering needs to be added to reduce its impact on the car
## 7.The choice of motor is very important. Check whether the dead zone between the motor gears is large, otherwise the motor needs to be replaced
# Bluetooth
## Bluetooth uses HC_05
![29fd340b0719f0bfa6d4135312af034.png] ![17d3f1397b479bac973e1490003aa92.png] ## The Bluetooth serial port configuration is the same as the USART2 serial port of Liangshan School, occupying PC10 and PC11 pins
![image.png] ## The mobile phone software configuration is as follows
![8a5c4bc93d8c7e60f2c0e01293d3f0b.jpg] ### Press and hold up Bluetooth to send "w", release to return to "s".
### Press and hold Down Bluetooth to send "d", release to return to "s".
### Press and hold left Bluetooth to send "l", release to return to "s".
### Press and hold right Bluetooth to send "r", release to return to "s".
### Press up Bluetooth to send "s"
# 2.4G module
## Under development.........................
# Summary
## When making the car, I didn't choose stm32 to get started, so there was a lot less information, and I needed to transplant it. It was really difficult for me as a novice. I wanted to give up many times during the process, but I persisted in the end and learned how to debug PID. Although the effect is very good, I will continue to improve my algorithm.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-04 11:24:25

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号