IMPORTANT Edit: A huge thanks to @Bill SCHONFELDER who has carefully put the calibration procedure through its paces. Bill spotted a problem that I had not come across which has now been corrected. The Blockly code has been updated, the GUI did not need changing.
Please remember that this code is for Windows based machines only and will not run correctly on an emulator on the Mac. For Linux or Mac OSX you will need to build the application from the source code using Processing. All of the files are available for you to do this in the single zip file attached.
Thank you Bill!!
OK. You have carefully followed the instructions on how to build Otto and have made sure that all the servos are centralised (set at 90 degrees) before you attach the horns. You are now at the very exciting moment where you check to see how Otto moves and dances and so you upload your first simple Blockly code.
:( What happened? Why did the legs and feet move out of position? Otto doesn’t look right and doesn’t move smoothly.
Do not be disappointed and do not worry! This is completely normal and happens in every Otto build. This is the stage where you need to adjust the central positions of the servos using a simple process called calibration. This will only need to be done once and then the correct positions will be remembered every time you turn on your Otto.
If you are unsure about any of the following instructions, please watch the short video tutorial that guides you through the calibration procedure:
Video: to be updated.
In the zip file attached you will find two folders and one Blockly file.
Stage 1: Blockly code for Otto
To calibrate Otto, you will first need to upload the Otto_Servo_Calibration.bloc code to Otto. Once the uploading is complete, unplug the USB connection to Otto.
Stage 2: Servo Calibration GUI
You will now need to run the Servo Calibration program. Make sure that the USB is unplugged. Depending on your Windows platform, you will need to run either the 32- or 64- bit executable file contained in its relevant folder. Please leave the file in its folder - the program will not run if it does not have access to the data files. The folders are quite large so that no additional software needs to be installed; this has been checked on three Windows 10 laptops but not on a 32-bit system.
On start up you should see a red cross by the USB label at the top of the interface. Plug the USB into Otto and the red cross should turn into a green tick when the program has recognised that the USB connection has been made (this might take a second or two). If you forgot to unplug the USB, you will need to close the program, unplug the USB and start the program again. Then plug in the USB. You can now calibrate the servo positions so the the legs and feet are correctly aligned. The slider allows for large changes in the angle and the +/- buttons much finer control on the position of each servo.
When the servos on Otto are correctly aligned, click on 'Walk Test' to see how Otto moves. If further fine adjustments are required, they should be done now and the walk test repeated. Be careful that the USB cable does not interfere with Otto's movement.
When you are happy that everything is aligned, click 'Save'. A tick and properly aligned Otto will appear on the interface. Your Otto will produce a happy sound (if you have connected the buzzer) and dance.
CONGRATULATIONS!! You have successfully calibrated Otto's servos. The positions have been saved to Otto and will not need to be calibrated again unless you change the Nano or any of the servos.