7ch Propo + S/C mix encoder update/rewrite

Single to Multi propo
User avatar
Phil_G
Posts: 596
Joined: 15 Feb 2018, 23:32
Contact:

7ch Propo + S/C mix encoder update/rewrite

Post by Phil_G »

*** There have been many updates since this thread was started, and itself its a rewrite of the original encoder thread lost when 'reunited' closed.
Its good for telling the story & setting the scene but please get the latest sketch and document from items P16a and P17a on the Archive page of www.singlechannel.co.uk ***

Heres the 'Version 2' thread as it began in 2019:
This is really for my own satisfaction, I've wanted to revisit this project for ages but its only recently that Shaun kicked me into gear with his 'Retro Ramblings'.

The lengthy 2014 "7ch+s/c encoder" thread was irretrievably lost when "Reunited" closed and whilst the thread itself was a really good craic, it was 8 years ago so here's an overdue update, let me say from the outset that this remains a really simple encoder - it doesnt compare with Mikes full-on and quite excellent computer-radio encoder or with say the Microstar, or with probably a dozen other very clever encoders out there in webland - but that's not where its aimed ;)

Just like the old version its intended for plain, simple retro conversions such as Skyleaders, Fleets, Krafts etc, with the benefit of a few niceties over the originals. As such the encoder has no display and hence no menus, no pushbutton-trims, it has no model memories - just like the old sets! This makes for simple conversions with just a few servo leads connecting the switches and pots. Some of us (me, Ron, Frank...) prefer each model to have its own dedicated, 'period appropriate' transmitter so model memories arent a concern, and mechanical trims dont lend themselves to 'storage' anyway though I know Mike has gone to great lengths to overcome this. Having said what it doesnt do, here's what it does do:

Features:
Interrupt-driven PPM (same as the Reeduino) replaces the inline timed method
Single Channel (S/C) escapement emulation mix, sequential and compound
...with the option of a faster S/C escapement rotation speed
Minute-minder flight timer
Slow channel 7 with the option of 2 speeds (.8 or 3 seconds transit)
Switchable channel order Fut/Spek/Spek400uS/ETAR (ETAR is for modules with an unwanted map)
When TAER-gear-aux1-aux2 is selected the PPM changes to 400uS pulses to suit Spektrum DM8/DM9
Expo now mimics Futaba expo (thanks Mike & BEB)
Rate (travel volume) on primary channels as before
Channels changed to 1100 - 1900 plus trims, ie trims are now excluded from calibration (easier)
3-position calibration mapping to ensure neutrals with imperfect sticks
Reversing by holding appropriate stick over on power-up as before, retained in flash
V-tail 50:50 mixer as before
Elevon 75:25 mixer as before
Hardware throttle lock switch as before
Throttle soft-lock with alarm if invoked (throttle must be closed before it will open) as with all my stuff :-)
Single-handed range-test sweep (set tx sweeping, leave tx & walk away with model)
Inactivity alarm to avoid batteries flattened overnight, etc etc

The channel-order selection makes it easier for me - now I dont have to set AETR or TAER on requested boards.

Connections:
Following Mikes suggestion, to accommodate an 8-way dipswitch I've swapped D6 (timer button) and D8 (75:25 mixer) from the previous version. Theres no code change as such, only these two port pins are swapped. Obviously your 'D6/D8' hardware connections have to match the sketch. Any ready-made encoder requests can be supplied with or without the dipswitch but will have the current 'swapped D6 and D8' firmware regardless of whether a dipswitch is actually fitted.

This means that the options in blue such as S/C emulation speed, Ch7 transit speed, channel mapping, and mixers can optionally be selected by flipping a dipswitch rather than by adding & removing links to the header pins:
D1 S/C emulation speed, linked = fast *** remember DIYMore Strong board has D0 and D1 reversed ***
D0 PPM out, position unused, use the RF module header
D2 spare
D3 channel 7 speed, slow or faster (.8 or 3 seconds transit)
D4 channel order with D5...
D5 D4&D5 open = AETR, D4 linked = TAER127, D5 linked = TAER712 (400uS), D4&D5 linked = ETAR
D6 75:25 mixer dipswitch or link
D7 50:50 mixer dipswitch or link


D8 minute-minder button 1 minute per pip
D9 throttle lock switch
D10 S/C sequential button
D11 S/C compound button
D12 Channel 7 toggle switch
D13 buzzer (& haptic if reqd, connect in parallel in 2N3904 emmitter)
A0 Aileron pot
A1 Elevator pot
A2 Rudder pot
A3 Throttle pot
A4 Aux1 channel pot
A5 Aux2 channel pot
A6 Expo switched pot (switch is only tactile, not wired)
A7 Rates switched pot (switch is only tactile, not wired)

Note that the calibration process is slightly different - centre all trims, hold either S/C button, switch on, keeping the button held, waggle all the controls including the aux pots to their extremes, then centre all controls including the throttle and aux channels. Release the button. Leave the trims central throughout calibration. This accounts for sticks that electrically arent quite perfectly centred.

Additional features are all simple optional plug-in switches or buttons, so can be omitted if not required, or options can be selected using either an 8-way dipswitch if fitted, or if headers are fitted, bridging links like Spektrum bind plugs, linking the signal pin to ground - positive is unused but beware 5.08mm links that short all 3 pins! :o

The encoder has been extensively bench tested and has flown many times without problems by a small group of us.

I've done a much briefer doc concentrating only on the DIY-More 'Strong' board, of course anyone familiar with Arduino will have no trouble on pretty much any of the popular boards. The mods differ between different boards, so check whats required if you use other than a DIY-More Pro Mini Strong.

As before, if anyone would like an assembled, programmed & tested board, ready-to-go, drop me an email on philg@talk21.com please. Let me know if you prefer header plugs or a dipswitch for option selection. Time permitting, I dont mind doing the odd 'variation on a theme' either.

For headers, here are some suitable 'option select' plugs (Spekky bind-plugs), reasonably priced, in packs of 10:
https://www.ebay.co.uk/itm/401028336922

header_plugs.jpg
header_plugs.jpg (14.21 KiB) Viewed 226574 times


Dont use those little black 5.8mm links as they short all three pins together and could destroy your board!


I've a nice Skyleader Clubman, already Frskyfied and was originally fitted with a 5ch PIC encoder which was fine but basic - so I've re-refitted it with the new 7ch encoder:






As the document shows, a small mod is necessary to the DIY-More Strong" board to provide a convenient RF module header which carries neg, battery pos and PPM.







Bear in mind the dipswitch is optional, you can choose headers or a dipswitch, the code is the same.


IMG_20200210_141058_397.JPG

IMG_20200221_102253.jpg

7ch_new_wiring_feb.jpg

7ch_new_wiring_dipswitch.jpg

Cheers
Phil
PPM_Enc_7ch_sc_v2_2022.ino
(20.76 KiB) Downloaded 116 times
PPM_Enc_7ch_sc_v2_dipswitch.pdf
(11.87 MiB) Downloaded 155 times


Previous download count for reference (dont click these, its just a picture! The actual links are the ones immediately above this):
7ch_download_count.jpg
7ch_download_count.jpg (30.32 KiB) Viewed 210436 times
User avatar
Phil_G
Posts: 596
Joined: 15 Feb 2018, 23:32
Contact:

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Phil_G »

Edit 12/02/2020: Tidied up so there is only one version of the code & the document, which suits either 'dipswitch option' or 'header options' without any changes. Regardless of whether you choose a dipswitch or headers, D6 is now the 75:25 mixer and D8 is now the minute-minder button. Other than this pin-swap, the code is unchanged. (Inadvertently getting D6/D8 the wrong way around is harmless).

Edit 08/02/2020: Following Mikes suggestion, above is a 'dipswitch' version which avoids the need for links for selecting options.
To accommodate an 8-way dipswitch I've swapped D6 (timer button) and D8 (75:25 mixer)
Theres no code change as such, only these two port pins are swapped. Obviously your 'D6/D8' hardware connections have to match the sketch version. Any ready-made encoder requests can be supplied with or without the dipswitch. I hate having multiple versions so the 'swapped D6 and D8' version will be the one regardless of whether a dipswitch is actually fitted. I'll leave both up for a week or so then remove the original (the unswapped D6/D8 one)

This means that options such as S/C emulation speed, Ch7 transit speed, channel mapping, and mixers can be selected by flipping a dipswitch rather than by adding & removing links to the header pins.

Edit 07/02/2020: Added a diagram to the document showing switched 'rates' as requested by Paul. No code changes, just a document edit.

Edit 24/01/2020: Added a video to the post above which demonstrates the 'Strong' board mod to provide a 3-pin RF module header.

Edit 20/01/2020: No code changes as such but I still wasnt quite happy with the noises I'd chosen, so I've changed them again. I spent a while experimenting with sounds and settled on these which I'm happy with, they're nicer and less intrusive (on the flight line I found the timer alarm was annoying!)
Took the opportunity to change ch7 so its now either 0.8 seconds or 3.2 seconds transit time which seems more sensible. In the document I found another reference to using the 5.08mm links - this has been removed. They are a bad idea as they short all 3 pins including the 5v supply. You could omit the centre pin (+) as Mike suggested but one day you'll pop it onto the wrong header, and let the magic smoke out :D

Edit 16/01/2020: In the document I found a reference that I'd missed, to using the 5.08mm links - this has been removed. They are a bad idea as they short all 3 pins including the 5v supply.

Edit 14/01/2020: I've posted an update, just changes to the way the buzzer sounds, adding a startup pip, made the minute-minder alarm less intrusive (in practise the alarm was annoying!). This is just a small code update and only concerns the noises it makes, encoder-wise there are no changes.

Edit 18/12/2019: Found a cheap source of Spekky bind-plugs in packs of 10, ideal for selecting options, edited into first post above.

Edit 15/12/2019: I've added a few explanatory comments and renamed the array "channel[]" to "contrl_pos[]" as it really depicts control positions, whereas some were confusing it with receiver output channels. No code changes.

Edit 14/12/2019: the links (bridges, straps, whatever you call them) arrived and they're no good at all for our purposes, so I've removed the reference to them here and in the document, which I've reposted above. No code changes, just a document update.

Edit 13/12/2019: added a few drawings to the doc, showing buttons & switch connection examples.
No code changes

Edit 5/12/2019: I've added a couple of photos to the document, also removed a dead link to the old SinglechannellersReunited thread. No code changes. I'll improve the document over time, its brief but I think it covers everything, if anyone spots an omission please shout.

Edit 5/1/2020: Clarified (hopefully) the calibration process in the header notes and in the document as I've had reports of 'throttle trouble' which in every case has been due to the 'old' calibration process being used and the throttle stick hadnt been centred. Others have switched off before releasing the button - it cant save calibration values if you've switched off! This is the most frequent email query and try as I might to explain it clearly, calibrating still seems to confuse some users, probably because it has changed - and it must be done properly :)
See the doc for optionally setting a 'non-linear throttle' which is particularly nice for IC engines
Also edited the 'separate trim pot' diagram with values suggested by JMP.
Added the demo video to the first post.
User avatar
F2B
Posts: 200
Joined: 16 Feb 2018, 11:23
Location: 20 m NE of Amsterdam

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by F2B »

Congratulations and thank you!

Chock full of good ideas, a tremendous help in further understanding the matter as a whole.


Bruno
F2B or not to be....
User avatar
Wayne_H
Posts: 808
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Wayne_H »

Phil_G wrote: 05 Dec 2019, 23:03 The lengthy 2014 "7ch+s/c encoder" thread was irretrievably lost when "Reunited" closed and whilst the thread itself was a really good craic...
Cheers
Phil
check your pvt email
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
Scott Todd
Posts: 66
Joined: 26 Mar 2018, 23:21

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Scott Todd »

Super Awesome! As a regular user (over 30 conversions with occasional custom software mods) this is quite exciting and extensive. Its SO appropriate for vintage metal boxes. I know the displays and such are cool but to just fly an old transmitter, it just doesn't get any simpler. Great job Phil!

Scott
KI7LWR
User avatar
Bo Edstrom
Posts: 23
Joined: 20 Sep 2018, 19:52
Location: Sweden

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Bo Edstrom »

About channel 1-6 on Phil's 7 ch encoder board, on the DIY More (DM) Strong Series Pro Mini 5 volt /16 MHz microcontroller board:
https://www.diymore.cc/products/diymore ... 2456455226

In Phil's documentation about his 7 ch encoder it is written about paralleling unused connectors on ch 1-6:

Paralleling unused analogue stick inputs: This applies to channels 1 to 6 and though it isn’t absolutely necessary, unconnected or ‘floating’ inputs can cause an unused channel to act unpredictably. This will never cause a problem in use, but leaving an unused channel to its own devices is untidy. Often an unconnected input will ‘pick- up’ the adjacent connection, sometimes it will stay at one extreme of travel, sometimes it will wander. The reason I suggest paralleling unused inputs to a used input is to ensure that unused channels behave predictably. The encoder always sends 7 channels.

Question:
What can be good solutions to do such paralleling?
Example, lets say You want to use Phil's 7 ch encoder in a 2 or 3 ch radio. That mean parelleling 4 or 3 unused connectors.
Lets say for a 3 ch radio:

A0 Aileron (used)
A1 Elevator (used)
A2 Not used (Rudder)
A3 Throttle
A4 Not used (Aux 1)
A5 Not used (Aux 2)

In this example I need to parellel (all 3 pins?) from one used lets say A1 to unused in this case A2-A4-A5.

Maybe use solder on tabs (ears, similar as used on solder ears on batteries) on each pin that is to parallel and then just use wire between the tabs(ears)?
Or is there any low profile "jumpers" similar to what is shown in Phil's latest documentation but very low profile so it can be stacked, for in this case paralleling purpose? If so one could use a short servo cable with connectors, from A0(used) to A2(unused) and one from A1(used) to A4(unused) (+A5 unused) and this way parelleled, assuming use of low profile jumper between A4-A5). But I do not know how high (long) the pins are on the DIY More Strong Series Pro Mini board, if it would be possible to have low profile jumpers paralleling A4-A5 and on top of that an ordinary servo connector on A4 (or A5) coming from A1.
How do You folks do this paralleling in easy way?
I would prefer not to need to solder tabs(ears) on any pins and wire between the tabs(ears).

/Bo

Image
Last edited by Bo Edstrom on 15 Dec 2019, 00:43, edited 6 times in total.
Scott Todd
Posts: 66
Joined: 26 Mar 2018, 23:21

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Scott Todd »

Phil should respond with a more technical answer but in short, you can just leave them. I have done lots of 3 channel radios and I usually just leave them. He only says its 'untidy'. You could also go into the sketch and zero them out. Somewhere around throttle lock and the slow function, you could just add the commands 'channel[x]=0' where x is each channel you want to zero.


I think half the fun is playing with Phil's code and learning what it does. Then its SO easy to make simple custom mods like this.

I'll edit/delete this when Phil corrects me :) Please don't quote this post.

Here is a screen shot of what you would add to Phil's code. And here is a photo of it in action. You can see I pulled plugs from the three unused channels and the PPM analyzer shows them still centered.

Hope this is slightly clearer than mud and helps :)

Scott
Attachments
IMG_0761.jpg
Screen Shot 2019-12-14 at 10.28.38 AM.png
Last edited by Scott Todd on 14 Dec 2019, 17:32, edited 2 times in total.
User avatar
Bo Edstrom
Posts: 23
Joined: 20 Sep 2018, 19:52
Location: Sweden

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Bo Edstrom »

Thanks Scott,
We will se if Phil discover my post and Your suggestion, and what he has to say about it.
But still if one want to physically parallel several unused pins I'm intrerested to know how others have done it (preferable not by soldering anything on the pins involved).
Just mounting servo leads with connectors on the unused pins and then solder together the ends together (all plus ends together, all minus ends together and all signal ends togehter, and some shrink tube on each such soldered ends) will work I suppose but it is maybe not so "neat".

/Bo
Last edited by Bo Edstrom on 14 Dec 2019, 17:53, edited 2 times in total.
Scott Todd
Posts: 66
Joined: 26 Mar 2018, 23:21

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Scott Todd »

So I did do this in earlier builds. You don't need to put the GND and V+ pins in. I usually just added a wire to the nearest wiper pot, put a single pin on the end, and plugged it into unused channel. If you are using servo leads, just put the signal on the pot wiper. You could add the + and - if you wanted but they are not required as this is a common bus on the Arduino board.

You already have the Sketch open to flash it. Its literally two minutes to scroll down, add the three lines, and re-flash. Problem solved. (it could be on one line but I put it on three for the example for clarity)

You'll get some other reply's. Its a friendly board :)

Scott
User avatar
Bo Edstrom
Posts: 23
Joined: 20 Sep 2018, 19:52
Location: Sweden

Re: 7ch Propo + S/C mix encoder update/rewrite

Post by Bo Edstrom »

OK,
So if paralleling between lets say from one used A1 to unused, in my case to A2-A4-A5 unused, You need only paralleling the signal pins? It that correct?

/Bo
Last edited by Bo Edstrom on 14 Dec 2019, 17:50, edited 1 time in total.
Post Reply