- Posts: 94
"Sticky Logical Switch" like OpenTX
- belrik
- Topic Author
- Offline
Set output of channel high when a 2-pos switch is high AND momentary (trim button) is pressed.
Output remains high until 2-pos switch is low, despite momentary switch returning to low state.
How can this be achieved? In OpenTX are "logical switch" is created which goes high when the two inputs are high but only goes low when a single input goes low.
Please Log in or Create an account to join the conversation.
- -=Hubi-Dirk=-
- Offline
- Posts: 209
A complex mixer has to be programmed on channel 7, see pictures.
1. If the HOLD switch is set to position 1, the value on CH7 remains at the minimum.
2. If the momentary switch TRN is pulled out, the value for CH7 goes to maximum.
3. When the TRN momentary switch is released, the value of CH7 remains at the maximum.
4. If the HOLD switch is turned to the 0 position, the value on CH7 goes to the minimum.
Unfortunately the minimum value is -150 and the maximum value is +150, the reason for this is still unclear to me. But the function fits.
By the way, unlike OpenTX or EdgeTX, you can't use the trim switches as momentary switches.
Please Log in or Create an account to join the conversation.
- belrik
- Topic Author
- Offline
- Posts: 94
-=Hubi-Dirk=- wrote: I have a suggestion for you, this is how I understood your request.
A complex mixer has to be programmed on channel 7, see pictures.
1. If the HOLD switch is set to position 1, the value on CH7 remains at the minimum.
2. If the momentary switch TRN is pulled out, the value for CH7 goes to maximum.
3. When the TRN momentary switch is released, the value of CH7 remains at the maximum.
4. If the HOLD switch is turned to the 0 position, the value on CH7 goes to the minimum.
Unfortunately the minimum value is -150 and the maximum value is +150, the reason for this is still unclear to me. But the function fits.
By the way, unlike OpenTX or EdgeTX, you can't use the trim switches as momentary switches.
Please Log in or Create an account to join the conversation.
- -=Hubi-Dirk=-
- Offline
- Posts: 209
Please Log in or Create an account to join the conversation.
- hexfet
- Offline
- Posts: 1891
I'm sure there's multiple ways to do this. Mine is based on the sticky throttle hold I use for helis. It's not quite perfect as if the arming switch is active at power on the output is positive.
The below uses GEAR0 as the arming switch and trim L+ as the momentary. I used Devo10 emulator to set this up so your tx might not have this trim switch.
First set up Virt1 using a trim as a momentary switch.
[virtchan1]
template=complex
[mixer]
src=Virt1
dest=Virt1
curvetype=min/max
points=0
[trim5]
src=Virt1
pos=TRIM_L+
step=193
value=-100,0,0,0,0,0
Then set up Virt2 as the arming switch. The key is the second mixer which has itself as an input which gives the capability of holding a state.
[virtchan2]
template=complex
[mixer]
src=GEAR0
dest=Virt2
switch=GEAR1
usetrim=0
curvetype=min/max
points=0
[mixer]
src=Virt2
dest=Virt2
switch=GEAR0
usetrim=0
curvetype=min/max
points=0
[mixer]
src=GEAR0
dest=Virt2
switch=Virt1
scalar=103
usetrim=0
muxtype=add
Please Log in or Create an account to join the conversation.
- -=Hubi-Dirk=-
- Offline
- Posts: 209
thank you for your information that trim switches can be activated as triggers.
My example showed the programming via the GUI of the Devo 12s. A selection of Trim_L+ is not possible there, or is not displayed there.
How do you proceed here?
Edit: Hexfet, thank you for your reference to the documentation. I was able to reproduce the function for the trims without problems with the description.
Please Log in or Create an account to join the conversation.
- belrik
- Topic Author
- Offline
- Posts: 94
I had my trims mapped as virt1-virt4 so I removed that, inserted your virt1 trim and the channels exactly as you have written them but replacing "GEAR0" with "SW H0" and "GEAR1" with "SW H1".
Please Log in or Create an account to join the conversation.
- belrik
- Topic Author
- Offline
- Posts: 94
One sticking <ahem> point is that the arming channel goes high only when trim is pressed *after* the switch is moved, holding trim whilst moving the switch appears not to work.
Working config:
[channel5]
safetysw=!Virt2
safetyval=-100
template=expo_dr
[mixer]
src=SW H1
dest=Ch5
curvetype=fixed
[mixer]
src=SW H1
dest=Ch5
switch=SW H1
scalar=-100
curvetype=fixed
[mixer]
src=SW H1
dest=Ch5
switch=SW H0
curvetype=fixed
[virtchan1]
template=complex
[mixer]
src=Virt1
dest=Virt1
curvetype=min/max
points=0
[virtchan2]
template=complex
[mixer]
src=!SW H1
dest=Virt2
switch=!SW H0
usetrim=0
curvetype=min/max
points=0
[mixer]
src=Virt2
dest=Virt2
switch=!SW H1
usetrim=0
curvetype=min/max
points=0
[mixer]
src=!SW H1
dest=Virt2
switch=Virt1
scalar=103
usetrim=0
muxtype=add
[trim1]
src=Virt1
pos=TRIMRH-
step=193
value=-100,
Please Log in or Create an account to join the conversation.
- Home
- Forum
- General
- General Discussions
- "Sticky Logical Switch" like OpenTX