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
gcmoir
Posts: 15
Supporter
Can someone help me with this please. I am using a servo to return my start switch to the off position. I have it configured in the DISPLAY tab as follows:
Min Value = 0
Max Value = 255
Max rotation = 100% (I will adjust that as necessary later).

When I press TEST, the servo rotates anti-clockwise which is the wrong direction. To change this I have set the INTERPOLATION setting as follows:
Input Value = 0
Output Value = 255
I check the activation box but when I run TEST it still turns in the wrong direction. So now I reverse the INTERPOLATION setting as follows:
Input Value = 255
Output Value =0
Unfortunately, still not changing the direction of rotation.

I have searched on the forum and as far as I can see, one of these interpolation settings should change the direction of rotation. I guess I'm doing something wrong but I don't know what. Can anyone help?

Thanks,
Graeme
2022-03-19 14:57
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
Maybe changing the MIN and MAX values might help.
So MIN = 255 and MAX = 0

Haven't tested it on my own but sounds logical.
2022-03-19 15:07
Avatar
gcmoir
Posts: 15
Supporter
Hi Kjoussen,

Thanks for the suggestion, I should have mentioned that I already tried that. When I press TEST nothing happens, when I press STOP the servo rotates and then stops. Further presses of TEST and STOP produce no movement. I have also tried the various Interpolation options and also no different. I have tried another servo and get no different results. When I go back to MIN = 0 and MMAX = 255 the servo responds normally except in the wrong direction.

Graeme
2022-03-19 16:09
Avatar
Whiteknuckle157
From: Bayern - Bibertal, Germany
Posts: 50
Graeme,

if possible, I might show you on Discord.

This is somewhat counterintuitive. There is no reversing of direction of a servo in Mobiflight. The servo always runs counterclockwise.
The concept is the other way around.

Let me give an example: You have a pointer attached to a SG90 servo. The servo naturally can turn from 0 to approximately 175 (officially 180°) degrees counterclockwise.
The pointer should point to a scale on a decal. Generally, instrument pointers turn clockwise, not counterclockwise. If this is the case, you attach the pointer in such a way, that it points to the max scale position with the servo set to zero. In Mobiflight you set min value to 0, max value to 100 and max rotation to 100 (%). Then press test while Mobiflight is NOT in RUN mode.
The servo pointer will now turn the approximately 180° counterclockwise. Now estimate the percentage needed to reach the zero position on the scale. This depents on the scale itself. For my double gauges it is 60%.

Now you have established the range of the servo. What you need then is how to map the sim-value to the servo. This is the next step.

Here you have to understand the min and the max value in Mobiflight. These values should correspond to the value given by the simulator.
Example: C172 Oil Temp has a range from 75 to 245 degrees Fahrenheit. MSFS 2020 gives this values directly (check if set to Fahrenheit and not to Rankine).
Hence set min value and max value to 75 respective to 245.

When you now start the sim and run Mobiflight your pointer will move corresponding to the oil temperature but in the wrong direction.
Here you use the compare function. first row: input value 75 output value 245, second row: input value 245, output value 75.

Please do not hesitate to ask if anything is left unclear.

cheers

Volker
2022-03-19 22:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

The other guys still give a lot of good informations....
BUT
The most important element was missing.


You mix up the Interpolation and the Test mode. these are two different things!!


With TEST Mode we say.... "Please simulate a Output Value of XXX, with the current Settings".
So for example you say MIN =0....... MAX =255....... Rotation = 100% TEST is 128 .....
Means the Motor start turn at Zero Point and it turn ( in your case) conterclockwise from 0 to 50% ( 128 is 50% of 255)

The INTERPOLATION not change this "testing procedure".... It Change the SIM Value itself. So you can NEVER test a Interpolation by the Test mode!!!!

In easy words.... Your Motor still turn counterclockwise.... 0 is still 0 and 255 is still 255.

The Interpolation just change the SIM Value into a new value.... Means if Sim show 0 its now 255 and if Sim show 255 its now 0.
But for sure... for the Motor 0=0 and 255=255 already..... Theats the whole logic of Interpolation !


By the way.....
The Switch ( Sim Data) is pretty sure not 0-255. Its 0 and 1 ( 2 ,3 for FLT and CONT)
So why you think about 255 ??

Simply say MIN 0, MAX 1 .... And define in transform that GND is "0" ...:And OFF ( and also CONT and FLT) is 1.
And if this is reversed in case you mount the motor wrong way you say.... GND = 1 and all others are 0. Then its inverted without need to use Interpolation!
Good Luck !
2022-03-19 23:50
Avatar
gcmoir
Posts: 15
Supporter
Hi Pizman, Whiteknuckle,

Many thanks for taking the time to respond to my question. I am following Michael Schulz at Mickey's Flight Deck for the design of the B737 starter switch and I just copied the settings he shows on his demonstration video. That's where the 255 comes from. Anyway, I changed my setting based on what Pizman said and used 0 for min setting and 1 for maximum. I am using the comparison setting described by Michael as follows:

If current value is = 16 then set it to 0 else set it to 1. Actually, he uses 255 but I saw that Mobiflight was giving an output value of 16 so I replaced the 255 with 16.

I started Prosim and the switch works as designed. When engine speed reaches the defined speed, the servo rotates and knocks the switch off, the servo then rotates back to its rest position ready for the next start.

Basically my problem was not understanding the way the test function works.

Thanks a lot guys.

Graeme
2022-03-21 14:45
Avatar
TheGerman
Posts: 9
I was working on a flaps gauge and had the same question. The flaps values were from 0 (MIN) to 800 (MAX) and the simple solution was to use the "Transform" function, in this case, I put in "800-$", so with flaps 0 (value=0), it starts the servo with 800 (MAX) and when adding flaps, the value goes up and and the "transformed" value decreases, the servo moves clockwise.
2022-12-31 04:34
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconTheGerman:

I was working on a flaps gauge and had the same question. The flaps values were from 0 (MIN) to 800 (MAX) and the simple solution was to use the "Transform" function, in this case, I put in "800-$", so with flaps 0 (value=0), it starts the servo with 800 (MAX) and when adding flaps, the value goes up and and the "transformed" value decreases, the servo moves clockwise.



:thumbup:
Yeah thats the "math way"

Interpolation 0=255 ----> 255=0
do the same like
Transform 255-$

Also things like if($=1,0,1) can be done as ($+1)%2

Apollogys for hundrets of "old" guides i post here. I also need some years and good teachers to see what simple math syntax can do.
Good Luck !
2023-01-05 22:51
icon