cnpcshangbo/FOPD-tuner

How to integrate MATLAB optimization method for tuning?

cnpcshangbo opened this issue · 1 comments

First, we need to figure out what objective function to use for tuning parameters.

There're several options:

  • ITAE
  • Gain and phase margin, Bode loop shaping, flat phase specification
  • ITAE + ITAE (50%gain) + ITAE (150%gain)

What is the function that we want to tune?

  • ITAE
    If we use ITAE as the objective function, we need to make a MATLAB function that can output the ITAE value with inputs of three parameters to be tuned. That means the MATLAB function should be able to call a Simulink model, then fill parameters into the Simulink model, run it and collect the ITAE value.

  • PM (Phase margin)
    If we want to make PM to be minimum, we need to create a MATLAB function that can output the PM. This can be realized by using bode() function in MATLAB. Therefore, PM method is the simplest one which we need to try first.

To-do list:

  • Create objective function;
  • Determine the input value range and output range;
  • Put constrains into optimization script.

How to build the objective function?

% Calculates derivative at crossover frequency
% Output: derivative at crossover frequency
%
% In: 
% variables:
% lambda, ki and kp
% Fractional order: lambda
% Integrator gain: ki
% Proportional gain: kp
%
% constants: wc, phi
% Crossover frequency: wc
% Phase margin: phi.

Next, we need to figure out the process for calculating the derivative at crossover frequency is in the article. Let's consider the three specifications for flat phase.
image