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! 

Go to page 1Go to page 2123Go to page 4Go to page 3
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
@ Ryan....

You maby missunderstand SIM/Stepper Input.

Stepper entry means the Number of Steps your Motor need for a Full Circle.... Mostly have 2048 ( Some have 1024 or 4096)
So This number normaly not must change ( Only if you like to limit a Gauge if it should only show a 270° Rotation from Zero-Full)

The SIM Value means tha Value of used OFFSET in combination with a FULL Circle of Motor.
This value is used for gauges that should turn more then 360° ( Like a Altimeter for example)

So.... A Example: Altimeter Analog
Here for the Big NEedle the 360° Scale represent 1000ft .
The Offset for example is 100% Clear.... Means a Altitude of 2500ft represent a Value of also 2500

Now our Sim Stepper Entry must be Sim: 1000 / Stepper 2048 (If you use a standard stepper ... Else 1024/4096)

That say.... A Range of 1000 in Offset Value should turn the Stepper motor 2048 Steps.

*************
In Your example..... If you use Sim Stepper 360 - 2048 then change of "360" In Offset Value will turn the Stepper 1 time full circle.
BUT: If Your Offset Value for example is from 0-32000 and it is set at 5000 for example at systemstart .... Then Your motor will turn maby 15 times full circle to get from Zero to 5000 ( Cause we say 360 is one circle )

Solution:
1: Check out what stepper you got.... Use Stepper Value of 2048 ! Use SIM and TEST Value 1000 Make a Test Run with Test Mode in this Tab....
If you got a 2048 Stepper it should Turn 360° If it turn only 180° or 2 circles 720° you got a 1024 or 4096 Stepper and you should change the Value in Stepper field !

2. Read Out the Offset of your Trim .... Not use a Motor at the moment ! .... Now Get in Virtual Cockpit and find out HOW Does the Offset Value change if you turn the Virtual Wheel exactly 360° .... Maby do this 10 Times to get multiple values and find a middle value ( I think you can not turn it exactly 360° with mouse so find the avarage )

And now you got it....... THIS Value must set in "SIM" Field ! So your Wheel will turn nearly 1:1 like the Sim Wheel.

NOTE:
To make This working your Wheel have Offset ZERO as marker..... If you load a flight and your Trim is in middle Position then your Stepper will turn the Homecockpit Wheel lots of circles to reach this position ! . Thats why a Stepper is maby not a good solution for Trim !
Good Luck !
2018-08-25 11:59
Avatar
Ryan27679
Posts: 52
Hi, thanks so much for your detailed response. I'll try your suggestions next time I get a chance to work with it.

The stepper came from https://www.ebay.co.uk/itm/5V-4-Phase-Geared-Stepper-Motor-with-ULN2003A-Driver-Board-28BYJ-48-Arduino/121433812858?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

There is some info on there that I don't remotely understand but you may?

I tend to find that the test or calibration movement buttons don't really work for me. If I try to shift it 50 degrees say, either way, it'll nudge a little in that direction then return to where it started. Certainly setting it to 360/2048 makes it turn way too far. I'm obviously going very wrong somewhere, but 360/360 was really close to working, it just wasn't exact. Even then, if I did a full 360 turn in P3D, it'd follow fairly well (minus 10% maybe) but just after south (maybe 200 degrees) it more or less stopped moving for a while, then started again but by then it was maybe 40-50 degrees off..

This is all with external power to the arduino etc, but I seem to be having delayed or missed inputs in various places at the moment.

The trim wheel is on an encoder, not a stepper, but it's an encoder with quadrature output, I don't know if that works right with Mobiflight or not. It's the whiskey compass I'm trying to replicate with the stepper.
2018-08-25 13:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
A bit confused at the moment....

You mean your TrimWheel is build as INPUT with a Encoder ??? So it is not run by a Stepper as a OUTPUT at the moment ??

iconRyan27679:


The trim wheel is on an encoder, not a stepper, but it's an encoder with quadrature output, I don't know if that works right with Mobiflight or not. It's the whiskey compass I'm trying to replicate with the stepper.



For Compas the technic is different .... Here you need at first the Compas Mode to allow Mobiflight the "Swap" 0-359 or 359-0

Then you need good values.... Normaly here the STEPPER value must be again 2048 ( or 1024/4096 if other stepper)
the SIM Value must be work with your used Offset.... If Offset support data 0-359 Then all is fine.
Tell us what offset you use..... Or simply find out yourself what value is shown.... In FSUIPC some offsets must be recalculatet !!
If its not smoothe maby a Decimal Problem is also there.... A Value like 100,01 is shown same way like 100,99 cause Stepper se only the FULL Number.

In that case a Transform Multiplyer is need.....
orignal 360 Value give only 360 Movement Points ..... if You Multiply Raw Value by*10 then its 3600 ( So 10 time more steps available and motor run smoother)
Not forget to increase the SIM Value in Stepper setting also to 3600 instead of 360 to make this work !

****

LAST NOTE ( Important cause i did this mistake myself ! )
Get shure you have correct Offset.... a Compas is Magnetic .. A Course is different.
As much you get away from Equator the offset increase...... In Nort Alaska the Course can be 10° and More different to your Compas !
So... "Maby" Your Wrong Gauge is already correct but you use wrong Raw Data !
Good Luck !
2018-08-26 16:04
Avatar
Ryan27679
Posts: 52
Hi, sorry for the confusion - yes I'm using an encoder (with quadrature output - not usual 2-bit gray -- whatever any of that means) to control the trim. It's not motorised - the stepper is for the whiskey compass on 02CC (from my poor memory!) I 'think' the offset shows 0-359 (it's on that scale but I can't remember if it shows 0 or 360) but I can double check that. Its movement certainly mimics the compass.

I don't think the data is wrong, but how I've set it up may be. As I said it does behave almost correctly, just doesnt turn far enough - a full 360 in-flight is only about 320 on the stepper - but that was with the settings all wrong (360/360) - if I set to 360/2400 etc it turns many times per 360 in-flight.

I will try again though as you've recommended. The compass is not essential to me, I just like to explore what Mobiflight can help me to make happen!

Will get back to you with the results.
2018-08-26 16:26
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
Hi. qudrature is normaly ok i think ( Not shure im not a electric specialist) .... as i know THIS means it can have 4 states.....
and your 2 Bit Grey Code Also have 4 States ( 00-01-10-11) So a 2 Bit Grey Code Encoder is working "quadrature" as i know !
The 1:1 1:2 and 1:4 Resolution just mean how many steps are done with one detent.... 1:1 do all 4 Steps .... 1:4 do one step by detent.

*****

About Compas.... If it not make a full turn the values are wrong.
Again Important: Get shure the "Compas Mode" is active in your Stepper setting !
02CC sounds good... But i need to check it if there is a Problem.... Its written as double float ( Means 8 Byte ) .
To get the Decimal in this value in a good way the multiply*10 maby is needed.

Simply Try out.... Report eperience. If not work i will check this !
Good Luck !
2018-08-28 16:45
Go to page 1Go to page 2123Go to page 4Go to page 3