Sunday 14 October 2012

Pad Crash Protection and Basic Dome Position Control

Well, a lot more pottering than solid building this weekend, but got a few useful bits done.

I have redone the code to reset the dome and feet drives if the serial on the droid end doesn't receive an update for 20 attempts in a row, should be about 0.4s, works fine.  Also ordered an LCD without the I2C (was only £8), it will use more pins but should work and might not have the same issue.  Either way I have pad end Arduino crash protection now. :)

So with that done i went back to the dome drive and the position control.  For the position I am using one of these:
https://www.sparkfun.com/products/8678
With a wiper attached to the dome baseplate (old pics):





For the drive I am using the A&A dome gear and a Pitman controlled by a Syren 10 connected to the droid maser Arduino as a servo.  I tried the serial control of the Syren, but couldn't control the ramping so ditched it for the VarSpeedServo library and I use the "slowmove" option.

The old code I had used microseconds, I have been finding degrees easier to work with, especially as this is speed so the accuracy doesn't matter too much.  So I scrapped all that and I rewrote the code to sense the position and then depending on distance apply a speed to the dome and keep doing so until position is reached, I added 4 ranges to apply different speeds at different spots to bring it to a smooth stop and not shoot off if close already.  Then added a variable buffer value that allows me to change the accuracy so that head shakes etc aren't fussy about the exact spot so just change direction and don't seek the spot.  The VarSpeedServo really helped to smooth it all.  There is no clunking and it changes direction really smoothly.  Much better than the clunky mess i had with the standard servo library set-up. 

I can spin the dome, or face in any direction quite happily now via script, so next job is to add it all to the main Droid Arduino and get it under pad control, both via the stick and via buttons to face forward or spin or shake or whatever.  Going really well.  Will need my cameraman soon for another video. :)

1 comment: