PWM pins fluctuating during boot?

Hello everyone,

I’m currently trying to use a BBBlue to control a large fixed wing UAV via Ardupilot. I set everything up as per these instructions and it all worked perfectly first time round. After a few power cycles, however, I’ve noticed that the servos will twitch to random positions while the board is booting and sometimes these twitches will latch causing serious binding to occur (causing me to disconnect the battery to avoid damage), once the Ardupilot code starts the servos return to their default position. I’ve tried a couple of different servos (Hitec, Multiplex, Turnigy) and all are effected to a greater or lesser extent.

Today, I hooked up a scope to some of the PWM pins to see what was going on and noticed that they do indeed toggle between high and low a couple of times during the boot process. Whilst none of this toggling correlates to a valid servo signal (e.g. ~800-2200us @ 50Hz), it seems to be this that is causing the twitching, possibly because the servos don’t do much in the way of signal validation.

I figure this might be something to do with the initialisation of the board and the pinmuxes, but does anyone know exactly what’s going on? And more importantly, is there anything that can be done to solve it?

Thanks in advance!
Owen

I think you need to assume that pretty much anything can happen while the board is booting or crashing, and inhibit all servo activities unless you know the BBB is in positive control.

Depending on how “large” your fixed-wing is, it probably would not be a bad idea to put some kind of watch-dog timer in the system, so that if the software crashes/stops/looses-interest/reboots/low-battery/ the servos all go to some neutral/safe setting.

— Graham