Deriving the derivative

So I’ve finally managed to get the robot balancing well enough to be confident to push it around on tiles and not be afraid of it falling. The derivative term of the position controller seems to be helping a lot.

But obtaining the derivative was not fun. Over the past day or so, I’ve found out that the positional output calculated from the encoders was horrendous, causing the robot to vibrate weirdly. Since then I’ve had a look at the output, and am now using a complementary filter. figure

After I’d fixed this issue, I was still unsatisfied about the overshoot of the robot when it return to it’s target position. I thus increased the derivative term of the PID controller and saw improvements, except …

figure

due to the non circular nature of the omniwheels, the robot’s movements were getting bumpy and causing the derivative term to oscillate. I can’t really think of a simple software fix for this right now. I can now see why other ballbots like BallIP and Rezero have custom omniwheels that provide incredibly smooth movement.

figure