API Question SetControlSurfaceLevel "Permanent" and "Transient" Behavior?

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,327
Reaction score
3,248
Points
138
Location
Massachusetts
I have been working on a basic autopilot for Kev33's Mirage 2000 that I have been tinkering with for a while. It seems to work, but it seems to "stick" even when I shut the autopilot off. As an example, here is the part of the autopilot that holds the wings level:

C++:
    if (autopilot_status == 1)
    {
        //Level wings

        SetControlSurfaceLevel(AIRCTRL_AILERON, (GetBank() / PI));
    }

It's fairly straightforward and works well...until I want to shut it off, especially if I have been maneuvering while toggling the autopilot on/off, and I suspect that the last input when the autopilot is shut off is persisting, and I don't know how to clear it. Even if the autopilot inputs are close to zero, that seems to affect the effectiveness of the flight controls after the autopilot is shut off.

In the API Reference there is this note for the SetControlSurfaceLevel method:

This method affects the permanent setting of the control surface, while manual input via keyboard or joystick
affects the transient setting. The total target state of the control surface is the sum of both settings, clamped
to the range [-1...+1]

So I guess my question is, is there a proper way to "reset" the flight controls to remove any permanent setting and resume full manual input? Is it sufficient to simply set the control level to 0 when the autopilot is toggled off? I assumed that the control level could be entered via the autopilot OR by manual input, but it seems the actual implementation does some horrible weighting of both.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
Yes, when the autopilot is shut off, the control setting should be set to 0. That's how my atmospheric auto pilots all work.
 
Top