Wednesday, July 23, 2014

Receiver v3

It seems that I've taken a long break from writing once again. In the meantime, I finalized the layout of version 3 of the receiver and ordered the boards from Dirty PCBs. The boards arrived in a couple of weeks and looked good to me. This was the first time I had boards made, so I can't really compare the quality to any other prototype service. Anyway, the boards cost $14 including shipping and I'm very pleased.

Schematic: here
Layout: top bottom both

Unpopulated board. Top side.

 
Unpopulated board. Bottom side.

Fully populated board. Top side.

Fully populated board. Bottom side.


The design is now single board, and it still is smaller in all dimensions compared to receiver v2. The one big change in the electronics is now the inclusion of a multiplexer IC, which allows me to use a single hardware PWM channel on the microcontroller to control up to 8 servo channels.

Timing diagram of the new hardware servo updating.
The hardware PWM has a period of 2.5 milliseconds. In the beginning of the period, the PWM output is set high and it will be directed to the selected servo channel by the multiplexer. After the pulse high period, the PWM hardware will bring the output low and invoke an ISR on the processor. This ISR will then load the appropriate pulse length of the next servo channel to the PWM hardware (hardware will not use the value immediately, but from the beginning of the next period). The ISR also configures the multiplexer to select the next servo channel. As a servo pulse is at most 2 milliseconds long, we have at least 0.5 milliseconds time to finish the ISR before the next period starts. This makes the whole servo driving very non-time-critical.

Surprisingly many things needed changes to port the code from receiver v2 to v3, so in addition to having the new servo update code, I now also have new general purpose timing code, new navigation data request code and new multilevel fail-safe code to name a few.

To keep things simple, I decided the servo pulses do not need to be synchronized with the incoming radio control packets as they were before. This introduces a 20ms worst case latency to all channels. Since typically the servos are not updated faster than that anyway, I'm not very concerned.


Receiver v3 as it currently resides in my Graupner Elektro Rookie.

At the time of writing, I've gone flying twice using the new receiver, for a total of slightly more than 10 flights. The receiver has performed very well so far. Up next is to 3D print a nice enclosure for it.