Interfacing with Microsoft Flight Simulator
Lurker
Posts: 8
Anyone interested in tinkering with Microsoft Flight Simulator and BASIC stamps?
I developed a DLL in 1999 to send the pitch and bank values from FS98 to the printer port. I designed some cool circuitry with dual latches (pitch and bank), summing amps, and comparators to drive a pneumatically-controlled moving cockpit. Being an ex-EE/ current developer, the software and electronics is as far as it got. Maybe one day I'll get a welder friend to help with the rest.
Anyway, on to the story... I recently got the WAM kit from Radio Shack to build a light controller for church. The stamp is so robust that I finished that in no time and began to realize the potential of these things. I pulled up my old FS98 code and modified for serial out. I then wrote a little code for the stamp to display the hex values on the 7-segment LED readout and saw that it was working fine. Then I went a little further and digitized a pot input and compared with the pitch/bank required from FS98 and controlled I/O pins to drive the relays for the air cylinder control valves. This little board replaces all the other hardware and works great! Wow!
This DLL presently sends out "KDPPBB{CR}" with PP and BB being 2-digit hex pitch and bank values at 2400 8N1 on COM2. It could be modified to include acceleration/g-force, flap location, engine speed, whatever...I'll gladly give away the DLL as it is now and I'll even modify it to a certain degree, but I don't want to share the DLL source code right now. The BASIC stamp code is definitely a gimmee and is really simple. I just hate sitting on this for so long without letting someone benefit.
If there's an interest and an agreement to use it for non-commercial use only, I'll share.
I developed a DLL in 1999 to send the pitch and bank values from FS98 to the printer port. I designed some cool circuitry with dual latches (pitch and bank), summing amps, and comparators to drive a pneumatically-controlled moving cockpit. Being an ex-EE/ current developer, the software and electronics is as far as it got. Maybe one day I'll get a welder friend to help with the rest.
Anyway, on to the story... I recently got the WAM kit from Radio Shack to build a light controller for church. The stamp is so robust that I finished that in no time and began to realize the potential of these things. I pulled up my old FS98 code and modified for serial out. I then wrote a little code for the stamp to display the hex values on the 7-segment LED readout and saw that it was working fine. Then I went a little further and digitized a pot input and compared with the pitch/bank required from FS98 and controlled I/O pins to drive the relays for the air cylinder control valves. This little board replaces all the other hardware and works great! Wow!
This DLL presently sends out "KDPPBB{CR}" with PP and BB being 2-digit hex pitch and bank values at 2400 8N1 on COM2. It could be modified to include acceleration/g-force, flap location, engine speed, whatever...I'll gladly give away the DLL as it is now and I'll even modify it to a certain degree, but I don't want to share the DLL source code right now. The BASIC stamp code is definitely a gimmee and is really simple. I just hate sitting on this for so long without letting someone benefit.
If there's an interest and an agreement to use it for non-commercial use only, I'll share.
Comments
I'd love to give it a try...
My email is:·· Tronikod@yahoo.com
Thanks in advance.
I mentioned FS98 in my original post and probably led some to believe that it won't run on the newer ones. I use this on FS98 and the original Combat Flight Simulator and it works fine. I'm quite sure it will work on the newer versions of Flight Simulator, I just haven't tested. The DLL is also Win32 and should work on 98 through XP just fine.
As an example, here's the code I presently use to get the pitch and bank info into the stamp:
Simple, huh? Remember, give me a few days to find the SDK and I'll email you from home (presently at work).
I have almost all the editions of FS from· FS5 thru FS2002!! but i think FS98 is best for speed reasons...
I'll just check it for compatibility on all editions for you if you want.
PS. You'll have feedback·about my progress·on the construction of the chair pretty soon·
Thanks again.
·
It's going to fun to have someone else playing with this.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video Display Module" Available Now.
www.sxvm.com
"A problem well defined, is a problem·half solved."
·
For the test run I connected two normal servos I had spare with a little green puppet having springs on its legs that is moved by the feedback of the FlightSim98 front-back and from side to side!!!!
I've included video with the operation of the little fellow moving around. I can hardly wait until I'll be ready to connect it with the "special" chair-cockpit I'm planning to build.
Here is the modified code (I added some lines)
Post Edited (Tronic (Greece)) : 4/18/2005 12:56:51 PM GMT
I have the pitch and bank maxing out at 45° because I figured that's as far as my cockpit would ever need to move. Remember that this is all modifiable, just let me know.
brokebob
Thanks
Sid
But you have to search for it as its too big to post it for you (30Megs unziped!!)
Thanks a lot.
Sid
http://www.avsim.com/hangar/utils/nav/#Download_beta_
The direct link to the NAV23c installation files are
http://www.avsim.com/hangar/utils/nav/Nav23c.zip
If you've found nothing to help you in these, you have to wait until tommorow cause I may have·a help file about·at my·home computer...
·
Thanks
Sid
These aren't stupid questions, most don't know how to interface with FS or that it's even possible. Download the FS2000 console SDK from Microsoft and you'll have all the info. But to develop a dll for FS, you'll need c programming experience and visual studio.
All,
I'm always asked how to get data INto FS and this won't satisfy that. I have a sidewinder joystick and it came with a nice gui app that allows assignment of any control on the stick to any keypress or FS control. That's the easiest way to control FS from outside and is my suggestion. Maybe a stamp app that sends data through the USB port that can emulate this?
My method of interface is good for what I'm doing and that's about it. It was never designed for output to the real world and is something I just thought I'd try when I was really into FS several years ago. The SDK does not cover any of this and serial port programming experience is helpful.
Just wait around until Tronic and I work out all the bugs and I'll post the resulting work. I'm presently adding acceleration and deceleration and once the bugs are worked out I'll be finished.
Lurker
You can also add waypoints in the between of the flight path... Its not so hard to figure it out since it has GUI!!
This is awesome. Just a few months ago a coworker and I were discussing how cool it would be to make a "force feedback" chair. Did you use Visual C++ to create the DLL that hooks up to flight simulator? I'd also be interested in giving the DLL a whirl if you are still "releasing" it into the wild.
Ryan
www.force-dynamics.com/index.shtml
There's some good video showing the device in action. There's also some very good descriptions about the chair design and how it compares to what other companies normally do. It might give you some ideas about the physical implementation of this.
Thanks, PeterM
Their design is close to mine, except that·in my·design·I'm using·four air cylinders...
...and the big difference is the low cost of parts and construction which is less than 1000 dollars.
Post Edited (Tronic (Greece)) : 5/9/2005 10:49:34 AM GMT
Yes, I did use visual studio to develop the dll. Tronic and I are trying to tweak it and get it ready for the masses. He's done a lot of testing and made suggestions for g-force and rollover handling.
I've been riding "motion simulators" for years and have some dvds of my favorites (even 3D glasses). I've looked underneath several for ideas for this thing. I first developed the dll in 1999 and just sat on it. Finding the stamp renewed my interest and made the interface to the pneumatics a lot easier. I thought by now someone else would've marketed something like this so I could just buy the physical implementation. But all I see out there is a messy implementation connected to some very expensive hardware. Tronic and I are going to get this figured out and post it for the world (for free). I just set up a forum at forum.wr.ca/?id=2523. You can keep a watch there and at flightsim.com.
Lurker
Yeah the man on top is a LEGO man...
This version sends 3 bytes - pitch, bank, and dashlights.· The pitch and bank max, baudrate, comport#, and acceleration settings are now controllable through a cfg file.· As icing on the cake, the dashlights byte outputs status of landing lights, plane on ground, stall, overspeed, autopilot, brakes, landing gear, and flaps.· So this may be of interest to someone wishing to light indicators in their non-moving cockpit - it isn't necessary to use the 1st two bytes.
Here's some sample code to show how to use it to light the dashlights:
I'll be limiting my activity on this forum from this point forward since this is almost a completed project and I have a dedicated forum set up.
-Lurker
Again, here's the Support Forum. I'm now going to concentrate on the pneumatics and will post stamp code and info as I progress.
A basic stamp based wash-out effect for simulating true direction of the G-forces during a bank roll !!
Great stuff!!·
Thanos
The power for the motion cames from two 350 watt computer PSU that provides the 12 volt needed from the motors.
It needs no end-stop switches as the feedback potentiometer automatically ramp-down when max angle is reached for either axis. The servo code that BS2 is running is proportional with a 5 times Kp (Proportionality constant) to keep the motion soft. Increasing the Kp up to 8 or 10 times it reacts really fast but draws lots of current from the PSU (I measured more than 10 ampere) and burns the power cables...
See in·the video how the cockpit moves in two axis.
motion flight simulator 2 axis operational:
http://youtube.com/watch?v=JDOSoz1QL9A
I yet have to add an LCD display in the front of the pilot seat, the custom USB rudders (you see·it lying down on the floor) and the microsoft ff2 sidewinder stick in it.
Lurker has more info on the progress of his great utility on the link below:
http://www.etherealsounds.com/
See ya, Thanos
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 5/30/2007 6:54:36 AM GMT
http://www.youtube.com/watch?v=TBD9Juqx7PI
Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·