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
J.G.
Posts: 15
I am new to this so please excuse me for stating the obvious etc.. :blush:

I have managed to set up some switches successfully now thanks to help received in another topic. I am trying to set up a rotary encoder to control the rudder trim. The encoder I have also has a switch built into it which is operated by depressing the knob rather that turning it.

The switch works well and I have this set up for Rudder Centre (66594) In the hope it will centre the rudder trim as well as the rudder itself. It seems to work but is less than ideal as I want the rudder trim to be centred and not necessarily the rudder itself. (is there a way of centring just the trim?)

The rotary encoder doesn't work. I have it set up as an input device on pins 20 & 21 which are mapped as follows:
Right = Rudder trim right (66279)
Fast Right = Rudder trim right (66279)
Left = Left trim right (66278)
Fast Left = Left trim right (66278)

There is no output to the debug screen for the encoder when turned in any direction but the push button actions are displayed.
Can anyone provide me with help and advice to get this running please?

Thanks.
2018-06-20 17:11
Avatar
StephanHo
From: EDDG, Germany
Posts: 1857
Supporter
Hi J.G.,

First of all: It would be interesting to know what you are using for a simulation (FSX, P3DVx, X-Plane or Standard) and which aircraft (Boeing, Airbus, PMDG).

You describe very well which EventIDs you are using, but do not say which parameters you are transferring. For each EventID you need parameters so that Mobiflight and finally the simulation knows what to do.

The EventIDs you have chosen are among the standard FSX machines. As long as no parameter is being transferred, Mobiflight can not display anything in the debug window.

The fast parameters are basically not required.

It is also possible that you wired wrong, then nothing happens.

So you should check again the correct wiring and then look which parameters you are transferring.

If all this does not work, just sign up here and answer my above questions.
Grüße,
Stephan (Time: UTC+2)
2018-06-20 18:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6007
Supporter
Hi

Maby we talk about two different problems here.

Question is....

Do you have a HARDWARE Problem.... Means Your Encoder is broke or maby wrong wired.... or Maby simply wrong configured in Mobiflight.
OR
Do your Encoder work fine and simply the used Config is wrong.

To find out you can use the DEBUG String ( See if the Device sends a Signal like " XYZ Detect Signal ON LEFT " ) OR you can make a simple test config.
( For Test config use simply KEY Pres or a Funnction you know 100% that work like ParkingBrake ... Or a Switch you already tested. )

About your Events

1. Get shure you use right System...... Those Events are ONLY for Standard Aircrafts !! If you use a AddOn you must find out yourself if it use this Events or if it get own Events.

2. If you not use a ON FAST special system ( You say you use SAME Event here) THEN you not need ON FAST finaly.... Simply Disable it.
On Fast is only need if you use it for a DIFFERENT function like in ON LEFT/RIGHT

3. Your RUDER Event Controll the Rudder.... The TRIM Event controll the TRIM. You already find out youreself.
So if you like to center the Trim you need a Event that controll the Trim!

RUDDER TRIM LEFT 66278
RUDDER TRIM RIGHT 66279
RUDDER TRIM SET 66732
And in Offsettable:
0C04 2 Rudder trim value/control: –16383 to +16383 [NEW!]

So it would think... LEFT is Event 66278 Parameter 1 .... RIGHT is Event 66279 Parameter 1
For center you need the SET Event.... Here EventID is 66732 .... Parameter is the Value you like to set it (-16383 to 16383 ) Pretty shure "0" Zero is CENTER.... So use Parameter "0" here.

Please try out and report experience !
Good Luck !
2018-06-20 18:48
Avatar
J.G.
Posts: 15
Thanks for your help. I use P3D v4 - Sorry I should have said.

I went through everything and found faulty wiring. :blush:

The main rudder trim settings are now working, all I have to do is to get the centring switch thing working.

Unfortunately, somehow I have managed to do something that has effectively switched off all external views of my aircraft. In the cockpit I can see the aircraft, cockpit etc., all outside views there is no aircraft what so ever. When I figure out what has caused this I will look into using the set trim command to see if that centres the trim. at the moment I cant see the tail to see if the trim is moving!!!

J.
2018-06-20 19:22
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6007
Supporter
iconJ.G.:

at the moment I cant see the tail to see if the trim is moving!!!



Don´t care about the grafics.....

You "feel" the trim while testing in flight pretty shure :rolleyes:

simply READ the Offset ....
iconQuote:

0C04 2 Rudder trim value/control: –16383 to +16383


by a output config (without device) .

There you see the current TRIM Value..... And if it be manipulated by your encoder.
Good Luck !
2018-06-21 00:02
Avatar
J.G.
Posts: 15
In my last post I mentioned that I had lost the external visuals for all of my aircraft.

I have found the problem and reproduced it several times. Here is what I did:

I deleted my Prepar3D.cfg file
I started P3D without Mobiflight - textures were back and other things were good.
I shut down P3D.
I started P3D with Mobiflight and all my switches active including those associated with the rotary encoder.- The textures had disappeared!
I shut down P3D.
I deleted my Prepar3D.cfg file.
I started P3D without Mobiflight - textures were back and other things were good
I shut down P3D.
I started P3D with Mobiflight and all my switches active except those associated with the rotary encoder.- textures there and other things were good.

I repeated this process twice and the results were always the same.

So currently it seems to be either an issue with my encoder or a bug in the rotary encoder part of Mobiflight.

I have ordered a different make of rotary encoder to see if it is the encoder. Its due to arrive today so I hope to test it later. I will post my findings here.

JG
2018-06-21 12:13
Avatar
StephanHo
From: EDDG, Germany
Posts: 1857
Supporter
Hi J.G.

Basically it can not be due to Mobiflight, because it does not communicate with the simulation, but only with FSUIPC. So that can not be the cause.

Let's wait and see what the hardware replacement will do.
Grüße,
Stephan (Time: UTC+2)
2018-06-21 12:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6007
Supporter
Simple Question....

Is the grafics gone directly when you start Mobiflight.... or Only when you Do something ( Like turning the encoder)

For me it looks like you have use a wrong Input in a Mobiflight INPUT Config....

In the CFG there is written your Screen Settings.... So if you for example use for your rotary not "CENTER Rudder" and have a wrong ID number that for example say "CLOSE all Windows" then it result in your problem.
***

As Stephan said... Mobiflight NOT do something in your CFG.... But it can start a Event THAT change something in CFG.

So please confirm.... Is the problem direct after Start or only when you make a Input... If Yes WHAT Input.... Simply open a new Mobiflight File (Without Configs) to get shure there is no wrong input config . THEN it should NOT longer kill your File.
Good Luck !
2018-06-21 21:29
Avatar
J.G.
Posts: 15
Thanks for your help with this.

I have the replacement encoder and I will wire it up and test it tomorrow. I will post my findings here.
2018-06-22 00:33
Avatar
J.G.
Posts: 15
I have wired and fitted the new Rotary encoder to the Arduino and am getting the same problem.
The encoder is built for the Arduino board (Mega 2560) and can be seen here:
https://www.amazon.co.uk/gp/product/B06XT58ZW9/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

The wiring was done like this:
• Encoder CLX pin to Arduino pin 21
• Encoder DT pin to Arduino pin 20
• Encoder SW pin to Arduino pin 19
• Encoder GND pin to Arduino ground pin
• Encoder + pin not connected.

The Mobiflight configuration was as follows:
Input - Type Encoder:
• Left – FSUIPC Control no 66278
• Left fast – FSUIPC Control no 66278
• Right – FSUIPC Control no 66279
• Right fast – FSUIPC Control no 66279
Input - Type Switch:
• Switch - FSUIPC Control no 66732 Param 0

System software:
• Windows 10 64 bit
• P3D v4.2
• FSUIPC v5
• Mobiflight v7.4.0

Cause of symptoms:
When the encoder is used the value of SEE_SELF in the Prepar3D.cfg file is set to 0 (Zero). This causes the external views to not see the aircraft. So if I run Mobiflight and connect to FSUIPC all appears good with the normal switches working as they should. The SEE_SELF parameter is set to 1.
However as soon as I move the rotary encoder’s knob the aircraft disappears. If this is done whilst viewing the outside of the aircraft it vanishes in front of your eyes!
A check on the SEE_SELF value finds that it is now set to 0 (zero). Manually changing this value back to 1 restores the aircraft outside view until you use the encoder again.
I hope this provides enough information for any investigation.

Thanks,
JG

Edit: There is an FSUIPC Control no for the SEE_SELF value in the list of FSUIPC Control nos. It is 66118. This I did not use and it is sufficiently different to have been used in error.
[Last edited by J.G., 2018-06-22 12:45]
2018-06-22 10:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6007
Supporter
Hi Again.

About the Encoders....

Myself and lots of people here use Standard Encoder like this.... https://www.reichelt.de/Rotary-Pulse-Encoder/STEC11B01/3/index.html?ACTION=3&LA=2&ARTICLE=73911&GROUPID=3714&artnr=STEC11B01&trstct=pol_1
These use no PCB and not need a 5v line.... They have only A , B , GRD and BTN ( Some got a 2nd GRD for the Button but it can be wired together, cause all GRD are the same)

BUT: Some guys here also use your KY-040 Encoders and report they work fine....
I´m just wondering cause most of the other guys report that they MUST use the 5v line from Arduino, too.... Maby it NOT work if 5v is not set.

*****

About Problem.
Its mysterious that your encoder controll a function that is not in config.

In your last posting you NOT awnser my basic question 100%
You say you use a new encoder.... BUT.... Do you use a new config, too ??
To exclude ALL other issue spots please make a Test with a NEW Config File.... And THIS should include ONLY the needed things....
((NOT Rework your current file ( for example by deleting the not needed parts). Its important to create a NEW File !))

So i Think you should make a file WITHOUT Output Configs....
And ONLY 1 Input Config.... ( With device is the Encoder)
Use in this Config ONLY On Left and ON Right.... ( No On Fast Commands) ( with 66278 and 66279 And parameter 1 (also 0 for testing if you want) )
If possible use a MEGA for testing that include also ONLY one Device (Encoder) and no other stuff.
( And test it with ADMIN Mode Active for P3D abd Mobiflight )

I call this the "Sherlock Holmes Methode" ... Excluding all not important things and reducing the system to the abolute basics will help you to find a issue !
that NOT means you shuld finaly work every Encoder on a single MEGA... This is just to find the Problem !
Good Luck !
2018-06-22 13:33
Avatar
J.G.
Posts: 15
Hi Pizman82.

Thanks for your quick reply.

My original encoder was exactly the one that you directly pointed to in your last post. So I can report that both types do the same thing.

I didn't use a new config. However I have a second identical Mega board and so I will try to use that with nothing else to test the encoder. I wont use the "On Fast" commands as well. I will not connect the switch part of the encoder but I may try the switch in complete isolation as well.

I probably wont get to do this until Sunday but I will post it as soon as I can.

JG
2018-06-22 14:03
Avatar
J.G.
Posts: 15
Hi.

The bad news: The new encoder made no difference at all.
The good news: I have found the problem and now have the encoder working as I want.

The problem is this. When I assigned an event by picking it out of the dropdown list I first typed "RU" to quickly get to the rudder controls and then selected the appropriate command from the short list displayed. I then pressed Use and an event ID was populated in the box at the bottom. At the same time as the event ID is populated the event ID box is cleared so you have an event ID but no longer have the name of the event ID displayed. I was assuming that the populated ID was correct. It wasn't.

If you shorten the list of events by typing something in to narrow the list, you don't always get what you expect. In my case it was populating the SEE_SELF ID number. Hence my issue with the disappearing aircraft. However if you scroll down the entire list of events and pick the one you want then without narrowing the field, although it takes longer, you always get what you pick.

I found this out by using a separate Arduino to isolate the controls as suggested and got it to work on the separate board. Once that was done I moved it over to the board I wanted and all was good.

So perhaps there is a bug around the selection of event IDs but it is no big deal. Most people wont use the list shortening method that I did.

Its been a learning curve getting MobiFlight to work but certainly not a steep one. Its a great piece of work and does a great job! I start thinking "what can I do next!

Thank to everyone who helped with this.

JG.
2018-06-23 15:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6007
Supporter
Basicly NICE that it workes for you ! :)

About situation.

Thats a little problem.... Cause users ( mostly beginners) not report a problem correct ( whatever they not do that purposely )

You say you use correct event... but you not do it... Shure you "choose" the right one.... But a simple check of Number below would show the issue.
So you understand... Its not possible for me to help you with a easy solution if the given information is wrong !

Thats a additional fact why i´m personaly against the "preset lists" .... if a user just CLICK on something in a list then he NOT think about the system.
You simply belive in the preset and not check the data.... What happen if Preset is out of date (its from maby 2010 ) and meanwhile there is a complete other function an that EventID Number ?

So i recommend to all Users : NOT use Preset Lists ...
If You need a Event then SEARCH for it in a List ( Like the FSUIPC Documents Lists for FSX Controls PDF ) ... OR Use Logging Tool of FSUIPC to find out the correct Event ( Or Offset)

In Mobiflight simply enter all Information by Hand ... Then you can be 100% shure all is correct finaly !
Same for Offset Outputs.... NOT use Preset ... Enter Offset, Typ, Size , Bitmask and so on ALL BY HAND ! . A Bit more work but less work as searching for a issue 10-20 hours.
Good Luck !
2018-06-23 16:13
icon