Jump to content
The simFlight Network Forums

Sending pitch & bank commands to FS


Guest GFD

Recommended Posts

Hi,

I'm wondering if it is possible to send pitch & bank commands to FS via FSUIPC. I'm programming an autopilot and I would like to send my own commands in stead of using the autopilot commands defined in FSUIPC at this moment.

If this isn't possible, in what way can I do this anyway ?

Thanks for your help.

Bart Devriendt

http://glassflightdeck.sourceforge.net

Link to comment
Share on other sites

Hi,

I've been doing exactly the same thing.

The way I programmed it was to use a little control theory and control the aielerons. I think the algorithmn is called a DIS - differentiation, integrating summing.

To control bank angle you need to control rate of role (which is roughly what you get for a given aieleron setting).

To make the aircraft turn to a certain heading you control bank angle.

Cheers

Mark

Link to comment
Share on other sites

I'm wondering if it is possible to send pitch & bank commands to FS via FSUIPC. I'm programming an autopilot and I would like to send my own commands in stead of using the autopilot commands defined in FSUIPC at this moment.

Pitch and bank are controlled by elevator and aileron. You can just take over those controls. You can even ask FSUIPC to disconnect the user's controls so that they don't interfere. The control inputs are at offsets 0BB2 AND 0BB6. The facilities to disconnect the real controls are at 310A,. Please refer to the Programmers Guide in the SDK.

Pete

Link to comment
Share on other sites

Hi,

My code drives the offsets Pete has pointed out. My spelling of aileron is just a little wrong :)

Anyway, here is the code for the main control loop for bank hold:

double bank = iAircraft.Bank();

double error = bank + iBank;

double pC = iPConstant*error;

iIntegrator += (iIConstant*error);

iTrim = (int)(pC+iIntegrator);

iSurfaces.SetAileron(iTrim);

It's in Java. You need to experiment with the 2 contants. At the moment I use

iPConstant = 700.00;

iIConstant = 45.00;

Cheers

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.