Phase 06 · Week 22 · 105 minutes

Day 152: Calibrate joints, verify frames, and perform low-speed teleoperation

Real hardware bring-up · Treat the physical robot as an unreliable distributed system.

Chapter 22 · Bring up real robot hardware through bounded, evidence-led gates

Today in the field story

One problem, then the next

Bench Zero receives a cardboard joint and a simulated encoder. You version joint identity, sign, zero, scale, limits, frame relationship, and calibration evidence against an independent reference. A leased one-axis teleoperation rehearsal uses bounded increments, freshness, exclusive authority, visible latency, cancellation, and measured simulated stopping. The browser or controller UI is never the sole stop owner. Real calibration and motion remain deferred until platform procedures, supervision, workspace controls, and safe-energy commissioning are approved.

Why now

Wrong sign, zero, scale, or joint identity can invalidate every later command and dataset.

Ignore today

Do not move a real joint or infer physical stopping from simulation.

Unlocks next

A versioned calibration and teleoperation contract for collection rehearsal.

Understand

Build the physical picture first

Calibration gives raw feedback physical meaning, while first-motion discipline tests one predicted identity, sign, scale, frame, limit, lease, and stop at a time.

Calibration is a versioned mapping, not a button press. For each joint record the physical joint identity, encoder identity, raw representation, zero or home reference, positive direction, counts-to-unit scale, wrap behavior, gear ratio, offset, hard range, verified software range, temperature or load condition, procedure, tool, operator, timestamp, and resulting artifact. Homing establishes a reference by an approved motion or sensor sequence; an absolute encoder may retain a position code across startup. Neither one automatically proves the joint name, sign, scale, mechanism alignment, or robot frames.

Verify meaning against an independent physical reference. A marked cardboard hinge, protractor, dial indicator, fixture, surveyed point, or manufacturer gauge can challenge what software reports. Check several points in both directions to reveal offset, reversed sign, wrong joint order, nonlinear scale, backlash, hysteresis, wrap, or missed counts. Then verify the URDF joint axis and parent-child transform: a positive reported change should produce the predicted link motion and tool displacement. Consistent numbers in a self-referential software loop can all be consistently wrong.

Design low-speed teleoperation as a leased request path even in simulation. The operator must hold an enabling or dead-man control; commands have bounded magnitude, rate, acceleration, duration, workspace, joint range, and age; loss of focus, release, stale state, disconnect, or lease expiry ends command renewal at the robot-side owner. Show requested, accepted, and measured values separately. One axis, one small increment, clear virtual space, and a written prediction make identity and sign errors visible before combined motion. An application speed cap or browser dead-man control is not safety-rated unless the complete implementation is designed and validated as such.

A real first-motion procedure is platform- and site-specific, so this lesson does not prescribe one. Before powered movement, qualified owners must have completed mechanical and electrical inspection, load and mounting review, approved safeguards, energy control, manufacturer setup, calibration prerequisites, safe modes, independent stop verification, work-area control, recovery, communication plan, and authorization. The learner rehearses the sequence only in simulation. Real observations, if later authorized, must be captured through the approved procedure and may invalidate calibration immediately when hardware, firmware, mounting, tool, transmission, or encoder relationships change.

Words you need

Name each idea precisely

Calibration artifact

A versioned record of the mapping parameters, identities, conditions, method, references, results, residual error, and approval that give raw measurements physical meaning.

Physical example:

Joint 2's file binds encoder serial E42, zero count 410, positive sign, 8,192 counts per revolution, gear ratio, checked angles, residuals, and robot configuration hash.

Homing

An approved procedure that establishes a joint or axis reference, often using a switch, index, hard reference, or known pose.

Physical example:

A simulated axis moves toward a virtual reference switch under its modeled procedure, backs off, and records a repeatable home offset without claiming a real switch is safe.

Independent reference

A measurement or fixture outside the same software mapping being checked, used to expose a shared sign, zero, scale, or frame error.

Physical example:

A protractor reading challenges the encoder-derived hinge angle instead of comparing the encoder value with a second display of the same value.

Command lease

A bounded grant that permits a command to remain valid only until an explicit expiry unless a current authorized owner renews it.

Physical example:

A simulated jog command expires after 150 ms; network disconnect or browser focus loss stops renewals, so the robot-side owner returns the application command to zero.

Dead-man or enabling control

A continuously held operator input whose release withdraws ordinary motion permission; its safety status depends on the complete rated implementation, not its label.

Physical example:

Holding a simulator key renews a tiny one-axis jog lease, while release immediately stops renewal and the state display confirms measured velocity reaches zero.

Math, one line at a time

Work through today’s relationship

Prerequisite rescue · optionalZero-power electricity bridge: voltage, current, resistance, and power

Before buying, wiring, or energizing hardware, use paper calculations and manufacturer documentation to detect impossible loads, overheated conductors, and incompatible supplies.

V = IR
voltage equals current multiplied by resistanceUnit: volts (V)
P = VI
electrical powerUnit: watts (W)
I
charge flow through one declared pathUnit: amperes (A)
  1. On paper, a documented 12 Ω test load across 24 V would draw I = V/R = 24/12 = 2 A.

  2. Its electrical power would be P = VI = 24×2 = 48 W, so an ordinary low-power resistor would be unsuitable even though the arithmetic is simple.

  3. Stop at the calculation: do not assemble or energize the circuit. Verify ratings, protection, isolation, polarity, grounding, wiring, thermal limits, and a supervised low-voltage commissioning plan with qualified guidance.

Programmer analogy

Types and range checks catch bad values in software; electrical ratings are physical contracts whose violation can create heat, fire, shock, or loss of braking.

On paper, what current would an ideal 10 Ω load draw from 5 V?

I = V/R = 5/10 = 0.5 A; this calculation is not permission to build or energize a circuit.

Encoder scale is

s=2π8,1920.000767 rad/count.s=\frac{2\pi}{8{,}192}\approx0.000767\ \mathrm{rad/count}.

A 410410-count zero offset is

q0=410s0.314 rad,q_0=410s\approx0.314\ \mathrm{rad},

with sign determined by physical verification.

Calibrate and jog one simulated joint with independent checks

A simulated revolute joint uses 8,192 counts per revolution. Its candidate zero is count 410. A test observation at count 820 should correspond to a marked physical-reference angle of negative 18 degrees under the robot's declared positive-axis convention.

  1. Compute scale as 2π / 8,192 ≈ 0.00076699 rad/count and raw displacement as 820 - 410 = 410 counts; preserve full precision in the artifact rather than rounding the calibration constant prematurely.

  2. Apply the candidate positive sign: 410 × 0.00076699 ≈ 0.3145 rad, approximately positive 18.0 degrees, then compare it with the independent reference of negative 18 degrees.

  3. Reject the candidate mapping because sign disagrees even though magnitude is plausible. Trace encoder mounting, device sign, joint identity, transmission direction, and URDF axis; choose one authoritative conversion owner and document the corrected negative sign.

  4. Test corrected zero, quarter-range, and another interior point from both approach directions in the simulator; record residuals and identify any modeled backlash, wrap, or hysteresis rather than fitting only the original point.

  5. Predict how a small positive joint-coordinate change should move the child link and tool in the declared frames, then compare simulator state and visualization to that prediction before enabling a jog request.

  6. Configure a simulated one-axis jog with a held enable, very small increment, bounded speed and acceleration, 150 ms command lease, fresh-state guard, joint and workspace limits, and explicit cancel; keep requested, accepted, commanded, and measured records separate.

  7. Rehearse normal release, focus loss, delayed packet, stale state, limit approach, reversed sign, and cancellation. Accept the mock workflow only when each case reaches its declared terminal state and preserves enough timing and calibration evidence to explain it.

Result

The calculation exposes a sign error that a magnitude-only check would accept, then the corrected version supports one simulated leased jog whose request, expiry, measured response, and fault cases remain distinguishable.

What this proves

First motion should test one physical assumption at a time; independent reference and robot-side expiry are more valuable than a confident visualization.

Physical examples

Where this appears in real life

Encoder sign disagrees with the hinge

A mock encoder changes from count 410 to 820 with 8,192 counts per revolution. Software reports positive 0.314 rad, while an independent marked hinge shows the physical convention should be negative.

Look for:

The magnitude is plausible but sign convention is wrong; reject the calibration, trace sensor direction and joint-axis definition, and never compensate by silently negating an unrelated controller output.

Stale teleoperation lease

A simulator sends jog updates at 20 Hz with a 150 ms lease. The latest command arrives with 85 ms of age, then the browser loses focus and sends no renewal.

Look for:

Only 65 ms of declared validity remains; the robot-side owner expires the command locally, measured velocity reaches the simulated stopped state, and the UI does not claim its disabled button caused the result.

Hands-on exercise

Make the idea observable

Use a cardboard hinge with angle marks or a robot simulator, a mock encoder table, and a teleoperation fixture that cannot command powered hardware.

  1. Create a calibration record with joint and encoder identity, zero, sign, scale, range, frame axis, configuration version, method, independent reference, and validity conditions.

  2. Evaluate at least three mock counts in both approach directions, include one reversed-sign or wrong-joint fault, and record residual rather than only pass or fail.

  3. Move the cardboard link or simulator through predicted positive and negative changes and compare joint state, link motion, child-frame axis, tool displacement, and limit state.

  4. Configure simulator-only teleoperation with one axis, held enable, bounded magnitude, rate and acceleration, short lease, fresh-state requirement, visible command age, cancellation, and measured feedback.

  5. Run normal press-and-release, focus loss, disconnect, packet delay, stale state, joint-limit approach, and wrong-sign scenarios without modifying the expected result after seeing the run.

  6. Export the calibration version and correlated request, acceptance, command, state, expiry, stop, and fault timeline; label all real mounting, energized motion, and safety behavior not verified.

Observe

A display can agree with its own wrong mapping, and a UI can show stopped while an old command remains valid elsewhere; independent geometry and robot-side command expiry challenge both illusions.

Done when

The sign, zero, scale, joint identity, limits, and frames pass independent mock checks; every simulated teleoperation loss case expires or cancels locally; no step directs real powered motion.

Build today

Bring up a LeRobot-supported arm or mobile robot with calibration, limits, teleoperation, and emergency stop.

Evidence to save

DONE when a comparison table for “Calibrate joints, verify frames, and perform low-speed teleoperation” contains the test condition, metric, result, and justified engineering decision.

Common mistakes

Catch the wrong mental model

Wrong

Accepting calibration because the reported angle is smooth and inside limits.

Better

Compare multiple points and approach directions against an independent physical reference, verifying joint identity, zero, sign, scale, range, wrap, and frame convention.

Wrong

Keeping a jog command valid until the browser sends an explicit stop.

Better

Use a short robot-side lease and held enable so focus loss, disconnect, stale state, or operator release ends renewal without depending on a final network message.

Wrong

Calling a reduced application speed a safe-speed safety function.

Better

Describe it as an ordinary bounded test setting unless the complete sensing, logic, output, failure performance, integration, and validation meet the applicable safety requirements.

Job connection

How this becomes employable evidence

Own versioned joint and frame calibration, build operator jog workflows with leases and stale-state visibility, support qualified first-motion commissioning, and preserve independent measurements that distinguish a UI or model error from a sensor, mapping, mechanism, or controller defect.

Relevant target roles

  • Robotics Application / ROS 2 Integration Engineer
  • Robot HMI / Control & Monitoring Engineer
  • Robotics Deployment, Integration & Validation Engineer

Chapter 22 interview drill

Interview questions: Calibrate joints, verify frames, and perform low-speed teleoperation

Practise a 60–90 second answer: define the idea, connect it to a physical robot, state assumptions, frames, and units when relevant, then finish with the failure signal or evidence you would inspect.

Primary interview scenario

A joint value looks smooth and plausible but moves the real link in the opposite direction. Explain how you isolate identity, sign, zero, scale, transmission, URDF axis, and frame errors, then design a low-speed teleoperation rehearsal that fails safely on focus or network loss.

Answer shape: clarify the situation → trace the physical and software path → test the most likely boundaries → name the evidence that would confirm the result.

Technical follow-up questions

Q1How can a calibration be numerically plausible and physically wrong?
Model interview answer

The value can remain within range while joint identity, zero, sign, scale, gear relationship, wrap, unit, or frame axis is incorrect.

Q2What must happen when a teleoperation client disconnects?
Model interview answer

The robot-side command lease must expire or cancel through the designed local path, command authority must be resolved, and measured state must confirm the declared ordinary stopped outcome.

Q3Why is simulation required before any approved first motion?
Model interview answer

It exposes mapping, interface, limit, lease, UI, and recovery defects without real energy, although it cannot validate mounting, load, wiring, braking, hazards, or physical safety functions.