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
738ca
Posts: 2
Hello Everyone,
I am a novice with Mobiflight and Arduino as well for that matter. I 3D Printed Josh Kattz's Wet Compass design and have installed a small stepper motor. My little stepper did not come with instructions but I believe I have most of it figured out. I have connected an Arduino 2560 Mega to com port 11 and upgraded the firmware on the Arduino. Also have a 5v power supply connected to Arduino. The stepper motor driver is connected to the Arduino with 4 leads. In1, in2, in3 and in4. I am guessing these are the motor leads 1 threw 4 and I have connected them to available ports on the Arduino.

When pressing Run in Mobiflight Connector 9.3 the stepper will spin. I can also adjust the rose using the manual move function in mobiflight. Everything seems to work ok..except....the proper degree does not show. for instance..if aircraft is facing east..the rose points to 170,if I move to RWY 25, compass points to 75, when moving back to east now compass points to 190. Always pointing to a different heading. I know that the stepper is seeing FSUIPC as when I move my plane to a different runway, the compass rose also moves and points to a different heading. I thought I had correctly set Zero, by manual adjusting then clicking on the Zero button. This didn't seem to work, as when I switch directions with the plane, I keep getting a different degree on the compass, even when moving back to a previous rwy, i get random compass headings..never consistent. Does anyone have an idea what I am doing wrong or how I can calibrate to get the compass heading to match that of the sim?
2022-03-12 01:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5979
Supporter
Pretty sure your settings are wrong !

You need to know the Motors prefferences.... How many Steps are used ( each Motor is different here).
Then you need to set this values correctly in the Config .
You also need to get sure the Sim Value is corrrect. Mostly some recalculations are also needed here !

I recommend.... NOT start with the Compas itself and with a direct Sim connection.
At first make testings with the TEST Mode, to find out the correct Values.
After you confirm the Motor is calibrated correct and work fine , THEN you can think about to connect to Sim and use the Compass as Value Source.

Like always.... Not mix up things ! ..... Without get sure the Motor is set correctly you can not show the virtual Compass..... Cause you finally not know if issue is in case of wrong Motor settings or in case of wrong Sim Data !
Good Luck !
2022-03-12 15:12
Avatar
738ca
Posts: 2
Hello,

Thank you for responding. I am using a small common stepper, the 28BYJ-48 that came with a small driver board. I am not sure how to set up connecting direct to the sim or on it's own, but I will look into that.

I'm sure my settings are a problem, but I must try to solve which ones. I'll list them here as maybe something will show that is wrong.

For the motor wires, I have double checked that the motor pins 1,2,3 and 4 go to the Arduino pin assignments shown in config. In my case:
Motor Pin 1 - Arduino Pin 6
Motor Pin 2 - Arduino Pin 3
Motor Pin 3 - Arduino Pin 4
Motor Pin 4 - Arduino Pin 2

SIM VARIABLE

Set to - FSUIPC
Offset - 0x02CC
Value Type - Float
Byte size - 8

DISPLAY/Display type

Set to - Output Device
Module - Mobiflight Mega SN-66d-bb2
Use Type of - stepper

DISPLAY/Settings

Stepper - set to Stepper
Steps per Revolution
Sim/Stepper 360 2048
Test value 2048
Compass box is checked.

New note: when using the test function the rose always stops at 354 degrees after clicking on Mobiflight STOP button. I believe this to be where the stepper is 'zeroed out at'. This is always consistent and always goes back to this point. Maybe you can see something wrong with my settings..or something I am missing. The correct sim value is showing in both sim and mobiflight module. Both match. It's only the stepper that is not matching mobiflight or the sim.

Would you be able to point me to a working link on how to use the Test Mode correctly?

This is what happens when I use Test Mode: The compass rose spins anti-clockwise until I click on STOP, then it turns several revolutions in reverse and stops at 354 degrees. I don't understand how to use the Test Mode to have the rose stop at the degrees shown in sim/mobiflight.

I will keep reading and studying up on Mobiflight. I think I am very close to having this working. Again, thank you for your time in responding. Sincere warm regards.
2022-03-12 16:08
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5979
Supporter
You not 100% understand the Values....

The SIM Value indicates what "range" of Sim Value is used for our Gauge for a "Full" Movement. In Case we use a Endless Gauge ( that can turn multiple times like a real compass) we use here the Value that is needed for a 360° Turn of the Motor.....
And thats 360 ( If Raw Value is a Number between 0 and 359 .) If Raw Value e.g. would be a number betwee 0 and 3590 then also the SIM Value must be 3600 instead of 360.

The STEPPER Value represent the number of Steps that are needed to turn the Motor exactly 360° ( in that case) . It not have to be 2048 exactly. Some motors have other gears or tollereances. So it can be e.g,. also 2042 .

In Combination we simply say " If the Sim Value increase by 360 then this must occure in 2048 Steps send to the motor.... And that "should" be exactly 360° Turning range."

*
The TEST Value is just a hypothetical SIM Value we create for testing.
Its verry IMPORTANT that Mobiflight is NOT in Run Mode while you test..... Cause then the Test and the real Sim Value would flickering and override each other.
So make Testings always in STOP Mode !

In Your case with SIM 360 / Stepper 2048 the best TEST Value ids also "360"
We simply say " Please turn the Motor exactly 1 resolution !

If the test ends exactly at the starting point again then values are fine..... If Test ends at 350° e.g. then you know the Steps are to less..... Means 2048 Steps are not enough to make the full circle.
By this testing you must figure out the exact "STEPPER" Value you need for YOUR Motor setup.


For sure...: You could also use as TEST Value 180 for example..... Then the Needle must turn exactly to the 180° South Position.


***
I hope that info helps.
Feel free to join our DISCORD and contact me there. Then we can check it out together !
Good Luck !
2022-03-12 17:00
icon