Skip to content

Code, usage notes for operation of an STM32-controller "self-balancing car"

Notifications You must be signed in to change notification settings

playfultechnology/pid-balancecar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pid-balancecar

Code, usage notes for operation of an STM32-controlled "self-balancing car", as shown below:

There are several similar models available from different suppliers on AliExpress, BangGood etc.

Source Code

The "open source" code was supplied by the vendor as a baidu link. Link: https://pan.baidu.com/s/1M-D3hrumQRwJgep1K78iIw
Password: bx5w The problem is you can't download from baidu without a baidu account, and you can't create a baidu account without supplying a Chinese phone number. I previously made use of a workaround (https://oneleaf.icu/), but that no longer seems active, so I have uploaded the original supplied code to the download/ folder of this repository.

The code/ directory contains several versions of the project:

Operation

  • Long press on USER button: toggle operation mode
    • "putong" (普通) = "ordinary" (i.e. static balance)
    • "bizhang" (蔽障) = "obstacle" (i.e. moves to avoid obstacles placed in front of ultrasonic sensor)
  • Short press on USER button: start/stop balancing

Connecting via BlueTooth

  • Pair with the BT04-A module (passcode 1234) to be able to send/receive data via BT Classic serial interface

Connecting via RC

  • Connect an RC receiver (e.g. FS-iA6B) to the connector near the power with the BT04-A module (passcode 1234) to be able to send/receive data via BT Classic serial interface.
  • The connector is a 4x3 block, with 4xGND, 4x5V, and GPIO pins PC6-PC9.

Hardware

Adding the CCD Line-Following Module

  • Compile the Keil uVision project with CCD support contained in pid-balancecar\download\CCD Attachment\TSL1401线性CCD模块附送资料V3.1-202120217\2.平衡小车专用CCD巡线代码\2.STM32平衡小车 CCD巡线\CCD巡线代码【高配版平衡小车STM32F405RGT6】
  • If required, install support for the STM32F405RGT6 board
  • To upload the code (without using the STLink dongle), load the FlyMCU application.
  • Set the COM port and bps:76800, then hit the big (P) button to program the board.

About

Code, usage notes for operation of an STM32-controller "self-balancing car"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published