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
Gc2203
Posts: 13
Hi all,
please is there a tutorial that can help me to understand how i have to set an encoder (mine has 5 pins : GND/5v/Sx/Dx/Click) by using mobiflight with MSFS2020?
I have already download the ultimate Connector software and i've establish the communication between my Arduino mega and my pc.

Thanks in advance
Giulio
2020-11-04 12:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

There is no needness for a aditional tool..... I never heard about "ultimate conncetor software" .... Whatever. Nothing is needed expect Mobiflight and a Mega !
Also there is no difference from MF side whatever you use FS2020 or FSX/P3D .

And finay your 5 Pin Encoder work same way as all other 5 Pin Encoders.
Instead to standard Encoders those use a 5v line additionaly.... The other Pins are The same.... GRD , Left, Right and finaly "Click" will means the Push button on Top pretty sure !

If you got a specific question... then tell us. If you ask just how to wire those encoders... Google please !
Good Luck !
2020-11-05 19:32
Avatar
Gc2203
Posts: 13

the problem is not the physical connection of my encoder to the arduino mega board.
my problem is to understand how to set mobiflight to make this encoder, for example, vary the IAS speed of the autopilot.
what i was wondering was if i could find a tutorial that could show me step by step this process.
2020-11-08 17:51
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again

Here there exist no tutorial but a lot of Forum Postings. Technical this is also not needed cause its fully self explaned if you understand the tutorial for Buttons already.

Step 1 : Inplement the Encoder in the Hardware settings and upload to Board. Choose there the Typ "Encoder" and select the 2 Pins you use for the A and B data line.

Step 2: Create a INPUT Config and choose as Typ from Dropdown the Encoder you create before.

Step 3:
Here the UI looks a little different to a Button ..... Buttons got PRESS and RELEASE .... Encoders got LEFT and RIGTH ( And Fast-Left / Fast-Right but we not care about this now)
In the LEFT Tab you can set what shoud happen if you turn left..... And logical in the RIGHT Tab you say what Mobiflight should do if you turn right !
Here the Entrys are simmular to a Button. You can choose EventID´s or Offset Inputs for example. See this situation same way as the encoder would be just 2 Buttons that only have a press option.

Finaly: Everytime you turn the Encoder, the Software wil detect a moving and calculate if it was left or right.... Then it will execute exactly the command 1 time that you define for left or right.
Good Luck !
2020-11-09 13:58
Avatar
Gc2203
Posts: 13
Thank you very much for your help.
Now I have set up my encoder to handle the IAS of the autopilot module.
I chose the "AP.airspeed value" option in the standard FSUIPC values ​​and turning left I set the value -1 while on the right the value +1. In the cockpit of my A320neo I actually see a variation but when I turn left the value goes to 1 and when I turn right the value goes to 990 kts, which is the maximum.
Where am I wrong?
2020-11-12 18:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
You not understand the basic logic !

At first.... If you use EventID then you not must be think about the follow.... If you like to use FSUIPC Offset then you must do Calculations !!

You say it should write on Leftturn to Offset 07E2 the value "-1" and on right it shoud write "+1"
Means if current value is 200kt and you send "-1" then it will be set to "-1" If value is 200kt and you turn right you send "+1" so it is set to 1.
Cause you say.... "send -1" or you say "send +1" (what means 1)
( By the way... In your report it is inverted.... Pretty sure your LEft/Right logic is wrong. Maybe you swap the wires/pins)


The correct worklflow is to say for example on Left : "Take current Offset Value, Subtract 1 from it and send the result back to Offset."
E.g. currently 200kt is set..... Then our logic say Read 200..... 200-1=199 ..... Send 199 to the Offset back.

Correct syntax is $-1 and $+1

BUT
There can be another Problem in case of a non regular value. If you have currently "0kt" set and you say $-1 then it will calculate 0-1=-1 .... And Minus 1 is not regular cause Knts can not be negative..... Result.... It show highest value like 999kt. (Thats a binary computer logic).
So you need here a "formula" .
You need to say If Value is 1 or greater then Subtract -1 from it.... BUT if Value is curently "0" then NOT subtract again.... Then simply set 0 all time to not get negative finaly.
Syntax is if($=0,0,$-1)... So If Vaue is currently 0 then send 0 again.... Else ( If value is not 0 means bigger) then send Current Value -1.

****************
Summary: Use EventID if possible. If Not you should have knowledge how to build the correct value or formula.
Good Luck !
2020-11-12 21:09
Avatar
Gc2203
Posts: 13
OK, very good!! thanks to you for your assistance now I have already started running some encoders. I was wrong in writing the formula !!!!
One more thing is not clear to me:
what does the "Type" option mean when setting an encoder?
I see that there are several choices such as 1 detent per cycle (11) or 2 detent per cycle (00,11) etc etc.

thanks in advance for your reply.

Giulio
2020-11-16 17:56
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

It means what you expect already.

Encoders have 2 factors..... Signals and Detents.

Detent are the mechanical notches you feel when you turn it "one step" to the Left/Right .... This Step is a detent. The Number you mut care for is the detents per Circle. So how many detents the switch need to be turned to reach 360° movement.

Signals are the internal electrical proceses the switch finaly execute to the wires. They are also counted by 360° . So a switch can do e.g. 20 Signals within 360°
I not like to explane now the full logic.... Sure the switch also send a signal each detent.... This is deeper math and programming logic now. so simply lets call it like it is)


And Typ at the end means the combination of that 2 factors.... If a Encoder got 30 Detents 30 Signals .... Then its a 1:1 Encoder. If it got 30 Detents but just 15 Signals then its a 2:1

You must set in Mobiflight the correct typ now.... If you use e.g. a 2:1 Encoder but you set it as 1:1 then MF will just act on every 2nd detent.
Good Luck !
2020-11-16 20:32
Avatar
Gc2203
Posts: 13
thanks for your explanations, they are more and more useful to understand the logic of the software.
there is one more thing I would like to understand with your invaluable help:
I understood that the configuration can be done either using the offsets FSUIPC7 or with EVENTID but with this I don't understand how to set the relative parameter.
I am using MSFS2020 with standard aircraft (for example with AirbusA320Neo).
Once I have found the eventId I want to use I don't understand with what reasoning I can find the correct parameter.

thank you as always for your assistance.

Giulio
2020-11-17 14:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Again

Basicly there exist multiple kinds of Events. I not own FS2020 so i can not fully help you direct. But it looks like FS2020 and FSUIPC7 work in most cases simmular to the past. So i simply tell you my current knowledge from P3D.

I know 3 kind of Events....

1. Execute Events ( My personal term. Don´t know if they called so official)
These are Events that "execute" a process.... For example a Event for Increase AP Altitude by 100ft. Here the Parameter is not important. Mobiflight ask for a Parameter by default so we must use it.... But it´s no matter if you use 0, 1 or 999999 ..... This Event simply do always the same !

2. SET Events
This kind of Events SET the function to the value you use as Parameter. For example the Event SET Heading will imply set the AP heading to the value you use as parameter.
Parameter 222 means it set Heading exactly to 222°

3. Special Events for AddOns.
AddOn Aircraft can use "own" Events.... That work verry individual.
For example PMDG Boeings use a EventID system where the Event Itself is the location of the System.... For example the HEading Encoder in the Virtual Cockpit.
And the Parameter represent different Mouse Actions. So i you like to simulate a LeftClick on the VNAV Button then you use the EventID of the Vnac Button and you use the Parameter for LEFTClick.


****************
Summary: You must know what Event you use.... then you understand the correct Parameter.
Good Luck !
2020-11-19 19:34
icon