Guy on Simulink

Simulink & Model-Based Design

Plant Identification Using the PID Tuner (Part Deux)

In a previous post, we highlighted how the system identification capability of the PID Tuner app can help identifying an experimental plant. Today we see another very useful application: Identifying a linear plant from a model that does not linearize.

Not all models linearize easily

Most users who tried linearizing complex Simulink models know that it is often not an easy task. For a Simulink model to be realistic, it must have discontinuities like saturations, quantizations, ON/OFF controllers, etc. All those elements are known to linearize to zero, and consequently make it impossible to apply classical control design techniques.

When linearization fails, system identification can help.

The Challenge

To highlight this functionality, I picked a demo model which I thought would be challenging for the PID Tuner: sf_electrophydraulics: a PWM Driven Hydraulic Servomechanism.

PWM Driven Hydraulic Servomechanism

This model already contains a PI controller doing a decent job, so I was curious to see if the PID Tuner would be able to do better.

As expected, I opened the dialog of the PID block, clicked the "Tune" button, and the PID Tuner app opened with a badge saying: Plant cannot be linearized.

The model cannot linearize!

Identifying a plant from a simulation

In the PID tuner, I clicked on the link to identify a plant

Identify Plant

and I choose to obtain my data by simulating the model

Simulate Data

Under the hood, the app will open the loop and replace the PID block by a source signal to excite the system. Since I know that the output of the controller is a duty cycle percentage, I specified that this input should be a step from 0% to 90%.

Design a Step Input

I clicked the Simulate button, and obtained the following data. As I would expect based on my knowledge of the system, a 90% duty cycle results in a motion of ~18mm.

Design a Step Input

I clicked the Apply and Close buttons to go back to the Plant Identification tab. Here I can try different structures for the plant model, and use the adjustors to manually tweak the plant model:

Identifying the plant Plant

Designing the Controller

I saved the plant and went back to the PID Tuner tab. I cranked up the Response Time and Transient Behavior sliders to get something aggressive, and I clicked the Update Block button to apply the gain values to the block.

Tuned Controller

When I simulate the model with this tuned controller, I can only realize that the controller designed using the PID Tuner app is tracking the set point as good as the original controller.

Simulation Response

Now it's your turn

I have to admit, I am really impressed by how easy it was to obtain a plant model and a controller for this model. Given all the complex discontinuities in this model, I was certain it would require more work to design a controller for it.

Give this new functionality a try, and let us know what you think by leaving a comment here.

  • print
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.