flip/flop virtual switch for mixer

More
31 Aug 2016 20:42 - 31 Aug 2016 20:57 #53340 by FrankV
flip/flop virtual switch for mixer was created by FrankV
Hi people!
I like to know if there is a way to make a flip/flop switch with the virtual channels in the mixer menu?
I did read a lot, but not found it or didnt understand :)

What I would like to do:
my quad has no minimum throttle setting and might cause a FlipOfDeath. If you use the minimum throttle setting in the settings menu, it might occur that the props keep spinning (combination with the GPS module). Therefor I look for a method to solve it by the Deviationtx software :)
And simply setting the min throttle to a switch is in my opinion a bit too dangerous (unexpected rotating of the props e.g.).
And to make it more complicated: the FOD might only occur in one flight mode (manual). In other flight modes (GPS,LOT) the minTHR is maintained by the FC. So I can't simply add a minTHR..

The startup procedure I would like (Using Rud D/R as "throttle hold"):
1- RudD/R0 is the position in rest or startup.
2- Arm the quad by putting the RUD/THR stick to left/down position. Armed, but no rotating motors.
3- Switch RudD/R to 1. Once throttle is above (e.g.) 10% the motors start to spin. In this position the minimum throttle is set to this 10%, so there will be no FOD.

After the flight:
4- The minimum setting must be maintained as a minimum until: (RuddD/R=0) AND (THR stick=0) AND (Rudd=lower right). But only, if RuddD/R has been "1" before (didnt forget during the flight to switch RuddD/R0->1??). From this moment THR is allowed to go below 10% again.

In this way I get:
- no direct spinning from motors when the quad is armed,
- no FlipOfDeath during flight,
- no unexpected rotating of motors,
- no unexpected THR=0 because accidently the RuddD/R switch is touched....... (e.g. with a belt/coat/hand/fingers/whatever).

I only see this possible if there is a way to set a virtual switch to "1" in step 3, after the THR>10% and this virtual switch also resets to "0" in step 4 like.
Is this possible? And if so, how?

Thanks for thinking with me,
Last edit: 31 Aug 2016 20:57 by FrankV.

Please Log in or Create an account to join the conversation.

More
01 Sep 2016 02:05 #53350 by mwm
Replied by mwm on topic flip/flop virtual switch for mixer
I didn't go through the complete details, but to do an "AND" setting, you use a virtual channel as the switch. Get the initial value as 100/0, then us a min mix type for each additional mixer. That way, it'll stay at 100 only if they are all on.

To use the old value, look at the tutorial for "sticky throttle hold", which does that trick. There's a more recent summary as part of my writing a devitionTx model writeup at rc.mired.org/p/writing-deviationtx-model.html .

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.

Please Log in or Create an account to join the conversation.

More
03 Sep 2016 22:44 #53453 by FrankV
Replied by FrankV on topic flip/flop virtual switch for mixer
Thanks mwm, I did try reading and the "script" as mentioned on you page.

But that is not what I meant. It acts with the RuddDR, that is true. But when the switch is back, the setting changes instantly.

With a flip/flop (set/reset) function this would not be the case.

Let me try to explain in a more simple example: like arming and disarming a regular quad
Left stick (throttle) down (-100) AND RudderLeft (100) -> quad is armed
The quad stays armed unitl:
left stick THR down (-100) AND RudderRight (-100) -> quad disarmed

If it is armed, it should stay armed.
If it is disarmed, it should stay disarmed.

How should such a mixer/virtual channel look like?

In fact, it should act like the LTRIM and RTRIM buttons installed as switch.

Please Log in or Create an account to join the conversation.

More
04 Sep 2016 07:12 #53461 by mwm
Replied by mwm on topic flip/flop virtual switch for mixer
Well, I think I gave you everything you the parts you needed B) , but let's see how it goes together.

IIUC, the goal is to have a channel (we'll call it ARMED) that goes to on (100%) when the ARM signal is given, to off (-100%) when the DISARM signal is given, and otherwise stays where it was last put?

Yup, I gave you all the pieces to do that. Pretty easy. Start with two virtual channels ARM and DISARM. They both use the AND trick to go on when you signal ARM or DISARM with the sticks.

Now create your ARMED channel. Three mixers. First mixer has ARMED (yes, itself) as a source, Set curve to MIN/MAX because I like that for switches, but 1-1 or Expo or any number of others will work. This will set the output value to the old value of ARMED. Second m,ixer has a fixed curve, scale of 100%, ARM as the switch., mix type of replace. It will set the output value of the channel to 100% when the ARM signal is given. Last mixer is also a fixed curve, but the scale is -100% and the switch is DISARM. It will set the output to -100% when the DISARM signal is given.

That should do it.

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.

Please Log in or Create an account to join the conversation.

More
04 Sep 2016 12:21 - 04 Sep 2016 12:36 #53467 by FrankV
Replied by FrankV on topic flip/flop virtual switch for mixer
Thnks mwm for your respons, I appreciate it.

Well, if I make it even more simple to try only the ARM it does not work.
For now, I replaced the DISARM virtual switch for the RUDDR switch.

That means: while looking in the mixer it works. Flipping the RUDDR switch it gets 1 if it was zero, and you get zero if it was 1.

But when you are out of the mixer and look at the channel monitor it does NOT work.
That means: sometimes it does, sometimes it doesnt. It seems to be "in doubt" when passing the zero point in the first page. So I also tried to change this to 1-1 as you mentiond, but then really nothing happens.
And as far as I can see, I entered exact the mixer as you mentioned. So what goes wrong here?

[virtchan3]
name=Arm
template=complex
[mixer]
src=Virt3
dest=Virt3
usetrim=0
curvetype=min/max
points=0
[mixer]
src=AIL
dest=Virt3
switch=Virt3
usetrim=0
curvetype=fixed
[mixer]
src=Virt3
dest=Virt3
switch=RUD DR0
scalar=-100
usetrim=0
Last edit: 04 Sep 2016 12:36 by FrankV.

Please Log in or Create an account to join the conversation.

More
04 Sep 2016 14:31 #53469 by mwm
Replied by mwm on topic flip/flop virtual switch for mixer
Your third mixer needs a curve type of fixed.

This one uses DR1 and GEAR1 as the switches. DR1 turns the channel on, GEAR1 turns it off.
[virtchan1]
template=complex
[mixer]
src=Virt1
dest=Virt1
usetrim=0
curvetype=min/max
points=0
[mixer]
src=AIL
dest=Virt1
switch=DR1
usetrim=0
curvetype=fixed
[mixer]
src=AIL
dest=Virt1
switch=GEAR1
scalar=-100
usetrim=0
curvetype=fixed

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.

Please Log in or Create an account to join the conversation.

More
04 Sep 2016 22:00 #53474 by FrankV
Replied by FrankV on topic flip/flop virtual switch for mixer
When I make the 3rd one fixed, is does not work either.
When checking in the mixer mode it does, but not in flying mode looking at the channel monitor..... In channel monitor it works sometimes and sometimes not. An unstable switch. More like a rondom type of switch..... so useless for me.

The second option works well (as expected), but that is not were I was looking for since it uses 2 real switches for this function (on to set the channel, another one to reset).

Please Log in or Create an account to join the conversation.

More
05 Sep 2016 03:43 #53483 by mwm
Replied by mwm on topic flip/flop virtual switch for mixer
Well, what you get when you turn your Tx on may well be stable, but it should be solid after that. All of my models use as very similar trick for throttle hold (i.e. - goes off iff throttle output is 0 and throttle hold switch is on, goes on on the throttle hold switch), and that's never been a problem.

I'd suspect problems in the switches. If you're using physical switches, that would be a hardware problem. If you're using virtual channels as switches, possibly the programming in those virtual channels.

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.

Please Log in or Create an account to join the conversation.

More
05 Sep 2016 07:42 - 05 Sep 2016 21:44 #53489 by FrankV
Replied by FrankV on topic flip/flop virtual switch for mixer
I can imagine you look at the cause in other problems.

But I made a short video, showing differences and you can see that the physical switch is working fine, but the mixer does not work as expected.

(2 minutes)

In the video the switch used is Gear0.
For the video connected to channel 2, so in the channel monitor the virtual switch and channel 2 are good to observe.

Please note that channel 2 shows a good constant switch. Also in mixer menu the switching of the virtual channel goes as espected.
The virtual channel Virt1 just randomly switches (to be shown in channel monitor).

I tried this setting on 2 different radios (both Devo 10) with the same result.
Thats why I have been struggling with this issue for hours now :(

But strange enough, I also copied the "throttlle hold" mixer from you page, but that does not work either on none of my devo's..
You describe: "So now RUD DR0 turns on the throttle hold, and RUD DR1 won’t turn allow it to be turned off until the throttle output goes to -99 or -100. A sticky throttle hold.". I dont know what you exactly mean here, but suspect is should be "throttle stick will be followed until the stick is set to the off position".
But what it does:
at RUDDR0 it simply passes the throttle value,
At RUDDR1 it holds the throttle at the last state whatever you do with throttle.
Back to RUDDR0: continues with the state the THR is in.

Are there any solutions left?
Last edit: 05 Sep 2016 21:44 by FrankV.

Please Log in or Create an account to join the conversation.

More
07 Sep 2016 21:42 #53609 by FrankV
Replied by FrankV on topic flip/flop virtual switch for mixer
Hmmm a bit disapointed in finding a stablity problem.
I solved it another way, but was much more puzzling before I got some succes.... :(

I noticed that one of the reason is the min/max option. Max is >=0, Min <0 where I expected Max>0, Min <=0 (makes more sense to me).

So for me this discussion is closed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum