In this chapter we will set up the development environment of the Balanbot using Balanduino's firmware. Balanbot v1.2 compatible with Balanduino v1.2.
Note: Because of the differences between Balanbot and Balanduino, structure and size of the wheels, etc. The balancing effect may not good as you expected, you will have to adjust the PID params to reach your expectation.
For what version of your Balanbot, please refer to the Mainboard version as beblow. As we can see, our Balanbot version is v1.2.
It is can not use the firmware directly, we need slightly modify the Balanbot's mainboard, there is a solder jumper(SJ2) located on the usb host socket of the mainboard, short this solder jumper will works well when using Balanduino firmware.
See below image:
Please use arduino 1.56 or above Otherwise will get a compile error.
Unpack the Source code file to your local disk. The file structure should same as follow.
Open File->Preferences, Sketchbook location, click OK and reopen your arduino ide.
Then connect USB cable to your balanbot, for windows, will popup new hardware installation.
Upack the driver to your local disk and locate the driver path to driver path of the new hardware installation. After install a new Serial port will appear, see your device management.
Next open the demo, Open File-> Sketchbook->Balanduino.
Before next step make sure your ide Tools->Board has Balanbot menu. If this not appear check your Sketchbook folder contains hardware folder.
Then select Tools->Revision Revision 1.2 or older
And choose the newly installed Serial port, my is COM135.
OK, we can upload the demo code now. Click the upload icon to upload. When uploading the rx and tx led of balanbot near the USB socket.
We could see arduino ide says:"Done uploading." when it's done.
Open the serial monitor, also you will hear a "Beep", indicate the initial was succeed.
Note: When you replace the main IC ATMega1284P with new one. You need do this step.
Type CR; and press Enter to restore default EEPROM values.
Next we need calibrate motors, before calibrate motors you need place balanbot's wheel upward. Then type MC; and press Enter in Serial monitor.
Now will print the both motor encoder readings.
According the tips complete calibrate motors.
Now you got you balanbot ready to go.
Now pull out usb cable and plug in bluetooth dongle to balanbot USB host socket.