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! 

icon
Avatar
jose1982
Posts: 11
Hello, I need some help, i am trying to make a vor for the cessna 172 in fsx, and have a little issue with the parameters, i am using the 0C48 offset for the loc needle, but the servo is not moving in the right direction, when the needle in the vor is completely to the left, the servo is in the middle position and when it moves to the right and reaches the middle position of the vor, the servo moves to the starting position again, i do not know if i have to make a conversion, and do not know how to make it, i tried many configurations in min and max value of the servo and with the interpolation, but i couldnt solve the problem, if someone could help me it would be great.
[Last edited by jose1982, 2020-04-09 14:39]
2020-04-09 04:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4465
Supporter
Hiho

Pretty easy.... I not do this myself but the main logic work always same way.

1. Search for the Raw Data and get as much information as possible..... Mostly in Offset Lists.

iconQuote:

0C48 1 NAV1 Localiser Needle: –127 left to +127 right



2. Observe the Offset !
Create a new File in Mobiflight
Create a output config and insert the needed Data. In That Case Offset 0C48 Typ INT Size 1 Byte. Please us NO DEVICE.... NOT select your Motor !

Now startup your Sim and run Mobiflight.... Get sure you can see Sim and Mobiflight Connector Window at same time ( So use Sim in Window mode ! )
Play with the Offset.... In your case fly 360° circles so the Offset goes mutliple time from lowest to highest point and back.
Always check the Data in Mobiflight Window right of the Config..... The "FSUIPC Value" line show you the value that i send by FSUIPC at the moment.

Finaly you must know.... HOW do the Offset work. Is it in that case realy from -127 to +127 or is it for example 0-127 to the right but to the left it is 255 ( beginning in the middle) downwards 129 for full Left ...... If yes then this is a "Signed Unsigned" issue in FSUIPC.
( I not test it.... So i not know the awnser myself)


3. Build Output Value.
After know youreself how the Offset work it is easy to build the config.

For example If Offset realy go from -127 to +127 i recommend to bring the value to a positive Value all time ( Cause Servos not like negative Raw values as i remember)
Use Transform " $+127 " .... Then Offset Range is 0-254 .... Use in Servo Settings Min 0 Max 254 (or 255) and all is fine. Value 0 is full left... Value 127 is Neutral Value 254 is full right.

If Offset include the signed unsigned Problem as i said above then formula is more difficult.
Use here if($>127,$-127,$+127) That means if Raw Value is Above 127 ( So needle on the left side of the panel) then it subtract 127 ..... Then Full left is changed to "0" and 1 Point to left is changed to 126 .... If Raw Value is less then 127 ( Needlo on the right) our formula "Add 127" so Neutral 0 change into 127 and full right change into 255.

Servo Settings are the same. Cause we finaly also have a Value 0-255

*************

You see... The key is to "understand" and learn how the offset work..... then the final step to create a formula is not problematic !

Please report success and tell us what way was correct.... Then other user still know how the Offet work !
Good Luck !
2020-04-09 17:49
Avatar
jose1982
Posts: 11
hello, I tried what you say, in the fsuipc value (all to the left) it shows 130, in the middle it shows 0 and all to the right it shows 127, i used Transform " $+127 " and servo settings min value 0 and max 255 but it did not work, then i tried the second option that you gave me but it did not work too. The only way that i found to make it work was making an interpolation. This was my interpolation setting, it could be useful for someone else:

Input Output
Value Value

130 - 0
142 - 13
155 - 26
167 - 39
180 - 52
193 - 65
206 - 78
218 - 91
231 - 104
244 - 117
0 - 130
12 - 143
25 - 156
37 - 169
50 - 182
63 - 195
76 - 208
88 - 221
101 - 234
114 - 247
127 - 255

Thanks for your response.
2020-04-09 19:08
Avatar
jose1982
Posts: 11
And now i have a similiar issue with stepper motor, i am using the 0C4E offset for the OBS, i could make the stepper turn in the correct way, but in the sim when it goes for example from 010 to the left 334 when it reach the 0 degree the stepper make a 360 degree turn and and then it keeps turning correctly. What could i do to solve it?

Edit: I solved the problem :blush: :D
[Last edited by jose1982, 2020-04-09 19:34]
2020-04-09 19:22
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4465
Supporter
iconjose1982:


Input Output
Value Value

130 - 0
142 - 13
155 - 26
167 - 39
180 - 52
193 - 65
206 - 78
218 - 91
231 - 104
244 - 117
0 - 130
12 - 143
25 - 156
37 - 169
50 - 182
63 - 195
76 - 208
88 - 221
101 - 234
114 - 247
127 - 255



iconpizman82:


If Offset include the signed unsigned Problem as i said above then formula is more difficult.
Use here if($>127,$-127,$+127)



Check your Interpolation.... It make exactly what my formula will do .... If Raw Value is bigger then 127 it will subtract ..... If Value is less then 127 it will Add .
Ony difference is you use not always same value.... But also nearly 130 +/-
Good Luck !
2020-04-09 20:48
icon