How-to
Reseat servo horns at the startup pose on a robot arm
Short answer
Reseat every servo horn with the arm in its startup pose, straight up, before you touch software. A horn seated one spline tooth off shifts each commanded angle by 360 divided by the tooth count — typically 10 to 25 degrees on hobby-class servos — and offsets cannot recover travel the link geometry clips at an end stop. Trim only the residual fraction of a tooth with per-joint limits and a linear map.
On this page
- Why does a freshly programmed arm land at the wrong angle?
- Why can't software offsets recover a horn seated off the reference?
- Example: how far off is one spline tooth on a 25-tooth servo horn?
- How do I reseat a servo horn at the startup pose?
- How do I find each joint's free travel and set its limits?
- How much error should software trim after a reseat?
- Example: how do I map a 0 to 180 command onto a 158 to 176 degree window?
- How do I verify the arm holds both ends without buzzing?
- Questions asked
Wrong angles on a freshly programmed hobby arm are usually not a software problem. The servo horn is seated on the output spline a tooth or more away from the true reference, so every commanded angle lands shifted by the same whole-tooth step, and no offset can recover travel the link geometry clips at an end stop. Reseat each horn with the arm in its startup pose — straight up — then set per-joint limits from a measured free-travel test and reserve a linear map for the residual fraction of a tooth. This article gives the diagnosis, the arithmetic, the reseating steps and the verification.
Why does a freshly programmed arm land at the wrong angle? #
Because the horn, not the sketch, sets the mechanical zero: a horn seated one spline tooth off shifts every commanded angle by 360 degrees divided by the tooth count — typically 10 to 25 degrees on hobby-class servos — and it shifts every position by that same amount.
Two fault classes hide behind "wrong position", and the servo's sound and temperature separate them before you open the sketch:
| What you observe | Fault class | What it means |
|---|---|---|
| Joint settles quietly at a consistent error across the whole range | Reference offset | Horn seated one or more spline teeth from the commanded reference |
| Joint buzzes or warms near one commanded end | Travel clipping | Link meets a hard stop or a neighbor link before the servo reaches the commanded angle |
| Reaches both ends but the arm is not vertical at startup | Offset only | Range intact; the reference is merely shifted |
| One end blocked, the other free | Offset large enough to clip | Reseat first; trimming alone forfeits usable range |
Sound and heat make the call: a clipped hobby-class servo simply draws stall-level current and buzzes against the stop, while a closed-loop servo axis in the same geometric trouble reports it as a following-error alarm, which the article on servo drive following error fault troubleshooting works through end to end.
Why can't software offsets recover a horn seated off the reference? #
An offset shifts the setpoint, not the structure: the servo closes its position loop on its own output shaft and knows nothing about the link, so code can trim the fraction of a tooth left after reseating but cannot give back travel the links block at a hard stop.
The horn engages the output shaft through a splined interface, so the link installs only at discrete angular steps, one per spline tooth. Seat it one step away and every angle on that joint moves by that whole step. Where the shift pushes the link's free arc past a hard stop — the frame, a neighbor link, the end of the intended arc — the servo commands a position the structure blocks. It sits there loaded: the output stage heats and the gear train carries the stall torque for as long as the command stands. Reseating restores margin at both ends at once, which is why it comes before any trim.
Example: how far off is one spline tooth on a 25-tooth servo horn? #
On an illustrative 25-tooth spline one tooth is 14.4 degrees, because 360 degrees divided by 25 teeth is 14.4, and two teeth of seating error is 28.8 degrees — larger than any software trim should ever be asked to absorb.
Worked example with illustrative inputs: a 25-spline horn and a link whose free arc ends at 185 degrees, measured on the physical unit. The real tooth count comes from the datasheet of the servo in that joint; these figures show the size of the error, not a component rating.
- Per-tooth step: 360° ÷ 25 teeth = 14.4° per tooth
- Seated two teeth off: 2 × 14.4° = 28.8° of shift on every commanded angle of that joint
- Startup pose: the commanded 90° (straight up) actually sits at 90° − 28.8° = 61.2°
- Top of travel: a commanded 170° asks the shaft for 170° + 28.8° = 198.8°, and with the free arc ending at 185°, the last 198.8° − 185° = 13.8° of command stalls the servo against the stop
Decision: reseat, do not offset. A −13.8° trim that clears the top end drops the startup pose to 61.2° − 13.8° = 47.4°, so the offset trades the top end's margin for a worse reference; reseating recovers both ends at once.
How do I reseat a servo horn at the startup pose? #
Power the arm up in its startup pose, support the link, loosen one horn screw at a time, set that link true, and retighten — one joint at a time, because each joint's reference is the neighbor set before it.
- Load the library's startup-pose example (
testBraccio90on the common desktop training arm) and power up so every servo drives to straight up and holds there. - Support the link you are working on by hand before touching its screw: a link released from the spline falls under its own weight and shocks the gear train.
- Loosen that joint's horn screw, rotate the link to true vertical relative to its neighbor, and retighten with the link held exactly there.
- Take the nearest tooth, not a wished-for angle: seating close to the reference keeps usable range on both sides of the joint.
- Repeat joint by joint up the arm, then power-cycle and confirm the same straight-up pose returns.
- With power off, swing every joint by hand through its full arc to confirm free movement before commanding anything.
How do I find each joint's free travel and set its limits? #
Step the commanded angle slowly from the startup pose toward each end and log the value on the serial monitor where motion stops or the servo starts to buzz: those logged angles are that joint's software minimum and maximum.
Move in small steps and pause long enough for the joint to settle, noting both the angle where motion stops and the angle where the buzz starts — take the conservative one. Hard-code those angles as the joint's minimum and maximum in the sketch. The arm's own catalog lists its intended movement and angle ranges: take those as the first reference, then confirm them on the physical unit, because a previously assembled arm rarely matches the catalog seating exactly.
How much error should software trim after a reseat? #
Less than half a tooth. Keep total software correction under half the per-tooth step — under 7.2 degrees on the 25-tooth example, where a tooth is 14.4 degrees — because a larger residual means the horn is still seated wrong and you should reseat again rather than stack offsets.
The order of correction is mechanical first, protective second, cosmetic third: the reseat removes the bulk shift, the per-joint limits keep commands out of the stops, and a linear map only reshapes the command range onto the window the joint actually has. A map compresses resolution, so let it carry the residual fraction of a tooth, never the bulk shift.
Example: how do I map a 0 to 180 command onto a 158 to 176 degree window? #
Scale the command by the window: a gripper whose free window runs from 158 to 176 degrees is 18 degrees wide, so each input degree moves the output 0.1 degree, and the midpoint command of 90 degrees lands at 167 degrees.
map() and constrain() are documented library calls; cmd, lo, hi and out are illustrative variables with the types and initial values shown:
int cmd = 90; // commanded angle in degrees, initial value 90
int lo = 158; // measured free-travel minimum in degrees
int hi = 176; // measured free-travel maximum in degrees
cmd = constrain(cmd, 0, 180);
int out = lo + (long)cmd * (hi - lo) / 180;
The test that proves the result: print out while stepping the command — cmd = 0 prints 158, cmd = 90 prints 158 + (90 × 18) ÷ 180 = 158 + 9 = 167, cmd = 180 prints 176, and cmd = 200 clamps through constrain() and prints 176.
At 0.1 degree of output per input step this suits a gripper; a joint that needs fine positioning deserves a wider window from a better seating, not a narrower map. Converting a logical command into the units an actuator actually consumes is the same arithmetic in every medium — calculating step and direction servo pulses per unit is this same map worked for position counts.
How do I verify the arm holds both ends without buzzing? #
Command each joint to its stored minimum and maximum in turn and hold briefly: silent and cool at both ends means the limit has margin, while buzzing or warmth means the limit sits beyond the real travel, so pull it inward a few degrees and repeat.
Then command the startup pose and check every link visually vertical. Sort whatever error remains by its signature:
- A constant error at every commanded angle is seating: reseat and keep the trim under half a tooth.
- Buzzing or heat at one commanded end is a limit set beyond the measured free travel: pull that limit inward.
- Every move long or short by the same factor is a scaling constant, not the horn — the fault behind a stepper axis that travels 1.25 times the commanded distance, where the fix is the counts-per-unit constant.
- Silent but still off target after a verified reseat: the gear train or the servo itself is worn, so stop commanding that joint and replace the servo.
With horns reseated at the startup pose, limits measured on the unit, and no more than half a tooth of trim in the sketch, the arm returns to the pose its own library assumes, and every angle you command afterwards means what it says.
Questions asked
How far off is one tooth if my servo's datasheet shows a different spline count?
Divide 360 degrees by the tooth count in the datasheet. Fifteen teeth give a 24 degree step, thirty-six teeth give 10 degrees, and the 25-tooth example in this article gives 14.4 degrees. Whatever the count, one tooth is a large slice of a hobby joint's useful arc, which is why reseating recovers range that trimming cannot.
Should the horn sit 90 degrees to the servo case instead?
That is the centering convention for single-purpose servos such as RC steering: apply the center pulse, then set the horn 90 degrees to the case so travel comes out equal both ways. An arm joint has a better reference — the library's straight-up startup pose — because the pose, not the case, is what the rest of the machine assumes.
The arm lands slightly differently depending on which direction each joint approaches from. Is the horn seated wrong?
No. A seating error is constant and appears identically from both directions. A pose that shifts with approach direction points to gear backlash or a loose horn screw: tighten the output screw and re-test from both directions. If the direction dependence survives a tight screw and a fresh reseat, the gear train in that servo is worn.
Can I keep the offsets a previous user hard-coded and just reseat around them?
Zero them first. Offsets and limits written in under the previous seating add to the new one, so the arm double-corrects and a joint can stall at an end again. Reseat with a bare startup-pose sketch, measure the free travel fresh, and re-enter only the residual trim.