Hello! Welcome back to our course on multivariable control.
In our last lesson, we established a clear, intuitive understanding of controllability. We learned that it's the fundamental property that determines whether we can steer a system's state wherever we want. Most importantly, we saw that controllability is the key that unlocks our ability to stabilize unstable systems—like your rotary inverted pendulum—by allowing us to place the system's poles (eigenvalues) in stable locations.
Today, we transition from concept to calculation. While intuition is vital, engineering requires a definitive, mathematical test. This lesson will equip you with that tool. Our learning outcome is to compute the controllability matrix and use its rank to determine if a system is controllable.
From Concept to Calculation: The Controllability Matrix
For a linear time-invariant (LTI) system described by , where is the n-dimensional state vector, there is a powerful algebraic test for controllability. This test revolves around a special matrix called the controllability matrix.
This matrix, often denoted as or , is constructed from the system's and matrices as follows:
Let's break down the components of this matrix:
- : The columns of the matrix represent the directions in the state space that our control input can directly influence or "push."
- : This term represents the directions the system can be pushed in after one infinitesimal time step. The system's internal dynamics, represented by , act on the initial push from .
- : This represents the directions reachable after such steps.
The columns of the entire controllability matrix collectively span all the directions in the state space that can be reached by applying some control input.
To get a formal introduction to this matrix and the test that uses it, please watch the first part of the following video.
Controllability of a Linear System: The Controllability Matrix and the PBH Test
This video from Christopher Lum provides a very clear, step-by-step introduction to constructing the controllability matrix and the condition for controllability.
Watch from 04:00 to 09:20. The video formally defines the controllability matrix and explains how to build it. It then introduces the rank condition and works through a straightforward 2D example. Notice the mention of the ctrb function in MATLAB, which is a practical tool you will use.
The Controllability Rank Condition
As the video explained, the definitive test for controllability is the rank condition.
A system is controllable if and only if the rank of its controllability matrix is equal to , the number of state variables.
From your background in signal processing and linear algebra, you know that the rank of a matrix is the number of linearly independent columns (or rows) it contains.
- If , the columns of span the entire n-dimensional state space. This means there are no "hidden" or "unreachable" directions. We can steer the state anywhere.
- If , the matrix is "rank-deficient." This means the columns only span a subspace of the full state space. There are directions the control input can never influence, making the system uncontrollable.
For a formal statement of this crucial theorem, please review the following document.
This PDF from the University of Toronto provides the formal theorem statement.
First, read the paragraph at the end of section 2.1 (starts with '(ii) Let CAB denote...'). This defines the controllability matrix, which they call CAB. Then, skip to section 2.2 and read 'Theorem 2.2'. This is the formal statement of the rank condition we are discussing.
A Visual Example
Let's solidify this with a clear, static example. The image below shows the calculation for two different third-order systems.

Let's trace Example 1:
- Identify A and B: The system matrices are given. .
- Form the Matrix: We need to compute .
- is given:
- Construct :
- Check the Rank: We can find the rank by checking for linear independence. The determinant of this matrix is non-zero (), which for a square matrix means it has full rank.
- Conclusion: Since and , the system is controllable.
Physical Intuition Behind the Rank Test
Now, let's connect this mathematical test back to the physical world. The following examples show how the structure of the system and its actuators directly impacts the rank of the controllability matrix.
Controllability of a Linear System: The Controllability Matrix and the PBH Test
Let's return to Christopher Lum's video. He presents a brilliant sequence of examples based on a 2D mass-spring system that builds intuition for what makes a system mathematically uncontrollable.
Please watch the following segments: Uncontrollable System (10:56 - 17:38): An actuator can only apply force horizontally. Intuitively, it can't control vertical motion. Watch how this physical limitation results in a rank-deficient controllability matrix. Making it Controllable (17:38 - 22:13): A second actuator is added for vertical force. See how this changes the B matrix and makes the controllability matrix full rank. Subtle Case (22:13 - 28:50): A single actuator is mounted at a 45-degree angle, applying force in both directions. The video shows that this system is still controllable and uses MATLAB to confirm the rank, demonstrating a practical workflow.
These examples beautifully illustrate the link between the physical system and the abstract mathematics:
- An inability to actuate a certain part of the system (like the vertical motion in the first example) manifests as zero-rows in the controllability matrix, leading to a rank less than .
- Adding more actuators (or placing them more effectively) adds more non-zero entries and linearly independent columns to , increasing its rank and potentially making the system controllable.
Test your understanding!
Consider a simple two-state system:
Is this system controllable? Follow the steps to compute the controllability matrix and check its rank.
Show answer
-
Identify A, B, and n:
We have the matrices and , and the number of states is . -
Form the Controllability Matrix:
We need to compute .- is given: .
- Next, compute :
-
Construct :
-
Check the Rank:
The two columns, and , are linearly dependent (they are identical). Therefore, the rank of is 1. -
Conclusion:
Since , which is less than , the system is not controllable.
Conclusion
In this lesson, we have established the definitive mathematical test for controllability, a critical step in control system design.
Key Takeaways:
- The controllability matrix captures all the state-space directions reachable by the control input.
- The rank condition provides a clear, binary answer: the system is controllable if and only if .
- This test can be performed by hand for small systems or with software like MATLAB (using
rank(ctrb(A,B))) for larger, more complex systems like your inverted pendulum.
Preview of the Next Lesson:
We now have a tool to answer the question, "Can we control the state?" But this assumes we know what the state is. In many real systems, we can't measure every state variable directly (e.g., measuring velocity might be difficult or expensive, while position is easy). This raises a new question: "Can we determine the full state of the system by only looking at its outputs?" This is the question of observability, the dual concept to controllability, and it will be the subject of our next lesson.