As an exercise in the use of MRAC, the MIT rule (explained in the theory section) was applied to a driven pendulum system. The system contained a vertically oreinted bar whose pivot point was attached to an encoder, so that the angle and angular velocity could be measured. To the end of the bar, a DC motor and propellor were affixed. When voltage was applied to the motor, the propellor spin and pull the bar up. The goal was to command the bar to a specified angle. A diagram of the system is given below:

Newton's laws and conservation of angular momentum were used to derrive the equations of motion. The equations and resulting transfer function for the linearized system are given below:

The controller for this system will take the form:

The MIT rule will be used to form update rules for the adaptive parameters in the controller. Following the same process as outlined in the theory, the equation for the error and cost function are written. From these, an equation for updating theta can be written as a function of the sensitivity derivative.

It is then assumed that the controller has both an adaptive feedforward (*Theta1*) and an adaptive feedback (*Theta2*) gain. To derive expressions for the sensitivity derivatives associated with these parameters, the error function must be restated to invlude *Theta1* and *Theta2*. The equation for the error is first rewritten as the transfer function of the plant and model multiplied by their respective inputs. The input *Uc* is not a function of either of the adaptive parameters, and therefore can be ginored for now. However, the input *U* can be rewritten using the feedforward and feedback gains. This can be used to derrive an equation for *Yplant*.

The error can now be written with the adaptive terms included. Taking the partial derivative of the error with respect to *Theta1* and *Theta2* gives the sensitivity derivatives. Remember that *Uc* does not include either parameter, and therefore is inconsequential when evaluating the derivative.

The sensitivity derivatives obtained contain the parameters from the plant. The premise of design with MRAC assumes that the plant characteristics are not absolutely known. This seemingly places the design process at a dead end. However, the goal was to make the plant approach the model. If the model is close to the actual plant, the model characteristics can be substitued for the plant characteristics, giving the following sensitivity derivatives:

Then, applying the MIT rule, the update rules for each Theta can be written. The block diagram for the system with the derrived controller is shown below. Note that the plant input and output measurements are filtered BEFORE being multiplied by the error and gamma.

This system was modeled in simulink. The open loop step response plotted below illustrates the need for control. The settling time for the system is upwards of 100 seconds! The reason for the persistent oscillations is a lack of damping in the system.

The controller designed above was implemented. The Simulink block diagram is shown below, along with the response to a step command of 35 degrees. The transfer function implemented does not exactly mach the transfer function stated earlier. There are alos several gains added around the plant. This is because the system stated earlier assumed an input of a commanded angle. Here, the plant must receive a voltage command.

The plant response obviously doesnt match the reference model. In fact, the plant almost goes unstable. This response is largely due to the near instability of the open loop system. Tuning of gamma and changing the refernce model did not allieviate this problem. In an unconventional attempt to kill the oscillations, proportional and derivative control was applied across the plant. The resulting simulink model and output are shown below.

The reference model was chosen to have a settling time of 3 seconds and a damping ratio of .707, which is an industry accepted standard. The plot shows the response for several different values of gamma. As can be seen, when the value of gamma is increased, the system responds much faster, but threatens to become unstable. A smaller value of gamma leads to longer adaptation times, but a less volatile response.

As a note, the practice of adding PD control across the plant is not generally accepted in MRAC design. There is an inherit problem with MRAC models in that the parameters continue to update even when the proper values are reached, resulting in oscillation about the set point. However, the conventional was of handling this problem are to make the input signal "rich" or to add a dead zone which kills updating when the error is within a given limit.