KIPR · Botball Explorer
Activity Sections

Discovery · Coding Project 8

Arm and Claw Together

Two servos, one system. This is the biggest scoring project in the whole strand.

Project
Coding Project 8
Strand
Coding
Phase
Make It Grab
Time
One class period
What You Are Doing
Adding a claw to your arm, learning to grab, carry, and release — then stacking cubes and dropping poms into baskets.
Mission Anchor
Mission 12 complete · Mission 3 base · Mission 11 base · Mission 13 bonus — 37 points
Before You Start
Project 7 — and your claw must be built. That build lives in the Systems strand.
What You Need
Before you start: type your PIN in the box at the top of the page. Your teacher gave you this number. When you finish, press Submit & Download to turn in your work and save a copy.

Try It — Be the Robot

A claw is an — the part of the robot that does work on the world. In Project 6 your effector was the front of the robot, and it could only shove. A claw can hold.

Two servos, two jobs

ServoIts jobIts two or three positions
ArmRaise and lowerup · horizontal · down
ClawOpen and closeopen · closed

Now act it out

Put a cube on the table in front of you. Pick it up with one hand, move it, and set it back down.

Do it again — slowly this time — and write down every separate movement, in order. Do not skip anything, even the parts that feel too obvious to write.

StepWhat my hand did
1
2
3
4
5
6
7

Try swapping any two of your steps. Pick a pair and describe what would go wrong.

That List Is Your Program

Grabbing is not one action. It is five or six small ones that only work in one order. Close the claw before the arm is down and you grab nothing. Raise the arm before you close the claw and you lift nothing.

The whole skill in this project is sequence.

Learn It — Five Numbers and an Order

What a claw has to do to hold something.
Find the positions for up, down, horizontal, open and close.
You already know every command you need. Nothing new gets introduced here — you just use two instead of one.

Write down all five positions

Put them at the top of every program, in the name = number format:

// Your positions will be different --- do not copy these!
// arm        = 0
// up         = 230
// horizontal = 1000
// down       = 1234
//
// claw       = 3
// open       = 1246
// closed     = 340

Notice the first line of each group is the , not a position. You now have seven numbers to keep straight, and every one of them is buried somewhere in your code.

Preset both servos

Project 7 taught you the preset trick for one servo. With two, it matters twice as much — an arm that slams down and a claw that snaps shut is a good way to break something.

// Arm up
set_servo_position(0, 230);
// Claw open
set_servo_position(3, 1246);
enable_servos();
msleep(1000);

Arm up, claw open, then enable. The robot wakes up in a known, safe shape every single time.

The grab sequence

Code / partWhat it means
1. Arm up, claw openPreset, then enable. Safe starting shape.
2. Drive to the objectArm stays up and out of the way while driving.
3. Stop — ao()Do not grab while still rolling.
4. Arm downClaw comes down around the object. Wait for it.
5. Close clawNow, and only now, grip.
6. Arm upLift. The object comes with it.

Every single grab in this project is that sequence. You will type it four times today. Remember how that feels — Project 12 is about fixing it.

Live judged or final position — this changes your strategy

Look at how a mission is scored, not just what it asks for. Two missions can want the same thing and mean very different things by it.

Code / partWhat it means
Live JudgedA judge watches it happen during the match. It counts the moment it is true — even if it falls apart afterwards. Your robot may be holding it.
Final PositionScored after the match ends, from whatever is left on the field. Your robot has to let go and the result has to survive on its own.

Robot Support Is Allowed --- Sometimes

The definition says support from a robot is permitted. So for a live-judged stack, your claw can still be holding the cube in place when the judge sees it.

For a final-position stack, that is worth nothing. Let go, back away, and the stack has to stand by itself.

Setting an object down is harder than picking it up

Opening the claw is easy. Opening the claw without dragging, tipping, or flicking the object is the actual skill.

  • Lower the arm before you open, so the object has a short drop, not a long one.
  • Open, then pause, then back away. Backing off while still opening drags the object with you.
  • Back straight away, not on a curve. A curve sweeps the claw sideways through what you just placed.

⚠ Basket Exclusivity

Mission 11 uses orange poms. Mission 15 (Project 12) uses blue poms. If your team attempts both, they must go in different baskets. Decide now which basket belongs to which mission, and write it down.

Do It — Grab, Carry, Stack

Step 1 — Find your claw positions

Servo Widget again. Your arm numbers are already on your Project 7 card — now add the claw.

PositionNumberNotes
Claw open
Claw closed on a cube
Claw closed on a pom

⚠ Closed Does Not Mean All the Way Shut

“Closed” is whatever number grips the cube — not the smallest number the claw can reach. If you send the claw past where the cube stops it, the servo strains against the cube and burns out. Find the number that just grips, and stay there.

A pom squashes, a cube does not. That is why they get different numbers.

Step 2 — Grab it

Create a new project called Grab. No driving at all — place a cube inside the open claw by hand.

Write the first. Two rules: the arm starts up and the claw starts open.

// 1. Preset arm up and claw open, then enable
// 2. Move the arm down
// 3. Close the claw
// 4. Move the arm up
// 5. Disable servos

Did you need an msleep() between every step, or only some of them? How did you decide?

Step 3 — Go grab

Create a new project called Go Grab. Now add driving — the cube sits a short distance away.

// 1. Preset arm up, claw open, enable
// 2. Drive forward to the cube
// 3. Stop --- ao()
// 4. Arm down
// 5. Close claw
// 6. Arm up
// 7. Disable servos

What happened the first time? Most robots either stop too early, stop too late, or push the cube away before the claw gets down.

Step 4 — Put it down without wrecking it

Add to the end of your program: carry the cube somewhere, set it down, and back away leaving it standing.

What did you have to change to stop dragging the cube when you backed off?

Step 5 — Mission 13 Bonus — Your First Stack for 7 points

Watch Mission 13 video

Base Mission

1 point Live judged

All three Unstraight Cubes satisfy the definition (cubes are the black line).

Bonus Mission

7 points Live judged

Two Unstraight Cubes form a scoring stack — one Unstraight Cube is another.

Advanced Bonus

13 points Final judged

All three Unstraight Cubes form a scoring stack. All cubes must originate from the Unstraight Cube area.

Scores

  • All three Unstraight Cubes are the black line.
  • One Unstraight Cube is another Unstraight Cube.
  • All three Unstraight Cubes participate in valid relationships (traditional stack or pyramid).

Does Not Score

  • One or more Unstraight Cubes are touching the black line.
  • Two Unstraight Cubes touching side-by-side without .
  • An Unstraight Cube stacked with a cube from another mission area.
  • Only two Unstraight Cubes participate in the Advanced Bonus stack.
Start here because it is the easiest stack on the field — the cubes are close together, and it is live judged, so your claw can still be holding the top cube when the judge looks.

Step 6 — Mission 12 — Stack and Grab for 16 points

Watch Mission 12 video

Base Mission

11 points Live judged

Two spilled cubes form a scoring stack — one spilled cube is another spilled cube. Both cubes must originate from the spilled cube area.

Bonus Mission

5 points Final judged

The scoring stack remains intact and the lower cube of the stack is touching the black line.

Scores

  • One spilled cube is another spilled cube.
  • A robot is supporting one or both cubes while the relationship exists.
  • The scoring stack exists and the lower cube is touching the black line.

Does Not Score

  • Two spilled cubes touching side-by-side.
  • A spilled cube stacked on a cube that did not originate from the spilled cube area.
  • The stack no longer exists at final scoring.
  • The upper cube is touching black line but the lower cube is not.
You already know how to get here — that was Project 5. Reuse your approach code and add the grab.

Two Different Jobs in One Mission

The base is live judged, so your claw may still be holding the top cube. The bonus is final position — you must let go, back off, and the stack has to survive until the match ends.

Get the base first. Then work on letting go cleanly.

Read the “does not score” list again. Why does the lower cube have to be the one touching the line?

Step 7 — Mission 3 — Mixed Freight for 7 points

Mission 3

Mixed Freight

Watch Mission 3 video

Base Mission

7 points Live judged

Create one stack consisting of a Green Cube a Yellow Cube, or a Yellow Cube a Green Cube.

Bonus Mission

9 points Live judged

Create a second stack consisting of a Green Cube and a Yellow Cube.

Advanced Bonus

13 points Live judged

Create two stacks such that one contains a Green Cube a Yellow Cube, and one contains a Yellow Cube a Green Cube (opposite color arrangements).

Scores

  • Green on Yellow or Yellow on Green — both satisfy the Base Mission.
  • Two valid mixed-color stacks satisfy the Bonus Mission.
  • Two stacks with opposite color arrangements satisfy the Advanced Bonus.

Does Not Score

  • Green on Green or Yellow on Yellow — same-color stacks do not score.
  • A single three-cube stack does not count as two scoring stacks.
  • Any cube used in one stack may not be reused for another stack.
Either order works for the base. Green on yellow, yellow on green — both score. Same colour on same colour scores nothing.

Step 8 — Mission 11 — Hazard Disposal for 7 points

Mission 11

Hazard Disposal

Watch Mission 11 video

Base Mission

7 points Final judged

One Orange Pom is a basket.

Bonus Mission

7 points Final judged

Two or more Orange Poms are the same basket.

Scores

  • One Orange Pom is a basket.
  • One Orange Pom partially extends into the interior space of a basket.
  • Two or more Orange Poms are the same basket.

Does Not Score

  • An Orange Pom is touching only the outside of a basket.
  • An Orange Pom is resting above a basket without extending into it.
  • One Orange Pom is in Basket A and one is in Basket B — does not satisfy Bonus.
A different grip problem. Poms squash, so your closed position for a pom is not the same as for a cube.

Is Generous

A pom only has to partially extend into the interior of the basket. It does not need to be sitting neatly at the bottom. But touching the outside of the basket, or resting on top of it, is not .

Which basket did you use, and which one are you saving for Mission 15?

Step 9 — Run the whole thing five times

Chain all four missions into one program, same as Project 6 — banners, one section at a time.

RunM13 bonusM12 baseM12 bonusM3M11Points
1
2
3
4
5

Which grab was least reliable, and what made that one harder than the others?

Score It — Checkpoint

My best run

Mission partScored?Points
Mission 13 — Bonus (two unstraight cubes stacked)7
Mission 12 — Base (two spilled cubes stacked)11
Mission 12 — Bonus (stack survives, lower cube on line)5
Mission 3 — Base (mixed-colour stack)7
Mission 11 — Base (orange pom in a basket)7
My total37

My full servo card

Seven numbers now. Copy them somewhere you will not lose them.

SettingValue
Arm servo port
Arm up
Arm horizontal
Arm down
Claw servo port
Claw open
Claw closed on a cube
Claw closed on a pom
Basket I used for Mission 11

Live or final?

Say how each one is judged, and what that means for whether your claw can still be holding it.

Mission partLive or final?Can the robot be holding it?
Mission 12 Base
Mission 12 Bonus
Mission 11 Base

Can you do it again?

Think about it

Count how many times the six-step grab sequence appears in your program. Now imagine your claw’s closed position changes by 30. How many separate places would you have to edit?

A judge tells your team the Mission 12 stack scored the base but not the bonus. Your robot did everything you programmed. What most likely happened between the judge seeing it and the end of the match?

Your robot can now drive, turn, grab, carry, stack, and release. Everything it does is still measured in time — how long to push, how long to turn. What would change if it could measure in distance instead?

Next

You are carrying seven numbers around in comments, retyping them everywhere, and one rebuild would break all of it.

In Project 9 — Names for Your Numbers, those comments become real. You give each number a name once, and the whole program starts using it.

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