Balance Bot Build
Build Groups are a great way to get the community involved in creating something together. Each member of the group has the drive to contribute and be a part of something big, and in a physical setting like the Makers Asylum, helps people get ready access to tools which would not possibly be available at home.
Posts on Facebook for the build group went out, and we met with the participants on a Saturday Afternoon. We went over how the build group is going to progress, what components are going to be used, how the mechanics of balance work, how the human brain acts as a very complex control system, and how a PID helps achieve smooth balance.
Feb 1st-Feb 7th
We worked on creating a laser cut frame for the Balancebot, keeping in mind all the parts that are going to be fit on the bot, holes for routing wires, motor mounts, and pieces that help make levels on the bot become flat and parallel to the ground. This is particularly important, because the bot has an IMU, and it needs to be level. We used inkscape to design it, and the laser cut it on acrylic.
Purchased the motors and all the electronics from the local electronics market, Lamington Road.
February 7th, 2015
Day progressed with the members starting to solder the Mapone. The group did smoke tests of the Blink LED, which confirmed that all is in good shape!
We brought all the parts to the group, and explained how the parts will fit together. These were easy to fit, with all the holes drilled and the joints on acrylic fit really well.
The day started with identification of each component, its role, and testing it out with simple arduino programs. For example, I explained about the motor driver chip, what an H-bridge is, what back EMF is, why we need to have flywheel diodes in the circuit that drives a motor, and the L293d module. We interfaced this module to the arduino, connected the motors, and wrote simple programs to turn the motors clockwise and anticlockwise.
We used a LM2596 buck regulator module, the MPU6050 6 DOF IMU and a L293D motor driver module.
This was a crucial day, we started early at 11 am. The plan of the day was to get the bot on its feet, er, wheels.
Everyone started with seeing if the gyro returned data well, and which axis of the gyro needed to be used, once we had the angle of tilt information, we started to do on/off triggering of motors based on angle. It wasn't a very good control strategy, because the response of the motors was the same irrespective of the magnitude of the angle, leading to wild oscillations. The bot rarely was able to keep up with the change in angle.
One of the groups tried to map ranges of angle to PWM speed of the motors. for example, a smaller angle has slow speed, larger error angle had a larger speed. The response improved, but still wasn't ideal.
We moved on to using the PID library, which is a great way of encapsulating a complex functionality inside a ready library, with good function interfaces.
The groups then tried to tune the library to get a steady response, but by the end of the day, none of them were successful.
The groups took their bots home, and tried to fix the issues with balancing them.
I started to build the balancebot at the Asylum, and that is still a WIP.
Will post a video once I am done with it. Here is a link the Makers Asylum github library where my code commits are done.