2WD Platform with compass

Thanks, I'll have a read up on PID logic.

With regards to the compass jitter, its difficult to know if I'm getting any as its rock solid when attached to the computer and I can't read it while its "unplugged", not sure what other people do, maybe onboard SD logging will speed up debugging of this and any future projects.

That said, I have experimented with compass jitter smoothing, however looking at the maths I don't think it'll help. Currently I have an array of 50 integers and that's updated at each read and then an average is taken by cycling the array and dividing by array size. Problem is that lets say I record a heading of 220 49 times and then get a bad one of 100, that's still an average of 217 which will cause it to speed up/slow down one motor, if I then keep this for 50 more cycles it'll affect my heading for a whole second. Drop that to 5 in the array and the average is then 196 (((220 x 4)+100)/5).

I was thinking I might try keeping 5 but junking anything which is "unrealistic", ie. if I get a reading more than is feasible to achieve given the previous reading and turn speed of the platform.

All that said, I don't know if the jitter is +/- 2-3 or if its as bad as I describe. Given the flat surface, I suspect that my problems are due to the rate at which I'm updating the motors so I'll do some more reading and experiment some more.