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
Spider
Posts: 4
Hello everybody,
I'm not new to the forum. I had spam problems with the old account and had to create a new one. Okay...
My new project is building the analog tools for MSFS. I am having a lot of trouble figuring out how to center and operate Stepper Motors 288YJ-48 based tools. Up to now I've only managed to get the Vertical Speed to work by putting random numbers (after verifying that the instrument works) in the MF DISPLAY tab. I don't understand the logic of how to enter values in SIM/STEPPER and how to manage the tool. I'm talking about the two new ones that are ready, namely the Heading Indicator or Directional Gyro and the RPM engine for the Cessna.
In the meantime I send you a photo of the Vertical Speed made with the 3D Printer and the Laser engraver



2023-01-10 20:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
Hi

The STEPPER Value is the number of Steps your Motor need for a 360° turning.
Mostly this is 2048 or 4096 .... Can be different for each Motor

You can test it for example by using SIM 100 - Stepper 2048 and Test Value 100
If you run TEST the Motor must turn 360° exactly....
You can also use test value 1000 ..... Then it must turn 10 times and stop exactly at Zero Point again.
If yes.... the 2048 is correct. If not you need to adjust it !

The SIM Value finally means the Value range of the Data we receive from Sim and that should occure in a Turn of the selected Steps (STEPPER Value)

Example:
We got a Value from Sim that can be 0-100 .....
The Motor have 2048 Steps for a Turn.
SIM 100 STEPPER 2048 now means..... If Sim Value is 0 it is at 0 Postiion..... If Sim Value = 25 it turn 512 Steps to the Right and is in 90° Position.
If Sim Value increase to 100 it turn 2048 and make a full turn.

Lets say we talk about a Altimeter.... Here we say e.g. Sim:1000 If altitude is 3000 it will turn 3 full circles.


**********
Simply give it a try with a very easy value like Alt. You pretty fast understand the logic!
Good Luck !
2023-01-11 17:52
Avatar
Spider
Posts: 4
hello and thank you very much for your reply. therefore the value 2048, depending on the Stepper used, does not change. what varies is the Sim value. so I should measure the excursion of the instrument hand, set the starting point 0 and then calculate the value to be inserted in the SIM, right? Do I have to enable interpolation as well or is there no need? what is interpolation for then?

Thanks again
2023-01-11 21:33
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
Interpolation is need if a Gauge is non Linear....
E.g. Flaps Gauge in B737....




The way from 0-5 on the gauge is way more like the way from 25-40 .... So here you need a Interpolation to define each point.

Lets say the Raw Value is 0-40 ..... The half would be 20 .... But in Half of the Gauge Moving range there is just 10. So its NOT Linear.... We need to calculate the single points!



We normaly use the Compass Logic here and define the SIM Value as 3600 ( 0,1° Steps)
To find out you use the TEST Mode and say for example "100" Test ( Turn by 10°) Is this the Flaps 1 Point ?
If to faar try 80 ... If not enough try 120 or so.... Simply figure out what "Output Value" You need for the Motor to hit exactly the "Flaps 1" Point on the Gauge.....
Do the same for each Position and note it an a paper.
Then you check the Sim Value.... Move Flaps in Sim to Pos 1 .... And check how the Sim Value looks like.
Lets expect Sim Value is 0 for Flaps 0 ..... 100 for Flaps 1 .... 200 for Flaps 2 and so on.
Then you use interpolation and say....
0=0 .... 100= The Value you figure out for POS1 ..... 200= Value you find out for POS2 and so on.

The interpolation finaly use the predefined Points you enter and calculate all points between.
In easy words... You say for multiple Raw Sim Values a "new" Value you like to have.
The 3600 Methode we prefer cause you can easy check the angle of the gauge with a geometric triangle (or with eyes) and you have a nerly good value in first try.
E.g. in the Picture above the Flaps15 Point is nerly 1800 ..... Cause its maybe 180° out of Flpas 0.
[Last edited by pizman82, 2023-01-12 20:41]
Good Luck !
2023-01-12 20:34
Avatar
Spider
Posts: 4
Ok thanks, all clear enough.
I inform you that in no way I was able to calibrate and operate the instruments. Neither with MSFS 2020 variables, nor with FSUIPC variables. I tried the vertical speed gauge. By entering different values, the instrument is totally busted. If I set sim 100, Stepper 2048 and test 100, the hand turns continuously without stopping. I've tried various solutions by lowering the Sim values, but it's completely out of tune. I don't know how to handle steppers. I had made a calculation based on your indications, that is, if with sim 100 stepper 2048 and test 100 you have a rotation of 360 degrees, then with 1024 you have 180 degrees. In the test phase with the sim off, this logic works, but with the sim started, the lancet goes about its own business. I don't know what else to do... thanks anyway
2023-01-12 22:22
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
Hi again

You can not make the "Testing" while Sim is Running.... Cause then there is a Conflict for sure between the Sim Value and the Test Value.

For example.... If you use SIM 100 and TEST 100 Offline it work....
But now expect you read from Sim in this Config the Altitude and your in 2000ft ....
If you would RUN MF now the Stepper must turn 20 Times a Full circle.... Cause we tell him 100 is a Full Circle and Value in Sim after Run is 2000 (2000/100=20)
If you press TEST now (while Online) then 20.000 and 100 is done same time and conflicting (flittering).


So....

Rule 1: Do all testings for Servo itself OFFLINE.
E.g. the Sim100 Test 100 Stuff or to Calibrate the Zero Point)

Rule 2: Find out the Range of Values WITHOUT have the Servo in Config selected (To avoid wrong unless turns)
So create simply a new Config... Open one Output Config and read the needed Data. choose NOT for a Device like the Motor.
Then RUN MF and check the Values (Collumns Right of the Config)
Change Situation in Sim.... E.g. Pitch Up and Down for the VS Gauge testing.
Find out that way how the Value is working....
Is it Full numbers or a Float, is it positve or can it be negative .... Whats the Value for Center Point.... How far can the Value goes and so on.

Finally Use this information to Build the final Config for the Stepper....
You know now what "SIM Value" you need !
Or you know if you must recalculate the Sim Value before .... E.g. need to use Round or Truncate to avoid decimals, need of Add something to avoid Negative Numbers or maybe divide it to small down a hudge number into a smaller one.
Target is.... You need a Clean and straight "Output Value" that can be used for the Stepper at the end.
Good Luck !
2023-01-16 16:16
Avatar
Spider
Posts: 4
Hello and sorry for the delay in replying.
I completed the 3 instruments (Variometer, Gyro and Tachymeter) with full satisfaction. For the Variometer I used the variable for the Vertical Speed and then I did the calibration by setting 0. For the Gyro I used and tried to make the instrument behave like a compass. The only problem I have is that when the plane takes a NORTH heading (360°), the instrument turns, goes 360° but comes back and turns 360° in the opposite direction and then stabilizes NORTH. If you can give me some pointers on this. For speedometer I set the variable and then I enabled interpolation and assigned the speed/hand position values with the stepper values. In short, it's wonderful to see that the hand moves on the instrument and is the same as it moves on the Sim. Anyway today I'm trying to post the various settings.
One thing I've learned that I consider FUNDAMENTAL is to click STOP on Mobiflight before closing the simulator.

In the meantime, thanks for everything
2023-01-20 09:09
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
Yeah
If Sim is Crash ( or you not correctly Stop the system) then Motors loose there Zero Point.

For future Builds you can also think about a mechanical Calibration (Mobiflight support this)
Here we define a "Button Input" located to the Servo. On this Input is a electrical Part.... Can be a Light sensor, Laser or a simple mechanical Button.
If you use this then MF after Startup simply turn the Motor aslong the Input get high.... So it calibrate automatically on every startup !


About Gyro....
Here we got the COMPAS MODE ( Option in the Stepper Settings on Display Tab)
If you use this, then the System understand the "Overrun"
Logical for Compass (0-359) .... But also usefull for Alitimeter....
Your 100ft Needle not need to be controlled by the full altitude .... Cause then it must e.g. turn 10 times backwards if you stop a flight at 10.000ft
Here you could say COMPASS Mode ON..... Sim Value 1000 .... And in Transform you say $%1000 ....
Then a Altitude of e.g. 12350ft show just 350 on the Output side.... Means Motor show only current "hundrets" 0-999 and ignore the Thousands.
Good Luck !
2023-01-21 22:16
icon