Jump to content

Autopilot code


shanwick

Recommended Posts

Posted

Does anyone know where the code for the autopilot is? In the core of FS9, in the autopilot gauge or in the .air file?

 

Just curious as to why the operation of the autopilot can vary between aircraft, that's all.

 

Dijvid

Posted
It's in the FS9 core or "engine". The gauges and FDE files call parts of the code into action from there, as required to suit the aircraft type/era.

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Posted
It's in the FS9 core or "engine". The gauges and FDE files call parts of the code into action from there, as required to suit the aircraft type/era.

 

Thanks for your reply.

 

I guessed this might be where the code is in which case it prompts another question .... why then can capturing the ILS, for example, be so good in some a/c and terrible in others if they are all calling the same code?

 

BTW, I'm down south in Reading about 400 meters from the WOD NDB.

 

Dijvid

Posted
BTW, I'm down south in Reading about 400 meters from the WOD NDB.

 

Pleased to meet you, sir - I've virtually flown over you many times. I'm about 15nm E-SE of the POL VOR.

The autopilot performance question is a good one; I think it depends on the quality of the gauge and FDE programming. The GPS coding changed from FS2002 to FS2004, so FS2004-native autopilots may work better in FS2004 than earlier versions. Also, for any autopilot to work properly in FS2004, the aircraft.cfg must contain autopilot, direction, attitude and turn indicators sections, and the .air file must contain Autopilot Settings, OBS Availability, Avionics Availability, Autopilot/Secondary Aerodynamics and Autopilot Limits sections.

The aircraft.cfg direction, attitude and turn indicators are the gyroscopes which send data to the autopilot. They can be driven by vacuum or electric, or slaved to another compass. Sometimes the incorrect power source is specified which causes problems.

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Posted

Besides autopilot control parameters its actions also depend on the various flight tuning parameters such as trim, effectiveness and sensitivity, limits, and other control surface characteristics plus weight and balance and power considerations.

 

Be sure the trim settings are set correctly by the aircraft manual. The autopilot for pitch works through the elevator trim control and it must be within range. Similarly it applies to the rudder trim and aileron trim.

 

Go through the autopilot section of aircraft.cfg in the various default models to see how they differ by aircraft type.

 

As usual make safe copies of anything you edit.

 

The FS9 SDK is no longer available through Microsoft but is hosted at AVSIM:

 

fs9_sdk_tool_pack.zip

 

Searching for that file there will give you its complete description of what each kit of the collection does.

 

The aircraft container section has documentation for aircraft.cfg with definitions and examples with default parameters for each section. FSEDit kit has the similar descriptions for the .air file. It includes the FS Edit tool to modify this.

 

I recommend not using FS Edit unless very experienced. In the aircraft container documentation read about flight tuning, autopilot parameters, and other sections that affect the flight dynamics and autopilot operation so you can understand the dependency of AP operation as interfaced to the flight dynamics.

 

This can give you an understanding how settings of the AP can change and where not stated in aircraft.cfg will show you the defaults applied.

KMSP - Minnesota: Land of 10,000 Puddles

Support Team

[sIGPIC][/sIGPIC]

Posted

Thanks for your replies, Ronzie \nd Tom. However, I was/am just mildly curious about the autopilot and have no intention of trying to meddle with it.

 

Dijvid

Posted
Pleased to meet you, sir - I've virtually flown over you many times. I'm about 10nm WSW of the POL VOR.

 

Well, if you look up and happen to see a red and white B58TC Baron at FL100 - FL120 belonging to Trans Europe Air Medical [TEAM, for short, which is my own virtual organisation] then give me a wave :pilot:

 

Dijvid

Posted
Always thought it strange that people can hack into the CIA and NASA and banks etc, but nobody can access fs9's 'secret' code.

 

Is it really that hard to do?

 

Well, hacking CIA, NASA and banks is just for those wanting a bit of fun - but FS9 is much more serious than that:) Nevertheless, FS9's "secret" code has been hacked - it's known as the "No CD" crack ;););)

 

Dijvid

Posted
Well, if you look up and happen to see a red and white B58TC Baron at FL100 - FL120 belonging to Trans Europe Air Medical [TEAM, for short, which is my own virtual organisation] then give me a wave :pilot:

 

Dijvid

 

Virtual ...... Wave????

[sIGPIC][/sIGPIC]
Posted
Always thought it strange that people can hack into the CIA and NASA and banks etc, but nobody can access fs9's 'secret' code.

 

Is it really that hard to do?

 

These are completely different and unrelated technical proceedings.

 

To "hack" a network or system means to gain access to its operating system or protocols by whatever means necessary. More often than not this is not even possible to do from the outside, you need a "doorway", either by exploiting a known weakness or by injecting something to the inside (by sending mails or trying to spread malware so broadly, that eventually someone carries it inside). The "hacker" from the movies who applies fancy software to "crack" passwords is a myth.

 

The "hacking" you have in mind is different. Simply put, you want to permanently alter a pre-compiled binary executable. This by and large is impossible without the source code, that you can alter and then recompile. Unfortunately you won't get the sources, ever, because they are intellectual property of Microsoft. The most people can do in terms of "hacking" is altering some data variables that are already there- if they are lucky. You could alter a string encoding "hello" into "hullo", but you can't change it into "good morning" - simply because that string is longer, and it would overwrite other things that come after it in memory. But that is about it, you cannot alter the code that is being executed in any meaningful way (except breaking it - like the "no cd" alteration). There is nothing sinister or secret about this, it is just how binary programs are and how they work (Scripting languages are a different matter). And this is a good thing too, because otherwise anyone could steal your code, alter it and sell it as his own. The only thing you have to guard with your life are your source files...

Posted
The "hacking" you have in mind is different. Simply put, you want to permanently alter a pre-compiled binary executable. This by and large is impossible without the source code, that you can alter and then recompile. Unfortunately you won't get the sources, ever, because they are intellectual property of Microsoft. The most people can do in terms of "hacking" is altering some data variables that are already there- if they are lucky. You could alter a string encoding "hello" into "hullo", but you can't change it into "good morning" - simply because that string is longer, and it would overwrite other things that come after it in memory. But that is about it, you cannot alter the code that is being executed in any meaningful way (except breaking it - like the "no cd" alteration). There is nothing sinister or secret about this, it is just how binary programs are and how they work (Scripting languages are a different matter). And this is a good thing too, because otherwise anyone could steal your code, alter it and sell it as his own. The only thing you have to guard with your life are your source files...

 

It is possible to both disassemble and decompile Windows exe files into assembly or partial source code. While not necessarily enough to recompile after making changes, it would let an experienced developer work out how the application works. Most EULAs have clauses specifically forbidding this to protect their IP.

Posted
It is possible to both disassemble and decompile Windows exe files into assembly or partial source code. While not necessarily enough to recompile after making changes, it would let an experienced developer work out how the application works. Most EULAs have clauses specifically forbidding this to protect their IP.

 

Sorry, I know that I oversimplified this.

 

You mean into Assembler or machine code? Or "Assembly" or "Assemblies" as in C# libraries? ANSI C /C++ and C# are different worlds really. C# is Microsofts attempt at rebuilding Java, and a little easier to decompile if you really want to. But only a little.

 

ANSI C or C++: Most of the modern binaries would generate millions of bytecode lines, making it a lifetime job to really reprogram it. There are disassembler/decompiler applications out there, that succeed in producing more or less usable source files. Unfortunately this too is a massive effort, more often than not simply not feasible to do.

 

Btw it is not that easy to understand and alter a program that somebody else wrote, even if you have the sources - provided it is big and complex enough.

Posted
Sorry, I know that I oversimplified this.

 

You mean into Assembler or machine code? Or "Assembly" or "Assemblies" as in C# libraries? ANSI C /C++ and C# are different worlds really. C# is Microsofts attempt at rebuilding Java, and a little easier to decompile if you really want to. But only a little.

 

ANSI C or C++: Most of the modern binaries would generate millions of bytecode lines, making it a lifetime job to really reprogram it. There are disassembler/decompiler applications out there, that succeed in producing more or less usable source files. Unfortunately this too is a massive effort, more often than not simply not feasible to do.

 

And all I originally asked was "Does anyone know where the code for the autopilot is?" 'cos I was just mildly curious - that's all.

 

:confused: :cool: :pilot:

 

Dijvid

Posted
Ahhh, I remember now... and how IS the B58 Baron autopilot after all this? :p

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Posted
Ahhh, I remember now... and how IS the B58 Baron autopilot after all this? :p

 

It's the Dreamfleet Baron that I fly. I haven't modified the AP at all.

 

The AP is OK except for one thing which may be because I use the Turbo version which was created a long time ago by an English test pilot called Peter McLelland, although his mods did not include anything about the AP.

 

The Baron only has two stages of flaps and when I select flaps 2 the a/c sinks a little below the glide and has to climb back up. I've tried coming in at a higher speed but that doesn't make any difference. Anyway, my usual approach is to lower the speed to 110 kts with flaps 2, disconnect the AP at 500' AGL and lower the speed to 100 kts on short finals. I've long got used to this and I guess that real a/c have their little oddities which pilots have to be aware of and circumvent.

 

The Baron is the only a/c I fly and I love it to bits. Although it has been my trusty steed for a very long time now I still find something on the odd occasion that I never realised before.

 

Dijvid

Posted
It's the Dreamfleet Baron that I fly.

 

An excellent choice, with the exotic Turbo mod too! The sinking below the glide slope is probably due to a very slight imbalance in the flaps lift/drag ratio which can easily be fixed, but you may find approaches less challenging as a result. If the [flaps.0] section in the aircraft.cfg looks like this:

 

[flaps.0]

type= 1 //0=Piston, 1=Jet, 2=None, 3=Helo-Turbine, 4=Rocket, 5=Turboprop

system_type=4 //Electric

span-outboard= 0.410 // 0.0 .. 1.0

extending-time= 4.0 // seconds

damaging-speed=152.0 // KIAS

blowout-speed=250.0 // KIAS

flaps-position.0=0.00 // degrees

flaps-position.1=15.00 // degrees

flaps-position.2=30.00 // degrees

lift_scalar=1.00

drag_scalar=1.00

pitch_scalar=1.00

 

Change the lift_scalar=1.00 to 1.20, or similar proportion if it's a different number. This will increase the lift generated by the flaps by 20%. You should now notice a slight "bump" upwards when the flaps are lowered, and you may need to reduce speed slightly when on the glideslope if the nose dips down too much. If 1.20 creates too much lift, just change it down to 1.15 and so on until it's spot on.

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Posted

Thanks, tiger, for the reply - and compliments about my choice of a/c :cool:

 

In days long gone now I have decreased the lift_scalar on a/c because they have caused too much climb but it has never occurred to me to increase it as you suggest. Obvious, when you think about it, but it's all too easy NOT to think about it :( I'll give it a go and let you know how I get on.

 

BTW, what do you poodle about in when you are "up there"?

 

Dijvid

Posted
I'll try just about any plane, just to see what it's like! But I did "get attached" to the PSS Airbuses (or should that be Airbii?) and then the Wilco Airbuses for a long time, applying all the tweaks and doing a few of my own, until flying them became like a job. I now do shorter flights in smaller planes, those with the funny windmills on the front, and have spent this summer touring Southern Europe in the CLS Piper Arrow 4 Free. I decided that this little plane needed some TLC and the latest results can be found in the library under Piper Arrow Plus 2. This winter I'd like to tour Northern Europe, and I've fitted Matthias Lieberecht's BAe Panel Project Jetstream 31 panel into the VirtualCol Jetstream 31's 2D and VC panels. The Jetstream has a linked prop rpm and prop pitch system (a sort of semi-auto throttle) which I think I've managed to program into the throttle gauge code - the first leg of the tour/test flight commences today with a hop over the North Sea to a top-secret research facility in the Netherlands... OK, it's the Hard Rock Café in Amsterdam, look out Schiphol! ;)

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Posted

You sound like someone after my own heart!!

 

In a couple of week's time I will be leaving [in virtual terms!] the UK to over-winter in Norway and anywhere else in Europe that is far north.

 

Do you fancy the idea of the odd bit of e-mailing regarding FS2004 and aviation in general? If so then why not PM me with your address and I'll respond accordingly. If not, though, then don't hesitate to say so. I'll probably sulk for a year or two but I'll get over it :p

 

Dijvid

Posted
Do you fancy the idea of the odd bit of e-mailing regarding FS2004 and aviation in general?

 

Thank you for the invitation, I have PM'd my acceptance just now.

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...