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
kjoussen
From: Hamburg, Germany
Posts: 178
Hi all,

within my project (Trim Wheel) where the tests so far are fine, ihave now a small problem where i have to make some adjustments to the formula in transformation and don't know how.

The FSUIPC Offset for the Elevator Trim gives values from -16383 to +16383 which i transform right now with

iconCode:
($+16383)/128


to convert it to 0 .. 255 for the servo driving the wheel (my own servo which can makes 10 turns ;) )

So far so good.

Unfortunately the trim wheel of an Airbus has an asymetric dicision.

It has 5 "steps" up and 3 "steps" down. So when the trim wheel on the screen shows 0 (for flat) the Offset-Value is approx -3550.

Funny enough when looking on the screen and moving the wheel with the mouse the value 0° is at 1up instead of 0 what i assumed.
And then the FSUIPC value is 0 and the output value for the servo is 128
How do i reflect this in my formula? Or is there anything wrong with my thoughts and i just can ignore it?

Thanks

Kai
2022-03-03 23:03
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Kai

I not fully understand the situation..... Specialy the Mix of INPUT and OUTPUT.

The basic Idea is OK.... Whatever its not needed.
The Sim Value in the "Display" Tab of the Servo Config not is limmited to 0-255 .....
I´m not sure for now if the Original 32767 would work..... But i think so.

Means.... Convert the "negative" Area into Positive .... -16384 -> + 16383 into 0-32768 was important....
Divide through 128 is normaly not needed.....
As i said Maybe MF not allow 32768 in case of a Size Limitation..... But for sure then /2 or /4 should be enough.
A Servo should "understand" Values from 0-16384 or 0-8192

About the "+2 and +3"
This is a INPUT Problem.... right ?
Your Servo not care about that Fact...
It simply show the position of the virtual Wheel.
It will maybe increase "more" by UP and decrease "less" by DOWN ..... in case the input action work "strange" here.....

But i will say this is no factor in the "OUTPUT" of the Servo..... Its not related to your Input Device.... Its related to the Virtual Sim !
Good Luck !
2022-03-04 00:37
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
Good morning,

i assumed that i can change the values for the servos as well, but i think it makes no difference, whether i divide by 128 to get values from 0 to 255 or if i divide by 8 to get values from 0 to 4095 for the servo. Or does it?

And my +2 / +3 and whatsoever problem .... yeah, hard to explain.

Look at this picture, maybe then you know what i was trying to tell.



Kai
2022-03-04 08:40
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
About the Division.

Your right. In your example it make presumably no difference.....
Its like thewith Steppers!
The Motor got also a Range and technical a maximum of Positions.
I not know how many smallest Movings a Servo can do until it pass the whole range from 0 to 100% .
Lets for example expect it would be 500 !
If you divide the Value into a 0-2000 Range then we are over the limit.... Increase of "+1" of Calculated Value not evrery time move the needle.... Only every +4 it make a little move.
But we not care, cause this is (In that EXAMPLE) already the most possible resolution of moving.

Lets say you extreamly divide the Value to 0-64 ..... And lets expect again hypothetical the Servo have 500 "Steps".
NOW a increase of Sim Value by 1 will move the Servo ~~8 Steps forward. So it "stutter".
And technical we mess a lot of possible "steps between" that would be available in a 0-32787 Offset!

Solution:
Normaly our target is to Divide/Multiply the Value to a Point where we have no stutter but also no all time hum.
So a Compromise between smooth and quiet is the key.... Not to many not to less values.

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

About Problem:

Looks like the Gauge is linear.... On the Picture the range between 2-->3 looks a little shorter but i expect this is in case of the radial round Body.... So its linear, or not ?
Neyt question is to find out if Virtual Gauge (Value) is also linear or not.

If Linear then your Problem is just a wrong logic..... Cause you expect The Sim use the Whole Area ( -16383 to + 16383 )

Solution:
Just read the raw Trim Value ( Without any recalculation) and move the Trim in Virtual Cockpit to the lowest posible Point ..... Note the Value you got ( i expect its NOT -16383)
Move the Trim now to most up position and note the Sim Value.
You can also stop in this testings in the "0" Point of Virtual Gauge and note the Value of the Offset.

With this Values we can calculate the System....
We know where it starts, where it ends .... So we know the "Range" and we also know the Position/Value of the Virtual Center . So we see if its linear or not.
Good Luck !
2022-03-04 12:29
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
Well, what is "linear".....as acurate as i can set the virtual Trim Wheel on the screen, following values are coming out

Virtual WheelOffset ValueDifference
3 Down-16383
2 Down-11502-4881
1 Down-7277-4225
0 -3475-3802
1 Up 0 -3475
2 Up36113611
3 Up75073896
4 Up117784271
5 Up163844606


So more or less it is linear.

As you can see when the wheel is at position 0, the value is not.
But at "1 Up" it is 0, what is - according to logic - correct, as it is the "middle" position of all 9 possible.

So the question is, how to reflect this in the transformation formula, if needed at all, and how to tell MF that during startup when it calibrates servos, putting them on 0-pos, it has to set this particular servo to -3475?

Thanks so far.

Kai
2022-03-04 13:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Strange....
How does this look like in the virtual cockpit ?
The scale from my point of view is 1:1 for UP and DOWN until Position 3 .....
The UP had another "non numbered" Position called "UP" above the UP3 detent.... so i expect its nr 4.
BUT
Where is Number 5 ??
Please tell me what happen if you virtually trim to UP3 so the Scale shows "3" .
Nor increase until your imaginary "4" .... Does scale now show the UP Detent ?
And most interesting.... What happen with the needle/scale if you trim to "5" ?
Good Luck !
2022-03-04 14:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Whatever.... I still can give you a final solution.... But i think maybe we could do it much more easy with a transform)

SOLUTION: Use "Interpolation" . And prepare yourself to do "a couple of " Testings.

Step 1 is easy.... You Mount the Servo in a way that ZERO means the Position of the Indicater in the fully DOWN Detent.
(IN theory if your servo is inverted you can do it also from fully UP as starting point.... i not know your Hardware here)

Step 2 We now not need the Transform.... We directly handle the raw Value -16383 to + 16383.
So next select the needed Turning Rate of your Servo.... Go to Display Tab, select the Servo and you can use the MIN 0 MAX 255 preset for this testing.
Just say "Range 100%" and press TEST.
The Servo must turn from the lowest Point ( DOWN ) to the Highest Point ( As You said UP 5) And must Stop there.
If it turn to far, then you need reduce the Rotation Value until it exactly fit the End Point !

Step 3 Lets use for this hypothetical 1000 As Full Range ..... So Set in Servo Settings "MIN=0 MAX =1000"

Step 4 Enable the Interpolation Feature on the Compare Tab.
For first testing you need 3 Lines ....
Input -16383 = Output 0
Input -3475 = Output 500
Input 16384 = Output 1000

Logic seems good. But again. I wondering why the Gauge from Pic looks Linear.... the Value is defintily not.

Maybe this already workes.... If not we must play with the Values.... E.g. if the non linear Area is just over UP3 then we can hold it linear till there oand only upwards we change it.
Simply add more "Points" into it. In theory you could make a single line for all 9 Detents....
Then it will work 100%
Good Luck !
2022-03-04 15:11
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
Hi pizman,

again, if you could move the trim wheel in the virtual cockpit of the FSX accurate enough it might happen that the differences are equal. Therefore i assume that the whole thing is working linear.

Why Airbus has 3 Nose Down trim spots and 5 nose up trim spots....i don't know, but it is like it is.

However, your last message gave me the right direction how to implement it.

Steps 1 - 3 were already made when i finalized my 3D-printing and mounted all the parts (as mentioned here or in another post, i created a new "servo" by taking a geared DC-Motor, a 10-turn-poti and the servo electronics from a 20kg servo. Tada....you have a servo which can turn ten times....working like a charm)

Step 4 sounds brilliant, will test it this weekend. Hopefully. I'm married. :D

Kai
2022-03-05 01:14
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
A second thing i have to achieve....

My "servo", consisting of a geared motor, a 10-turn-poti and the electronic of a 25kg Servo, can make 10 turns.
But the wheel in an Airbus only makes 8.

Is it correct to take my whole transform formula and multiply it with 0.8 to "reduce" the value, or is there a better way?

Thanks

Kai
2022-03-08 19:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Lots of ways....
the Servo pretty sure can be done most smart by reduce the Rotation Range....

If you set it from 100% to 80% it should be exactly what you need.
Simply test it with the test Button..... If it now only make 8x360° your right. If not you need to adjust it.

For Input also just a mathematical thing.
Check the position of your Poti in the most Down position ( i expect "0") and check the Value in the most Up Position ( Maybe not 1024.... Just 810 for example)

Then you have a Range .... In that example 0-810 .

Finally you need to "divide" the input range through 810 to know how much Inc/Dec is need to fit to 1/810 Movement.

BUT

Why not simply test your $*0.8 idea. No need to think or talk about it. If it work, then its fine. If not try the upper idea !
Good Luck !
2022-03-08 19:52
icon