Regular & Super Speed servo setup and calibration
This example will show you how to trim the regular & Super Speed 360 degree servos to your controller.
Items you will need for this project
Prerequisits
This example assumes you are familiar with the Arduino IDE, connection and uploading. If not we suggest you visist
www.arduino.cc and read their getting started and learning guides.
Overview & Descripton
The 360 servo differs from regular ervos in the fact that it will rotate a full 360 degrees in either direction. It is also speed controllable. All controllers can output a certain center value and these do differ. So to eliminate creep and lock the servos's center we need to know what the particular servos center value is (they do differ from servo to servo).
For example.
Using an Arduino, we want to be able to center the servo. With a 360 degree servo the center is the full stop mode. To do this we simply write a value of X to the servo from the Arduino. The servo is trimmed so that when it receives a value of X it stops. The value of true center may differ from servo to servo, so we must get this calibration value from the servo and use it to center it.
The circuit
White wires are shown in grey for clarity.
Make up this circuit on your breadboard. The wire colours are just for clarity on the diagram and do not relate to the jump wire kit colours, however the wires on the servos are true. The circuit connects the Arduino to the servos.
Pay attention to the polarity, and the servo connections. Double check all your connections are correct before connecting power. Short circuits and reverse polarity can damage the Arduino, sensors and servos.
Setup code
(Arduino only) This code will set the Arduino so that is can receive serial data from the calibration application (see below).
// BotBuilder 360 Servo calibration.
#include <Servo.h>
Servo servo;
void setup() {
servo.attach(10);
Serial.begin(19200);
}
void loop() {
static int v = 0;
if ( Serial.available()) {
char ch = Serial.read();
switch(ch) {
case '0'...'9':
v = v * 10 + ch - '0';
break;
case 's':
servo.write(v);
v = 0;
break;
}
}
}
Application
(Windows Only)
Download the application
Using this application connect your Arduino to the computer via the USB cable. Select the current com port the Ardunio is on and click "Connect". Then move the Servo Control slider bar untill the servo stops. To ensure you have a good center value, move the slider a few notches left and right. You will find a "dead" zone around the late 80's to early 90's. Record this value, a sticker on the servo with this value is a good idea. This means that when you come to use the servo in your applications you can easily refer to it's center value.
Other platforms
You can still find the center value for the servo. To do this load up an application that can communicate with a serial device, you can even use the serial monitor in the Arduino IDE. Connect at 19200 baud, and then send the following command: s90 The letter "s" is a delimiter and the following numerical value is the angle of rotation to send. To find the center, send 's' + XX untill the servo stops moving, example:
s88 = creep
s89 = creep
s90 = creep
s91 = creep
s92 = stopped
Other uses
Using the above application, you can also find the optimum speeds for different applications. Sometimes you may want to rotate very slowly, or quickly. Using the app you can easily find the correct values. The app also makes a good servo tester!