王达业

[Shenzhen University Electric Competition]-Balancing car design based on STM32

 
Overview

System architecture and function description

(1) System architecture and function description     The STM32F103C8T6 chip is selected as the main control chip. This chip has 32-bit processing capabilities, which can make the self-balancing system operate more stably and efficiently. The chip operates at a frequency of up to 72MHz, and can reach 1.25DMips/MHz during memory wait cycle access. It uses single-cycle multiplication and hardware division, and has 64K flash program memory, 3 general-purpose timers, and a timer to meet PWM, recording To realize functions such as wheel speed, there are also 37 fast I/O ports, and all I/O ports can be mapped to 16 external interrupts. The self-balance sensor uses an MPU6050 six-axis acceleration gyroscope to obtain vehicle body level data. This sensor is an integrated 6-axis motion processing component. The six axes mainly include the gravity acceleration component in the xyz three-axis direction and the angular velocity in the xyz three-axis direction. It integrates the gyroscope and accelerometer into one, thus greatly eliminating the need for independent use. The time error of the gyroscope and gravity accelerometer not only reduces the space occupied by the PCB board, but also provides temperature output and sensor cascade. MPU6050 has the following characteristics: ① It uses three 16-bit ADCs for the gyroscope and accelerometer respectively to convert the measured analog quantity into an output digital quantity (-32768, 32767); ② The full-frame sensing range of angular velocity is ±250, ±500, ±1000 and ±2000 degrees per second (dps), which can accurately track fast and slow movements; ③ The full sensing range of the gravity accelerator is ±2g, ±4g, ±8g and ±16g; ④ On-chip FIFO with 1024 sections helps to reduce system power consumption; ⑤ Provides 400kHz I2C and 1MHz SPI communication interface, and also provides a modifiable address IO (AD0) for the I2C interface; ⑥ Voltage range: 2.5V- 3.3V, the module is compatible with 3.3V and 5V. After being processed by the PID attitude algorithm, it passes through the MG310 Hall reduction motor. Due to power limitations, the processor's own GPIO cannot directly provide power to the motor, so an additional motor driver chip is required. This chip has a high-current MOSFET-H bridge structure, dual-channel circuit output, and can drive 2 motors at the same time. The PWM signal input frequency range is up to 100KHz. The efficiency is much higher than the traditional L298N, and the volume is also greatly reduced. Within the rated range, the chip basically does not generate heat. In terms of power, mg310 Hall reduction motor is selected. This Hall motor has small operating voltage, stable speed, 9kg large twist, and compact size, so this motor was chosen. The ultrasonic ranging module uses HCSR04, with a detection range of 2cm-450cm and a detection angle of <15°. In addition, this self-balancing system is equipped with a BT04-A Bluetooth serial port [9] . This Bluetooth serial port supports the V2.1+EDR protocol. It has the advantages of small size, low power consumption, and high transceiver sensitivity. It can be connected to a self-developed mobile app. To view and control the car body system, the app is made with the Yi Android development platform. This app has the function of operating the movement direction of the self-balancing system and obtaining data of the self-balancing system. (2) Functional description:     This self-balancing system can achieve self-balancing; it can move forward, backward, left, and right while maintaining self-balancing, and can drive in a straight line without serious shaking; after picking up the car, the car stops rotating, and when it is put down, it can resume normal operation. Rotate; equipped with an ultrasonic module to intelligently avoid obstacles; the OLED screen displays current status, temperature and other data. In addition, this self-balancing system is also equipped with a BT04-A Bluetooth serial port, which has data transmission and exchange functions. You can use a self-written mobile app to view and control the car body system, which is more convenient and flexible. This system uses the STM32F103C8T6 minimum system as the main control. The self-balance sensor uses an MPU6050 six-axis acceleration gyroscope, and drives the encoded motor through the TB6612 motor driver chip. Therefore, in terms of motor control and power supply, the first consideration is large current. In terms of drive and power supply, the line width has been increased to allow the system to maintain better passability. In the voltage stabilizing circuit, two lithium electrolytic capacitors and three electrodeless capacitors are used to create a clean power supply to make the system more stable and accurate.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 04:31:04

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号