As its exam time I have been carefully avoiding revision with a mix of counterstrike and micromouse work. New PCBs are 95% ready to be ordered and so my focus has turned to the controllers.
After implementing a fixed point maths system for the controller (10.5bits signed for those who care) and ziegler-nichols tuning the PI controller I had a one wheel mouse – putting a bit more effort in I got it to two wheels – yay.
Tuning it was a bit of a chore – so automation is king and I was able to produce this graph (yes, no axis labels, minus 2 marks for me, x is the time, y (going back into the scene) is as the gain increases and z (going up) is the velocity for said gain:
The idea is to find the point where oscillations occur, the above plot was far too noisy so a 16 point moving average was applied:
I got a value of about 1.2, but it is questionable, will compare against some simulated controllers to see if it seems a likely value – it does however work well enough to control the motors!
Now the results:
It is nice having onboard bluetooth for this sort of debugging, anyhow, things look nice – the integral term does push things out of whack when going from zero or getting down to zero – but possibly an artefact of the controller being ill tuned – there is still a large overshoot to a step input which is not what you would expect from a z-n tuned controller…
Video, go to http://www.youtube.com/watch?v=AYmkJvthVJw and click on view in HD at the bottom! or watch it in small size bellow:
Next time it will be slower and have a straight line controller built in, after that its onto cornering!