Yet another Encoder Board

Single to Multi propo
Post Reply
User avatar
Posts: 607
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Yet another Encoder Board

Post by Mike_K »

A KiCAD 3D Model of the new GTS 2.1 encoder
A KiCAD 3D Model of the new GTS 2.1 encoder

As a few of you may know, I've been having fun seeing how much I can fit onto a 40x40mm encoder circuit board to run either Phil_G or the modified "F3A" encoder firmware. The boards have the same dimensions and roughly the same connections layout as the DM More Pro Mini Strong, but previously I've managed to add reverse polarity protection (the Pro Mini Strong has reverse polarity protection, but it’s removed with Phil's modification), aileron and elevator rate/expo pot's and Zener diodes and adjustment pot for the battery meter. What else could I add to the next design? I’ve had a small feature "wish list" for a while:

1. Combine the F3A firmware features with Phil's S/C emulation, so you have throttle reverse, aileron differential and single channel on the same encoder
2. Low voltage alarm

The description below will bore most of you, but in summary, the encoder is still the size of a Pro Mini Strong, with 8 channels, servo reverse on TAER, aileron differential, eleven and v-tail mixing, single channel compound and sequential emulation, low voltage alarm, individual rates/expo on aileron and elevator with onboard adjustment pot's (or optionally you can still fit external rate/expo pot's if preferred), both JR/Spektrum channel order (TAER)/polarity and Futaba channel order (AETR)/polarity, reverse polarity protection and zener diodes and adjustment pot for the battery meter.


After a bit of scheming I decided that if I could make do with a 4-way DIP switch, instead of a 7-way (or 8-way), there would probably be room for the low-voltage alarm circuitry. It would also free some spare inputs for the low-voltage alarm and the S/C push switch.

The 4-way DIP switch now does the following:
SW1 - Throttle reverse
SW2 - Channel 5 and 6 order (xxxx A.L, G, Aux1,Aux2 or xxxx G, A.L, Aux1, Aux2)
SW3/4 Aileron differential %

Elevon is now selected by holding the elevator and aileron joysticks fully over at power on. To turn off elevon, hold the elevator/aileron joysticks over at power-on, this action toggles the elevon on/off. Similarly, V-Tail is selected by holding the elevator and rudder joysticks fully over at power on. To turn off, hold the elevator/rudder joysticks over at power on - this action toggles V-tail on/off.

On previous encoders, a DIP switch selects between JR/Futaba channel order and polarity, but it is now replaced with two simultaneous cppm outputs, one JR polarity/TAER channel order, the other with Futaba polarity/AETR channel order. There's a Schottky diode on the Futaba output for Futaba modules, so it should be directly compatible with most Futaba modules such as the TM-7 and TM-8

There is both compound and sequential S/C emulation, to toggle between compound and sequential, you hold the S/C switch down at power on.

The low-voltage alarm uses the last I/O freed up by using the 4-way DIP switch, the alarm voltage is set with an onboard SMD potentiometer.
A potential divider on the Vbat, gives a voltage output less than 5.0V with a fully charged battery. It uses a single comparator (LMV331TP SOT-23-5 SMD) with the ATmega input pull-up enabled (it has an open drain output, it switches to 0V or floats) with a “feed-back” resistor to add a small amount of hysteresis (Vbat +/-0.15V of alarm voltage), so that if the battery voltage drops slightly with the sounder, it doesn’t intermittently alarm

I've done away with the icsp header as we can just use D11, D12 and D13 (which are now all switch inputs) and I've added a single-pin header for the icsp reset

Next, I used an externally driven SMD buzzer (just the magnetic part, no internal oscillator). They’re smaller and there’s far more choice of smd devices. We have to drive the buzzer with a transistor anyway (as the Arduino output doesn’t source enough current), so no additional transistor is needed, just a reverse polarity diode across the buzzer. We then need a 2.7KHz oscillator (the resonant frequency), so it's driven by Arduino D3 configured to use OC2B, TCNT2 can be set for PWM 50:50 duty at 2.7KHz. The buzzer has a second resonant frequency of 8.1KHz, the PWM frequency can easily be set for a two-tone alarm maybe for something like the low voltage to really get your attention.

Finally, I delete the LED from D13, as it serves no purpose now, but have retained the 5V power LED (green).

It was all prototyped using a Pro Mini Strong with the voltage comparator and similar sounder on strip-board (all components were through-hole for ease of prototyping) and everything seems to work OK, so I designed the board in KiCAD and ordered with JLCPCB and I now wait with bated breath for the boards to arrive and test out. The Arduino program still makes use of a lot of Phil's code, why re-write if it works? I'll open-source the code once all is proven, but the hardware isn't so easy to implement without the dedicated GTS board.
User avatar
Posts: 913
Joined: 15 Feb 2018, 21:49
Location: West Yorkshire

Re: Yet another Encoder Board

Post by Shaun »

Posts: 26
Joined: 18 Jun 2019, 03:48
Location: Eden, MD USA

Re: Yet another Encoder Board

Post by JohnH »

Sounds Great Mike. Let us know when they will be available and how much would be the cost.
John H.
"Here's another fine mess you've gotten me into."
User avatar
Posts: 749
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia

Re: Yet another Encoder Board

Post by Wayne_H »

Well done Mike👏

Once a Retrobate, always a Retrobate............ ;)
Posts: 373
Joined: 16 Feb 2018, 13:57
Location: South Devon, UK

Re: Yet another Encoder Board

Post by Pchristy »

An excellent project!

Makes my brain hurt just thinking about it!!! :lol:

Post Reply