Sign in to follow this  
Superpilotv2

Buiding an basic Autopilot

Recommended Posts

Hi guys,

I´m thinking of replacing my aging C206 Stationair II (one of Carenado´s first for FSX). It still flies good but the grafics are just plain bad. Replacement will probably be their C177 Cardinal (or an other similar suited single engine plane with reasonably short filed capability while keeping up a nice cruise speed, give some tips.).

Anyway, onto the topic: As the C177 isn´t equipped with an autopilot but I´d love to have some basic help when flying (flying longer distances by hand is pretty exhausting). I think of the ability to push the normal AP-button (Z) and the plane just holds the wings level and the height. Though I study computer science (at least partly), I haven´t any experience about the FSX gauge system (shame on me as an FSX addict).

 

So has anyone an idea how things like that work?

Share this post


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

Steffen, it that's enough for you, just add the default AP as a popup window (or maybe even find a spot in the VC, if you can stand the optics). This lets you adjust the values and can also be coupled with the GPS and things.

 

Maybe there are some freeware mods available which alter the behaviour and look a bit, but the default gauge entry picked from the standard planes is a simple copy and paste job and will drive your C177 (or any Carenado plane for that matter) just fine.

 

If you are running other Carenado planes, you can also borrow one of their gauges. Just check their panel.cfg for the actual name and then edit the new plane's cfg.

 

For example, this window is from the C. Bonanza, offering a very basic gauge.

[Window02]
Background_color=0,0,0
size_mm=1169,250
window_size_ratio=1.000  
position=0
visible=0
ident=795
window_size= 0.220, 0.063
window_pos= 0.015, 0.720
zorder=0

gauge00=C185!Toggle_AP,  333,1,35,35
gauge01=BonF33!Autopilot,  0,0,1169,250

Share this post


Link to post
Share on other sites

Well, I thought abut that too. But I feel that´s highly unrealsitic. Luckily I have the appropriate SDK installed, I will investigate into programming a little invisible gaunge with XML.

Share this post


Link to post
Share on other sites

Well if it's really just

I think of the ability to push the normal AP-button (Z) and the plane just holds the wings level and the height.

you should look for the [autopilot] section in the aircraft.cfg and make sure there's a

autopilot_available=1

set. This will enable the Z command for you.

 

If the section is missing, pick one from the default planes and add it. The parameters should be fine or at least cause very little trouble. For details on them, you can read on here: http://msdn.microsoft.com/en-us/library/cc526949.aspx#mozTocId942782

Share this post


Link to post
Share on other sites

Well if it's really just

you should look for the [autopilot] section in the aircraft.cfg and make sure there's a

autopilot_available=1

set. This will enable the Z command for you.

 

If the section is missing, pick one from the default planes and add it. The parameters should be fine or at least cause very little trouble. For details on them, you can read on here: http://msdn.microsoft.com/en-us/library/cc526949.aspx#mozTocId942782

 

 

Thanks for that. 

 

That link gave me everthing I need. Found the additional flag "default_pitch_mode". That set to 2 enables the height hold methode when the AP is turned on (when Z is pushed! Yeah, got everything, no need for extra gauges (although I will investigate further into gauge programming!).

 

Edit: Just need to add the following lines in the aircraft.cfg: 

 

autopilot_available=1
default_pitch_mode=2
default_bank_mode=2

Share this post


Link to post
Share on other sites

I haven't tried but I think it keeps current altitude or current pitch. Check the parameter default_pitch_mode too. I guess you can define what it does right there.

 

Edited. Already seems to have worked out. Safe skies! :smile:

Share this post


Link to post
Share on other sites

I haven't tried but I think it keeps current altitude or current pitch. Check the parameter default_pitch_mode too. I guess you can define what it does right there.

 

Edited. Already seems to have worked out. Safe skies! :smile:

As I just found out, I´ve got no money to spend for the Cardinal this month. Thus I tried it on the A2A P-51D Mustang (military version). Though I have both versions, I always liked the military one more. The only thing that bugged me was that it had no autopilot for flying longer routes. Now with the lines added it will hold height and wings level. Perfectly what I want. :-) Thanks for your tips.

Share this post


Link to post
Share on other sites

If I read your post correctly you have some interest in building an xml gauge yourself just to learn how to do it. I recently uploaded to the Library a basic autopilot for a Saitek FIP which may be useful for you as a template to adapt to a panel gauge. Go to the Library and search AP_MultiFuel_Gauges for FIP .

That is the second set of gauges I have done and i learnt from scratch (with a lot of trial and error to see what the effect was) and then I found Philippe Verhaege's pdf on creating gauges for a FIP ( search his name in the Library) which is very useful and much of whats in that will be useful for understanding how to build a panel gauge too, the main difference being you wont be limited by the 305 x 240 pixels of a FIP screen.

Share this post


Link to post
Share on other sites

Also, expanding on the suggestions for getting into gauge programming, here's a few links:

 

Gauges sub-forum at FSDeveloper

http://www.fsdeveloper.com/forum/forums/gauges.64/

 

Creating XML Gauges (ESP online sdk, but it mostly all works for FSX)

http://msdn.microsoft.com/en-ca/library/cc526953.aspx

 

Simulation variables

http://msdn.microsoft.com/en-ca/library/cc526981.aspx

 

Those three links alone will get you going, but there's a wealth of info available via google.  Using xml gauge programming to access basic autopilot functions is quite easy.  There's quite a bit of basic autopilot functionality built in to FS; the gauge programming is simply one of a few interfaces to it.

Share this post


Link to post
Share on other sites

Thanks for the additional infromation, guys. Much appreciated, I´ll look into it when I have more time.

 

One other thing that came up recently: The P-51D wis working great with the "simulated pilot" holding the ehight and wings trait. But I´t a mess keeping the right course with the wind interfering. I know that  can change it to "hold course" but AFAIK the P-51 doesn´t have the ability to set a course. Looks like there´s some programming to find a way that it uses the current heading for steering. 

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