×

Notice

The forum is in read only mode.

Mixers queston: 3 pos switch from trim button?

More
07 May 2015 04:36 #32198 by vvs
Hi,
I am trying to setup mixers so one of my trim buttons will work like a momentary 3 pos switch. I want output of 0 normally and -100 or +100 if trim button pressed up or down. Could be any 3 distinct values actually.

Is this even possible? So far I created two virtual channels from trims and they output +100 as expected if trim button pressed. Now I guess I need another virtual channel to combine these two and mix desired output.. I cannot however figure out what curves/offset to use. Would appreciate any help!

Below is snapshot of what I got so far:

[virtchan1]
name=PLUS
template=complex
[mixer]
src=AIL
dest=Virt1
scalar=0
curvetype=fixed

[virtchan2]
name=MINUS
template=complex
[mixer]
src=AIL
dest=Virt2
scalar=0
curvetype=fixed

[virtchan3]
name=ADJ
template=complex
[mixer]
src=Virt1
dest=Virt3
scalar=50
offset=-18
muxtype=add
curvetype=min/max
points=0
[mixer]
src=Virt2
dest=Virt3
scalar=50
offset=-50
muxtype=add
curvetype=min/max
points=-70

[trim5]
src=Virt1
pos=TRIM_R+
neg=None
step=193
value=-100,0,0
[trim6]
src=Virt2
pos=TRIM_R-
neg=None
step=193
value=-100,0,0
More
07 May 2015 20:41 - 07 May 2015 20:43 #32224 by mwm
If you've got the two virtual channels working, then the obvious way to do this is with three mixes:
  1. Fixed curve, scalar 0, no switch.
  2. Fixed curve, scalar 100, PLUS switch
  3. Fixed curve, scalar -100, MINUS switch

However, you can do it with two mixes if you're tricky about it:
  1. Min/Max, input PLUS, Scalar 100
  2. Fixed curve, scalar -100, MINUS switch.

I'm doing this off the top of my head. I believe the output of PLUS is zero when no switch is on, so this will be right. If it's actually -100, then the second mixer should have a scalar of 0 and !MINUS as the switch.

If you haven't read it, my tutorial on writing model configs covers doing this kind of thing (flight mode control on a 200QX) in some detail.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.
Last edit: 07 May 2015 20:43 by mwm. Reason: use ordered lists...
More
07 May 2015 22:01 #32230 by vvs
I have tried that obvious mix first. Unfortunately it doesn't work, and this is why I am asking here =)

If I assign VIRT1/2 as SWITCH it doesn't act as one. I think this is something to do with momentary nature of trim and as consequence of Virt1/2. I think right way is to actually mix outputs of Virt1/2 in right way or even use delay curve if needed to overcome momentary limitation. But this is where my basic knowledge of mixers ends =)

I indeed read and reread your tutorial, it is great source of info! Really appreciate time you put into it.
Time to create page: 0.033 seconds
Powered by Kunena Forum