7-Layer Phantom-Jam Resolution & Per-Joint I²t Servo Winding Thermal Fuse
How Ainekio V2 prevents micro-servo burnout while eliminating false carpet jams: 7-layer phantom-jam safeguards across firmware and NeuralPose, 1.8 s walking reverse unsnag, full-span [1..4094] ADC stall sensing, and an 8–10 s per-joint I²t thermal fuse.
At 5.0 V, a stalled MG90S micro servo draws 700–850 mA (3.5–4.25 W) into a tiny rotor with almost no thermal mass—heating the copper winding at ~2.5–2.8 °C/s. During early bench testing, a single blocked shoulder joint pushed against a mechanical stop outside its nominal [500, 2800] µs calibration range while waiting on an unbounded arrival check, burning out over ~156 s. Conversely, cutting global PCA9685 OE power whenever a foot brushes a chair leg would drop the robot onto its belly on every minor snag, and overly sensitive software recoil heuristics falsely clamp fast swings on carpet.
To solve both sides, Ainekio V2 pairs an 8–10 s hardware-enforced per-joint I²t winding thermal fuse on the ESP32-P4 with seven anti-phantom-jam safeguards across firmware, NeuralPose, NeuralPosePresence, and the Host Gateway—eliminating false carpet trips and mid-air limb freezes while keeping genuine locked-rotor protection active.

Boot → Stand → Greet & observe → Stretch → Stall detected via 4th-wire wiper lag → Winding protected & verbal fault report.1. Seven-layer phantom-jam safeguards
Fast carpet swings and wave transitions exposed seven interacting causes of false leg jams, inverted-carrier over-retraction, and competing recovery loops. Each layer is resolved cleanly without weakening the hardware I²t fuse:
- Streaming reversal unlock (firmware): During cyclic
50 Hzdirection reversals, stall tracking enforces an80 µsdeadband, resets on80 µs/sslewing, unlocks on25 µstarget shifts, and ignores clipped or extrapolated ADC samples for reversal progress (while full-span[1..4094]thermal protection stays active). - Bounded stand recovery & arrival timeouts (firmware): Firmware gates stand recovery behind
!actively_levelingso continuous208 HzIMU balance trims never masquerade as posture drift. Unloaded replans cap at2, and every motion arrival check escapes after0.8 sso limbs never freeze mid-air (while inactivity rest always reachesPCA9685 OE = 1). - Single posture-recovery owner: Whenever host
50 HzNeuralPoseowns the body, firmware disables its own stand-hold recovery loop (stand_enabled: false) while keeping50 Hz4th-wire telemetry and theI²tthermal fuse (jam_enabled: true) active. - Learned compliance & terminal stance settling: Hardcoded
280 mssoftware recoil clamps (which mistook normalMG90Stracking lag for jams) are replaced byNeuralPose’s learned carpet-relock compliance plus terminal stance settling—waiting until stance error settles<= 5.5°and shoulder error<= 3.5°, safely inside the7.0°zero-heat deadband. - Carrier home margin: Clamping the upper-carrier floor
3.0°inside its-30.87°Home stop (>= -27.87°) and keeping carpet step lifts at18–20 mmprevents carriers from over-retracting into the invertedabove_calibrationzone where they look identical to a mechanical jam. - Single authoritative abort signal: Event-driven LLM recovery synthesis is removed; the host bridge interrupts an active motion job only when firmware reports a real hardware thermal cutoff (
outputs_released: true). - Carpet-safe
50 Hzpresence:NeuralPosePresencestays motor-silent during speech capture without sending disruptivestopcommands and keeps speech nods purely sagittal (0.0°shoulder target) so feet never scrub sideways into carpet (3-system neural motion).
2. Walking reverse unsnag (1.8 s) & full-span [1..4094] ADC sensing
Autonomous 1.8 s reverse unsnag
When a foot hooks a power cord or rug edge during forward walking (> 0.05 m/s), both on-chip and host MicroDuck controllers trigger the same reverse-unsnag reflex:
- On-chip
ESP32-P4: Integrates snag time whenever joint error exceeds14.0°while shaft velocity stays below10.0 deg/s. After1.8 s, firmware overrides velocity to-0.45 m/sstraight backward at full stride scale for1.8 s, backing the foot clear before resuming forward walking (2.5 scooldown). - Host neural gait: Triggers the identical
1.8 sreverse maneuver on either 4th-wire joint lag (>= 14.0°at< 10.0 deg/s) or zero ground-plane odometry progress (< 25 mmover1.8 swhile lagging>= 10.0°). - Ainekio OS goal alignment: Locomotion progress tracking uses a
5.5 scognitive stall window so a full snag-detect + reverse-unsnag + re-attempt cycle (~4.5 s) completes before Goal Review flags a blocked path.
Full-span [1..4094] 12-bit ADC jam measurement
The 156 s bench burnout happened because ADC readings outside the [500, 2800] µs calibration interior were previously discarded. Firmware now linearly extrapolates each joint’s 3-point CD74HC4067 calibration curve across the entire non-railed 12-bit span (raw ∈ [1..4094]), catching hard mechanical stops near 0° and 180° while still rejecting open/short wire faults (0 or 4095).
![Quantitative time-domain chart of per-channel MG90S winding thermal_load[j] over 0 to 24 seconds comparing hard end-stop rotor lock (8.0-9.0 s selective LEDn_OFF_H = 0x10 cutoff and 12.0 s cooldown to 0.35 rearm) against zero-heat standing sag (<=6.5 degrees) and fast carpet swings (>12 deg/s).](/posts/jam-protection/i2t-thermal-vs-phantom-jam-curves.webp)
I²t winding thermal accumulator over 0 → 24 s: hard rotor locks trip selective LEDn_OFF_H = 0x10 cutoff in 8.0–10.0 s while 11 healthy channels hold stance; standing sag (<= 6.5°) and fast swings (> 12°/s) accumulate zero thermal load.3. Per-joint I²t winding thermal fuse & selective PCA9685 cutoff
If a wedged limb stays physically pinned past NeuralPose compliance or MicroDuck’s 1.8 s reverse unsnag, ESP32-P4 firmware protects the motor winding directly with a per-joint I²t thermal accumulator:
Constants:
DEADBAND = 7.0° # Normal standing gravity sag (<= 5.5° settled) generates ZERO heat
SLEW = 12.0 deg/s # Moving shafts (>= 12°/s) do not accumulate locked-rotor heat
FULL_SPAN = 11.0° # 18.0° stalled error = 1.0× nominal stall dissipation
MAX_DUTY = 1.25 # Caps extreme angular error at 1.25² = 1.56× heating rate
TRIP_SECONDS = 9.0 s # Trips in 8.0–10.0 s under hard rotor lock
COOL_SECONDS = 12.0 s # Linear cooldown retaining thermal memory across re-jams
REARM_LOAD = 0.35 # Channel stays masked (0 µs) until cooled below 35%When thermal_load[j] reaches 1.0:
- Selective single-channel cutoff: Firmware masks only the tripped channel (
0 µsviaPCA9685registerLEDn_OFF_H = 0x10), leaving globalPCA9685 OEenabled so the 11 healthy servos hold stance without a belly-flop collapse. - Authoritative cancellation: Firmware aborts the active motion and emits
{"t":"event","name":"servo_stall","joint_mask":...,"outputs_released":true}. That singleoutputs_released: truecontract cancels active gateway and Freestyle jobs cleanly (while explicit operatorstopwithdetach: truestill disarms all PWM outputs on demand). - Cooldown & smooth re-seeding: Masked channels remain unpowered until
thermal_load[j] < 0.35, then re-seed from the live 4th-wire shaft reading so re-engagement never snaps abruptly.
4. Hardware-in-the-loop, calibration & simulator verification
Three harnesses verify stall sensing and thermal cutoff without risking physical windings:
- Native C + Python HIL suite: Compiles production
ESP32-P4motion and feedback C modules against a simulatedPCA9685register bank and 12-bitCD74HC4067ADC. - Interactive
simulator.ainek.iofault injection: Runs the same compiledESP32-P4C firmware atop500 HzMuJoCo WASM across V1, V2 “Kanzagroth”, and V3 “Killdozer” with per-servo pin/jam controls so operators can lock any joint mid-walk and watchLEDn_OFF_H = 0x10trip in8–10 swhile healthy joints hold stance (simulator guide). - Automated bench calibration tilt guard: During automated 3-point potentiometer sweeps, the calibration runner monitors the
LSM6DS3IMU and immediately aborts if body tilt exceeds25.0°(catching a robot slipping off its stand).
| Test Suite | Simulated Condition | Verified Outcome |
|---|---|---|
| 1A · Standing Gravity Sag | 60 s continuous Stand hold at 6.5° steady load sag (<= 7.0° deadband) | thermal_load == 0.0, 0 false trips |
1B · 50 Hz Neural Streaming | 60 s cyclic 50 Hz MicroDuck / NeuralPose reversals (80 µs deadband, 80 µs/s slew, 25 µs shift) | Reversal tracking unlocks cleanly; 0 false trips |
| 2 & 3 · Hard End-Stop Lock | Joint 0 pinned against stop outside [500, 2800] µs | Trips in 8–10 s, sets LED0_OFF_H = 0x10, keeps ch 1..11 live, emits outputs_released: true |
| 4A–4C · Deadlock Bounds | Blocked Freestyle frame, blocked Stand (!actively_leveling), blocked lay_down | Freestyle escapes at 800 ms; Stand caps at 2 replans; lay_down reaches PCA9685 OE = 1 |
| 5 · On-Chip MicroDuck Snag | Forward twist (> 0.05 m/s) with > 14° swing snag | Detects snag in 1.76–1.90 s and drives -0.45 m/s reverse unsnag for 1.78–1.84 s |