Autopilots are very complex; it is not uncommon for a real airplane autopilot to behave erratically when it is not configured according to specifications, or if the airplane flies outside of the autopilot operating limits. This also holds true in Infinite Flight; parameters for control response are different for every aircraft, and for each configuration of flaps, airspeed and altitude.
Here's how to use the autopilot modes in Infinite Flight. The autopilot settings are accessed through the bottom row of buttons, in the "Autopilot" section.
Note: When first turned on, the ALT mode immediately tries to maintain the current altitude, this can cause control issues if the airplane is climbing or descending too rapidly. Make sure you set the ALT mode when the airplane climb rate is less than 500ft/min.
Note: The HDG mode can start oscillating if the airspeed is too low (close to stall speed).
This mode maintains the specified airspeed. Armed airspeed is shown in the top left part of the hud.
Note: This mode will try its best to reach the airspeed, if there isn't enough power available, the airspeed might not ever be reached.