Base Mission
7 points Live judgedA robot is Botguy.
Discovery · Coding Project 7
A motor that goes to a place instead of just going. Seven points for touching one plastic guy.
Student PIN:
Hold a wheel motor in one hand and a in the other. They look similar. They are not.
| Wheel motor | Servo | |
|---|---|---|
| Wires | Two — red and black | Three — orange, red, brown |
| Plug | Two metal prongs | Black plastic plug |
| How far it turns | Round and round, forever | About half a circle, then stops |
| What you tell it | How hard to push | Where to go |
The Real Difference
You never tell a wheel motor where to stop — only how hard to push and for how long. A servo is the opposite: you tell it a position and it goes there and holds.
That is exactly what an arm needs. “Up” is a place, not a push.
| Code / part | What it means |
|---|---|
| S — orange wire | Signal. This is the wire that carries the position you asked for. |
| + — red wire | Power. |
| − — brown wire | Ground. Remember it as: the ground is down, and down is negative. |
Plug your servo into port 0, brown wire toward the minus side.
On the Wombat’s Home Screen, tap Servos. Enable port 0 and drag the slider slowly.
Now let go of the slider and try to push the arm with your finger. What happens?
It Pushes Back
A servo does not just move to a position — it holds that position and fights anything that tries to move it. That is why it can lift something and keep holding it there.
Notice that we are counting from zero again — same as the motor ports.
Position 1024 is the middle. That is where a servo goes by default.
⚠ Never Below 150 or Above 1900
The numbers go to 2047, but your servo physically cannot reach the ends. Sending it past its limit makes it strain against its own stop, and it will burn out. A burnt servo does not come back.
Stay between 150 and 1900. Always.
⚠ Servo command range vs classroom safe limits
The set_servo_position() command accepts positions 0 to 2047 (about 180°). Classroom hardware must stay in the safe band 150–1900, with center near 1024. Sending commands into the burn zones (below 150 or above 1900) can destroy the servo.
| Code / part | What it means |
|---|---|
enable_servos(); | Turns on all four servo ports. Nothing works until you call this. |
set_servo_position(0, 800); | Sends the servo in port 0 to position 800. Two — port first, then position. |
msleep(500); | Gives the servo time to actually get there. Not optional. |
disable_servos(); | Turns the servo ports off at the end of your program. |
Why msleep Again?
Same reason as the wheel motors. set_servo_position() tells the servo to start moving — it does not wait for it to arrive. Without an msleep(), the next line runs while the arm is still halfway there.
When you call enable_servos(), every servo immediately jumps to whatever position it was in last time. Which might be anywhere.
If your arm was down when you last ran a program, it will slam down again the instant your new program enables the servos — possibly into the field, or into a cube, or into your hand.
The Preset Trick
Call set_servo_position() before enable_servos(). The servo then wakes up already knowing where to go, and moves there instead of to its old position.
// Risky: arm snaps to last position
enable_servos();
set_servo_position(0, 524);
// Better: arm starts at 524
set_servo_position(0, 524);
enable_servos();Position numbers mean nothing on their own. set_servo_position(0, 1746); tells you nothing about what the arm is doing. every one:
// up = 524
// horizontal = 1566
// down = 1746
Use the format name = number. There is a reason for that — in Project 9 those names stop being comments and become part of the program.
Mission 9 A robot is Botguy. Botguy is outside the enclosure AND is touching the warehouse floor.Recover Botguy
Watch Mission 9 video
Base Mission
7 points
Live judgedBonus Mission
9 points
Live judgedScores
Does Not Score
Using the widget, find the number for each of these and write it down. Stay inside 150–1900.
| Arm position | Number | What it looks like |
|---|---|---|
| Up (straight up) | ||
| Horizontal (level) | ||
| Down (not touching the floor) |
⚠ Down Means Nearly Down
Do not find a “down” that presses the arm into the floor. The servo will keep straining to reach a position it cannot get to, and that is exactly how servos die.
Create a new project called Wave. Move the arm to all three positions with a one-second pause between each. Put your position comments at the top.
#include <kipr/wombat.h>
int main ()
{
// up = 524
// horizontal = 1566
// down = 1746
// Preset to down
set_servo_position(0, 1746);
enable_servos();
msleep(1000);
// Horizontal
set_servo_position(0, 1566);
msleep(1000);
// Up
set_servo_position(0, 524);
msleep(1000);
disable_servos();
return 0;
}Use your numbers, not these. and run.
Delete all three msleep() lines. Compile. Run. Watch closely.
What did the arm do?
Put them back.
Run your Wave program so the arm finishes up. Now swap lines 9 and 10 so enable_servos() comes first, and run it again.
What did the arm do the instant the program started?
Why could that be a problem in the middle of a match?
Put it back the safe way round.
Create a new project called Reach. Practice away from the field first: put any object a short drive away, then drive to it and touch it with the arm.
Two rules, borrowed from how the mission works:
// 1. Arm starts up
// 2. Drive to the object
// 3. Stop
// 4. Lower the arm to touch it
// 5. Raise the arm again
Onto the field. Create a new project called Botguy.
Botguy is inside the enclosure. Your robot has to reach in and make contact — direct contact, arm to Botguy.
means direct contact
Two objects are when they are in direct physical contact. Contact through something else — a cube, a wall, another field element — does not count. Your arm has to reach Botguy himself.
| Try | What I changed | Did the arm reach him? |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 |
| Run | Touched Botguy? |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
| Mission part | Scored? | Points |
|---|---|---|
| Mission 9 — Base (robot Botguy) | 7 | |
| My total | 7 |
Keep these next to your driving numbers. Everything from here uses them.
| Setting | Value |
|---|---|
| Servo port my arm is in | |
| Arm up position | |
| Arm horizontal position | |
| Arm down position | |
| Arm position for touching Botguy | |
| msleep needed for a full up-to-down move |
A wheel motor takes a power. A servo takes a position. Why does an arm need a position and a wheel does not?
Your position numbers are scattered through your program as bare numbers with comments next to them. If you rebuilt your arm slightly differently tomorrow, how many places would you have to change?
You can touch Botguy but you cannot get him out of the enclosure. What exactly can a claw do that a single arm cannot?
In Project 8 — Arm and Claw Together, a second servo joins the first. Two servos working as one system means you can finally grab, carry, and release — and a whole set of missions opens up at once.
KIPR · Botball Explorer — Discovery Projects · © KISS Institute for Practical Robotics 1997–2026
When you are finished, press the button to turn in your work and save a copy.
KIPR · Botball Explorer · Discovery