Yes, you read it right! A bot that knows how to balance. In this post we’ll learn how to make your own Self Balancing Robot using balancewii.
Components required in this project:
- Arduino NANO
- MPU6050 Gyro Sensor
- HC-05 Bluetooth module
- A4988 Stepper Driver
- Nema 17 Stepper motors
- 100mm Wheels
- Acrylic Sheet
- 150mm Threaded Rods
- Orange 1500mAh 3S 40C/80C (11.1V) Li-Po Battery Pack
- 6 x 8 cm Universal PCB Prototype Board Double-Side
- 100uF, 50V capacitor
Make the connections as shown in the above circuit diagram. We have used a 6×8 cm universal PCB prototype board to solder out the connections.
Note: Check for short circuits using DMM before mounting the hardware.
For the framework, you need 4 x 150 mm Threaded rods.
Three 140×75 mm acrylic sheets for lower, middle and upper platforms.
Drill suitable holes to fix stepper motor on the bottom platform.
Screw tight the stepper motors suing angle support.
Add the frame work rods at each corner of the base platform.
Now it’s time to add the middle platform.
Fix tightly the middle platform and now also add the top platform, fix it using dome nuts.
Place the Li-Po on the base, fix it to place using zip-ties.
Now place the circuit board on the middle platform, the orientation of the board should be similar as shown.
Connect both the stepper motors to A4988 drivers as shown.
Bravo! The structure is ready, Now It’s time to program the Arduino.
To begin programming the Arduino, we must first download balancingwii firmware for the balancing robot.
This firmware is based on the Multiwii firmware, which is commonly used for quadcopter and multi-rotor flying drones.
Mahowik, who created this firmware, deserves special recognition.
Download the firmware balancingwii by clicking here, then click the green clone or download button.
The firmware will be downloaded in ZIP format to your computer.
Rename the folder containing balancingwii.ino file to “BalancingWii” to avoid compiling error.
Now open the balancingwii.ino file in arduino and compile and upload the code without making any changes.
If your MPU6050 orientation is similar to us, keep the CURRENT_AXIS to PITCH otherwise change it to ROLL.
BT module should be turned OFF before uploading the code.
We are going to use app called EZ-GUI, It is an Android based Ground Control Station (GCS) for UAVs based on MultiWii and Cleanflight.
- Open the app, click on the three dots at the top right corner of screen.
- Go to settings.
- Click on BT Device to select BT module “HC-05”
- Now select the firmware as “Multiwii 2.40” and click next till you reach at home screen.
- Click on CONNECT and wait for the app to connect to your BT module.
- Swipe left and navigate to settings.
- Click on AUX, select ARM, SIMPLE, POS HOLD for AUX1, AUX2, AUX3 respectively.
- Click upload and send the data to controller.
- Go to PID, alter the values to the one given below and click upload.
Now place the bot at a flat elevation for calibration. Wait till the calibration ends.
Now back from this screen, and click on three dot at top right corner and go to “advance” and then go to “Untested” and then click on “Model control”
NOTE: If you are not able to control your bot try changing the channel to “ROLL” and “PITCH”.
And it’s ready, Use the joystick to run your self-balancing bot.
Play with the settings to learn more about the bot and its working.
That’s it for the blog. Stay safe. Stay tuned at Robu.in