MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Doon1
Posts: 53
I'm not sure how to use this. I would like to add the "PROP FORCE" output value (that has been transformed $/10) to the "WIND FORCE Z" output value. Then I would like to multiply that value by the "RUDDER FORCE" output value.
No clue how to do this but I'm trying... Am I even doing this in the right place?
https://imgur.com/gallery/OfKkrqZ
[Last edited by Doon1, 2022-02-18 04:10]
2022-02-18 04:05
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Right Idea.... But a little wrong settings.....

You missunderstand the "as Symbol" .
You can NOT say there "+" or "*" cause you like to ADD or MULTIPLY it.....

You "define" a symbol there, so we can use this values as Placehodlers (Variables) within the Formula !

NOTE: Its high recommend to use as Symbol here Chars like "A" and NOT math signgs like +-* or so.
Also avoid Chars you will use in the Transfrom field by commands.... e.g. if you write a IF Statement like if($=1,0,1) then "i" and "f" also can not be used as a Placeholder!

So in your Case....
Lets expect you set ProbForce as "A" .... and RudderForce as "B" .

In transform i think you like to divide the WindForce through 1.7 at first.... THEN you like to Add Prop Force .... And finaly you like to multiply it by Rudder Force.
Correct Syntax in Transform : ($/1.7+A)*B
Good Luck !
2022-02-18 16:23
Avatar
Doon1
Posts: 53
Ah, I see.
I also have to multiply the rudder force by 100. So the resulting formula reads ($/1.7+A)*(B*100). Correct?
There is no need for me to add an entry in the transform field of either the PROP FORCE or RUDDER FORCE pages. I instead do all the math in the WIND FORCE Z transform window.
I also need to only use the PROP FORCE value that is less than 50. I’m guessing here so no laughing. ($/1.7+(A<50))*(B*100) How does that look?
2022-02-18 18:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconDoon1:


I also need to only use the PROP FORCE value that is less than 50. I’m guessing here so no laughing. ($/1.7+(A<50))*(B*100) How does that look?



I think that is not working ..... A<50 is no correct mathematical term.... You can use it in a IF statement like if a<50 then else.... But A<50 is no correct syntax for itself.

I recommend.... To make it more easy.... Do all the "steps between" within the own Configs.

For example:

Config 1 Read Windforce .... Transform $/1.7 (Include your divide)
Config 2 Read Probe Force .... Transform if($<50,$,0) .... (So it show all Values less then 50 but execute "0" if Value is greater or euqual 50. )
Config 3 Read Rudder Force .... Transform $*100

Finally Config 4 ( Read itself no Value.... So we not use $ Here,) We define the First 3 Configs as Placeholder A, B and C
And Transform here is finally.... (A+B )*C

Means all the "middle Calculations" are done in the base configs already!

Extreme example.....
You could also use as 4th Config a Config without own Offset and only define 2 Placeholders ( A Windforce, B Probe Force)
Transform A+B ..... Lets call thiss Config " CALC1

Then you create another Config and you use as Placehodlers (A = CALC1 B=Rudder Force
Transform A*B


****************
I hope you understand.... There is no need to save Configs or to do all in one line.
For MF its no difference !
Good Luck !
2022-02-18 22:29
Avatar
Doon1
Posts: 53
This is beginning to make more sense to me. I like the idea of being able to transform each config separately. I tried that yesterday, but my syntax was wrong. My greatest hurdle now seems to be the syntax. Can you recommend a good source to better learn this? I get so confused at the Arduino forums because there are so many different languages that people seem to code in.
For example: The rudder control has a range of -1 to 1 with 0 being centered. I need the negative range to display as a positive range. So that when I move the rudder either way from center it will go from 0 up to 1. I'm going to go search for how to do this.
Thanks,
[Last edited by Doon1, 2022-02-19 00:38]
2022-02-19 00:02
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
The needed "Syntax" is not Arduino Language or C++ and so on....
In Mobiflight Transforms ( and Compare) we use a special PlugIn called "NCALC" ....

Here is the Documentation : https://github.com/ncalc/ncalc/wiki

to awnser your question.....

iconDoon1:


For example: The rudder control has a range of -1 to 1 with 0 being centered. I need the negative range to display as a positive range.



the correct Syntax in transform is.... Abs($)

Abs is the used syntax for the "Absolute-Function" This will change every Value into it´s positive Counterpart .... So -1,234 --> 1,234 // -13 --->13


And for sure... You could solve this with easy math..... IF Value is less then zero then multiply by -1 else show Value..... Syntax: if($<0,$*-1,$)

Cause for example -13 * -1 = 13
Good Luck !
2022-02-19 00:56
Avatar
Doon1
Posts: 53
Thank you. I spent some time at the ncalc wiki. Going to spend more time there... I'm all ready to hook a motor up and test the rudder force. I'm sure I'll have to play with the numbers to get the feeling right when I go full scale. I'll post back with the progress.
2022-02-19 14:31
icon