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.
Load servo_tool
Section titled “Load servo_tool”- Set up the UNO Q in Arduino App Lab if you haven’t yet (first boot, Wi-Fi, updates).
- Download servo_tool.zip. Don’t unzip it.
- 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.zipand click Install. - 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).
- 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.
arduino-cli core install arduino:zephyrarduino-cli lib install "Adafruit PWM Servo Driver Library"arduino-cli compile -b arduino:zephyr:unoq firmware/servo_tool/sketcharduino-cli upload -b arduino:zephyr:unoq firmware/servo_tool/sketch -p <port>This loads only the sketch, so you get the Serial Monitor commands but not the web page. The sketch talks through the
Bridge’s Monitor (the Arduino_RouterBridge library, included with the UNO Q core), not Serial, which on the UNO Q
is the D0/D1 pins. Its output shows up in App Lab’s Console → Serial Monitor while an app is running.
To install the whole app from a terminal instead of App Lab’s import, copy the zip to the board and run
arduino-app-cli app import servo_tool.zip there.
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 |
Test each servo
Section titled “Test each servo”- Switch on the servo supply.
- 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.
- 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. - Press 0°, then 180° (or type
s 0 0, thens 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°.) - Reject any servo that stutters, grinds, clicks, buzzes when holding still, or gets hot.
- 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.
Label and assign
Section titled “Label and assign”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:
Click or tab to a joint.
Channel 0: Front left shoulder
- Assembly angle
- 90° (1500 µs) ·
a 0in servo_tool - Pose when fitting the horn
- Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate.
- Cable
- Short lead, straight up out of the shoulder servo mount into the body.
- Label
FL-S(e.g. masking tape on the plug)
Channel 1: Front left hip
- Assembly angle
- 120° (1833 µs) ·
a 1in servo_tool - Pose when fitting the horn
- Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded.
- Cable
- Out through the hole in the upper leg’s top shell, together with the knee lead, into the shoulder.
- Label
FL-H(e.g. masking tape on the plug)
Channel 2: Front left knee
- Assembly angle
- 180° (2500 µs) ·
a 2in servo_tool - Pose when fitting the horn
- Lower leg straight on from the upper leg, as if the leg were hanging straight down.
- Cable
- Extension cable; through the gap between the upper-leg shells, in the groove under the top shell, out of the top-shell hole.
- Label
FL-K(e.g. masking tape on the plug)
Channel 3: Front right shoulder
- Assembly angle
- 90° (1500 µs) ·
a 3in servo_tool - Pose when fitting the horn
- Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate.
- Cable
- Short lead, straight up out of the shoulder servo mount into the body.
- Label
FR-S(e.g. masking tape on the plug)
Channel 4: Front right hip
- Assembly angle
- 60° (1167 µs) ·
a 4in servo_tool - Pose when fitting the horn
- Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded.
- Cable
- Out through the hole in the upper leg’s top shell, together with the knee lead, into the shoulder.
- Label
FR-H(e.g. masking tape on the plug)
Channel 5: Front right knee
- Assembly angle
- 0° (500 µs) ·
a 5in servo_tool - Pose when fitting the horn
- Lower leg straight on from the upper leg, as if the leg were hanging straight down.
- Cable
- Extension cable; through the gap between the upper-leg shells, in the groove under the top shell, out of the top-shell hole.
- Label
FR-K(e.g. masking tape on the plug)
Channel 6: Rear left shoulder
- Assembly angle
- 90° (1500 µs) ·
a 6in servo_tool - Pose when fitting the horn
- Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate.
- Cable
- Short lead, straight up out of the shoulder servo mount into the body.
- Label
RL-S(e.g. masking tape on the plug)
Channel 7: Rear left hip
- Assembly angle
- 120° (1833 µs) ·
a 7in servo_tool - Pose when fitting the horn
- Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded.
- Cable
- Out through the hole in the upper leg’s top shell, together with the knee lead, into the shoulder.
- Label
RL-H(e.g. masking tape on the plug)
Channel 8: Rear left knee
- Assembly angle
- 180° (2500 µs) ·
a 8in servo_tool - Pose when fitting the horn
- Lower leg straight on from the upper leg, as if the leg were hanging straight down.
- Cable
- Extension cable; through the gap between the upper-leg shells, in the groove under the top shell, out of the top-shell hole.
- Label
RL-K(e.g. masking tape on the plug)
Channel 9: Rear right shoulder
- Assembly angle
- 90° (1500 µs) ·
a 9in servo_tool - Pose when fitting the horn
- Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate.
- Cable
- Short lead, straight up out of the shoulder servo mount into the body.
- Label
RR-S(e.g. masking tape on the plug)
Channel 10: Rear right hip
- Assembly angle
- 60° (1167 µs) ·
a 10in servo_tool - Pose when fitting the horn
- Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded.
- Cable
- Out through the hole in the upper leg’s top shell, together with the knee lead, into the shoulder.
- Label
RR-H(e.g. masking tape on the plug)
Channel 11: Rear right knee
- Assembly angle
- 0° (500 µs) ·
a 11in servo_tool - Pose when fitting the horn
- Lower leg straight on from the upper leg, as if the leg were hanging straight down.
- Cable
- Extension cable; through the gap between the upper-leg shells, in the groove under the top shell, out of the top-shell hole.
- Label
RR-K(e.g. masking tape on the plug)
Later: before each horn goes on
Section titled “Later: before each horn goes on”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.
Assembly angles
Section titled “Assembly angles”Each servo is fitted at a specific angle:
| Joint | Left legs (FL, RL) | Right legs (FR, RR) | Pose when fitting the horn |
|---|---|---|---|
| Shoulder | 90° ch 0, 6 | 90° ch 3, 9 | Leg hangs straight down, square to the body; horn arms square to the outer shoulder plate. |
| Hip | 120° ch 1, 7 | 60° ch 4, 10 | Upper leg at the standing angle (one horn arm, 60°, past the top arm), lower leg folded. |
| Knee | 180° 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.