How to set up a complex mixer or complex template

More
22 Dec 2014 08:58 - 22 Dec 2014 09:24 #27141 by ThomasC
Hello mattygerman,

as already stated, I am quite new to Deviation, the "sequencer" was my first programming using the advanced gui, and I may not yet fully understand all of its concepts.

For the requested 350QX solution (which I have understood shall mimic a classic throttle hold mechanism for this specific quadcopter, which I don't own for myself) the virtual channel is meant to be source for all mixers that need it, so it makes sense. In the NanoQX setup this was the first solution that actually worked. Additionally this solution enables to synchronize two or more channels with only ONE timer: the delay of the virtual channel. So e.g. a retractable landig gear mechanism that is controlled by more than one servo can be operated in both directions, the sequence runs forward and backward (even when switch is reversed while the sequence is still running this works flawless), and the speed can be altered without bothering about bending servos etc.

mattygerman wrote: To be honest, I never thought a switch would "obey", or follow, a curve as well. But, on the other hand, it seems only logical that it does since a switch acts like a stick that is moved from -100% to +100% (or vice versa :silly: ) very fast.

And it's not my idea I must admit. I fly Graupner and Devo, and the channel sequencer is a Graupner idea. For Graupner you have to use a real channel as "mix only" to get a virtual channel that does the same as Deviation virtual channels. Nano QX was the first known flying object for me to actually use the sequencer (I use a fullrange DSMX module on the Graupner). I wanted to do this with Deviation, too, and it works, which makes me happy :)

As far as I can see from your post you do not use FMOD1 and FMOD2 anymore since you set up the mixer for channel 6 - which is the channel performing the real control - with the "Simple" template.
Is that correct?

Not fully. I use the transit from FMODE0 to !FMODE0 (which always means FMODE1) to trigger the mode switching. I do not need to define a switch, as the switch itself is used as channel source -> implicit triggering.

Then, if it is correct, why did you set up the Virtual Channel?

Was the first approach that actually worked. Beforehand I hadn't understood the way advanced mixers work. It's not intuitive - you have to know what you do, as quite some things can be misinterpreted, so my experience.

A virtual channel "only makes sense" (you may of course use any virtual channel for everything you like ;)) if used in a real channel mixer set up with the "Complex" template under circumstances where e. g. REPLACING one mixer with any other mixer ("Mux" = "Replace") would otherwise override and thus "destroy" complex mixing functions requiring the setup of different consecutive mixers, or, mixer pages. In such a case using virtual channels is "mandatory".

This part of the concept still appears a little blurry to me - I will have to read and test again.

And, did you also try your setup without ANY delay?

Honestly - no. Not yet. Until now. I replaced the "Delay" (aka Virt1) source on channel 6 with !FMODE0 - as expected, this doesn't work. The RX needs at least one value >0 on channel 6 to actually switch mode. It worked with delay of 1 (= 0.05 seconds), but just to play safe I raised the delay to 2.

The manual says the following about the "delay" function: "Delay: Delay the output of this mixer when used with a fixed curve. Scale of 100 represents 5 seconds delay. Can be varied by using scale or offset."
Since MIXER in your setting contains any multi-point curve in only ONE mixer I would assume that output of the COMPLETE mixer is delayed, i. e. output is delayed AFTER the curve has been fully processed rather than delaying output after processing individual values of the curve.

As I have understood and tested, Deviation behaves just like Graupner in that respect. I have tried to put all needed mixers in one channel, but I failed to source the delayed "sweep curve" to replace it with my sequence - I assume this was kind of recursive programming because I input the channel's own output. Deviation reacted confused with random channel values. So I learned: introducing a delay forces you to use a virtual channel. But only one per needed switch - should have called it "Delay-!FMODE0" to make it clear that it delays !FMODE0 (you would need one delay for each switch you want to use to trigger a delay, or one delay for each independent timing you want to use)

If this were true (and I guess it is :P ), you would not need any delay at all.

For me this did not work. But I may have overseen something - in case you get a working setup with your idea, can you please post the resulting config here?

On the other hand, IF the control board of the 350 QX would "expect" some delay after EVERY SINGLE INPUT, i. e., value of the "curve" (which might be the case since it is impossible for humans to move a stick - rudder stick - from -100% to+ 100% as fast as any switch) your approach, unfortunately, wouldn´t work...

I assume that at least ONE frame containing the target value must reach the RX. So, to calculate the needed delay, one has to step down to "solid guessing" (my approach) or calculate based on the transmitted framerate (50 Hz???)


cheers :)

ThomasC

---
Last edit: 22 Dec 2014 09:24 by ThomasC.

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

More
23 Dec 2014 09:55 #27161 by mattygerman
Replied by mattygerman on topic How to set up a complex mixer or complex template
Hi ThomasC,

Many thanks for your detailed clarifications.
This discussion hopefully helps other Deviation beginners to understand the functionality of this fascinating software better.

Best regards, and Merry Christmas to all,

Matthias

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

More
23 Dec 2014 23:36 #27180 by ThomasC
@Matthias: it was fun for me to discover this, and I am happy when people get help by my "playing with things" :)

One last thought on the "might need delay when moving sticks": the solution would be quite simple: curves with more curve points (be careful: this also speeds up each step!), e.g. 0,-100,-100,0,100,100,0 (7point curve) for throttle start.

Merry Christmas from me, too

Thomas

---

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

More
09 Feb 2015 08:25 #28483 by mwm
Hi guys,

Wonderful discussion about the "delay" mux. Really useful.

I've been cleaning up my 200QX model.ini. The 200QX uses the same init and shutdown sequence as the 350QX, so this was really useful. I started my 200QX with my 350QX model.ini, which started with Fabien's 350QX model.ini. It's much better now.

Anyway, I thought I'd share what I had.

First note: you don't need a sequence to shut things down. Just lower the throttle to -125% or so. I use the Safety feature in the channel configuration: set the switch to "T Hold", which is a virtual channel that implements a sticky throttle hold, and the Safe Val to -125. Works like a charm.

Fabien created a delay by feeding a channel back to itself and depending on the processing delay. I don't really like this. Having a nice simple delay as per ThomasC seems more robust.

So, my delay channel is:

And my rudder channel is:
[virtchan4]
name=Delay
template=complex
[mixer]
src=!Virt1
dest=Virt4
usetrim=0
curvetype=min/max
points=0
[mixer]
src=AIL
dest=Virt4
scalar=3
usetrim=0
muxtype=delay
curvetype=fixed

The curve type is Min/Max to clean up the sticky throttle hold switch. It's values aren't cleanly -100 & 100, but this fixes that. I also like using Min/Max whenever using a switch as a source, though that's probably just superstitious of me.

A Scale of 2 works to init the thing. 1 doesn't. I set it to to 3 because that's more than quick enough, and a little slower would make sure I wasn't sitting close to any boundary conditions.

And the rudder channel:
[channel4]
template=complex
[mixer]
src=RUD
dest=Ch4
[mixer]
src=Virt4
dest=Ch4
usetrim=0
muxtype=add
curvetype=5point
points=0,100,0,-100,0

A five point curve with zeros at both ends as ThomasC said. I put the spare one in the middle because it felt right. Maybe that's why it doesn't work with a delay of 1 for me but does for ThomasC.

Question for ThomasC: Does your NanoQX switch correctly track the flight mode? I couldn't get anything to do that reliably, and finally used a momentary trim on the ENT button to toggle the flight mode. I've got a toggle trim on the same button to display an icon, but that's still not reliably correct. Of course, I don't look at the display when flying, so it's not really a problem.

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
10 Feb 2015 00:50 #28519 by mwm
Forgot to mention:

If you're playing with advanced mixer programming, using the team nightlies is a major win. They've rewritten the channel monitor so that instead of displaying just the channels sent to the Rx, it displays all the channels that have a mixer - including the virtual ones. So you can see those without having to route them to an unused output channel.

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
22 Feb 2015 11:53 - 23 Feb 2015 07:11 #28994 by mattygerman
Replied by mattygerman on topic How to set up a complex mixer or complex template
Okay, I couldn´t resist to buy and try a quadrocopter myself ;-). I decided to try the “Quanum Nova” which seems to be a rebranded “Cheerson CX-20”. What I´d like to point out here is its APM based flight controller delivering full GPS and compass guided auto action, if desired. I highly recommend anyone to have a look at this amazing open source project under: copter.ardupilot.com/wiki/flying-arducopter/flight-modes/ (the link directly points to the 14 available flight modes).

I am publishing my setup for this very nice copter here – please see attached file - in order to make the importance of ORDERING of the many pages of channel 5 (flight modes) clearer. Ordering is critical in ANY complex mixer because Deviation follows a simple rule: the “highest” available mixer, i. e., the highest page number “rules” as it OVERRIDES all other mixers, at least if all of them REPLACE each other as in the case described here.

If you are a newbie, come to this post and try to understand what ORDERING does, I will first give you a brief description of what the many switches I assigned do.
The APM software lets you assign six of the 14 flight modes via switches. These 6 modes are defined in the “mission planner” software also available at the site given above. I use the following flight modes, in ascending order from “flight mode 1” to “6”:

Stabilize
AltHold
Loiter
RTL
Land
Drift

These modes are controlled, or distinguished from each other, by receiver output level differences of 33.
What does this mean?
The first mode is controlled by an output level (“scalar”) of -100, the second by -67, third -33 and so on up to +67.

Each flight mode is thus defined by the following output level:

Stabilize: -100
AltHold: -67
Loiter: -33
RTL: 0
Land: 33
Drift: 67

Please, anyone, VERY THOROUGHLY check this with the “mission planner” software under “Flight Modes”!

“Drift” is a special mode allowing you to fly the copter like a plane without the rudder stick. I. e., you control YAW via the aileron rather than rudder stick and whenever you are in fast forward flight and initialize a turn the software will automatically add ROLL to your yaw input so that you do not have to care about yaw or roll anymore (for someone never having flown a copter: it is absolutely difficult to add sufficient yaw to your roll – aileron – input because a copter does not have a tail like a helicopter and thus visual yaw control in the distance is difficult to almost impossible). Okay, I will not discuss “Drift” here any further.

I should explain why I separated “RTL” and “Land”. “RTL” means “Return to Launch” and it of course will auto land the copter when set accordingly. However, my landing area is rather small and, since the GPS based auto functions are not 100% accurate, I want to have the possibility to interact with the auto landing process, if necessary, without experiencing any hassles. Therefore, I programmed “RTL” to do the following: bring the copter home but perform a stable hover in about 4 meters above ground.
Then, when I am confident that auto landing will bring it down at the place I want, I pull the “Land” switch and there we go ;-).
Now, if during auto landing anything should go wrong, I want to have the ability to bring the copter into a stable “Loiter” position immediately and bring it down manually from there.
And HERE is where ORDERING becomes crucial.
My single “Loiter emergency” switch - “RUD DR1” - overrides ALL OTHER switches, or mixers, as it is the last on the channel 5 complex mixer pages.

You will see that I did assign some modes in a duplicate manner: I e. g. use “FMODE2” AND “RUD DR1” to turn on “Loiter” Mode. “Loiter” auto stabilizes the copter in all “4” dimensions, i. e., it controls altitude, yaw, roll, and nick (nick is called “pitch” by the authors of the APM site but, being a heli pilot, I prefer “nick”) so that the copter stands in the air like being “pin pointed”.
I use this double assignment because when it comes to emergency situations I am better with my left hand than with the right ;-). I also have two switches for “RTL” ("GEAR1" and "MIX2"). This is first due to my “left hand” preference and, second, because I wanted to avoid to turn on “Land” without bringing the copter home first. Imagine you hover above water and accidentally pull “Land”... ;-).
You may still interrupt RTL with “Land” at any point when necessary.

My “Land” switch ("MIX2") also turns down throttle to -100% so that the copter will auto disarm or “shut down” when landed.
This, of course, results in a security problem: If my “RUD DR1” switch is my security switch for “Loiter” it will have to override the “-100%” throttle of “Land” as well. Therefore, it ALSO sets throttle to “0%” because this is the position required by “Loiter” to auto stabilize altitude.
In this case it will of course not be possible to bring the copter down manually ;-).
But: once in a stable “pin pointed” hover you have all the time to set the other switches so that you MAY bring the copter down manually. You e. g. might switch to “Loiter” via “FMODE2” and THEN deactivate “MIX2” (and “MIX1”) and “RUD DR1”, in this sequence. Again, please see the mixer´s ORDERING to understand why the sequence in this case would be crucial.

Or you do ONLY control the copter´s horizontal position (forward and/or sideward) which is always possible during “Loiter” mode, then simply deactivate “RUD DR1” again and the copter will continue with auto land.
Or you do simply reestablish normal throttle stick control by activating "RUD DR1".
Or you do NOT set throttle to -100% via “MIX2” ;-).
The variations on this setup are “endless” thanks to Deviation ;-).

One last point:
With so many switches assigned to different modes it is absolutely CRUCIAL that you define “safety” positions for your switches during transmitter startup.
These are found under the “[safety]” section close to the bottom of the file.


A note on the receiver: I use a Walkera rather than a Spektrum receiver because the Walkera protocol very easily lets you set the “FailSafe” value of the throttle channel via Deviation which in turn activates the APM controller´s own fail safe protocol, e. g. activating “RTL” whenever a transmitter failure is discovered (what the APM will do in case of fail safe is customizable).


Final note: the file does not contain any gimbal settings. This is simply because I do not have attached one yet. But it is very easy to add them: assign e. g. "AUX4" (left potentiometer) to e. g. channel 6 and "AUX5" to channel 7.


Have fun!
Attachments:
Last edit: 23 Feb 2015 07:11 by mattygerman.

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

More
24 Feb 2015 03:08 #29069 by seaholic
:woohoo: Professor,
1st. You left out the most important point.
That is how do you like the Quadcopter verse the Helicopter?
2nd I am glad you are working on the APM controller and it sounds like you have it mastered. I had problems with mine; mostly operator error and I also had a defective GPS module.
I was trying to setup the controller for a V-Tail copter that I built (because its easier to keep your orientation at a distance, like flying an arrow.) I had all kinds of problems. The main problem I could not get the V-Tail it to stabilize.
So I gave up on it and put the old controller back on. I will try again, but this time I will use one of my old quad frames.
Since it has been several months from flying I will have to relearn everything and start over again.
3rd I wish you would publish a book or a manual on this subject, you always have been able to explain things in a way that is easy to follow.


:cheer:

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

More
21 Mar 2015 03:26 #29980 by nwoodschris
Replied by nwoodschris on topic How to set up a complex mixer or complex template
I am interested in a nano qx with a mode that varies the threshold for turning SAFE on/off based on the setting of the AUX5 dial similar to that 200 QX file on that thread. Basically when the dial is all the way down SAFE is always on, when it is all the way up SAFE is never on but in between it is only active at the far edge if the cyclic range. Does anyone have any thoughts on making this work?

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

More
04 May 2015 14:11 #32062 by mattygerman
Replied by mattygerman on topic How to set up a complex mixer or complex template
@seaholic: Sorry for not answering to your post for such a long time. I usually only visit this thread once I am informed about new posts via email. And somehow I didn´t receive one when you posted your comment.
Well... A heli pilot is a heli pilot is a heli pilot. Helis to me are much more "vivid" and thus interesting than copters. However, I wanted a good video platform. And as such, copters are great. The Quanum Nova, however, doesn't have the original APM controller inside. Only a clone which, unfortunately, SEEMS to lack the accelerometers. This, in turn, leads to rather unstable loiters in windy conditions as the copter can only rely on its rather inaccurate GPS information to "stay in place". I thus ordered an original APM. Still waiting for its arrival, though. Anyway, I am not sure if it is suited to control V tails. Apart from that, I just love the firmware and its ease of use. And its possibilities are really awesome.
Many thanks for your compliments re. my way of explaining things.

If I may give you an advice :ohmy: Try and learn to fly an FBL helicopter. This does have the tail you desire and, if controlled by a good FBL system, is not much harder to control - at least in hover mode :P - than a copter. You might even use the APM to stabilize it (although I prefer "specialized", smaller, and lighter heli FBL systems). On a heli you really wouldn´t think about any GPS controlled full auto loiter mode although I know there are "some" pilots enjoying to "throw away their Tx" and still having the heli in a full auto "pin pointed" hover. A "real" heli pilot, however, can only contemn such over sophisticated electronics :cheer: . On a heli, its difficulty of control is what "you" want :blush:
Anyway, if you have questions about the APM NOT referring to any V tail control :blink: just let me know.

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

More
28 May 2015 11:20 #33106 by echodelta
Hallo Matthias,

kannst Du mir diese Anleitung auf deutsch zukommen lassen? Das wäre wirklich sehr nett.

Gruss echo

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

More
28 May 2015 11:29 #33107 by mattygerman
Replied by mattygerman on topic How to set up a complex mixer or complex template
Halle Echo, darf ich Dich auf diesen Artikel von mir verweisen? walkera-fans.de/deviation-die-bessere-fi...st-alle-devo-sender/
Da steht das in Kurzform drin und noch viel mehr ;-).
Falls Dir das NICHT reicht, melde Dich bitte noch mal.

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

More
14 Jun 2017 04:45 - 16 Jun 2017 02:32 #62987 by reednoel4u
Replied by reednoel4u on topic How to set up a complex mixer or complex template
Hello every ones,
I wan't mix 6 channel fly mod.
I thinks that : The 3 mode of 1st can using mix complete with Complete Mix.
And 3 mode after can using curvetype=add, This case, using add DR1 with one of value to Fmod.
I using Mix by case for 4 channel is correct, so with 5 and 6 are wrong way, because it make some channel before is fail.
If we can using this mix Case, we just using 2 switchs.
please see config after and give me the solution.
Last edit: 16 Jun 2017 02:32 by reednoel4u.

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

Time to create page: 0.050 seconds
Powered by Kunena Forum