Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 38

Integral Control for Step Inputs

Recommended resources

Hello! Welcome to your next lesson on reference tracking and disturbance rejection.

In our last lesson, we saw how to achieve reference tracking by adding a pre-compensator gain, . This was an effective first step, but it came with a significant drawback: its performance relies entirely on having a perfect model of the system. Any small modeling error or external disturbance would cause the steady-state error to reappear.

Today, we will address this weakness by designing a controller that is inherently robust to such issues. We will do this by incorporating integral action directly into our state-space controller. Your background in signal processing might give you an intuition for this: an integrator has infinite gain at DC (zero frequency), which allows it to completely eliminate constant, or "DC," errors.

By the end of this lesson, you will be able to augment the state vector of a system with integrator states and design a controller that ensures robust, zero steady-state error for step reference inputs.

1. The Principle of Integral Control

The core idea behind integral control is to use feedback on the tracking error itself. Let the error be , where is the reference and is the system output. We want a control action that persists and grows as long as this error is non-zero, and only stops changing when the error is precisely zero. This is exactly what an integrator does.

Consider the block diagram below. The error is fed into an integrator (represented as 1/s in the Laplace domain), whose output is then used as part of the control signal. In steady state, for all signals to be constant, the input to the integrator must be zero. This forces to equal .

State-Space Control System with Integral Action
This block diagram shows how an integral action is incorporated into a state feedback loop. The error `e = r - y` is integrated to create a new state `w`. The control input `u` is then a combination of feedback from the original states `x` (via `Kc`) and the new integral state `w` (via `Ki`).

This closed-loop approach is fundamentally more robust than the open-loop pre-compensator from the last lesson, as it actively measures and corrects for error, whatever its source may be.


2. Augmenting the State-Space Model

To implement this in a state-space framework, we treat the output of the integrator as a new state variable. Let's call this integral state . Its dynamic equation is simply the definition of the error integral:

For now, let's flip the sign to match the convention in most control literature, which defines the error as . This choice is arbitrary and only affects the sign of the resulting integral gain.

Since , for a typical system with , this becomes:

We now form an augmented state vector, , which combines the original plant states and our new integral state :

Our goal is to write the dynamics of this entire augmented system in the familiar state-space form . Let's derive the augmented matrices and .

The following video provides a clear walkthrough of this derivation.

State variable control 34: Integral control

This video, 'State variable control 34: Integral control' by Corné van Daalen, excellently explains how to build the augmented state-space model for integral control.

Watch from 0:25 to 4:25. Pay close attention to how the integral of the error is defined as a new state (he calls it ζ, which is equivalent to our xₗ) and how its dynamics are combined with the original plant dynamics to form a new, larger state-space system.

As the video showed, by combining the plant dynamics and the integrator dynamics , we can define a new open-loop system. The dynamics of the augmented state vector can be written as:

Let's define the augmented system matrices:

We now have a new open-loop system described by the pair .


3. Designing the Augmented Controller

With the system in this new form, the problem reduces to something we already know how to solve: designing a state feedback regulator for the augmented system.

Our control law will be , where is the feedback gain for the augmented system. We can find this gain matrix using either pole placement or LQR, just as we did in previous modules, but this time applied to the pair .

If the original system has states and we add one integrator, the augmented system has states. Therefore, we must specify desired closed-loop pole locations for pole placement, or use an state-weighting matrix for LQR.

Once we compute the augmented gain , we can partition it to see the separate gains for the original states and the new integral state:

Here, is the proportional gain matrix (acting on ), and is the integral gain (acting on ). The full control law is:

The next video demonstrates this design process using LQR, which is a powerful method you're already familiar with, and shows how to implement it in MATLAB and Simulink.

Control of State-Space Models in Simulink By Using Linear Quadratic Regulator - Control Systems

This video by Aleksandar Haber demonstrates how to design an LQR controller for an augmented system with integral action.

Watch from 5:44 to 9:49 and then from 12:38 to 14:42. The first segment shows the formal construction of the augmented system and the LQR control law. The second segment shows the practical MATLAB code for defining the augmented matrices and solving for the gain K using the lqr function.

A Note on Controllability

For pole placement to work, the augmented system must be controllable. This is guaranteed if:

  1. The original system is controllable.
  2. The original system does not have a transmission zero at . Intuitively, this means the plant itself doesn't have a zero that would cancel out the pole we are adding at the origin with the integrator.
Test your understanding!

Let's return to the DC motor from the last lesson:

Construct the augmented system matrices, and , that you would use to design a controller with integral action.

Show answer

The original system has 2 states (). We are adding one integrator for the single output. The augmented system will have 3 states.

The augmented matrices are constructed as follows:

Plugging in the matrices for the DC motor:

You would now use this 3x3 matrix and 3x1 matrix with place or lqr to find a 1x3 gain vector .


4. Application to the Rotary Inverted Pendulum

This technique is directly applicable to your rotary inverted pendulum project. In fact, it is the standard method for enabling the pendulum's base to track a reference position while keeping the pendulum upright.

The following resource is from a master's thesis that implemented exactly this for a similar QUBE-Servo pendulum.

Rotary Inverted Pendulum Thesis

This thesis, 'Control of a Rotary Inverted Pendulum System Using ...', provides a perfect, practical example of augmenting the state vector for integral action on the very system you're working with.

Please read pages 20-21 (Section 2.2.3 Integral Action). Focus on how the author justifies needing integral action and then constructs the 5-dimensional augmented system. Note the final form of the augmented matrices ARS and BRS in Equations 2.23 and 2.24. This shows you exactly how the matrices are structured for your project.

As you saw, the original 4-state model (base angle , pendulum angle , and their velocities) is augmented with a fifth state, , which integrates the base angle error. The LQR controller is then designed for this 5-state system, resulting in a robust servomechanism.


Conclusion

Today, we've developed a powerful and robust method for reference tracking in state-space. By augmenting the system with a state that integrates the error, we ensure that any persistent error drives a corrective control action, ultimately forcing the steady-state error to zero.

Key Takeaways:

  • Integral action provides robust zero steady-state error by using closed-loop feedback on the tracking error.
  • It is implemented by augmenting the state vector with a new state representing the integral of the error signal ().
  • This creates a new, larger open-loop system defined by augmented matrices .
  • Standard design techniques like pole placement or LQR can be applied to this augmented system to find a new gain matrix .
  • This method is far more robust to model uncertainties and disturbances than the open-loop pre-compensator from the previous lesson.

Preview of the Next Lesson:
What happens if the system is subjected to a constant external force, like a persistent wind or an unmodeled friction? You may have guessed that the integral action we learned today is the key to solving this problem as well. In the next lesson, we will formally model the effect of constant input disturbances and see how the integral-augmented controller we just designed can be used to reject them completely.