Homing and Zeroing
How a robot finds where its mechanisms are when it turns on. Hard stops, relative and absolute encoders, limit switches and hall effect sensors, and two-encoder turrets solved with the Chinese Remainder Theorem.
A motor's encoder tells the robot how far a mechanism has moved, but not where it started. Before an arm, an elevator, or a turret can go to a position, the robot needs a zero: a known position that every other position is measured from. Finding it is called homing or zeroing. If the zero is wrong, every setpoint, soft limit, and gravity feedforward is wrong with it.
This section covers the ways to find the zero. It starts with the simplest, starting the robot with each mechanism against a hard stop, and ends with solving a turret's angle from two geared encoders. The last page picks a strategy for each kind of mechanism.
What you need
Algebra. The page on two encoders uses remainders (clock arithmetic) and explains them first. Two pages have interactive widgets. It helps to know the mechanism types from Robot Mechanisms.
Where to start
Read the pages in order. Each one builds on the one before.
1. Why Mechanisms Need a Zero
What the motor knows at power-up, what a wrong zero breaks, when to zero, and how to know you're homed.
2. Hard Stops
Why every limited mechanism needs them, soft limits, zeroing at a known start, and homing against a stop.
3. Relative and Absolute Encoders
The motor's encoder, absolute encoders, the one-turn limit and the wrap point, offsets, and fused sensors.
4. Limit Switches and Hall Effect Sensors
Sensors that mark one position, zeroing on the fly, and homing a turret with a hall effect sensor and the rotor angle.
5. Two Encoders and the Chinese Remainder Theorem
Reading a turret over more than one turn with two encoders on pinions with different tooth counts.
6. Choosing a Strategy
Which strategy fits each mechanism, a checklist for a reliable zero, and how to test it.
Key ideas at a glance
| Idea | One-line summary | Page |
|---|---|---|
| The zero | The known position every other position is measured from. Setpoints, soft limits, and gravity feedforward all depend on it. | Why Mechanisms Need a Zero |
| Know you're homed | Track whether each mechanism has its zero. Show it, and don't let the mechanism move on its own until it does. | Why Mechanisms Need a Zero |
| Hard stops | Solid stops at the ends of travel protect the mechanism when the code is wrong, and give a free zero. | Hard Stops |
| Known start | A mechanism that starts every match resting on its hard stop needs no sensor. Set its position at the start. | Hard Stops |
| Stall homing | Drive slowly into the stop with a low stator current limit. Zero when the speed stays near zero while the stator current is high. | Hard Stops |
| Relative vs. absolute | The motor's encoder counts from wherever it powered up. An absolute encoder on the mechanism knows the angle right away. | Relative and Absolute Encoders |
| The wrap point | An absolute encoder's reading jumps by a full turn at one point. Keep the travel inside one turn, and the jump outside the travel. | Relative and Absolute Encoders |
| Index sensors | A limit switch or hall effect sensor marks one position. Zero when it triggers, slowly and from the same side. | Limit Switches and Hall Effect Sensors |
| Sensor plus rotor angle | A hall effect sensor finds the turret to within a few degrees, and the motor's rotor angle finds the exact angle inside that window. | Limit Switches and Hall Effect Sensors |
| Two encoders (CRT) | Encoders on 19- and 21-tooth pinions repeat at different places, so together they read a turret over almost two turns. | Two Encoders and the CRT |
| A quarter tooth | Accept a solve only when the two encoders agree within a quarter tooth of the turret gear. A wrong answer is off by about a full turn. | Two Encoders and the CRT |
Five Mechanisms to Tune
Why almost every FRC mechanism tunes like a flywheel, turret, arm, elevator, or linear deployment, how to tell which one you have, and the cases that need extra care.
Why Mechanisms Need a Zero
What a Kraken's encoder knows at power-up, what a wrong zero breaks, the ways to find the zero, when to set it, how it gets lost, and how to know a mechanism is homed.