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
Nal3ma
Posts: 4
Hi Guys

I'm trying to build a stewart platform for a project and have come to conclusion on using FSX and FSUIPC with Mobiflight to send the data towards an Arduino Mega to control servos. Right as of now i've got it kinda dialled but i am confuse as i would require to have pitch, bank, yaw displayed on the stewart platform which i can use the FSUIPC Offsets 0578,057C and 0580 and i can only set one servo to read pitch and display pitch angle. however i have 6 servos to do the job. do i create 3 pitch, bank and yaw for 1 servos and multiply it by 6? also what is the config references for and will i be needing it? my prior guess is that it would be needed but from what i have seen i can only config ref it to 1 of the 3 x 6 = 18 setups.

Thank you for the help in advance!
2020-12-18 05:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

I not fully understand what you like to do.....

Does this "Platform" got a own internal Controller..... So you just need the "raw Data" from that 3 Offsets ? If yes i think this controller should be connceted ( with a own software) to the sim.
The problem with 6 Servos pretty sure is.... There must be a calculation. E.g. the Servo in the "right front" must act if you climb..... But it must same way act if you make a turn.
So there must be a "calculation" with a forumula that use the raw values and build finaly a Output Value for that servo.


About Mobiflight.
The "Refferences/placeholder" tool is usefull. With THIS we can include multiple Values into one calculation.
In your case.... You can include the 3 Raw Values as "Variables" into a formula to finaly get a Value that controll the servo.
But i don´t know this formula here.... Cause i not know how the Values must act to the servo.

Summary:
I have no experience here.... But from "outside" i would say this is so complex..... here you will need a "own" computer and software that handle the Plattform. Thats for me far above the posibility of Mobiflight !
A Easy System with 1 Motor for each direction.... Pretty sure possible with MF.... But 6 Motors that must interact with each other..... I don´t think thats possible !
Good Luck !
2020-12-18 23:58
Avatar
Nal3ma
Posts: 4
Hi Pizman82

we have fuipc to link the connection between fsx and mobiflight and we just need the raw data converted from the transform function in mobiflight. i have tried justifying the values and ensure that the output is correct which is correct after some measurements. eg if i pitch up 10 degrees, the servo connected moves 10 degrees.

for the calculation of 6 servos, we have the calculation at hand but i have no idea where to insert the calculation in the workflow. does it fit into arduino ide when the program is running? but if it is like that how does it read from mobiflight and arduino ide at the same time (path to arduino ide is set properly)

so for the reference/placeholder tool, i will activate it for 1 of each in pitch, bank and yaw for 1 servo?

it's alright i will try to get the necessary information i need to try and get it to work with mobiflight as im not very good with coding and all. recently started on this project but i have close to zero idea on all these coding and electronic stuffs so i am just reading informations as i go and trying to help myself out! so far mobiflight has been pretty easy to use and rather straight forward except for some connection problems which is error on my part.

thank you!
2020-12-21 06:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again.

Basicly.... it is not posible to "readout" a final Result or a raw Value FROM Mobiflight to use it in a other Aplication ( Like your Full Motion Controller).
Means.... MF can read Offsets.... It can Calculate it .... It also can calculate mutliple Offsets together..... BUT it just Output it to a SERVO Motor that is directly connected to the Arduino Mega.

Means.... If your "Controller" of the Plattform need something like "precalculated" Values via a USB Port or so..... this is NOT the usage of Mobiflight. Here Your Software of the Plattform need to read the raw Values ITSELF from the Sim and do the Calculations in OWN code.

BUT
If you technical know the formulas.... and you just need a 5v Signal (Digital Servo) from a Arduino..... YES Then Mobiflight can do it.

**********

About References Placehodlers.
This is pretty easy.....
You define in Mobiflight all 3 Raw Offset Values in a single config EACH..... All 3 Configs are READOUT.... Means they get NO Device !
In a 4th. Config you can now make your calculation.
You defenie here the 3 "Raw Configs" EACH as a Placeholder/Config Refference.... Like Config1= a Config 2=b Config 3= c
NOW You can write a formula whatever you need.
For Example you like for a Servo to have Value A and it hould also increase by 100 if Offset B is greater then Value 8000 .
Formula would be..... a+(if(b>8000,100,0))
Means it calc Value of Offset A ( Raw Value 1) and it ADD 100 if Value of Offset B is grater then 8000...... If Offset B is below 8000 it add "0".

**********

Technical every needed calculation with multiple raw values can be done.... Aslong you know the correct mathematical way and formula.

BUT
Only as a Output to a Servo Device in Mobiflight.... NOT as a "Number" you can readout with a external Programm!
Good Luck !
2020-12-21 20:29
Avatar
Nal3ma
Posts: 4
Hi yet again

correct me if i am wrong but from my understanding of the formulas portion of our convo, if i have the formulas and i know what to do with it i would have to place it in the transform portion of the "edit" beside each setting right?

however is that is the case, my formula is quite long and requires algebra which platform would you recommend me to use which allows mobiflight and the other platform (which contains the calculation) to work hand in hand and send the same stuffs to arduino mega without corrupting each of the data being sent (i am guessing if there is 2 different types of inputs towards a storage center it would somehow be confused and corrupt the information). do i use arduino ide or visual basic? (currently have both downloaded on my pc)

from what you have said above --> " For Example you like for a Servo to have Value A and it should also increase by 100 if Offset B is greater then Value 8000 .
Formula would be..... a+(if(b>8000,100,0))
Means it calc Value of Offset A ( Raw Value 1) and it ADD 100 if Value of Offset B is grater then 8000...... If Offset B is below 8000 it add "0" " can i ask where can i do this coding in? mobiflight or some other platform?

i do apologise if my question sounds stupid and i thank you for your time replying to my queries.
2020-12-22 05:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Your question is not stupid.... it´s just "special" .

At first.... I´m not a programmer. So for detailed information you should join our DISCORD Server Group. There are Users with a large programming experience... and also Sebastian ( Doc Moebius) the programmer of Mobiflight is there and can maybe guide you better then myself.

About Questions....

Sure... MF have Limitations but i don´t know or even saw in that case. All formulas i need till now was posible. Maybe my most difficult formula till now use 4x ElseIf and some AND/OR operators.... So Sure If you try to include a formula with 5000 characters.... This will get into a Error. I not reach the end but it exist pretty sure.
Basicly NCALC ( The plugin MF use for Math Calculations) is pretty deep. It allow IF/THEN/ELSEIF/ELSE ... Logical Parameters and all Operators. So many things are posible.

About Arduino IDE.
Here i think this is the wrong way.... The MEGA include the firmware.... So all Calculations are done in The MF Software on Computer. You not be able to do Things on the Mega itself cause here you would "remove" the firmware by own code!

If you like to write a own sketch..... Then your "outside" of Mobiflight. Means your Programm run on a OWN Mega that Handle all the work. But then it will not recive Data from Mobiflight ( like the Raw Offset Values) cause Mobiflight only talk to "Mobiflight Boards" means Megas with its firmware..... NOT Yours !
In that case you need also a own Programm on the Flightsim PC ( simmular to Mobiflight) that read the needed Values from SIM and send it to your MEGA !

**************
Last Idea.
If the Calculation is much more difficult maybe a LUA SCRIPT is the right way.
This is a own code you run directly within FSUIPC.
There you can pretty sure build verry advanced formulas ( more as in Mobiflight).

Logic is pretty easy.
In FSUIPC you got access to the same Offsets you would use in Mobiflight.
You make your formulas there.... And the result is written to a FREE Offset Finaly.
Then Mobiflight at the end just read THIS Offset ( that include the final calculated value) and execute it to the Servo Device !

*****************
Last Note:
As i know and see in the past..... Professional Cockpits with Full Motion Servos use OWN Software.
I never try out and i never meet a guy who make it with mobiflight..... So i would say.... those advanced Systems should work perfect. Maybe a improvisional solution is possible with MF..... But if you spent thousend of Dollars for the Plattform.... You pretty sure want a perfect result. So you also need a perfect "own" Software for it !
Good Luck !
2020-12-22 21:10
Avatar
Nal3ma
Posts: 4
ok i agree with you it is a tough job to do with special needs: (

i have joined the group and from the past few convos it looks kinda of helpful so i do thank you kind sir

last note: i do thank you for your time and bearing with me and you do stay safe and healthy in times like these!

have a good day ahead!
2020-12-23 04:43
Avatar
Doon1
Posts: 53
I know this is a late reply but you might wat to look at https://www.xsimulator.net/community/
2021-02-25 01:58
icon