Why my robot's body was twitching: ±0.4° at 3.4 Hz, and the gain that fixed it
- Log
- 6 of 26
- Date
- Reading
- 2 min read
Skills in this log
Something broke in this log. It is written up anyway.
On the afternoon of 20 October I noticed something that drove me mad: after some movements, the robot’s body kept shivering left and right. Tiny, but constant. Extremely irritating on a desk.

What the numbers said
The robot reports the position of each motor many times a second. Reading the body’s motor, the shiver became a clean curve:
| Measure | Value |
|---|---|
| Amplitude | ±0.4 degree |
| Frequency | 3.4 times per second, a period of 0.29 to 0.33 s |
| Size in encoder steps | about 9 steps of the motor’s position sensor |
| When | not every time; often after face tracking was switched on, then off |
| Does it stop by itself? | no, it survives the next movements |
Three times I thought I had found the trigger, and three times the next measurement proved me wrong. The pattern only made sense once I stopped looking for a trigger and looked at the motor itself.
Inside the machine
A servo motor holds a position by correcting its own error. The simplest way is a proportional controller: the further the motor is from its target, the harder it pushes. The factor between error and push is the gain. The body’s motor used a gain of 200, with no other term to damp the movement.
With a high gain, the motor pushes hard for a tiny error, overshoots, sees an error on the other side, pushes back, overshoots again. If friction and the small dead zone of the gears are just right, this never dies out. It settles into a steady little oscillation of its own, a limit cycle. That is what a shiver of nine encoder steps at a steady 3.4 Hz looks like.
The fix
I lowered the body’s gain from 200 to 120 in the maker’s configuration, kept a copy of the original file, and restarted the robot. Then I tried to make it shiver again:
| Test | Result |
|---|---|
| Attempts to trigger it | 5, three with tracking on then off, two with plain movements |
| Shivers | 0 |
| A 30° turn | within 1° in 1.04 s, no overshoot |
| A 100° turn, body included | 1.67 s, overshoot 0.1° |
| Back to the front | 0.00° |
What I cannot claim yet
This is a hypothesis that works, not a validated fix. The maker has not confirmed it. The next software update will overwrite my file, so I now read the gains after every update. And I have not measured how well the body holds its position when pushed by hand.
I read 160 titles of the maker’s public issue tracker and found nothing describing this. So I opened two issues: this oscillation, and a smaller oddity in the way the robot goes to sleep, in two steps, with a small drop of the head at the end.
Next: the afternoon test that showed the robot reacted to everything.

