Controller and Controllability


A system is said to be controllable if for all vector pairs (x
d, xa) in Rn there exists a finite time T and a command u defined on [0,T] such that when the command u is applied the solution x(t) starting from x(0)=xd gives x(T)=xa.

In layman’s terms, a system is controllable if you can start at A and apply commands to finish at B. Obvious, eh?
Mathematically speaking, the system is controllable
iff the controllability matrix

Pasted Graphic

is rank

PID controller

Every system has a transfer function (even if we don't know it and can't write it down) whereby an input u has an output y. The PID is a transfer function that places the roots of the system’s transfer function/PID function in a stable location, i.e. the real part of the roots is negative.


Pasted Graphic 1

is the closed-loop system’s transfer function, where V is the Laplace transform of the external stimulus, H is the system, Y is the output, and G(s) is the PID.

Pasted Graphic 2

By choosing K
p, Kd, and Ki, you’re placing the roots of the closed-loop transfer function strictly to the right of the y-axis. These roots can be chosen mathematically in advance, if you have some knowledge of the system, or empirically after-the-fact.
For even more on PIDs, the ball and beam, and Matlab,
click here.

LQR controller

An LQR controller seeks to minimize the quadratic equation:

Pasted Graphic 4

by using the Riccati equations:

Pasted Graphic 5

Which gives the ideal control u=-K*x with:

Pasted Graphic 6

Where Q and R are the relative weights of the cost of the control, and N is usually [0].

The lower R is, the more it costs to get to the destination but the faster you get there, and vice-versa. The individual elements of Q are weighted, meaning that we can place a higher priority on one variable, for instance, due to the geometry of my table, when I turn in two servo mode I get better performance when Q=[10 0 0 0; 0 1 0 0; 0 0 10 0; 0 0 0 1]. In this example, R=1 gives a quite good response rate that's not so fast that the table shakes itself apart but not so slow that the controller takes forever and a day to steer the ball to its destination.

For a better explanation of how the LQR controller works on the ball and beam system,
click here.

For an explanation of the Matlab function,
click here.

Geometric controller

The geometric controller is a much more complicated, much more idealistic controller than the other two above. It's advantage, however, is that we get to define the ball's behavior in a very strict sense.

position and velocity vs. time, velocity planning
First we define a ball trajectory. In this case, we specified that the ball must be motionless at the beginning, motionless at the end, and must have null acceleration at the end (i.e. the table is flat).

This gives us a position vs. time trajectory and a velocity vs. time trajectory. In the graph at right, the red curve is the position, the green curve the velocity, the x-axis is time, and the y-axis is in meters.

Once we have these trajectories, we can plot the behavior of the table to ensure that the table doesn't have to react too quickly in order to follow our curves

control vs. time, trajectory planning
We can see this in the graph at left. The table starts off at a severe inclination, but mellows out and at the end finishes perfectly at 0.

The x-axis is time and the y-axis is deplacement of the pushrod, which direcly correlates with the table's tilt angle.

velocity curves, family of, trajectory planning
Finally, this gives us a family of curves that the ball will try to follow. If the ball overshoots one curve, it will still fall on another one. It will simply follow the new curve, instead of trying to catch up to the old one.