FMS is one of the freeware high-quality flight simulator for model airplanes. It is written in Delphi language with some third party components. You can download it from
formatting link
My question is about the "flight dynamic model" of FMS and/or other similar simulators. Do you know any Delphi and/or C/C++ flight dynamics model code which takes the rudder, elevator, throttle, aileron, airplane's position, velocity and attitude (roll, pitch, yaw angles) as inputs and calculates the airplane's next position, velocity and attitude?
Flight Dynamics Model : ================== INPUTS: Time increment : dT (delta T in milli second) Control inputs : Rudder Elevator Throttle Aileron Airplane's current state : Position (in 3D. ie X,Y,Z) Velocity (in 3D, Vx, Vy,Vz) Attitude (in 3D, Roll, Pitch, Yaw angles) Airplane's constants: Wing span Weight ???? ???? etc.. OUTPUT: Airplane's next state after dT : Position (in 3D. ie X,Y,Z) Velocity (in 3D, Vx, Vy,Vz) Attitude (in 3D, Roll, Pitch, Yaw angles)
| My question is about the "flight dynamic model" of FMS and/or other similar | simulators. | Do you know any Delphi and/or C/C++ flight dynamics model code which takes | the rudder, elevator, throttle, aileron, airplane's position, velocity and | attitude (roll, pitch, yaw angles) as inputs and calculates the airplane's | next position, velocity and attitude?
There's a few open source flight simulators out there that obviously must do what you're referring to.
They include --
Slope Soaring Simulator --
formatting link
CRRCsim --
formatting link
Flight Gear Flight Simulator --
formatting link
And there's more, just google for 'em.
This mention on the FGFS page looks like it might be exactly what you want --
LaRCsim - A set of ANSI C routines that implement a full set of equations of motion for a rigid-body aircraft in atmospheric and low-earth orbital flight, suitable for pilot-in-the-loop simulations on a workstation-class computer.
Hi Lora, Inspired by FMS I started writing a R/C simulator last year. Never got around to finishing it though. But I figured out a working flightmodel. Mostly by directly implementing some basic physics. Of course I haven't documented my code well :-) but maybe it's a start for you. If I remember correctly it worked pretty well, but some tweaking is needed when pitch approaches -90 degrees. Sorry about the long post.
Very cool, gang, I've never done anything in Delphi, only in Fortran, but it looks good. Looks like you stopped short of making the graphical part (am I right here or not?). Seems like that would be a challenge, but maybe not as hard as I think for someone familiar with it. It looks like you're applying all the forces to the plane as a whole, and airflow is regarded as uniform over the whole plane. Note that without using a velocity-panel type model, where airflow is calculated individually at each location, that you will not be able to do any non-linear maneuvers, such as spins, snap rolls,lomcevaks, etc. but then again, this is how many commercial flight sims are made. Good job. Paul
Well, it's been a while, but I got a lot out of the first part of the following paper:
formatting link
There are two parts in the calculations : position and attitude. Basically you calculate the forces on the aircraft (gravity, drag, lift and thrust), say F for each of the aircraft axes. Then you calculate the acceleration using Newton F=m*a or a = F/m. This will give you the new position. The hard part is the rotations. Looking back at the code, I honestly have no idea where I got these but I remember it took me a couple of weeks to come to these. I can't guarantee the physical soundness, but the result was acceptable to me. The last calculations of dX, dY and dZ are simply translation from the aircraft axis to the world axis (some matrix math). There is also still some debug code in there (the "if ( ) > 50") because in the beginning I had some asymptotic behavior in some cases. Also, never forget to take the elapsed time since the previous run into account in the right order and places.
It's not simple and my implementation is far from perfect or finished, but it was great fun figuring it out!
Davy
"Richardo Rossi" schreef in bericht news:42e7c247$0$20271$ snipped-for-privacy@news.optusnet.com.au...
Hi Paul and Lora, For the record, the code is in c++. You're correct : the flight model is simple and limited, but it was the best I could do in a couple of weeks without taking an advanced course in aerodynamics :-) About the graphical side : I did some work on it (using DirectX). It actually had animated flight surfaces, smoke, shadows, sun flare, engine noise with Doppler effect... I have put some screenshots up on
formatting link
was about a month and a half of work to get to this point. I never finished it because - well - the fun part was done and there was still A LOT of work left : collision model, scenery modeling, configurable controls, network code, ... Lora, can you let me know if you ever find a use for the code? Thanks!
Davy
"Paul Ryan" schreef in bericht news:6GOFe.7414$_% snipped-for-privacy@newssvr14.news.prodigy.com...
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.