Self Balancing Robot

91 views
Skip to first unread message

George Taylor

unread,
May 26, 2022, 11:12:46 AM5/26/22
to Homebrewrobotics
William asked last night for some suggestions regarding getting his robot to balance on its two wheels. I used the same motors in Robigobi and downloaded the initial Arduino code from an example given at https://www.instructables.com/Arduino-Self-Balancing-Robot-1/ . I'm using an Arduino Pro Mini. A 7.2 V rechargable battery is mounted on the bottom board and feeds two voltage regulators. One is set for 6V feeding a DRV8833 motor driver driving the motors. The other regulator set at 5V for the Arduino. Notice the paint paddle. It doesn't balance without it.

William, please provide a picture of your robot. From what I saw last night, I suggest that you are asking the motors to supply way more torque than they can deliver to handle the mass of your robot. I suggest significantly reducing your robots  mass as a first step. Additionally, using the Arduino IDE plotter can help you tune the PID.

George

Chris Albertson

unread,
May 26, 2022, 12:24:35 PM5/26/22
to hbrob...@googlegroups.com
I looked at your Instructables link.  I think a key point is using a voltage regulator on the motor controller.  The PID gain constants depend of the voltage.    On a typical differential drive system, I don't use a regulator and let the PWM control perform that function.  I suspect most people do this

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/2014726079.659540.1653577941434%40connect.xfinity.com.


--

Chris Albertson
Redondo Beach, California

Sergei Grichine

unread,
May 26, 2022, 3:24:15 PM5/26/22
to hbrob...@googlegroups.com
A while ago I took a DfRobot kit and some parts as an example and made one. A secret sauce was three potentiometers, read by Arduino code. Their readings were converted to P, I and D - which made fine-tuning the PID controller easy and intuitive. 

DfRobot kit:   https://www.dfrobot.com/index.php?route=product/product&filter_name=KIT0040&product_id=1043

My 8-years old code here: https://github.com/slgrobotics/Misc/tree/master/Arduino/Sketchbook  - look for "BalancerDfr" and see Docs folder there as well. I re-tested the code today, it balances all right.

image.png

image.png

There are versions for a bigger balancer there - its hardware has been rebuilt and I can't test it anymore. Here is it dancing:

https://www.youtube.com/watch?v=Tjn3hky7iQs

Best Regards, 
-- Sergei Grichine
   

Martin Triplett

unread,
May 27, 2022, 10:49:41 AM5/27/22
to HomeBrew Robotics Club
This has been my favorite balancer bot project for a long time.  (I DID NOT BUILD IT)


He goes into detail about his cascading PID control and how he achieves balance and controlled forward movement, turns, spins, etc.  He includes code excerpts for all the key bits.  He also uses a Kalman filter and details about his sensors and motor setup.

Here are a couple of his videos:

Awesome stuff in my book.  I like it because it has a moving head and and visually acquires and recognizes specific signs that tell it where to go next and does a lot of controlled movement.

Hope this helps.

Regards,
Martin
Reply all
Reply to author
Forward
0 new messages