Go Down

Topic: And another self balancing robot (Read 11 times) previous topic - next topic

cyhex

Aug 18, 2012, 01:19 pm Last Edit: Aug 23, 2012, 03:28 pm by cyhex Reason: 1
Just wanted to share my code, in case someone, one day may find it useful


Video:

http://www.youtube.com/watch?v=coYkNLxFi1g&feature=share

Source code:
https://github.com/cyhex/bRobot


Self balancing robot based on Arduino UNO ATmega328 microcontroller


Hardware list:
   arduino uno
   dual mc33926 motor carier
   lipo 11.1 v / 1300 mAh power cell
   MinIMU-9 Gyro
   2x Motors, 12V 1A (max 2A), 50:1 gear ratio, 6kg/cm peak force
   big wheels
    jy-mcu v1.02 ( Bluetooth RF Transceiver )



Operation basics:

   Read raw gyro
   Read raw accelerometer
   Calculate current angle
   Calculate engine torque with PID controller
   Correct current position
   Do the same thing over and over again ( should be around 100 Hz )

Notes:
I decided against Kalman filter in favour of Complementary Filter
as its has almost same performance but without the complexity of Kalman filter.

CrossRoads

Pretty nice! Except for shooting off the table. I don't know what goes into coding one of these, hopefully you can tweak it up.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Far-seeker


Pretty nice! Except for shooting off the table. I don't know what goes into coding one of these, hopefully you can tweak it up.


According the the hardware list, the only sensor is the gyro IMU and that can detect the bot falling off the table but not prevent it.;)   It's going to take more than just tweaking the code to keep it on raised surfaces, like some sensors for edge detection.

Still, it's impressive given it's balancing reliably on two wheels and only uses the IMU.  Thanks for sharing cyhex!

cyhex

The shooting off the table part is caused by non tuned bluetooth remote controller.... what brings me to another issue - the hardware list missing the bluetooth serial controller.

bimbambom

Looks really nice!
I've read the PDF in your github, it was very informative and easy to understand.
I'm thinking of building a self balancing robot my self and may I ask how are you controlling the motors?
You don't have encoders so I'm guessing its an open loop design(?), how do you control the torque they output?

Go Up