With some simple term re-writing and by letting x1&equals;θ1, x2&equals;θ2, x3&equals;θ&period;1, x4&equals;θ&period;2 the equations of motion can be converted into state space form, that is x&period;&equals;A⋅x&plus;B⋅u.

The system defined in the previous section can be controlled so that the inverted pendulums remain vertical on top of the cart, that isθ1&equals;θ2&equals;0,using a state-feedback control strategy provided the system is: (1) controllable by the input, and (2) the states x1 and x2 can be measured directly

Even though the generic rank of the above matrix is 4 (i.e. matrix is generically full rank), we cannot say the system is controllable without verifying the conditions upon which the determinant of the controllability matrix becomes 0. For this system, the determinant becomes 0 when l1&equals;l2. From this we can conclude that the system is controllable if the lengths of the inverted pendulums differ from each other.

2. 2 Designing a State-Feedback Controller

Assuming we have prior knowledge of the desired location of the closed-loop poles for our system, we can use the ControlDesign[StateFeedback][PolePlacement] command to calculate the state feedback gain for a single-input system.

For this design, let us assume that the desired location of the closed-loop poles are:

We can obtain the closed-loop state-space matrices using the ControlDesign[StateFeedbackClosedLoop] command. Then we can verify that the closed-loop system has its poles located at the desired pole locations.

At this point, we can simulate the closed-loop system to verify if the controller that we designed is able to stabilize the inverted pendulums on the cart. Since the controller was developed symbolically we can perturb any number of the system parameters. Doing so, will give us a sense of the controller's robustness to parameter variations.

Investigating the Closed-Loop Response Simulation

Parameters

Value

Mass of cart M

Mass of pendulums m

Length of pendulum 1 l1

Length of pendulum 2l2

Gravity g

9.81

3. Observer-Based Control Design

The state-feedback controller which was designed in the previous section assumed that the states x1 and x2 are measured directly. This is not practical in many situations, and consequently control designers must turn into observer-based control design to control their systems. Observer-based control design makes use of an observer module to estimate the states. It requires the system to be observable in addition to being controllable.

3. 1 Determining Observability

This section will examine the observability of the system under the following conditions: (1) x1is measured andx2is not, (2)x2is measured andx1is not, and (3)x1andx2are measured.

Since the observability matrix is calculated symbolically, knowing that the matrix is generically full rank does not provide us with enough information to say that the system is observable for all possible values of parameters. We must determine for what parameter values the determinant of the observability matrix becomes 0. For this example, the system is observable for all values of the parameters.

The observability matrix is full rank. Clearly, the system is observable when both angles are measured, as well.

3. 2 Designing an Observer-Based Controller

In section 2.2, we showed how the ControlDesign toolbox could be used to design a state-feedback controller when both angles are measured. In this section, we will show how the ControlDesign toolbox can be used to design an observer-based control system when only one state, let us say x1, is measured.

According to the separation principle, for linear time invariant systems, the state feedback and state observer can be designed independently. We select the desired poles for the observer error dynamic to be about 5-10 times further away from the j&omega; axis than those of the state feedback gain design. This ensures that the state feedback poles are the dominant poles of the system.

For this example, the following values for the state-feedback poles and the observer poles were chosen. If you will recall, the state feedback poles that were chosen here are the same as those used in the state-feedback control design section.

Using the ControlDesign[ControllerObserver] command, the closed-loop system of the state-feedback controller and observer can be obtained. We can verify that closed-loop system poles match the desired pole locations.

We modify the state-space representation of the closed-loop system so that there are 8 outputs corresponding to all the states of the closed-loop system. The first four outputs represent the state outputs, while the last four outputs represent the observer error.

As in the previous section, we can simulate the closed-loop system to verify if the observer-based controller that was designed can stabilize the two inverted pendulums on the cart system.

Investigating the Closed-Loop Response Simulation to Observer-Based Control Design

Parameters

Value

Mass of cart M

Mass of pendulums m

Length of pendulum 1 l1

Length of pendulum 2l2

Gravity g

9.81

4. LQG Control Design

We design the LQR controller using the ControlDesign[LQR] command. First, using the ControlDesign[ComputeQR] command, we compute the values of the weighting matrices Q and R based on a desired closed-loop time constant.

We modify the state-space representation of the closed-loop system so that there are 8 outputs corresponding to all the states of the closed-loop system. The first four outputs represent the state outputs, while the last four outputs represent the observer error.

Maplesoft™, a subsidiary of Cybernet Systems Co. Ltd. in Japan, is the leading provider of high-performance software tools for engineering, science, and mathematics. Its product suite reflects the philosophy that given great tools, people can do great things.