MATLAB Answers

Pedja
0

Simulink PID autotuning problem

Asked by Pedja
on 13 Apr 2014
Latest activity Answered by jashandeep kaur on 11 Mar 2017
Hi, I have tried simple PID auto tuning function, but I'm getting rather strange result. I have attached mdl file, so You can maybe point to me where I'm doing wrong.
Pete
P.S. Sorry if question sounds stupid, I'm a newbie in Matlab/Simulink world

  0 Comments

Sign in to comment.

3 Answers

Answer by Arkadiy Turevskiy on 16 Apr 2014
 Accepted Answer

There is nothing wrong or strange with your model. You did not provide op_trim1 operating point that your model uses, so I just initialized the integrator in PID block at 6.37 (I can explain how I did this if you want) - basically to get rid of a large initial transient.
Once I did that, and ran the simulation with your PID gains, I got a reasonable response:
Another note: as gravity is somethign that does not change much, you can just add a constant feedforward term to your controller to compensate for it. Then, even if gravity changes a bit as you change locations, PID will do a good job compensating for that:

  0 Comments

Sign in to comment.


Answer by Arkadiy Turevskiy on 16 Apr 2014
Edited by Arkadiy Turevskiy on 16 Apr 2014

Ok, here is how I got that integrator initial condition.
First I added Trim Output Constraint on the "height" signal. To do that, right click on the signal, and specify Trim Output Constraint, as shown below.
Next, launch Linear Analysis Tool:
Now, we want to trim the model:
Click to specify the trim conditions:
All states should be in steady state:
The output (height) should be at 0:
Click "trim". Tool computes the operating condition op_trim1. Examine it to see the value for Integrator in the PID Controller:
All of this can also be done with a few lines of code:
model = 'Proba_3';
opspec = operspec(model);
opspec.Outputs(1).Known = true;
findop(model,opspec)

  0 Comments

Sign in to comment.


Answer by jashandeep kaur on 11 Mar 2017

may i know how does auto tunning take place?how does controller calculate the desired values of P and I?is there any method or algo?

  0 Comments

Sign in to comment.