Arduino self balancing robot – Update #2 & #3

After much consideration, I think I will try to make a self balancing robot first before a ball balancing robot as to get a better understanding of “balancing” algorithms first. Hence, I’m working on a self balancing robot now instead. Actually I had finished a few stuff a few weeks before I wrote this post, so I will be writing Update #2 and Update #3 together.

self_balncr_front

#Update 2 – 17/10/15:

Don’t really have any pictures on it, majority of the time was spend testing parts only. I decided to build a self balancing robot first to get more understanding on how balancing robot work. This is because 2 wheel self balancing robot only have to handle 1 axis (the x-axis), whereas the ball balancing robot have to handle 3 axis, which is more complicated.

Micro-controller

  • Using a Arduino Uno for testing purposes, intending to get a smaller micro controller soon
  • Thought about using ATtiny85, but it is too small in memory size & slow in terms of speed.
    • Verdict: Stick to Arduino Uno for now.

Locomotion (Settled)

  • Thought of using the 5V stepper motors for locomotion, but after testing them out, I realised it was way to slow to respond to changes……
    • Verdict: Nah, too slow. Will be choosing another type of motor to use.
  • Tried out 5V mini rotational servo motors with an Arduino Uno, seems to be a better candidate for the robot
    • Verdict: Should be good (enough?). Most likely using 2 FITEC Continuous Servo Motor (FS90R)
    • Things to keep in mind while using rotational motors:
      • 0° – No movement
      • 90° – Clockwise movement (max. speed)
      • 180° – Anti-clockwise movement (max. speed)

Sensor

  • Interfaced the MPU6050 (Accelerometer & Gyroscope Sensor) with the Arduino Uno, used it to control the speed & direction (aka velocity) of the servos
    • When the sensor falls in one direction, the servo has to react in the opposite direction. (~Newton’s 3rd law)
    • E.g. If the robot is falling to the left, the servo has to move to the right as to mitigate the fall

Coding

  • Implemented a simple program to do crude correction of the falling sensor.
  • Will be using only the gyroscope x-axis for now, with the values mapped.
  • The velocity of the servo will be determined by adding 90 with how much change there is in the Gyro-sensor (X-axis). (Since at 90, the servo will not be moving.)

That’s it for Update #2. Now, moving on to Update #3…

 

#Update 3 – 24/10/15:

Micro-controller (Settled)

self-balancing-2

  • I think I will be using the Bluno Bettle instead of Arduino Uno
  • Features:
    • ATmega328@16MHz: Similar to the Arduino Uno
    • Bluetooth Low Energy (BT 4.0): Can be used in the future for control
    • Micro USB port
    • Super Compact Size (28.8mm X 33.1mm, 10g): That’s what I need!
    • Working voltage: 5V DC
    • Digital Pin x6
    • Analog Pin x6
    • PWM Output x2
    • UART interface x1
    • I2C interface x1
  • Verdict: Most likely using this micro-controller.

 

Sensor (Settled)

self-balancing-3

  • Interfaced the MPU6050 (Accelerometer & Gyroscope Sensor) with the Bluno Bettle
    • Encountered various problems while doing so
    • Got -1 for all the output (Gyroscope values), took some steps to resolve problem (in ~2h):
      • Changed jumper wires.
      • Used I2C Scanner to make sure the Bluno Bettle can detect the MPU6050.
      • Did not detect any address at first, so I swapped the wires around. And it detected the sensor. Opps!

 

Body

self-balancing-5

  • Designed the body of the robot, it will consist of 3 body plates with stand-offs supporting it.
  • I will 3D print the parts, the sketchup file will be uploaded onto Github soon.
  • The servos will be attached below, sanwichiched between 2 of the plates.
  • The top section of the plate will be where the sensor (MPU6050) & the 5V voltage regulator is. I will be using a 3.7V Lipoly Battery to power the Bluno Bettle.

self-balancing-6

(I think the distance between the top plate & middle plate is a little to small. Maybe I will extend the stand-off by one more the next time.)

 

Coding:

  • Using the same code as previously mentioned. Will be adding the PID filter once I settled everything.

 

This are a few more other photos that I have taken: (Rather messy setup…)

 

And that’s about it. This is what I intend to do next time (hopefully):

  • Organise the jumper wires nicely (it’s rather messy now).
  • Find a good spot to place the Bettle & the battery.
  • Modify the body a little bit, maybe 3D print wheels?
  • Implement the PID algorithm into the robot.
Share this post:

You may also like...

Leave a Reply