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
Ilirio
Posts: 38
Hi,

I have a rotary encoder for the flaps control (attached to FSUIPC Events FLAP_INC and FLAP_DEC, or something similar). When I rotate the encoder rightwards or leftwards, the flap position is correctly modified. However whenever I change the sense of rotation (i.e. rotate clockwise when I was rotating anti-clockwise or viceversa), the first rotation is never detected.

May be this a configuration issue or it is just that the encoder is somehow broken?
2021-11-09 11:03
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi,

no, the encoder is not broken. Did you set the correct type of encoder in the device setup? So 1:1 or 2:1 or 4:1?
Grüße,
Stephan (Time: UTC+2)
2021-11-09 13:01
Avatar
Ilirio
Posts: 38
I supposed they were, as all variations are correctly registered as long as I don't change the direction.

I bought them in amazon, with no datasheet attached:

https://www.amazon.es/gp/product/B08728PS6N/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I only have the reference EC11, which I presume it belongs to a really big family of encoders
2021-11-09 13:41
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
The decisive data are below at Amazon. There is 20 detens and 20 impulses, so it is 1: 1.

Try connecting two LEDs to the encoder (less than 10mA). Then you have to turn very slowly to see the effect.
LED A should always come on, then LED B, then both off and the game repeats itself again. LED B and then go backwards. If you see an irregularity when changing direction, it is because of the encoder.

It could be tolerances, I wouldn't call it defective. Try a "better one"
Grüße,
Stephan (Time: UTC+2)
2021-11-09 17:51
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

I thought this "issue" was solved in a patch/hotfix "long time" ago.

But i also remember that Sebastian said this issue can happen in case of the way a encoder is read..... So if it is between a "step" it can not detect the direction of a inverse rotation in first step ( so data can be read as left and right same way) ..... means after change direction a minimum of 2 Detents is needed to confirm its correct.
(Not sure if this was solved.... but i think this was the basic problem)


About situation:

Your problem is.... You try to controll a system that is not build for Encoders.

Normaly Encoders are use for example to Radios, Trim Wheel and so on..... So no physical positions like in a flaps lever !

For example if you turn encoder to set a Frequency in Com 1.....
It´s no mater if it Increase the value by one antoher step after you turn xounterclockwise..... You simply turn it once again and all is fine.
Mostly you not feel this "issue" in case you will turn it already 2-xx positions.... So no mater if you turn it one detent more.

For sure.... if you controll Flaps..... And every detent represent a Flap position..... then a single Turn in new direction ( one detent) is a massive problem when it is turn in wrong direction by this issue.


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

Summary:
We should check once again if we can find the nature of the problem..... And if we be able to solve.
BUT otherwise....
User also should rethink if it is logical to controll e.g. Flpas with a Encoder that is fully the wrong typ of Input Device for that !
As Said above.... Encoders for e.g. Freqencys work fine ( whatever with this issue)..... cuase we not care about this missfunction there !
Good Luck !
2021-11-10 00:35
Avatar
Ilirio
Posts: 38
Thank you for your comments.

It's not really a big issue, but on the JU-52 the flaps position indicator is in a very unconfortable place to check and my desktop indicator (LCD+Mobiflight) sometimes fails (it shows the symbol I use to display it along with the trim position), so when approaching it's quite important to trust that when I command a point more or less of flaps the aircraft is doing what I commanded.

Talking about the correct device, I choose an encoder as the real thing has a wheel (both for flaps and pitch trim) and at the beggining I fantasized to join both controls in one encoder just as in reality (for the moment, that idea has been left until more access to simconnect variables is granted). I've consider changing the posibility of changing the encoder to a 4 position switch, but the only ones I could find where channel selectors, that is a lot of pins associated to the position of the switch, which is not what I want. Even I tried to find an simple on-off rotary switch for the radio, but again, nothing fitted. Maybe I'm not choosing the right words for my search...
2021-11-10 07:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
??

i think you need a little input from other users to enlarge the horizon for that.

E.g. "You not find 4 pos switches ??" ..... Simply use a 12 Pos switch. If the needed resultution is 30° its perfect. Just not use the Positions you not need.
If not a easy 1:x Gear with 2 cogwheels change a 12 Pos switch into every possible Switch (1° - 360° 1-12 Positions)
Or.... Build a Multi switch yourself by using simple a couple of Micro Switches into a "nodge holding mechanic"

Whatever.... Can you tell me how the flaps lever work in the JU52 Sim Aircraft ?

I just google and it looks like it is not a combined system..... Trim is done with then nearby wheel.... The flaps are done with the lever (or not ??) So this is not a encoder at the end.
Can be a Potentiometer..... But much mor logical is a Multi pos switch or a couple if single switches with nodges .

Please understand me correct..... I not say your way is fully wrong..... I just want to show alternates and show how other people make those things.
Mostly at beginnig we have problems in case we plan for difficult thins..... in case we simply not know there is a much more easy solution!
Good Luck !
2021-11-10 08:44
Avatar
Ilirio
Posts: 38
Hi pizman,


The JU-52, or at least the 1939 I usually fly has a wheel attached to the pilot seat. The wheel is used both for adjusting the pitch trim and to operate flaps, depending on the position of a lever next to the wheel. Although the position of the flaps may be "analogue" due to the operating system, manuals refers to 4 reference positions: 0º, 10º (climb), 25º (take-off & approach) and 40º (landing). So probably the pilot is able to set every angle from 0 to 40, but I have "discretized" to 4 positions namely 0, 10, 25 and 40, and using the Events FLAPS_DEC and FLAPS_INC it more or less work as I intend (each turn sets the flaps to those positions).

May be I could use a switch to achive those four positions, assigning each positions to each one of the four "main" positions, but as my initial intention was to use the more similar system I started thinking of encoders.

I know that by using gears and cogwheels much magic can be done, but I admit I don't feel confortable which those things, I have an IT background "engineer of non-existing things used to say some of teachers at university" so I feel ok with programming and even with electronics, but gear boxes and so really scare me. In fact I'm thinking on building some gauges which require dual needle and I don't know even where to start!! So in the case of switches where gears are not strictly need I'd prefer avoiding them :blush: :blush:
2021-11-10 09:20
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yeah....
Dual Needle Gauges need Gearboxes.


About the JU52....
Badly the Picture i see was not verry usefull. ( from a other version)
So i google for a Video and agree..... Switch is a "selector" and Flaps/Trim use the same wheel.

I expect Trim runs more then 1 circle..... So "Poti" is no longer a Option.... It must be a Encoder.
Means YES..... we need to find a way to do this with Encoder in a good way!

So there are many Questions.....
You say the basic system is analog..... So technical not 4 fixed positions..... Its more like a "Stepless increase" from 0-40. Right ?
How "far" is the range in the wheel ( in real and in sim ) ?
Pretty sure you not move the wheel just 1 detent forward to extract flaps Climb position from 0-10 ...... Do i expect correct that in sim a 360° Turn represent 40° Flaps.....
So for example a 25% turn occure in Climb..... 50 Turn nearly in TakeOff .... And a 100% Full turn in Landing ? Or do we need to turn e.g. 4 full cycles to get flaps to 40° ??

The next Question..... How does the Commands work "Flaps INC /DEC " .... Does it set Flaps directly through the 4 Situations (0,10,25,40) OR does it increase e.g. by 1 Degree° Up and down ? .... So e.g. you must send 10 times Flaps INC to come from 0 to 10 or do you need only sending 1 time ?
Follow Question..... Do we have another way to handle the flaps..... E.g. by writing the Sim Flaps Position Variable ( instead using the INC Event) OR may do we have a Event that say "Turn the Virtual Flaps/Trim Wheel of the JU52 by one virtual detent" ..... So we could simply turn the wheel and NOT set the flaps itself.
That would be the most easy way..... We just set the Selector and simulate a turn of the Virtual Wheel..... All things now are done by the simulator and MF only need one Encoder Logic.

******
Aslong the needed Variables are there and useable with MF ...... May we find a way.....
In easy words.... Figure out how this "should" work in real.... Then we can check again if there is a way!
Good Luck !
2021-11-10 13:34
Avatar
Ilirio
Posts: 38
Hi again!

Sorry for I couldn't answer before, I have had some minor health issues these days and couldn't spend time in flight simming.

Answering to your questions, the most realistic approach would be using the encoder to simulate a continuosly increase/decrease of the flaps deployment, from 0º to 40º. I should check on the simulator how many turns of the wheel are necessary to go from 0º to 40º, however I would bet that it is more than 360º (i.e. one full cycle). From reality I cannot know as there is very few documentation, and the existing one is in German which I cannot understand at all. What I could tell you is that there are no detents so in real life (or in the sim actioning the wheel) you could only more or less get the marked points of 10 and 25 (0 and 40 can be more precisely set as they are the edge values and no more turn is possible. I'll check this afternoon the turns issue.

About the Flaps INC/DEC, the approach I'm using, those Events are designed for aircraft for marked points of deployment, that is, for example in an Airbus when you execute a Flaps INC you would pass from Flaps 1 to Flaps 2 and so on. In the JU-52 those Events have been modeled to jump between the marked positions of 0, 10, 25 and 40, so when I execute a Flaps INC/DEC I jump between those points. It is not realistic, but for a first approach I found it easy and useful.

I think there is another way to position flaps, that is by using Flaps Set, which allows setting a specific value, but I haven't tested it. The turn of the wheel probably exists, but I fear that as other variables in the JU-52 is an O or B variable, so not accessible now.

******

Returning to the beginning... about the gear boxes do you know anywhere I could find gearboxes already designed? I imagine the dual needle is a common problem in cockpit building.
2021-11-15 07:20
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
For Switches they exist..... Including PCB´s.
E.g. this....
https://hispapanels.com/tienda/en/assembled/450-kit-for-concentric-assembled.html?search_query=concentric&results=20&
https://www.youtube.com/watch?v=HpW8PD9R3XI&t=2s

But you see it´s expensive.... And for a Gauge the system must look a little different..... whatever the basic idea is the same....
You use a "Shaft in shaft" build for the 2 needles..... The outer shaft ends in a cogwheel that es set to another cogwheel nearby ( Motor 1) and the inner shaft goes through this system and is set to Motor 2 one level behind.... Or also on same level again with 2 cogwheels.
I will say most users build this themself ( CNC, 3D Print)


******
About JU52

So i think "Increase (set) the Flaps Value will be the key.
Find out how many resulotions the virtual Wheel ( or a real aircraft) must do. ( I´m from germany.... If you link me the documents i can read them !) .
THEN we pretty sure find a logic.....
Lets say your Encoder got 20 Detents per turn..... And lets say Virtual Wheel must turn 3 full circles to get Flaps 0-40.....
So 3x20=60 Commands ...... Lets say Flaps Value goes from 0-16383 ..... 16383/60= ~~273 So if we say " On right .... $+273 " means wi will turn 60 detents (3 circles) to increase Flaps from 0 (0°) to 16383 (40°)

In easy words..... We need to know the logic.... and we must hope Ju52 have a writable SetFlaps Event/Variable.
Then its posible !
Good Luck !
2021-11-15 10:59
Avatar
Ilirio
Posts: 38
Hi Peter,

Finally I could check the functioning of the wheel inside the simulator and it was a great surprise, for flaps setting it only has 180º turn, so 0º is at 0 turn and 40º is at 180º. I will try to work with this data.

However, am I not going to have the same problem when I change turning direction in my rotary encoders? Probably it will be less noticeable but it will exist anyway, won't it?

Thank you for the links, I'll check them
2021-11-15 18:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
This is a other Thematic.... If there is a Problem here in your Hardware ( or really in the MF system still) then for sure.... The same behavour is still there....

BUT

Now it is not so extreme.....

Lets say you have a 20 Detent Encoder again.... Half turn 180° is 10 Detents ......
So we must say to come from 0-40° ..... Move Flaps on every detent by 4° .....

In old system you move Flaps by the 4 preselcted Positions.....

So letes assumed you are in Flaps 10 Position..... You like to decrease to "0" .... And lets say in case of the issue the Flaps turn 1 detent in WRONG way .....
In Old systme the one detent ( to set 0) occure in a set to 25! thats fatal !
In the "new" System you would turn 3 detents to come from 10 to 0 ..... With the issue it turn at first from 10 to 14 .... But the other two turn back to maybe 5..... So for sure.... Also here the Flaps are not Up ( like expected) but they are not massive mor out .... They are pretty "in" now.

Not perfect.... But you now be able to adjust the flaps by "feel".... You know the issue... So simply turn wheel a little more as expected to be sure they are fully UP or Fully DOWN.
If the position in the middle is not 10 and you set 8 or 12.... Nobody care about !
Good Luck !
2021-11-15 23:39
icon