Countdown to CamJam: 6 days to go

A day spent inconclusively tuning horizontal PIDs’ gains, with some integration tweaks to get better accuracy of velocities from the accelerometer, as yet untested, due to a bad beer last night (just 1 pint, guv) which left me after lunch today, staring down a toilet bowl, with undigested lunch staring back up at me.

The PID tuning goes loosely along these lines:

  • the P gain is there to maintain a fixed target velocity
  • the I gain is there to return Phoebe back to any point she drifts away from
  • the D gain is there to apply additional acceleration / braking to stop drift.

It’s visible working, but it is very sensitive – change one gain, and the effect on the others’ change radically – to some extent you can use some structure, but ultimately it’s also a lot of guess work and gut-feel which doesn’t sit well, the way my gut is currently feeling.

 

2 thoughts on “Countdown to CamJam: 6 days to go

  1. While looking at everything else, I notice that you have the following calculation repeated in several places. Might be better as a constant.
    500.0*math.pi/(65536*180)
    I know it’s not much, but I think the calculation is currently repeated at least three times per readSensors() call. Got to reduce the time available to do other things 🙂

    • Thanks Dave – well spotted, I’ll get that sorted immediately – I’ve done the equivalent throughout out the code (see the *Frame code for the best example) but missed those completely. Anything that increases performance is always a good thing and I do think the math(s) ones are expensive.

      The best I got was from reducing the number of calls of time.time() to one per loop – two fold improvement.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.