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
VR-FlightSim
Posts: 10
Hi everybody
I recently purchased the cockpit section of PA23-250 aircraft and I'm planning to convert it into the sim. Having a full-size replica or even the real thing was always my dream.
As I started looking for current solutions to interface the instruments, switches and radio displays, I stumbled across MobiFlight.
From what I've read so far, I'm very impressed by the ingenious simplicity and possibilities of this platform so I decided to give it a shot and ordered first Arduino Mega right away.

Now, the first question on my mind was "steppers or servos" ?
I'm obviously referring to mechanical instruments. The pit comes with a full set of original instruments that I would like to keep and convert.
I understand the main difference between the rotational range of the two. Apart from that, are there any benefits using one or another?

Regards
Jay
2019-03-28 08:02
Avatar
StephanHo
From: EDDG, Germany
Posts: 1260
Supporter
Hi Jay,

Welcome to Mobiflight!

The question of whether stepper or servo is almost like VW or Toyota.
If you already know the difference in the movement, that almost answers your question.
Basically, the servos have a 180 degree movement (there are some that continue to rotate), while steppers rotate 360 ​​degrees and as often as you like.
With the servos you can help with a gearbox or a reduction gear, with stepper this is not necessary.

Personally, I prefer stepper motors because they move more smoothly because of the given increment, while servos now and then tend to jitter and do not have the step division.

Best of all, you will buy a (good) servo and a stepper motor (28BYJ-48 5V driver board ULN2003) and try it out to find out which one suits you best.

Inquire who has which impressions of which device, brings you only limited something. By finding out for yourself, you can convince yourself. 50 opinions from users may show you a trend, but that does not mean that the result will convince you in your project.

Good luck with your project and if you have questions about Mobiflight then you know where to put them.
Grüße,
Stephan
2019-03-28 11:24
Avatar
VR-FlightSim
Posts: 10
Thanks Stephan
Your advice to find out for my self makes sense. Will do that.
Just out of curiosity, what's the difference between the stepper and servo regarding reference (starting) position?
I mean, the servo obviously knows it's range and min/max positions but what does the stepper use to reference it's zero?

Regards
Jay
2019-03-29 07:53
Avatar
StephanHo
From: EDDG, Germany
Posts: 1260
Supporter
Hi Jay,

no, neither servo nor stepper have a limit or a zero point of their own.
Since 99% of all servos are working in the servo range from 0 to 180 degrees, most servos are mechanically limited. Technically, they could also cover 360 degrees. For this purpose, only the mechanical lock must be eliminated. However, this requires a technical intervention in the servo and the warranty is lost.

This is similar for a stepper. Once switched on, it always turns in a circle until the power fails or another fault occurs if he will not stopped by the user.

Back to your question: A servo is usually mechanically limited. Looking at the scope of the servos in model making, this makes sense.

A stepper, on the other hand, turns and turns and turns. But where is its zero point, ie the point from which the movement originates? There is a controller for this. Even with Mobiflight offers the possibility to set the zero point. This is then the position to which the stepper repeatedly moves back or is driven back. This zero point should also be defined so that the gauges work properly.

Take, for example, the flapgauge of the B737. This has the position Flaps-Up. Once the gauge has been built, but the pointer is not properly positioned to zero, Mobiflight can accurately approach that position. In Mobiflight there is then the button "zero point". The controller remembers this and all movement always starts from this point.

There is also a special feature in Mobiflight, namely when a stepper is operated in compass mode. If e.g. 20 right turns flown, then the stepper does not turn back 20 turns, but just back to the zero point. For an altimeter, the stepper should turn back explicitly, so that it does not stop at 19000ft, but runs back down to 0, provided that the appropriate height is available. That's why the compass mode would not be appropriate here.

You see, there is an interaction between the software, the controller and the stepper and this interaction can be configured.

As for the movement, both in the servo and the stepper, there are many ways to make the settings so that they meet the requirements. Should this not be the case, then Mobiflight has the opportunity to interpolate. This means that an input value X of the simulator corresponds to the output value Y for the stepper (or the servo). This also works in conjunction with the Transform line, into which values ​​or formulas can be entered that influence the input value. The form in which this happens depends on the individual case.

I hope I have given you a brief overview and answered your question. I would not be surprised if this raises new questions. You should not hesitate to put her here if you can not get any further.
Grüße,
Stephan
2019-03-29 15:18
Avatar
VR-FlightSim
Posts: 10
Hi Stephan
Thank you so much for your thorough explanation. I've spent a few hours playing around with MF and reading through the forum. I have to say "I love it"!
The software is relatively easy to use yet still powerful enough to run my whole cockpit. I've successfully converted the first two gauges of my Pa23 250 pit and managed to calibrate them to work with X plane.
I very much appreciate all the work put into this so humble donation is in place.

I still have two questions I didn't find the answer to though.
I choose the steppers over servos. There's not an awful lot of info regarding stepper functions in the manual.
So to calibrate the range of the stepper and the physical gauge, (presuming linear range) would you recommend to use "transform" function or changing the ratio between "Sim/Stepper" values under "Steps per revolution" option?
I found that both options will do the trick, just not sure which one was implemented for such purpose.

My second question is regarding the external power.
I understand that if I occupy one Mega board with 10 steppers, I should add an external 5V power supply.
Now can I use the Mega's onboard DC socket or is it recommended to hook up the controller boards individually?

Kind regards
Jay
2019-04-12 07:35
Avatar
StephanHo
From: EDDG, Germany
Posts: 1260
Supporter
Hello Jay,

to your questions:

1. Stepper

The 2040 is the number of steps the stepper needs to complete one revolution. This is almost a fixed value.
The 3600 is basically an auxiliary value. A full circle has 360 degrees. Now it may be that the Simulatorwerte are so small, which in turn then jerky in the evaluation of the stepper itself. It is appropriate here to set this value higher, e.g. by a factor of 10, to get a smoother run. The key here is to keep the reference to the 360 ​​degrees. If you like it more complicated, you can use any value, but then have to worry about getting to the correct positions.
In this sense, it is not necessary to change anything in the values ​​for a linear operation.
The test value is basically also an arbitrary value. In my tutorial I took the end stop here with full flaps. This is 273 degrees back, therefore 2730 (factor 10). With the flaps you only need about 270 degrees of the full circle.
If you use the stepper for example As an altimeter, you can take any value between 0 and 3600 here. At 1800, a semicircle of 180 degrees should be approached here.
If the area that is traversed is no longer linear (as with the flaps), you have the option to specify this via the interpolation table. Here the simulator values ​​Sim1, Sim2 .... Simn are assigned the stepper values ​​Out1, Out2 ... Outn. If a simulator value of the table is reached, the stepper is set to the corresponding initial value. See stepper tutorial: https://www.mobiflight.com/forum/message/5649.html

2. External power supply

If, as mentioned by way of example, you connect 10 steppers to a board, then you will not be able to connect this external 5V to the DC socket of the MEGA, because the current would then flow over the MEGA board, thus dying the heat dead.
It is extremely important here to connect the external power supply(s) as follows:
GND of the power supply to GND of the MEGA module, +5V to the stepper directly.
By connecting the two GND potentials, they are considered as an electrical plane. This is necessary so that the data coming from the MEGA have the same reference potential (GND) so that the stepper can be controlled.
If the GND connection is missing, the stepper can not do anything with the data, as there is no counter potential.
It's like starting the car. If you connect only da +12V cable, you can not jump-start, only when the GND potential of the other car is connected, it works. So you always need a self-contained circuit, otherwise no electricity flows.
Nothing else has it with the external power supply on it. GND closes the circuits together.
Since cockpit construction may occasionally require the use of external power supplies, it makes sense to design the GND as a loop and connect the GND of all additional circuits or power supplies here. So there is always the guarantee that a common potential exists for all circuit parts and everything works satisfactorily.

Another note: a MEGA module may be max. 800mA current "pull". I recommend limiting the power consumption to 500mA. A continuous operation in the border area is likely to be harmful in the long run. A stepper requires about 200mA of quiescent current. Therefore, it should be operated from the outset with an external power supply. Here, too, applies to the external power supply: the load should not exceed 60% permanently. A pure recommendation on my part. Everyone can run their circuits at full load, but should also be aware of the consequences.
Grüße,
Stephan
2019-04-13 00:45
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2464
Supporter
Hi
About electrical question Stephan already said everything !

About Setting of range.

Here i see you are still advanced ! Most beginners will not understand that logic by themself !

Simply Awnser.... ALL is possible.... There is no Wrong way.

Example: You have a Raw Value that work from 0-100 ( For example Fuel Level in percent ) .... And The Gauge should have only 180° Moving Range (Like in my BMW Car )
At first you must know the Typ of your Stepper.... Mostly thats a 2048 Stepper.... ( There also exist 1024 and 4096 ) THATS the number of Steps your Motor need for a 360° Circle.

To recuce the Range here you have lots of ways.
1. You reduce the Stepper Value.
Normaly you say here SIM 100 ( Our fuel Value) STEPPER 2048 ..... Here a 100% of Fuel will turn the Stepper 2048 Steps and thats a FULL Circle.
If you use SIM 100 --- STEPPER 1024 then a increase by 100 of SIM will turn the Stepper now only 1024 Steps.... And thats the Half Range.

2. You increase the SIM Value
If you use SIM 200 --- STEPPER 2048 then a increase by 200 would make a full circle... A Value of 100 will only turn it a half circle now.
In Case that your Value can only run up to 100 in Sim this will work fine.

3. You can Transform the Value and let the standards in the Settings.
With SIM 100 --- Stepper 2048 and a Transform of $/2 the result is again the same....
In That case a Value of 100 will be transformed to 50 .... And 50 is basicly only a half turn of the Motor.

4 Combination ( Possible but not logical at all )
You can Say here SIM 4000 STEPPER 2048 and Transform $*20 .... Finaly this also bring the same result. (Whatever not needed and to difficult)

Extremaly you can also manipulat both values same time....
Reduce the Stepper Value by 90° ( 2048 *0,75 = 1536) Now a Value of 100 will turn 75° of the Circle..... If you now increase the SIM Value by factor 1,33 then we get again the same result .... SIM 133 Stepper 1536 will work ! ( Whatever Thats completly not usefull now)


*********

Specialy for NON Linear Gauges Stephan and myself use the "360 Methode" he said above.
We use here always the SIM Value 3600 and the STEPPER Value 2048 (If its a 2048 stepper)
THEN we use the Interpolation Tab to define Positions.
The biggest benefit of this methode is that the value is simmular to the degrees angle . With a "triangle ruler" you can calculate all values and they will work on first attemp !


Baiscly this can be used for Linear Gauges, too.... But thats a "additional" workflow for Mobiflight. I´m conservativ so i not make it... But its basicly posible to also limit range of Gauge.
With same example from Above.....
If you use SIM 3600 and Stepper 2048 ....
And you say in interpolation : Fuel Value 0 = Output Value 0 ..... AND Fuel Value 100 = Output Value 1800
THEN Maximum Fuel (100) will turn Motor exactly 180 Degrees (Value 1800 of 3600 we define in Motor Tab)

It also work (for LINEAR values only )if you "transform" your Value by multiplication that it is also finaly a xxxx Range ....
In example (1800 ( Degrees we like to range on gauge) / 100 (Max Value of the Offset) = 18 .... So "$*18" will bring us here exactly a value of 1800 if Fuel is 100%
Then SIM 3600 / Stepper 2048 is again correct here.

Summary.....
I hope i can show you a bit of the "deep" we can use here. If you build a gauge think about the most logical and most easy way and use it !
Good Luck !
2019-04-13 23:34
Avatar
VR-FlightSim
Posts: 10
Thank you very much for your replies guys.
All this info is really helpful and much appreciated!

I still, however, don't quite understand the electrical part though:confused:
Could you by any chance make an example connection diagram for me please?
One that shows how the external power would be applied across multiple stepper driver cards:-/

Kind regards
Jay
[Last edited by VR-FlightSim, 2019-04-18 01:19]
2019-04-18 01:14
Avatar
VR-FlightSim
Posts: 10
BTW

how can I become an official "supporter"? ;)
2019-04-18 01:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2464
Supporter
iconVR-FlightSim:


Could you by any chance make an example connection diagram for me please?
One that shows how the external power would be applied across multiple stepper driver cards:-/



Here Stephan is the most advanced guy..... Maby you can still "google" for that.

As i know you simply chain your 5v from suply via all 5v Inputs of the Ul2003 chips. The GRD is also chained..... Important is finaly that the GRD of Power Suply will also be set to your Arduino where the Motors are set on the Pin.
If i understand Stephan correctly then the grand target is finaly to have ONE Ground system for the whole cockpit.... So Every Arduino (whatever you use 20 Megas) must be connected to the SAME GRD.
PLEASE: Let Stephan reply. Maby my information are wrong !


*****
About "Supporter"

I don´t know. My status changed in the past when i beginn to make official Forum Support here. As i know Sebastian will give this label to users by hand.
"Maby" this is also a indication when a user make a donation in a special ammount. But i´m not sure about that.
Good Luck !
2019-04-18 09:32
Avatar
StephanHo
From: EDDG, Germany
Posts: 1260
Supporter
Hi Guys,

pizman is right with his view.

Here are two pictures to illustrate what a GND ring line should look like





I think the two pictures clearly explain the principle.
Grüße,
Stephan
2019-04-18 12:04
Avatar
VR-FlightSim
Posts: 10
Guys, thank you very much!
I think I'm comfortable enough to do what I need now.

You are most helpful :thumbup:
2019-04-24 05:15
icon