[SOLVED] Help to get BrickPi3 BalanceBot in balance!


constructing my 1st BrickPi3 device according to these instructions:

and finally got the BalanceBot.py running on the device (code equal to https://github.com/DexterInd/BrickPi3/tree/master/Projects/BalanceBot/ )

	pi@dex:~ $ sudo python /home/pi/Dexter/BrickPi3/Projects/BalanceBot/BalanceBot.py
	BrickPi3 BalanceBot.
	Configuring Infrared Receiver...
	Lay robot down so that it is perfectly still, then press Red Up on the remote.
	Configuring Gyro Sensor... Keep robot still.
	Stand robot up, then press Blue Up on the remote.
	Release Blue Up on the remote.
	Balancing, so let go of the robot.
	Use Red and Blue Up and Down to drive the robot.
	Oh no! Robot fell. Exiting.
	pi@dex:~ $

After pressing the Blue Up on the remote it just accelerates 2sec backward (or forward) and is not (even try) able to get in balance - no matter what I try.

I’ve run various tests and Python scripts from /home/pi/Dexter/BrickPi3/Software/Python/Examples/ and all sensors and motors “seems” running ok.

Also tried to swap Left<–>Right motor cables but no help.

The gyro is EV3 gyro sensor.

BrickPi3 versions:

Python 2.7.9 and Python 3.4.2
BrickPi3 Troubleshooting Script log
Checking for hardware, and checking hardware and firmware version.
Manufacturer    :  Dexter Industries
Board           :  BrickPi3
Hardware version:  3.2.1
Firmware version:  1.4.6
Battery voltage :  11.99
9v voltage      :  9.264
5v voltage      :  5.008
3.3v voltage    :  3.332
V 7.3
This version of Raspbian was modified by Dexter Industries on the Jessie Raspbian Build.
This version was updated on 2017.09.28
Start: Sat 25 Nov 16:00:27 EET 2017
End: Sat 25 Nov 16:06:40 EET 2017

Please help - what else need to be done?


@Matt, can you hope in on this one? This seems to be the balance-bot project for the BrickPi3.

Thank you!

You could try mounting the Gyro sensor backwards, so the sensor rotates in the opposite direction.

Can you take a picture of the robot showing how the gyro sensor is mounted compared to the motors?


Tried Gyro opposite direction - no help. On this picture Gyro on the original direction. Gyro side motor on port MA, Gyro on port S4.

One thing noticed during testings: should there be a 2-3 sec delay on the Gyro wakeup? Did a test by /home/pi/Desktop/BrickPi3/Software/Python/Examples/EV3-Gyro.py script (tried on port S1 and S4) and the 1st position values from sensor comes after 2-3 sec from script start.



Any further ideas what could try?

Perhaps logging some values, but which ones and what place in the code? Also, the balancing function is slightly too complex for me to understand how it really should work on numbers: what’s normal and what’s error.


It looks like you have your motors installed backwards. Please refer back to the instructions to see the correct orientation.

For ports, the gyro should be on S4, the IR sensor on port S1, the left motor (on the gyro sensor side) on MD, and the right motor on MA.

Try correcting the motors and confirming the correct ports are being used. When you run the BalanceBot program, be sure to follow the instruction in the terminal.

Thanks Matt - both motor’s orientation swapped/turned 180 degrees and now rocking nice in balance :balance_scale:

For an average analog guy was quite not unsurprising to understand that swapping only cables Left<->Right actually doesn’t change the Forward<->Backward direction (only turn direction changes)!

BricKuber waiting :cool: