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
fjgaspar
Posts: 18
Hi,

I have set up a rotary for managing Autopilot HDG. I have used the transformation $-182 to turn left, and $+182 to turn right.

When it comes to the display (and also happens in the simulator), if I turn to left until 179 degrees, the FSUIPC value reaches its limit and the rotary cannot go more than 179 degress to left. Also, when I turn right, the limit is reached and cannot go more to the right. So if I am heading 190 and I want to go to 170, I have to turn all the way to the right, because I cannot go further than 179.

I have read a possible solution, use the compare tab and putting the expresion $+360 if value is less than 0, but it doesn't work. It only allow not showing negative degrees, but still, I cannot go further than 179. The solution has to be to wrap the fsuipc value, so that when it reaches the most negative value, if continue to turn left it becomes the most positive, and viceversa when turn right. But I don't know how to modify FSUIPC values.
2020-12-21 18:30
Avatar
fjgaspar
Posts: 18
I think I have managed to solve it.

Using event id's instead of offsets, I have seen, watching the fsuipc console that if the value of FSUIPC is the maximun positive and receives an HDC INC event, it goes to the maximun negative and carry on to 0. The same, if at max negative receive an HDG DEC, it goes to max positive anf carry on to 0. I have arranged the transform formula so that the read in simulator matches the FSUIPC Output, and so, the display reading. The formula used has been this:

if($/182.2<0,$/182.2,$/182)

If anybody knows an easier way to do it, it will be wellcome.
2020-12-21 21:08
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
The Key here is to understand the Offset..... And YES This Offset is Strange. (In case FSUIPC use a different logic here as Mobiflight..... this occure in a problematic situation)

Basicly the most easy solution is.... Using EventID´s for INC/DEC . Here all the calculations are done by FSUIPC/Simmconnect in the Sim itself... So you not care about.

If you like to understand i try to explane......

The critical Point of those Offset Writes is the "swap" or "overdrive" .... In Heading we got a Value 0° to 359°
Lets say hypothetic the Offset is clear and work also from value 0-359
If you sue now for RIGHT $+1 and for LEFT $-1 then all looks good.... BUT there are 2 problematic spots.
If your in 359° and you turn Right..... Then your Formula say $+1 ..... means 359+1=360 .... It will send now 360 to the Sim..... But the Sim now get in trouble cause the Input is only allowed to a value 0-359 . Same happens in a Leftturn at 000° . Here $-1 occures in 0-1=-1 .... And a Input of -1 is not allowed in a range of 0-359

To avoid this we normaly use a IF ELSE here.... For example on Right we would say here if($=359,0,$+1)
Means.... If Value is eaxcatly 359 at the moment a Rightturn would NOT say $+1... It would directly set to "0" . If Value is not 359 ( Something between 0 an 358) it would simply add "+1"
On LEFT it would look like if($=0,359,$-1)

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

On the Heading Offset we got a second problem..... This Offset get a SIGNED -UNSIGNED Bug. In FSUIPC this Offset is SIGNED... But MF read it UNSIGNED.
Raw it is 0-65535 ( 0 is 0 Degrees .... 65635 is 359 Degrees) ..... But Mobiflight read it SIGNED .... Means 0 = 0 Degrees. 32767 is 180° but MINUS -32768 is 181°

That means.... The "Swap" now is not between 359/0 ..... Here the Swap is between 180/181.
So we would need a Formula (On RIGHT) like if($>32584,$+182,-32768) Means if Value is 179 or below) thn set $+182 to Add 1 Degree. ELSE Set -32768 that represent 181° here.


*******************
I know.... Verry confusing. I just want to show you what happen here !
Good Luck !
2020-12-21 21:48
icon