Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

My favourite
Post Reply
User avatar
Phil_G
Posts: 475
Joined: 15 Feb 2018, 23:32
Contact:

Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by Phil_G »

Reposted from 'reunited' Dec 2016, latest update 19/06/2022:

The 'Reeduino' is a stable project, ie all the development listed below has been finished
for over four years, with dozens of Reeduinos built. Please refer to the full document which is item P19 on the Archive page of www.singlechannel.co.uk

December 2016: I've done an arduino reeds encoder for up to 12 channels, it suits any of the popular low-cost 'ebay boards' including the small ones with the inbuilt 328P processor. [Edit: any I supply ready-to-go will be on the DIY-More 'Strong' board]

The Reeduino was originally intended to exactly mimic the spec of the existing PIC 12ch reeds encoder, and in its first incarnation was functionally identical in every way. However, as is the nature of these things, the spec has extended over time with some nice extras such as S/C escapement emulation, mixer, ATV etc...

Edit 2/1/2017: now has the option of a button for full single-channel escapement emulation - sequential and compound rudder & kick-up elevator.

Edit 7/1/2017: Added 'activetoggles'. Some projects dont need the full 12 channels and you can't just leave unused toggles disconnected as the inputs are then indeterminate. To enable the toggles you're using, disable the ones you're not, edit the 'activetoggles' array which is near the top of the sketch.
Remember that in a RET model you're using the aileron channel for rudder.
Think 'primary steering control' Image

Edit 18/1/2017: I've changed the resolution from 10uS to 1uS and its noticably smoother, especially when the servo transit speed is set very slow.

Edit 19/01/2017: Added trim lock to make trimming channels other than elevator much easier

Edit later 19/01/2017: Added 10 minute inactivity timer, morse R for reset, S for scan, K for OK. Added ID if reset held 10 seconds

Edit later 19/01/2017: Now has a V-tail mixer by grounding D7 either with a Spektrum bind plug or via a switch

Edit 21/01/2017: Added a brief document and diagram

Edit 30/01/2017: Added ATV, set with a Spektrum bind plug (or a momentary button) on D5. See post #here

Edit 06/02/2017: Very minor change to pips, see spec below. Have concluded testing, so calling it a wrap. Have added some notes to the header.

Edit 11/02/2017: Optionally a Tiny6-style trim button can be fitted to D4, in which case the elevator-trim toggle is not necessary.
This makes a 6 channel RET set more practical, behaving exactly like the Tiny6 reeds encoder with atv & S/C

Edit 17/02/2017: Made the S/C deflections relative to ATV. Eg, if you turn the rudder movement down using ATV, the S/C movement reduces accordingly

Edit 18/03/2017: Sweep mode can now also be invoked on power up with the Tiny-6 button depressed, same as the Tiny-6

Edit 19/06/2022: active toggles configuration, channel order & Vtail mix moved to a dipswitch


Now whilst its an accurate portrayal of a period reeds set, but with much more functionality, the 'extras' can be ignored and it can be used as a simple, basic reeds set. In use it will be totally familiar to anyone who's used to 'real reeds' or the old PIC reeds boards. It has all the same facilities of the old one, reversing by power-on with the toggle thrown (saved to flash), variable servo-slow via a pot, half-speed throttle & aux channels, proper elevator trim via the trim toggle and 'cheating trims' (with pips) on all the other channels by simultaneously holding elevator trim and the required channel to trim, range-test sweep, etc - exactly like the old one in every respect. Its wired the same way too, with resistors across the toggles to enable three positions to be read via one analogue pin - and as before the actual analogue value has no direct bearing on the servo, its quantised to just 3 values so we can tell if the toggle is pushed one way, pushed the other way, or in the middle. There are crude reed implementations out there where resistors hold a propo channel at neutral and simply switch to either travel extreme - sometimes with capacitors for servo-slow - but thats not the case here. "High - mid - low" is just an economical method of reading the three possible switch positions via just one arduino input.

So if its exactly the same, why bother? Well the extra features are nice, but its mostly because the old PIC reeds encoder boards were expensive, even the bare PCBs cost me £6, then theres a boardful of other components and each one took me a full evening to build & test. I always felt guilty that I had to ask £25 to cover costs & delivery but I just cant do them for less.
The 328P board on the other hand is complete and readily available from ebay for £3 or thereabouts, and it becomes an easy DIY project.
Easier and cheaper Image

Oh dont forget that A4 & A5 are switched around on the 328P board, thats the aux & trim toggles in this particular case.

I'll do a video when its cased up, not that theres anything new to see - apart from the S/C button you wouldnt know its not the old PIC encoder, which was the intention all along.
I'll write some notes asap. Here is the case I used: https://uk.rs-online.com/web/p/general- ... es/1610919
arduino_reeds12.jpg
reed_toggles.jpg

The sketch has the single-channel emulation option, D10 is sequential (button to ground) and D11 is compound. I use a 2-way toggle switch to connect the single-channel button to one or the other. Select which toggles you have wired if you dont have all them connected, as in say a 6ch or 10ch set.

The document is too large to upload here, download it from the singlechannel.co.uk site.

Reeduino Spec summary:

Up to 12 channel emulation. Used and unused toggles are configured in the 'activetoggles' array.
Resolution is 1uS and is super smooth, even when the servo transit speed is set very slow.
Servo reversing by switching on with the required toggle thrown. Saved to flash.
Reeds elevator-trim is emulated realistically, plus trims on every channel, by simultaneous use of elevator trim and
the required channel, with elevator trim lock to make trimming channels other than elevator much easier.
Optional 'Tiny-6' style trim button.
All trims are saved to flash.
Trim-pips with longer neutral-pip
V-tail mixer enabled by grounding D7 either with a Spektrum bind plug or via a switch
Adjustable Travel Volume (ATV) on every channel, range 20% to 112.5% travel. Default is 100%. Saved to flash.
Truly variable servo transit speed to match period servos such as the Bonner Duramite. Takes ATV into account.
10 minute inactivity timer, sounds if no keys are thrown for 10 minutes. Any key resets the timer.
Range-check sweep mode, whereby the transmitter can be left sweeping whilst you walk away with the model
Master flash reset, reverts all reversing, trim & ATV settings back to defaults.
One character Morse identifiers are used to confirm modes: D for reset to Defaults, R for Reversed, A for set ATV, V for ATV end, S for Scan, K for OK.
Futaba AETR or JR/Spektrum TAER channel order
Full Single-Channel compound escapement emulation via a 'tone' button
If the set is held in 'reset' for 10 seconds then a full ID is sounded.
reeduino_2.jpg
reeduino_orangerx.jpg
reeduinoheader.jpg
reeduino12.jpg




Edit: Since any further Reeduinos are most likely to be built on DIY-More 'Strong' boards, heres a video demonstrating the simple mod required to provide a convenient 3-pin RF module header carrying neg, battery pos and PPM:







Edit: ( this is important to me! )
I feel I have to explain the use of resistors and to make it clear that this is not "propo with switches instead of pots" :-)
The only reason for using analogue inputs with the resistors centre-biasing is to enable 3 'digital' positions to be read by one input pin. It makes the cabling easier and its more economical on processor input pins - the three toggle positions are not in any way linked to servo outputs, or to the resistor values.

Each input is quantised to 3 states: 'left toggle', 'right toggle' or 'neither'. To do this I use just the 2 most-significant bits of the ADC, which are translated as:
00=toggle thrown one way, signal line less than 1/4 rail, typically at ground 0v
01 or 10 =toggle at neutral, signal line is between a quarter to three-quarters rail, typically around half (2.5v)
11=toggle thrown the other way, signal line above 3/4 rail, typically the full 5v
Anything from 1/4 to 3/4 rail is seen as the toggle at neutral, this completely eliminates any resistor tolerances.

All the servo positioning is done from subsequent processing of 'target values' derived from several sources - the current position, servo-slow, trims, ATV and the various mixes - its not related to the precise voltages read on the analogue inputs as it would be with a 'switched' propo stick pot.
The old PIC Reeds encoders (the 12 & Tiny6) use exactly the same technique. Its important for me to emphasize this point because replacing sticks pots with fixed resistors on a propo encoder would a very simple but rubbish way of emulating reeds, and I dont want people to think the Reeduino or PICs use such a cheap & nasty option :-)

All this can be demonstrated by using a centralised pot instead of a toggle with resistors - it will be immediately obvious that as the pot is rotated, the encoder responds only to three switched states because half of the overall pot swing falls within the 'neutral toggle' band of 1/4 to 3/4 rail - neutral toggle is a digital switch status, and neutral servo is the result of lots of unrelated calculations :-)
Attachments
reeduino.ino
(18.2 KiB) Downloaded 190 times
User avatar
tiptipflyer
Posts: 346
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by tiptipflyer »

Re: 12-channel reed encoder "Reeduino" with S/C emulation
Postby tiptipflyer » Wed Mar 22, 2017 10:23 am


The next Reeduino version is ready for test-flying.
It is a Kraft Custom 6 replica using the Reeduino with S/C emulation and all the bells and whistles like ATV, mixer etc. but only 6 channels and a trim button like the Tiny6.
RF is a Jamara 35MHz module, power comes from an old 2S lipo, and because it is old and worn, no ballancing during charging.
Works great here at home, test-flying next week will proof its reliability.
A 12 channel version will follow in the near future.
.
fileac92.jpg
fileed19.jpg
Cheers
Fran
User avatar
tiptipflyer
Posts: 346
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by tiptipflyer »

Re: 12-channel reed encoder "Reeduino" with S/C emulation
Postby tiptipflyer » Sat Jun 10, 2017 1:09 pm


Hi Guys,
my Reeduino 12 channel transmitter is almost finished. I just have to add the S/C button, the ATV button and a mixer switch. The rest is ready to go and already tested. The flight-tests were very succesful, no problems at all as expected.
I was flying a Goldberg Slylane 42, a Hegi Fechdax, Ken Willard´s Roaring 20 and Schoolboy. A great radio. I chose the Engel Multiplex 3x4 replica design for this one.
It features both Spektrum 2.4GHz and Futaba 35MHz to be as versatile as possible, just a flip of the switch.
The Oled display shows the battery voltage and transmitter name and by pushing the tiny red button also the pulses for all six channels in numbers, so you can always can see what is going on.
One Arduino pro mini is powering the display and a second Arduino is powering the transmitter part. Power comes from a 2S Lipo.
Many thanks to Phil for the transmitter software and to Ron and Martin for the display software.
.
file2565.jpg
file2565.jpg
file8617.jpg
file8617.jpg (47.62 KiB) Viewed 3934 times
Cheers
Frank
jmendoza
Posts: 162
Joined: 18 Feb 2018, 23:07

Re: Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by jmendoza »

Going to give the Reeduino a try using Pro Mini Strong board.
It is going into an Original Orbit, the old Tube type, big Black box
I need to confirm that if I use 5 toggles (10 channel) code will be 1,1,1,1,0,1

Need to confirm that for safety reasons with an ESC, I'm assuming you cannot reverse the throttle.

Does the throttle servo run at half the speed of the other servos? If I set the servo speed to 1 second, does it take 2 seconds for the throttle to go full throw?

I have a ton of 4.7K in stock, but only a few 10K, so can I use 4.7K on the toggles?

To tidy things up I plan to run a daisy chain from each lug of the toggles for +5 and ground as the original Orbit wiring is already that way, and only add a single wire to each toggle for the signals to the Analog inputs. I typically use no connectors or pins, all hard wired and laced into a nice harness.

The original light bulb, used for tuning the RF output and power indicator will be retained by using a resistor in series with it to 5 Volts.

Phil, I see you used a Gibson pickup selector switch toggle for testing, nice!
Tip Tip, I like your NPN Kraft logo, the originals were PNP and it took me a while to figure out what was different with yours, very sneaky!

Wish me luck, as this will be my first Reeduino, but I have done quite a few of the 12 channel PIC reed conversions. This is a bit more complicated, but has way more features, so it's appears to be well worth the extra effort.
Merry Christmas guys! Jay
User avatar
Phil_G
Posts: 475
Joined: 15 Feb 2018, 23:32
Contact:

Re: Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by Phil_G »

Answers inline Jay.
Going to give the Reeduino a try using Pro Mini Strong board. Good man!
I need to confirm that if I use 5 toggles (10 channel) code will be 1,1,1,1,0,1 Yes thats right, see below

Need to confirm that for safety reasons with an ESC, I'm assuming you cannot reverse the throttle. actually throttle is reversible, I was pressured by the IC lads to allow it!

Does the throttle servo run at half the speed of the other servos? If I set the servo speed to 1 second, does it take 2 seconds for the throttle to go full throw? Yes, with full speed its hard to set. 1 second would be end-to-end. For me, thats far too slow, I know the old Duramites were slow but I like mine about twice as fast - so the throttle is 'normal'. Back in the day™ we used to run period throttle servos via a resistor dropper.

I have a ton of 4.7K in stock, but only a few 10K, so can I use 4.7K on the toggles? Yes not critical as long as they're equal within a pair
The original light bulb, used for tuning the RF output and power indicator will be retained by using a resistor in series with it to 5 Volts. I would run it from the battery volts, the 5v reg is crucial

Wish me luck, as this will be my first Reeduino, but I have done quite a few of the 12 channel PIC reed conversions. This is a bit more complicated, but has way more features, so it's appears to be well worth the extra effort. Its a piece of cake, loads have been done Jay. Dont omit the transit speed pot, its essential.

Config: [See following post 19/06/2022, the four most popular configuration can now be selected by a dipswitch]
Hi Jay
The two forward-slashes tell the compiler that the rest of the line is just a comment, to be ignored.
Comments are for our benefit, just to explain things, they dont affect the program at all.
If you have two config lines, only one of which you want 'active' its usual to have both lines in the code but to 'comment out' the unwanted line. This means its still there for the readers comprehension but the compiler ignores it, as its a comment.

In this format its exactly like REM in BASIC. There is also an option for commenting blocks of text rather than individual lines.

So in this case, all the activetoggles configurations are 'commented out' by prefixing with '//', except the one you actually want.

This is a 12 channel configuration:

Code: Select all

// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order:  aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};

//  const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch. 
//  const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle 
//  const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones, 
const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
...and this is a 10 channel configuration:

Code: Select all

// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order:  aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};

//  const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch. 
//  const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle 
const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones, 
// const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
...this is a 6 channel config, like the Tiny-6:

Code: Select all

// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order:  aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};

const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch. 
//  const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle 
//  const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones, 
// const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
Note that in each case, the line we want has had its '//' prefix removed, and all the lines we dont want are commented out by the '//' prefix.

Cheers
Phil
User avatar
Phil_G
Posts: 475
Joined: 15 Feb 2018, 23:32
Contact:

Re: Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation

Post by Phil_G »

This is a small update to the Reeduino project for new builds, please note that there is no advantage in updating a working transmitter as functionally nothing has changed. All I've done is to put the four most popular activetoggles configurations, the channel order (AETR or TAER) and the V-tail mixer on a dipswitch. This means theres no editing of the sketch to suit your configuration, the one sketch suits any just by flicking switches.
Of course the actual wired toggle configuration has to match the switch selection, see attached diagram :-
12ch with aux, thats 6 toggles - ail, ele, throttle, rudder, aux & trim toggle
10ch without aux, , thats 5 toggles - ail, ele, throttle, rudder, & trim toggle
6ch , thats 3 toggles - ail, ele, & trim toggle for gliders,
6ch again 3 toggles for IC - ail, ele & throttle using the trim button idea from the Tiny-6.
The ATV, S/C mixes, Vtail, transit speed, sweep & trim button options are unchanged other than I've had to move a few connections, other than that the original Reeduino P19 document still applies, for new builds just substitute the new connections until I get the document updated.
To emphasise please note that there is no advantage in updating a working transmitter as the overall functionally is unchanged, this is just a neater way of selecting configuration options without changing the sketch :)

reeduino2022.jpg

PS if you prefer, of course the dipswitch can be replaced by headers & links (spektrum bind plugs) - but for config that usually is only done once, dipswitches are ideal.
Attachments
reeduino2022.ino
(18.22 KiB) Downloaded 4 times
Post Reply