Complex Mixer with 5 flight modes and emrgncy RTH

More
20 Apr 2018 21:18 - 22 Apr 2018 12:34 #68773 by MikeNH
No eBay APP ID défined in Kunena configuration[/ebay]Devo 7e with 4-in-1 module with Deviation devo7e-v5.0.0-860f620

GOAL: 5 position trim (TRIMLV) with FMODE toggle to turn on/off Return To Home (RTF) using channel 5.

Flight Mode (FM) trim positions:
-100 = FM #1
-50 = FM #2
0 = FM #3
50 = FM #4
100 = FM RTH

FMODE toggle
FMODE1 = -100 (FM #1)
FMODE0 = 100 (FM RTH)


The model.ini file is attached.
I've been at this a very long time. I can get the 5 position trim to work nicely. I can get the FMODE switch to toggle RTH on and off (-100/100). I am unable to get this to work using a Complex mixer. Please help.

Thank you in advance.
Attachments:
Last edit: 22 Apr 2018 12:34 by MikeNH. Reason: Clarification

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

More
22 Apr 2018 16:03 #68794 by MikeNH
I've been plugging away at this because it could be important to get the quad out of trouble. The way this now works is there are 5 flight modes using channel 5. The modes are -100,-50,0,50,100. The "100" is the Return To Home (RTH) mode.

Regardless of the position of the flight mode switch (TRIMLV), when the RTH switch (FMODE0) is engaged, channel 5 goes to "100" and the flight mode switch has no effect until the RTH switch is disengaged.

I read all the tutorials that I could find and found very few (none) videos that address the Complex Mixer but all are difficult to understand. An explanation of what I understand is to start with the Trim and configure the 5 positions:

[trim1]
src=Ch5
pos=TRIMLV+
neg=TRIMLV-
step=140
value=-100,-100,0,0,0,0


Then assign 2 Mixers to Channel 5 (5-HOLD). The first mixer, Page 1, should not contain a "Switch" (I've read) so I created a 5 point curve:

[channel5]
max=100
scalar-=100
min=-100
template=complex
[mixer]
src=Virt1
dest=Ch5
curvetype=5point
points=0,0,0,0,0


And Page 2 uses FMODE0 and !FMODE1:

[mixer]
src=!FMODE1
dest=Ch5
switch=FMODE0
offset=100
usetrim=0
curvetype=min/max
points=0


QUESTIONS:
- Why should there NOT be a switch assigned to PAGE 1?
- On Page 2 "!FMODE1" appears to be the opposite of "FMODE0". Logic would suggest that the opposite of FMODE0 would be !FMODE0 or even FMODE1.

Again, the Deviation project has been great but programming has been difficult to understand. Any explanation for the above questions would be appreciated. Thank you.

Attached is the model.ini file that successfully implements this behavior.
Attachments:

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

More
23 Apr 2018 16:29 - 23 Apr 2018 16:32 #68805 by ajtank
The mixer output formula is: M(x) = if(Switch) { Src * Curve * Scale + Offset} else {0} + Trim
So I guess whether a switch is assigned or not does not matter because the trim values will always be added to the mixer output.
"!FMODE1" actually is equivalent to the value of "FMODE0" So it is basically the same no matter you put src=!FMODE1 or scr=FMODE0
Last edit: 23 Apr 2018 16:32 by ajtank.

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

More
23 Apr 2018 19:08 - 23 Apr 2018 19:10 #68813 by MikeNH
Thank you for the explanation. I did see the formula in the DEVO 7e User Manual but was unclear as to its meaning.
M(x) = if(Switch) { Src * Curve * Scale + Offset} else {0} + Trim

Is this a correct translation:
Complex Mixer Page Number = Formula's result

Formula Explanation:
M = Complex Mixer
x = Page number
Switch = HOLD, FMODE, etc..
Curve=See Curve Editing in the User Manual to assign a numeric value to the curve

Formula translation:
If Switch exists then this Complex Mixer Page equals Src x Curve x Scale plus Offset plus Trim
If Switch does not exist then Complex Mixer Page equals value of Trim

If this interpretation is correct, I'd like to add this to the User Manual for DEVO 7E/10/12E

Thank you
Last edit: 23 Apr 2018 19:10 by MikeNH. Reason: Clarification

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

More
23 Apr 2018 20:05 #68815 by FDR
FYI the trim part is optional, it can be switched off on the complex mixer page...

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

More
24 Apr 2018 14:20 - 24 Apr 2018 14:21 #68821 by ajtank
Oh yes your understanding is correct. The formula has listed all the possible components affecting the output but you can choose to drop off any component. For example you can choose not to use a switch then the mixer will always be effective or you put usertrim=0, etc.

I do find the formula clear enough but there are some codes which I do not see in the manual. For example min=x and max=y. Your mixer can jump to 150% after activating RTH but you have restricted the output by specifying max=100 in the model file.

The emulator is a great tool when you work on the mixers. I usually write the model file and test it on the emulator before loading to the radio.
Last edit: 24 Apr 2018 14:21 by ajtank.

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

More
24 Apr 2018 21:01 #68839 by MikeNH
Again, thank you for your reply. Although there is still a lot to understand, the explanation of the Mixer formula goes a long way to that understanding.

I was hoping to add this clarification to the User Manual but don't have access.

Thank you for helping me (us) to understand this critically important feature.

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

More
25 Apr 2018 01:12 #68843 by ajtank
I just try to explore the potential of Deviation through experiments.

I spent 3 months reading threads before investing on the 4-in1 module and Devo 10. I then spent another month or two looking at the model files created by other users. I have also started learning a bit of coding so that I can understand Deviation better. I am by all means still a learner.

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

Time to create page: 0.038 seconds
Powered by Kunena Forum