Jump to content
Sign in to follow this  
Guest Fabio Miguez

building a full motion simulator enclosure with MS FS 2...

Recommended Posts

Guest

Having had a fascination with flight simulators ever since I first played with a simple simulator on a Sinclair ZX81, I have always wanted to go that extra step to realism (You do get utterly hooked on realism over time, especially if you have flown for real!!!!)With the latest incarnation of MS Fight simulator, you can get pretty close (barring the odd glitch!) You can now run multiple screens on a pc, ie have 2 for outside views, and 2 for instrument views. Using part of the MSFS SDK you can use netpipes.exe and run multiple pcs per flight in real time across a LAN, and hence have more than 4 monitors hooked up to give a very real view inside and out of the cockpit. Add plug in switch gear from 'goflight', as well as realistic controls (including throttles etc) and things get pretty cool. Put the lot in an enclosure painted and shaped like a cockpit and things start to get very cool. Check out this static simulator at www.rcsimulations.com for an idea of what an be built.However, I have always hankered after the simulated movement that you get in a top end simulator (haven't we all!!)Having finally sold some other toys, I now have some spare dosh to at least have a go at constructing a simple movement enclosure. The idea is to build a cockpit box, populated with all of the above (4 monitors for outside view, 1 or 2 for instrumentation, additional switchgear controls etc) and then put this into a simple frame that allows 2 axis movement, pitch (probably limited to about 30-40 degrees, and roll (upto 360 degrees depending on weight and height of enclosure)I have already designed the mechanical systems, and have the movement control software ready to go. The enclosure design is also completed.The issue now is geting the dynamic in flight plane pitch and roll parameters out of MSFS in a useable format. I have downloaded the "netpipes" exe, and samples, but cannot make head nor tale of the code that is there ( I am not a c++ programmer)What I want to do is write a little program that dynamically writes the pitch and roll as a simple number (current poisition in degrees for both pitch and roll) and then pipe this to a file, or file handle, so that I can use my hardware control software to move the motion enclosure. It doesn't even need that many updates, just 1 or 2 a second would do.I am hoping that anyone who has created a panel, especially an artificial horizon gauge may be able to help.any thoughts you have please let me know.

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Hey tj.dale,Extracting the info you want is very easy, you don't even need netpipes or FSUIPC. Using the standard (poorly written) MS SDK you can get an idea, and then reading sd2gau14.zip written by Dai Griffith gives you a much better understanding. I wasn't a programmer when I started either, but you can get the hang of it with some studying.Basically, pitch and roll data can be extracted from FS using Token Variables, which are macros setup to give you exactly the number you are looking for. Plus, you can use simple derivatives (knowing a tad bit of math helps too ;)) you can get the accelerations in the three axes, and that can be used for your sim too to provide physical feedback (real simulators actually pitch up when you accelerate and down when you slow down, but since you are inside, and the visuals of the sim are not changing, the horizon can be static, the forces you feel are exactly like acceleration (glueing your back to the seat) or deceleration (hanging from the seat belt straps)).With a simple C or C++ program, this can be written to a .txt file, and then used by your hardware, by means of a LAN. I believe this is what you are intending on doing. If not, or if this was confusing, let me know, and I'll try to help some more.

Share this post


Link to post
Share on other sites
Guest

Many thanks for this Fabio, I now have Dai Griffith's zip file, and will read through this and have a go. Yes I had also thought through the use of acceleration data to pitch the enclosure. That's stage 2....!And yes, I do intend to use multiple PCs on a LAN, one of which will be dedicated to enclosure movement control.Do you have an example of a token variable macro?

Share this post


Link to post
Share on other sites
Guest

Fabio, I have now downloaded and looked at sd2gau14.zip as wellas the latest panels and gauges SDK. The more I look into this, the more I realise the hard work that panel designers like you put in. Respect due....I have come to the conclusion that I can use the attitude indicator gauge token variable(s) to output the pitch and roll data.I have also realised (as you have already stated) that I could use the data from the air speed indicator to derive acceleration from to augment pitch and roll for the enclosure too.Any chance of you producing a simple macro that pushes the pitch and roll data out to a text file for me. At least I can then use this to figure out what to do with the speed indicator, and hence have a go at creating an acceleration modification to the pitch input on the enclosure.Many thanks for the help so far.

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Hello tj.dale,The macros are easy to use in C. Basically, after your gauge skeleton is setup, all you need to add is an entry such asMODULE_VAR thenameofyourvariable {ATTITUDE_INDICATOR_PITCH_DEGREES}You'd definitelly want this variable to be a float so you can store some decimal info for better precision. The other Token Var I believe would be {ATTITUDE_INDICATOR_BANK_DEGREES}. There are {PLANE_PITCH_DEGREES} and {PLANE_BANK_DEGREES} but if I remember correctly, these had some funky results. You will have to eventually try it and read your variable at known pitch/bank degrees to see what results the above give you.For the acceleration, I'd use {FORWARD_GROUND_VELOCITY} to calculate the longitudinal acceleration and {SIDE_GROUND_VELOCITY} for the lateral. The math is quite simple. Since the derivative of acceleration equals the change in velocity, which is da/dt = dv, all you will need to do is calculate the change in velocity by simply subtracting the current velocity from a previous value (this is dv) and know what the time interval between these two was (this would be dt). You can then calculate the change in acceleration (da). Since you know when the aircraft is stopped both the long. and lateral accelerations are zero, as soon as you start to move, using this change in acceleration you can calculate the final acceleration.Finally, for the writing to a .txt file, it will depend on how your hardware will read this info. Meanine, do we need a specific format, how many times will it do it a second, etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...