Skip to content

Test and label the servos

On this page you only test and label the servos. No horns are fitted yet. Don’t use any servo that stutters, grinds, clicks or won’t turn a full 180°: once it’s in a leg, replacing it means taking the leg apart.

Horns go on later, on the shoulder and leg pages. Each servo then has to be at a known angle before its horn goes on: the horn has 25 teeth and six arms, so it only fits in a few positions, and fixing a joint later also means taking the leg apart. Those pages send you back to this rig to set the angle, so keep it set up.

This page uses servo_tool, an Arduino App Lab app for the UNO Q (firmware/servo_tool). It has a web page with a tab for each guide step that moves servos, so you press buttons instead of typing angles, and it also takes commands typed in App Lab’s Serial Monitor.

  1. Set up the UNO Q in Arduino App Lab if you haven’t yet (first boot, Wi-Fi, updates).
  2. Download servo_tool.zip. Don’t unzip it.
  3. In App Lab, click the + next to Apps and choose to import an app. In Import or install an App, click Import from computer, pick servo_tool.zip and click Install.
  4. Open the app and click Run. The first run takes a few minutes while the board downloads the compiler and the servo libraries (it needs internet access).
  5. Open the web page: App Lab shows its address while the app runs, or browse to port 7000 on the board, for example http://<your board's IP address>:7000. Any phone or computer on the same Wi-Fi works.

At power-up every output is off, so nothing moves until you press a button or type a command. The web page’s Test servos tab has a Test and an Off button for each channel, and a red All servos off button is always at the top. Once the legs are on the body, the Sequences tab moves the whole robot slowly: Legs straight down, and a Joint check that moves each joint in turn. In App Lab’s Console → Serial Monitor you can type the same things as commands, then Enter:

Command Does
h Help and the channel map
t 0 Test: sweep channel 0 between 45° and 135° twice, then stop at 90°
c Centre every channel (90°, 1500 µs)
a Move every channel to its assembly angle (table below)
a 4 Assembly angle for channel 4 only
s 4 120 Channel 4 to 120°
u 4 1600 Channel 4 to a 1600 µs pulse
o / o 4 Outputs off (all / one): the pulses stop, but a DS3218 keeps holding its last position while V+ is powered. Switch off the servo supply (the SZBK07’s switch, or the bench supply) to make it go limp. Don’t turn horns by hand while it holds: back-driving strains the gears
d Legs straight down, moving slowly (for a built robot on its stand)
x Stop a slow move where it is
  1. Switch on the servo supply.
  2. Plug one servo into channel 0: brown or black wire to the GND row. Push any horn loosely onto the shaft, without a screw, just as a pointer so you can see it turn. Take it off again afterwards.
  3. On the web page’s Test servos tab, press Test on channel 0’s row (or type t 0). The horn should sweep smoothly and quietly, twice, then stop and hold.
  4. Press 0°, then 180° (or type s 0 0, then s 0 180). The horn should turn about half a turn between the two. If it turns about three-quarters of a turn, it’s a 270° servo: the gait assumes 180°, so return it. (Many DS3218 listings are 270°.)
  5. Reject any servo that stutters, grinds, clicks, buzzes when holding still, or gets hot.
  6. Press Off (or type o), unplug it, take the pointer horn off, and put a ✓ on its case. Repeat for all twelve, always on channel 0.
One servo on channel 0 with a loose horn as a pointer: the test sweep, then end to end.

Write each servo’s job on a piece of masking tape on its case: FL-S, FL-H, FL-K, FR-S, and so on. That’s the label you need while building. Labelling the lead is optional: the plug is too small for tape, but a small flag of tape folded around the wire just behind it works, and it saves tracing wires when you plug them into the shield. If a lead ends up unlabelled, you can still identify it then by sending t <ch> and watching which joint moves. The channel each one plugs into is fixed by this map, and the firmware will use the same one:

▲ head (front)board stackSZBK07Front leftFront rightRear leftRear right01234567891011

Click or tab to a joint.

shoulderhipknee

Nothing to do here yet: the shoulder and leg pages send you back to this section. Leave the bench rig set up while you build. Before each horn goes on, plug that servo into its own channel (map above) and send a <ch>, so it’s powered and holding its assembly angle while you fit the horn. Then o <ch> and unplug it.

Each servo is fitted at a specific angle:

JointLeft legs (FL, RL)Right legs (FR, RR)Pose when fitting the horn
Shoulder90°
ch 0, 6
90°
ch 3, 9
Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate.
Hip120°
ch 1, 7
60°
ch 4, 10
Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded.
Knee180°
ch 2, 8
0°
ch 5, 11
Lower leg straight on from the upper leg, as if the leg were hanging straight down.

The knee angles put the servo at one end of its travel, with the leg straight. From there the knee can only turn one way, which folds the lower leg forward under the robot.

✓ Check off