## Model Predictive Control

There are many methods to implement control including basic strategies such as a proportional-integral-derivative (PID) controller or more advanced methods such as model predictive techniques. The purpose of this section is to provide a tutorial overview of potential strategies for control of nonlinear systems with linear models.

A following section relates methods to implement dynamic control with nonlinear models.

#### Exercise

**Objective:** Design a model predictive controller with a custom objective function that satisfies a specific problem criterion. Simulate and optimize a pendulum system with an adjustable overhead cart. *Estimated time: 3 hours.*

A pendulum is described by the following dynamic equations:

where *m _{1}=10* is the mass of the cart,

*m*is the mass of the item carried,

_{2}=1*epsilon*is

*m*,

_{2}/(m_{1}+m_{2})*y*is the position of the overhead cart,

*v*is the velocity of the overhead cart,

*theta*is the angle of the pendulum relative to the cart, and

*q*is the rate of angle change

^{2}.

The objective of the controller is to adjust the force on the cart to move the pendulum mass to a new final position. Ensure that initial and final velocities and angles of the pendulum are zero. The position of the pendulum mass is initially at -1 and it is desired to move it to the new position of 0 within 6.2 seconds. Demonstrate controller performance with changes in the pendulum position and that the final pendulum mass remains at the final position without oscillation. How does the solution change if the mass of the item carried is increased to *m _{2}=5*?

#### Solution

#### References

- Bryson, A.E., Dynamic Optimization, Addison-Wesley, 1999.