Monday 27 October 2014

I2C Issues Fixed and Dome rewired

Man what a long weekend!  Painful.

I thought id fixed the I2C issues, so i started a little rewiring.

I  tried to rewire the Adafruit to bypass the power on the board and use a direct supply for each relay supply, and swap from the dome 5v supply to all run on the 12v main battery.

Only to find that the Adafruit Servo driver wouldn't boot. Could I work out why?  No!  I didn't think about the library at first!  :(  So i tried to fix that and rewire at the same time, i tried all sorts.  :(  Eventually i found the issues, partly the library, partly bad connections.  Sorted them and rewired the dome using a UBEC (3a with 5A peak) to power the whole dome. Then i had crashing on the Adafruit.  Nightmare.

Also a few power issues initially, one servo not moving well and intermittent issues, so i added a capacitor to the supply and that helped sort some of the problems.  But the crashing was still happening.

After a lot of head scratching, and trying lots with the library to fix it, i realized what was happening.  The crashes were only after or part way through commands sent from the master, so the issue was passing I2C from the body.  The I2C was loosing the network and freezing the adafruit.  I had forgotten to tie the GND to the 12v into the dome, with all the problems i had overlooked it, with that re-added it is spot on. :D  So i went back to the library and reverted to an earlier attempt at the library fix.

Basically, lesson learned.  Test and fix one bug at a time, but make sure you test it fully!

The fix for the I2C was too severe initially, i needed a longer time out.  My new TWI.c file is great.  The master and ESC control is constant regardless of what happens on the I2C network, and the Adafruit works seamlessly.  :D  I will finish my rewire and run it for a week or so and post when im happy.

But the dome is now running powered by the main battery, so I have lost a lot of weight in the dome and managed to drop the dome battery.  All for £6 of ubec. :D  Here you can see my daughter boards for the power and mu UBEC fitted:



Body rewire next.  Im still not sure im doing the best thing, but im learning as i go, so having tried both i can make an informed decision.

No comments:

Post a Comment