Jump to content

How to create a 4-position switch?


Allan Bennett
 Share

Recommended Posts

I wish to be able to have one of my channels (let's say ch6) switchable to 4 pre-defined positions, roughly 0, 33%, 66%, and 100%.  The idea is that the first three values would be selected by a 3-way switch -- e.g. up = 0, mid = 33%, and down = 66%.  The final 100% output would be selected/deselected by a flick of monentary switch SH.  I'm familiar with how to program SH as an on/off toggle, but I can't see how to define ch6's outputs anything other than 0-50-100.

 

My Tx is Tarans 9D+2019 and my receivers are FrSky X-series.

Link to comment
Share on other sites

I don't own and never have owned an X9D but as no one else has answered you could probably most easily do this with flight modes but if you really want to use switches then the momentary (which can be a syicky switch would go on the top line weight 100% then if not true it would go to the next line 75% switch X up then 50% switch X mid then 33% switch X down.

 

Hope that makes sense. 

Edited by Philip Lewis 3
Link to comment
Share on other sites

9 hours ago, Philip Lewis 3 said:

the momentary (which can be a syicky switch would go on the top line weight 100% then if not true it would go to the next line 75% switch X up then 50% switch X mid then 33% switch X down.

I am not sure that would work Philip. You will end up with two True conditions, 100% on top and , say 33% on one of the lower lines. The last one encountered will take precedence, so you will end up at whatever switch X is positioned for. If anything, you will have to make the 100% by the SH toggle the last line. And all mixer lines should be the "replace" type.

 

Max.

Link to comment
Share on other sites

Rereading Alan's opening post I realised that he probably does not know how to create fixed positions with just a switch as input. This can be done with a mixer and the "MAX" source, as in this example:

Src = MAX, wt=66%, switch=X_down, multiplex = REPL

No further Input or source needs to be defined.

Edited by Max Z
Link to comment
Share on other sites

Just use the MAX source paired with the relevant input weights to get the % you want via four different lines on the mix screen, one for each switch position. You will need to put the line related to SH at the top of the list to ensure it goes live whenever SH is activated, irrelevant of the position of the 3-pos switch.

 

EDIT: Max’s posts above detail this well, sorry, our posts crossed.

 

Edited by MattyB
Link to comment
Share on other sites

Thank you for all those replies.  Following GrumpyGnome's reply (and before I saw the last two replies) I realised that curves will do the job for me.  I just programmed some 2-point curves at the values I want the 4 outputs to be.

 

Max Z and MattyB, you're right about my lack of knowledge of the use of the MAX function, though I now remember I have used it somewhre before!  I'll play with that this afternoon.  Thank you all.

Link to comment
Share on other sites

Just a bit more info:

The example I gave in my previous post shows the "Replace" operator as typical, but as the 3-position switch is multiple exclusive anyway, these lines could be the default "Add" operator. But "Replace" does not hurt.

But the last line (not the first line Matty), the SH toggle, should definitely be "Replace".

 

Btw I am using this excellent document from Mike Shellim as my reference.

 

Max.

Link to comment
Share on other sites

2 hours ago, Max Z said:

I am not sure that would work Philip. You will end up with two True conditions, 100% on top and , say 33% on one of the lower lines. The last one encountered will take precedence, so you will end up at whatever switch X is positioned for. If anything, you will have to make the 100% by the SH toggle the last line. And all mixer lines should be the "replace" type.

 

Max.

On the inputs screen that definitely works, like a computer open tx looks for the first true condition and once it finds the first true condition then it looks no further so other true conditions lower down are ignored.

 

As said above obviosly there are many different ways to achieve this. 

Link to comment
Share on other sites

20 minutes ago, Philip Lewis 3 said:

On the inputs screen that definitely works, like a computer open tx looks for the first true condition and once it finds the first true condition then it looks no further so other true conditions lower down are ignored.

I checked with the above referred document, and you are correct, that is how the input setup behaves. But at the same time, the mixer setup behaves as I explained, i.e. all the lines are processed top to bottom, irrespective of matches found.

Link to comment
Share on other sites

Thanks guys, I've now got what I want.  This is what I've programmed so far, and it does what I expect.

 

Clipboard01.jpg.c3ed267436207b41455155a5b690237c.jpg

 

I've noted that the SH REPLACE line must be the bottom one, otherwise it doesn't always go to 100%.  It's a simple switch at the moment, just for learning/testing.  I'll be replacing it with a logic switch for the final version.

Link to comment
Share on other sites

2 hours ago, Max Z said:

I checked with the above referred document, and you are correct, that is how the input setup behaves. But at the same time, the mixer setup behaves as I explained, i.e. all the lines are processed top to bottom, irrespective of matches found.

I personallt always put rates on the inputs screen and the advantage to putting weights on that screen is that you only put them on once for each contol and that will feed forward to aircraft with two servo aileron wing and twin servo elevator surfaces. Putting on the mixer screen means duplicating for each chanel.

 

Many ways to do it and I'm not advocating ut just saying that is one way which does work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...