Sign in to follow this  
Guest Fabio Miguez

FS2002 autopilots - where are they encoded ?

Recommended Posts

Are they encoded within the *.mdl files ? What type of autopilot controller (PID with gain-scheduling perhaps?) is used in FS2002 ?I am considering using FS2002 to play with intelligent flight control and would like to be able to implement different autopilot types. What tools will I need to handle the mdl files ?Adam

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

It has nothing to do with the .mdl files. It's in the .air and aircraft.cfg files.- Martin

Share this post


Link to post
Share on other sites

The autopilot is hardcoded in the depths of FS and can be influenced a little via .air and aircraft.cfg, but still behaves mostly the same for all aircrafts. For entire new modes you can try to implement them via gauges. It is possible (Sperry Pilot, CESSNA 400 NAVOMATIC), but it isn't too easy.Arne Bartels

Share this post


Link to post
Share on other sites

>The autopilot is hardcoded in the depths of FS and can be >influenced a little via .air and aircraft.cfg, but still >behaves mostly the same for all aircrafts. For entire new >modes you can try to implement them via gauges. It is >possible (Sperry Pilot, CESSNA 400 NAVOMATIC), but it isn't >too easy. >Arne Bartels FSUIPC or is it possible w/o?

Share this post


Link to post
Share on other sites

My "selfmade" autopilot gauges work always without FSUIPC.Arne Bartels

Share this post


Link to post
Share on other sites

>Are they encoded within the *.mdl files ? What type of >autopilot controller (PID with gain-scheduling perhaps?) is >used in FS2002 ? FS2K and FS98 had good autopilot code. We were just figuring out the PID FB variables in REC 1199 of the AIR file when MS screwed up the FS2K2 autopilot by making it 'self adjusting'. It's full of bugs and works like $@#%! I could adjust the previous FS version SPD hold so it was about 5X tighter than the FS2K2 PoS. THe 'MS' Yaw Damper is a joke. It also needs to be implemented better. However, due to the way the JS output is used in sim1.dll, it's difficult or impossible to control the AC dynamics with a custom FB system and the JS at the same time. >I am considering using FS2002 to play with intelligent >flight control and would like to be able to implement >different autopilot types. >What tools will I need to handle the mdl files ? >Adam I know a PID autopilot has been programmed for an upcomming commercial release. Unfortunately, not one I'm working on. I think "PIC" had some enhanced autopilot coding added to give it a decent autopilot on the FS2K2 update. Ron

Share this post


Link to post
Share on other sites

>Hey Ron. >>Just interested in what a PID autopilot is. An acronymn for "Position, Integral, Derivative" Feedback. Something I learned a year ago, though I knew the FB system theory. A Control System (such as an autopilot) compares Position with Command. It takes the difference (error) and amplifies that to actuate a change in the controlled variable. When the error is zero the Output equals the Command. However, simple position feedback systems may be sluggish, or oscillate. So, it is typical to also feed back the Derivative (rate of change) of the controlled variable. This adds Damping, which helps minimize overshoots. Integral FB is a bit less common. It results in any error being integrated (summed over time) and this forces the error to zero as time increases. Thus, the Output will exactly equal the Command after some time has passed. ALT Hold appears to involve Integral FB, since an FS aircraft will eventually get within a couple of feet (out of thousands) of the Set Altitude. Ron

Share this post


Link to post
Share on other sites

Hey Ron.Interesting, very interesting. I am taking Control Systems this semester in my Aerospace Engineering course, and am studying the very subject you mentioned.Although it is not just 2+2, it should be farly striahg tforward to code something like this, with integral feedback, no?

Share this post


Link to post
Share on other sites

My Sperry Pilot and the Cessna NAVOMATIC are PI autopilots. I done also a PID four-axis hoverautomatic for light helis lately. PID can act smoother then PI or P, but the D calculation is a bit tricky, since FS doesn't give you smooth variing values, they are (often) very "steppy". Some low-pass prefiltering helps often.Arne Bartels

Share this post


Link to post
Share on other sites

>Hey Ron. >>Interesting, very interesting. I am taking Control Systems >this semester in my Aerospace Engineering course, and am >studying the very subject you mentioned. I dropped out of my undergrad Controls Course, I did poorly on the first exam. ;) Later, I took a Controls Course as a grad student. They mentioned that jet fighters may get to alititude and speed fastest if one first dives, then climbs rapidly. Due to increased thrust at higher Mach levels. I see this in some of my jets. I did various FB stuff, but mainly in phase locked loop frequency synthesisers. These were genarally Type 1 for Phase (no average phase error), which would make them Type 2 for Frequency. Noise in the loop was the main challenge. >Although it is not just 2+2, it should be farly striahg >tforward to code something like this, with integral >feedback, no? If one understands the basics and how to program/interface to the OS and FS, then the main problem might be to be able to add JS output to the autopilot. Especially for a Yaw Damper. Where one must mix in pilot rudder commands. I have Roskam's S&C Vol II. It's mostly Bode Plots. He says many transfer functions (hydraulic actuators, etc.) are simple, first order lags. Roll Dynamics is also basically a LP filter. One can command a Roll Rate and close a 'Bank' postion around the Rate Loop. Pitch is more complex, sorta second order. That's one place the FS2K2 autopilot fails. In FS2K2 I could adjust FB parameteters to get Jets stable in ALT hold. There isn't much one can do in FS2K2. I think MathCad (expensive) is used to model and tune many real autopilots. One can also interface it with MSFS, FG, etc. (More $). Now if one had a well defined autopilot for FS2K2 and trusted the AC dynamics he could test fly his system. Much more informative than just a bunch of graphs. ;)Ron

Share this post


Link to post
Share on other sites

>My Sperry Pilot and the Cessna NAVOMATIC are PI autopilots. I have the Sperry autopilot in a CFS2 B-17. It controls the elevator rather than the pitch trim. The former is more approriate. Trimming with the pitch trim doesn't change 'elevator lift' so one gains no range with an aft CG. There is no 'trim drag' in FS other than for a fixed amount if the H. Stab is set at an angle. However your Sperry doesn't work in FS2K2. >PID can act smoother then PI or P, but the D calculation is >a bit tricky, since FS doesn't give you smooth variing >values, they are (often) very "steppy". Some low-pass >prefiltering helps often. >Arne Bartels I suspect the FS2K2 'autopilot' aliases the ALT error, since it sometimse drives the trim down when when one wants to hold ALT or climb. Probably due to insufficent sampling rate (and no LP filtering). To properly model 'fly by wire' AC one needs a stability augmentation system. Essentially an autopilot that makes the AC fly nicely even when direct control would be difficult. Arne, a good general Autopilot DLL would be very useful. It could use different parameters set for each AC set in the Registry. In fact, I suspect if you came up with a good autopilot DLL you could license it to some commercial developers. Those complex FMS systems have to inteface with the 'autopilot' and if that were already standardized and available it would lessen the work involved in programming them. Ron

Share this post


Link to post
Share on other sites

Hey Ron.Pitch is more complex, sorta second order. That's one place the FS2K2 autopilot fails. In FS2K2 I could adjust FB parameteters to get Jets stable in ALT hold. There isn't much one can do in FS2K2.Think you meant you did it in FS2K, right? ;-)Yes, it is second order. What needs to be done is find the altitude at which the aircraft is at, and what altitude it is commanded to. Derivate that, to obtain the vertical speed, and derivate that to obtain vertical acceleration, at which point this can be related to pitch angle.It sounds like it would be a good challenge to make a decent autopilot for FS2K2. But if I recall correctly, the 767PIC AP is pretty decent, no?I have to read on, for the plane I am trying to model has fly-by-wire in both the rudder and elevator. The book I mentioned has a good section on it, but first I need to learn what laws apply to this specific system, then model it.About MATHCAD, you are correct, expensive, but it would be a great way to test out flight dynamics to match the real thing, and to finetune the AP logic. Also MATLAB.How hard will it be to correctly model Hydraulics and Pneumatics through gauges? Is it possible at all?By the way, if you don't mind me asking, what do you do for a living? And where did you go to school? I am at Embry-Riddle, Daytona Beach. Hopefully off to work at EMBRAER in the middle of the year.

Share this post


Link to post
Share on other sites

Sorry about the Sperry, Which one do you (want to) use? I know I patched the one MARKIII for the R4D, but I lost a bit track what has been published and what not. The problem is that the further used keys KEY_ELEVATOR_SET, KEY_AILERON_SET and KEY_RUDDER_SET work the opposite in FS2000 compared to FS2002. The events KEY_AXIS_ELEVATOR_SET, KEY_AXIS_AILERONS_SET, KEY_AXIS_RUDDER_SET are however the same in all FS's they are available in.Arne Bartels

Share this post


Link to post
Share on other sites

Thanks a lot, Arne and Ron, for your insigthful replies>My Sperry Pilot and the Cessna NAVOMATIC are PI autopilots. What I'm having in mind is to try a Fuzzy Controller (FLC) and maybe enhance it with learning capabilities (adaptivity) later on. I know the FLC is capable of doing better than the "gain-scheduled" PI(D) (especially during transients) and thought it could be a nice experiment to try.Your comments are welcome.Adam

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