Last week I implemented autocalibration using pid control. I found out it worked well, but only if the miscalibration wasn’t too big. It worked to about half the maximum error. After some attempts to improve tuning I concluded it must be something else.
Pid controllers only work for lineair systems and my steering function isn’t. The output, rotational speed, is not linear related the the input, being number of encoder ticks for the steering motor.

This gave me two questions. Why does it work for small errors? And can i rewrite my steering function to be lineair?

I only have some suspicion about the answers to these questions. So if you have them please post’em.

I think my steering system behaves almost lineair if the steering angle is small. This being my answer to my first question.
I also believe it is possible to write a lineair steering function. But if an error factor is added it will no longer behave lineair. As the error in rotation speed is not lineair to the error in the steering.

So I concluded that my pid function only works for small errors and that is of no use to try to improve it.

And still, i love to see my car calibrate itself all the time. Also, I’ve managed to reduce the distance needed for calibration to aboout 25 cm.