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

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

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

Post by Phil_G » 15 Dec 2019, 12:38

Hi Bo, you're over thinking all this ;) Any 328P board will do, even Nanos, ProMinis or anything similar, genuine or clone. I've supplied hundreds of the type recommended and I just buy whatever is on ebay at the time - I've never seen one that isnt labelled "DIY-More" - but if it was, but looked identical, that wouldnt concern me. In fact I'm pretty sure DIYMore cloned their board from a "Deek Robot" design :D

I've added a few explanatory comments and renamed the array "channel[]" to "contrl_pos[]" as it actually depicts control positions, hopefully avoiding the confusion with receiver output channels. No code changes.

Code: Select all


// Optionally, and only if you fully understand the array allocations, you can set any unused analogues here instead of
  // paralleling unused analogue inputs.  Either method prevents floating inputs 'wandering' or following an adjacent pin.
  // Physical wiring is: A0=aileron stick pot, A1=elevator, A2=rudder, A3=throttle, A4=aux1, A5=aux2, and
  // A0 is your 'primary steering' control - on a rudder/elevator/throttle set, the rudder servo is plugged into the aileron channel. SOP.
  // Array numbering is: contrl_pos[0]=aileron stick pot, contrl_pos[1]=elevator, contrl_pos[2]=rudder, contrl_pos[3]=throttle, 
  // contrl_pos[4]=aux1, contrl_pos[5]=aux2.
  // So for example on a 3ch set, zero the rudder, aux1 & aux2 elements (contrl_pos[0] is primary steering) like this:

  // contrl_pos[2]=0; contrl_pos[4]=0; contrl_pos[5]=0 // example for a 3ch rudder-elevator-throttle set
  // contrl_pos[4]=0; contrl_pos[5]=0; // example for a 4ch aileron-elevator-rudder-throttle set


Bo Edstrom wrote:
15 Dec 2019, 02:05
...
So if I for example would not use aileron one would zeroing contrl_pos[0]
Is this correct?
No Bo, contrl_pos[0] is your primary steering channel, in a 3ch set rudder is primary steering.
You would never disable the aileron channel unless you fly some weird mode (3?) with steering on the secondary stick. When you fit out a 3ch rudder-elevator-throttle model, its expected that you'd plug the rudder servo into the receiver aileron channel... thats how its always been :D
The single-channel emulation operates on array element "contrl_pos[0]" as your primary steering channel, as do the V-tail and elevon mixes.
Its unfortunate that I initially used the word 'channel[]' as the name for the servo position array, as occasionally people confuse it with R/C channels and the order of channels output by the receiver.
So on a 3-channel set, you would zero contrl_pos[2], contrl_pos[4] and contrl_pos[5], leaving contrl_pos[0], contrl_pos[1] and contrl_pos[3] active for rudder, elevator and throttle respectively.
MaxZ wrote:
15 Dec 2019, 09:57
So it seems to me that, besides zeroing the unused channels, you still need to tie those together and connect them to the wipers of your stick pots (or just ch4 ?
No you dont Max, its either tie unused inputs OR code them out. The document is aimed at non-tech people who use my pre-programmed 7ch boards, or who are not adept at code changes, and they should tie unused inputs.
For those who can code, who fully understand the sketch and are blowing their own boards from it, zeroing unused contrl_pos[n]=0 is an alternative. Nothing has changed in this respect from the earlier code! :D

To be honest this urge for first-time-users to change a perfectly stable project before even trying it makes me nervous. If anyone is not absolutely 100% on how the code works I'd be much happier if they leave it as-is and parallel unused inputs exactly as per the document, many hundreds have been done this way, exactly as per the document, and it works!

Cheers
Phil

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 » 15 Dec 2019, 12:41

Phil,
Thanks for the clarification on the unused "channels". It is clear now (to me).
I did figure out the Aileron is used even in a 3 ch scenario, but I was just after the number to put in [X] for unused "channels" in the code.

For me I think it is no point to change anyting in the code since I do not see any special scenario (yet) to need to modify anything there. As You point out one should really know what things do there. Still interesting to see the code You have written for the 7 ch encoder, I was surprised that it was not more code needed then this.

Great that any ebay board will work then, as You say. I did not know, sorry.

Have patience with me, I'm learning slowly bit by bit (I hope), I have been flying proportional since 1973 so I have been flying for rather long time by now, but never digged under the hood in any of my radios really and I have never converted a radio before to 2.4 GHz, and the encoder boards are new teritorry for me. But I have read all Your documentation and most forum posts I have been able to i find about your 7 ch encoder. It is impressive work You have done for the retro RC users that want to convert an old radio with new encoder board (and 2.4 GHz module). I have maybe over 10 old radios from late 1950s, early 1960s but most are from early-mid 1970s that I would like to convert. It is proportionals, reeds and single channel radios. I have read Your documentation for the "Reeduino" and singel channel emulator encoders also.

/Bo
Last edited by Bo Edstrom on 15 Dec 2019, 13:20, edited 9 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 » 15 Dec 2019, 15:46

Great job explaining all this Phil :) It alwasy makes me smile when I read these threads. I have only done about 50 Arduinos. I have used all the boards in Phils' documentation and never had a failure of any of them. Some have been re-flashed hundreds of times when playing with the code. Most are radio encoders but I have also played with the PPM Analyzer (Excellant!) and a few other sketches related to RC stuff. I have been thru every line of Phil's codes and changed stuff on the bench to learn and understand what is going on. When asked, I almost always recommend people use his code as-is. Like Phil says, just because I like to tinker in there, doesn't mean everyone should.

Having said that, its good Bo is trying to understand a little of what is going on since he has a lot to convert. But at he end of the day, Phil's code is awesome and works great as-is. A few minutes of making extra leads for the unused channels is a small price to pay for the hours of enjoyment you will get flying your old Radio :)

Bo, there is also fun stuff going on in the Vintage Radio forum on RCG. You will find lots of pictures of radios and conversions. Phil also chimes in there and always has good stuff to add. Good luck and we look forward to some pictures ;)

https://www.rcgroups.com/forums/showthr ... ol-Systems

Mike_K
Posts: 317
Joined: 16 Feb 2018, 06:35

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

Post by Mike_K » 20 Dec 2019, 09:00

Phil_G wrote:
19 Dec 2019, 11:40
I found a cheap source of Spekky bind-plugs which are perfect for selecting options on DIY-More boards:
Hi Phil

I've been using these header pins for a while now with the DIY-More boards. Not as cheap as your Spekky bind plugs, but more easily available:

https://uk.farnell.com/amp-te-connectiv ... dp/2668461

I also bought some similar headers to what you bought from eBay and while they shorted all three pins together, they didn't fall to pieces. My solution to shorting all three pins out - don't fit the centre positive pin.

But what I've been using for my last few projects (not your transmitter) with the DIY-More boards has been to fit DIP switches. Now I know they are on a 0.3" (7.62mm) pitch and the 0V and inputs on the Arduino are on a 0.2" (5.08mm) pitch, but the legs can be easily "teased" inwards into position with pin nosed pliers. I don't know what inputs you've got your header connected to as I haven't looked at your code, but I would imagine they could be reconfigured if necessary. Ideally, the DIP switch is fitted at the end of the row of I/O (4 to 7 in my case) as they overhang a little at each end. In the photo, you can see digital 3 becomes a little tight to use. In my opinion, a DIP switch is a lot more convienient than headers and about the same cost.

https://uk.farnell.com/multicomp/mcnds- ... dp/2910894

DIY_More_DIP.jpg
Mike

User avatar
Wayne_H
Posts: 353
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

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

Post by Wayne_H » 06 Jan 2020, 02:10

Thanks again Phil, top job! :D
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)

User avatar
Phil_G
Posts: 312
Joined: 15 Feb 2018, 23:32
Contact:

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

Post by Phil_G » 10 Feb 2020, 15:30

Always open to suggestions, I've swapped a couple of pins to accommodate a high quality miniature 8-way dip switch for the option settings, instead of links. The swap is D6 with D8, so the minute-minder button is now on D8 and the 75:25 mixer is now on D6, which means both mixers are now on the dipswitch:


IMG_20200210_141058_397.JPG


Dipswitch position 1 - D1 S/C emulation speed (Remember DIYMore board has D0 and D1 reversed)
Dipswitch position 2 - D0 is PPM out so this switch isnt connected
Dipswitch position 3 - D2 spare switched option
Dipswitch position 4 - D3 channel 7 speed
Dipswitch position 5 - D4 channel mapping
Dipswitch position 6 - D5 channel mapping
Dipswitch position 7 - D6 75:25 mixer
Dipswitch position 8 - D7 50:50 mixer

Its unfortunate that the pins are D0 to D7 but the switch is labelled 1 to 8, in the doc I'll use switch numbers.

The wired connections are the same as before other than D8:
D8 minute-minder button (was D6)
D9 throttle lock
D10 S/C sequential
D11 S/C compound
D12 Channel 7 toggle
D13 buzzer

Analogue inputs are unchanged. If rates and/or expo are unwanted, A6/A7 will need a link as before.
A0 Aileron
A1 Elevator
A2 Rudder
A3 Throttle
A4 Aux1
A5 Aux2
A6 Expo
A7 Rates

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

The 'dipswitch or headers' version of the code is appended to post #1, the only difference from the former version is the D6/D8 swap, consequently this rearrangement is fine whether you prefer the dipswitch or header, and any ready-made encoders I supply now will use the 'swapped' code, and ultimately I'll phase the old doc & sketch out, two versions of the same thing is confusing.

There are pros & cons, headers give you the choice of a remote switch or a link, whereas a dipswitch is just the switch which is inside the transmitter case. Header links take up more room where the dipswitch is neat. Headers allow you to reallocate pins should you modify the code. So the dipswitch wont suit everybody but the revised pinout (D6 & D8 swapped) is fine either way, so both will use the identical sketch.

Cheers
Phil


dip_encoder.jpg

User avatar
Wayne_H
Posts: 353
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

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

Post by Wayne_H » 11 Feb 2020, 00:02

I like it!! 👏 :) Shall use on my next conversion - probably the EK Champion - after we finish our move.

Thanks Phil (and Mike ;) )
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)

Mike_K
Posts: 317
Joined: 16 Feb 2018, 06:35

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

Post by Mike_K » 11 Feb 2020, 14:46

Hi Phil

Have you found a 0.2" pitch DIP switch (to fit directly between 0V and the signal) or are you using a 0.3" pitch switch and "teasing" the legs into the PCB?

Cheers Mike

User avatar
Phil_G
Posts: 312
Joined: 15 Feb 2018, 23:32
Contact:

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

Post by Phil_G » 11 Feb 2020, 16:16

Hi Mike, I did have some 5.08mm switches years ago but no one seems to sell them now, at least I couldnt find any, so these are the usual 7.6mm but since they're low profile the legs tuck under nicely ;)
I would like to find some numbered 0-7 but I've not looked far, numbering isnt a search option on RS :D
Otherwise its bound to cause confusion as we have 3 descriptions for that row of connections:
01234567 = silkscreen (which is wrong)
10234567 = actual
12345678 = dipswitch
Fun & games will ensue I'm sure. One option would be a printed 0-7 sticker over the dipswitch labelling but it creates more faff when I'm trying to reduce it! ;)

The opening post is tidied up now, one size fits all ;)
Sorry for any confusion.

Cheers
Phil

FBMinis
Posts: 48
Joined: 25 Feb 2018, 17:59

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

Post by FBMinis » 11 Feb 2020, 21:47

Somehow I missed this thread. It seems the code has been reworked/improved, which means I'll have to build another TX (I wont "fix" the perfectly working old one). Thank you very much Phil et al.

Post Reply