# API QuestionSetControlSurfaceLevel "Permanent" and "Transient" Behavior?

#### Thunder Chicken

##### Fine Threads since 2008
Donator
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.

#### GLS

##### Well-known member
Orbiter Contributor
Addon Developer
Is it sufficient to simply set the control level to 0 when the autopilot is toggled off?
I'd put my money in this.

#### Blake

##### Addon Developer
Addon Developer
Yes, when the autopilot is shut off, the control setting should be set to 0. That's how my atmospheric auto pilots all work.

Replies
0
Views
126
Replies
1
Views
619
Replies
12
Views
781
Replies
3
Views
535
Replies
1
Views
262