Repost: Trad 12-channel reed encoder "Reeduino" with S/C emulation
Posted: 24 Feb 2018, 12:38
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'
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
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
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.
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
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'
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
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
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.
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