When Robots Learn to Fly: A New Framework for Stable Learning-Based Control

When Robots Learn to Fly: A New Way to Control Machines in an Uncertain World
Imagine you're holding a drone. You've programmed it to hover in place, and for the most part, it works. But then the wind picks up. Or the battery drains slightly, shifting the center of gravity. Or the propellers wear unevenly. Suddenly, your carefully tuned controller is struggling, overshooting, oscillating, losing track. Now imagine the drone can watch what happens, learn from its mistakes, and adjust its compensation in real-time—all without ever becoming unstable, without ever doing something dangerous. That's the promise of a new hybrid control approach that combines the mathematical rigor of classical control theory with the adaptive power of reinforcement learning.
The finding is striking: by adding a reinforcement learning component to a traditional feedback linearization controller, researchers at the University of Turku achieved significantly better trajectory tracking in simulations of a single-degree-of-freedom rotor-based system—and they proved mathematically that the combined system remains stable even when the learning algorithm makes mistakes. The learning-enhanced controller consistently outperformed the conventional approach, reducing tracking errors while maintaining bounded control effort, and it generalized well to disturbances it had never encountered during training.
This matters because the engineering world is full of systems that don't behave exactly like their models. Robots, aircraft, satellites, industrial manipulators—all operate in conditions that deviate from ideal assumptions. The standard approach has been to either accept performance degradation or spend enormous effort building more accurate models. This work suggests a third path: let the model be imperfect, but give the controller the ability to learn and adapt while maintaining rigorous stability guarantees.
The Science
The research comes from the Smart Systems Lab at the University of Turku in Finland, led by Gabriel da Silva Lima and Wallace Moreira Bessa. Their paper, presented at EURODINAME III (an International Symposium on Dynamic Problems of Mechanics), tackles one of the oldest challenges in control engineering: how do you make a system behave precisely as desired when the real world keeps getting in the way?
The physical system they studied is the Quanser AERO 2, a compact laboratory device that mimics the dynamics of aerospace platforms in a safe, educational setting. Picture a horizontal beam supported at its center, with two rotors—one at each end—spinning in opposite directions. When the rotors spin at different speeds, the beam pitches up or down. This single degree of freedom—pitch angle—captures the essential challenges of flight control: nonlinear dynamics, gravitational effects, and the need for precise trajectory tracking.
The dynamic model governing this system follows from basic physics. The equation of motion relates the angular acceleration of the pitch angle to gravitational forces, motor thrust, and applied voltage. The key parameters include the moment of inertia of the pitch assembly, the mass of the body, the distance from the pitch axis to the center of mass, and a proportionality constant linking motor voltage to thrust force. The system is nonlinear because the gravitational term involves a sine function of the pitch angle—small angles behave one way, large angles behave quite differently.
Classical control of such systems typically relies on one of two approaches. Feedback linearization attempts to transform the nonlinear dynamics into a linear system through a carefully designed control law, after which standard linear control techniques apply. Sliding mode control enforces robust tracking by driving the system state toward a predefined surface and then maintaining it there. Both approaches offer strong theoretical guarantees—but those guarantees depend on having an accurate model. When the model is wrong, performance suffers, and in extreme cases, the system can become unstable.
The hybrid approach proposed by Lima and Bessa preserves the feedback linearization framework as its foundation. This provides the mathematical structure for stability guarantees. But then they add a second layer: a reinforcement learning component that watches how the system actually behaves versus how it should behave, learns patterns in the discrepancy, and compensates for unmodeled dynamics and external disturbances in real-time.
The reinforcement learning module uses the REINFORCE-with-baseline algorithm, a policy-gradient method that learns by exploring different compensation strategies, observing outcomes, and updating its approach based on rewards. The "with-baseline" addition is crucial: it stabilizes learning by comparing actions against an expected baseline rather than evaluating each action in isolation, dramatically reducing the variance of policy updates and enabling more reliable convergence.
To ensure the combined system remains safe, the entire architecture is grounded in Lyapunov stability analysis. Lyapunov's method, developed by Russian mathematician Alexander Lyapunov in 1892, provides tools for proving that a dynamical system will converge to a desired state without ever needing to explicitly solve the system's equations. The key insight is that if you can find a function of the system state that always decreases over time, the system must be stabilizing. Lima and Bessa show that their combined error signal—the difference between desired and actual trajectory—has this property: it decreases over time regardless of what the reinforcement learning component learns, as long as the learning output remains bounded. This boundedness is ensured by the neural network architecture.
What They Found
The researchers evaluated their approach through extensive numerical simulations implemented in Python, using the fourth-order Runge-Kutta method for numerical integration with different sampling rates for the controller (10 Hz) and system dynamics (100 Hz). They trained the reinforcement learning agent over a maximum of 20,000 episodes, with each episode representing up to 60 seconds of simulated time.
The neural network architecture for both actor and critic consisted of fully connected layers with 64 neurons in each of three hidden layers. The actor network outputs the parameters of a Gaussian policy—the mean disturbance compensation and log standard deviation—while the critic network estimates the state-value function. During training, the system state was defined as a tuple containing the current pitch angle, angular velocity, desired pitch angle, and desired angular velocity. The learning rate for the Adam optimizer started at a given value and decayed linearly to zero over the training horizon, and gradient clipping with a maximum norm of 0.5 prevented numerical instability.
The first major finding concerns the value of the baseline in reinforcement learning. When comparing REINFORCE with baseline against vanilla REINFORCE across three different learning rates, the baseline-augmented algorithm consistently achieved higher final returns and faster convergence. With a learning rate of $1 \times 10^{-4}$, REINFORCE-with-baseline reached stable performance in approximately 2,500 episodes and maintained strong returns throughout training. Vanilla REINFORCE, by contrast, exhibited significantly more unstable learning behavior with wider fluctuations and slower progression—at the lowest learning rate of $1 \times 10^{-5}$, it failed to converge even after 15,000 episodes.
Convergence Speed: Baseline vs. No Baseline
| Label | Value |
|---|---|
| 1×10⁻⁵ | 0 |
| 3×10⁻⁵ | 4,000 |
| 1×10⁻⁴ | 2,500 |
This result has practical implications for real-world deployment: the baseline enables reliable learning in continuous control tasks where vanilla approaches might never converge to useful policies. The authors implemented early stopping based on the Wasserstein distance between return distributions over sliding windows, with a patience of 400 episodes and a minimum improvement threshold. Trajectory randomization every 400 episodes introduced nonstationarity that better mimics real-world conditions where desired trajectories vary over time.
The second major finding concerns trajectory tracking performance. Across 100 independent simulations with randomized initial conditions, the learning-enhanced controller significantly outperformed the conventional feedback linearization approach. The proposed controller closely followed the sinusoidal reference trajectory, with visibly reduced steady-state and transient deviations. Tracking errors remained consistently smaller for the learning-based controller compared to the feedback linearization approach alone.
Critically, these improvements came without introducing excessive control effort. The voltage profiles remained similar across both methods, meaning the learning component was not simply "trying harder" by applying larger inputs—it was working smarter, applying precisely calibrated compensation where needed.
The learned disturbance compensator oscillated in synchrony with the system dynamics, capturing the compensatory action needed to handle the gap between the model and reality. This suggests the reinforcement learning agent learned a meaningful compensation strategy rather than just injecting noise.
Tracking Error Comparison
| Label | Value |
|---|---|
| Conventional FL | 0.15 |
| Learning-Enhanced | 0.05 |
The third major finding addresses robustness: when the researchers injected previously unseen time-varying disturbances during testing, the learning-based controller maintained high tracking performance without any retraining. The disturbance signal had randomly sampled amplitude and frequency for each run, and the same trained policy—learned under one set of conditions—generalized to entirely different disturbances. The output trajectory remained tightly aligned with the desired reference, tracking errors stayed low and bounded, and the control voltage remained well-regulated. The learned compensation captured the oscillatory structure of the injected signals, adapting its output to the new disturbance patterns even though it had never explicitly encountered them.
Generalization: Seen vs. Unseen Disturbances
| Label | Value |
|---|---|
| Trained Disturbances | 0.05 |
| Unseen Disturbances | 0.07 |
The Lyapunov stability proof provides the mathematical foundation for why this generalization is possible. The proof shows that the closed-loop system exhibits uniformly ultimately bounded tracking errors—the combined error signal and its derivatives remain within a compact region whose size depends on the accuracy of the disturbance approximation. As the reinforcement learning policy improves its approximation, this region shrinks. Importantly, stability is guaranteed regardless of the approximation accuracy: the system remains bounded even if the learning component produces imperfect compensation.
Why This Changes Things
Control engineering has long been divided between two camps. On one side, model-based control with its elegant mathematics and formal guarantees. Feedback linearization, backstepping, sliding mode control—these techniques offer certainty. You know, mathematically, that your system will behave as specified. But they require accurate models, and accurate models require extensive system identification that can be time-consuming, expensive, or simply impossible for complex real-world systems.
On the other side, learning-based control offers adaptability but struggles with guarantees. Reinforcement learning has shown remarkable success in game playing, robot locomotion, and autonomous driving—but these are domains where occasional failures are tolerable. In flight control, in medical devices, in industrial machinery, failure can mean catastrophe. The lack of formal stability guarantees has been a significant barrier to deploying reinforcement learning in safety-critical applications.
Lima and Bessa's work suggests a resolution: keep the model-based controller as the stability anchor, let the learning component enhance performance within that safe framework. The feedback linearization controller provides the mathematical structure that ensures boundedness and convergence. The reinforcement learning component operates as an adaptive observer, estimating and compensating for discrepancies without ever violating the stability constraints. This separation of concerns is elegant and practical.
The implications extend beyond aerospace platforms. Any system with nonlinear dynamics and modeling uncertainties could benefit from this approach. Robotic manipulators operating with varying payloads. Autonomous vehicles encountering unfamiliar terrain. Power systems balancing variable renewable generation. The architecture is general: feedback linearization provides a template that could be adapted to many different physical systems, with the reinforcement learning component handling whatever the model fails to capture.
The results also validate the value of careful algorithm selection within the reinforcement learning framework. Policy-gradient methods like REINFORCE are well-suited to continuous control tasks where actions are real-valued, but their high variance has historically made them difficult to use reliably. The baseline extension reduces variance without introducing bias, leading to more stable and sample-efficient learning. This is not a new insight in the broader machine learning literature, but demonstrating its value in a control-theoretic context—with mathematical proofs of stability—moves the field forward.
The simulation results showing generalization to unseen disturbances are particularly encouraging. In practical applications, you cannot anticipate every possible disturbance during training. A controller that generalizes well to novel conditions is more valuable than one that requires exhaustive testing of every contingency. The fact that the learned compensation captured the oscillatory structure of new disturbances suggests the agent learned something meaningful about the underlying physics rather than simply memorizing patterns from training.
There is also something significant in the way the authors handle the trade-off between exploration and exploitation. During training, the system samples actions from a stochastic policy—adding variability to encourage discovery of better strategies. During deployment, it uses the deterministic mean of the learned policy—the best estimate of the optimal action. This transition from exploration to exploitation is common in reinforcement learning, but the explicit treatment here, with bounded outputs ensuring compatibility with the Lyapunov stability analysis, provides additional confidence for real-world deployment.
From a broader perspective, this work contributes to the growing recognition that the dichotomy between model-based and learning-based control is false. The most capable systems will combine the strengths of both approaches: the interpretability and guarantees of first-principles models, with the adaptability and robustness of learned components. This hybrid paradigm is likely to become increasingly important as control systems operate in more complex, uncertain environments.
What's Next
Several questions remain open, and addressing them will shape the future of this research direction.
First, the work has so far been validated only in simulation. Real-world experiments on physical hardware are essential before strong claims can be made about practical applicability. Physical systems exhibit phenomena that simulations may not capture: friction that varies with temperature and speed, mechanical hysteresis, sensor noise, actuator saturation. The Lyapunov analysis assumes perfect state measurements and unlimited control authority—real systems violate these assumptions. Experimental validation on the Quanser AERO hardware would test whether the simulation results transfer to the physical world.
Second, the training process remains computationally intensive. The authors trained for up to 20,000 episodes with 60-second episodes, totaling over 30 hours of simulated time. For real-world deployment, this training phase would need to be shortened, either through more sample-efficient algorithms, transfer learning from related tasks, or methods that enable online adaptation without extensive prior training. The early stopping criteria helped, but 2,500 episodes to stable performance (at the best learning rate) is still substantial.
Third, the stability analysis assumes the reinforcement learning output remains bounded. The neural network architecture with constrained output range provides this boundedness, but the proof does not characterize how performance depends on the choice of bound. If the bound is too small, the learning component cannot provide sufficient compensation. If too large, the boundedness assumption may be violated in practice. Understanding this trade-off quantitatively would help practitioners choose appropriate network architectures and output constraints.
Fourth, the current formulation handles a single degree of freedom. Real systems typically have multiple coupled degrees of freedom, and extending the approach to higher-dimensional state spaces introduces challenges: more complex nonlinearities, greater potential for unmodeled interactions, increased computational demands for the neural networks. The Quanser AERO system has two degrees of freedom (pitch and yaw), and the authors note that extending to both would be a natural next step.
Fifth, the approach relies on having a reasonably accurate model to begin with. The feedback linearization controller requires a model of the system dynamics, even if imperfect. For systems where even an approximate model is unavailable—completely novel platforms, biological systems, highly complex processes—this framework may not apply directly. Alternative approaches, such as learning the entire dynamics model from data rather than using a nominal model plus correction, might be needed.
Finally, the question of safety verification remains. Lyapunov stability analysis provides one form of guarantee, but real-world deployment typically requires more extensive verification, especially for safety-critical applications. Formal methods for neural network verification, probabilistic guarantees, and runtime monitoring are active research areas that could complement the control-theoretic approach presented here.
Despite these open questions, the work represents meaningful progress toward practical learning-based control. The combination of stability guarantees with adaptive compensation addresses a real engineering need, and the simulation results demonstrate the potential benefits. As computational resources improve and training methods become more efficient, the gap between simulation and reality will shrink, and hybrid approaches like this one are likely to find increasing application in robotics, aerospace, and beyond.
The broader lesson may be about integration rather than replacement. Control engineering has developed sophisticated tools over more than a century of research. Machine learning has developed powerful tools for handling complex, uncertain environments. The most promising path forward is not to abandon either tradition, but to combine them thoughtfully—letting each do what it does best, within a framework that preserves the properties we need and enables the capabilities we want.
For now, the findings remain in simulation, awaiting experimental confirmation and practical refinement. But the direction is clear: we can build controllers that learn and adapt while remaining predictably safe. That is a significant advance, and it points toward a future where machines operate robustly in an uncertain world—not because we modeled every possible contingency, but because we gave them the ability to learn from experience, constrained by the mathematics of stability.