Abstract:This article presents an attitude controller based on the Reinforcement Learning (RL). The inputs of the actor network are states of attitude angle, angular rates etc, where the output is the angle control command of elevator and aileron, achieving the rapid response of the attitude angle with variable initial conditions, avoiding the application of the conventional PID controller and the parameter adjustment. According to the states transfer characteristics, by setting the splitting neural network model, efficiency of algorithms is improved. In order to be close to the actual fixed-wing aircraft model, the simulation is based on JSBSim F-16 aerodynamic model, using OpenAI gym to build the simulation environment for reinforcement learning. With arbitrary angular speed, angle, and airspeed as initial conditions, the actor and critic networks are trained. The simulation results show that the RL based attitude controller has faster response and less dynamic error compared with the conventional PID controller.