0

I have been designing a controller for a motion system. The controller contains a gain, Proportional integrator(PI) and a lead filter in series. I have tuned the gain of the controller manually to obtain a desired bandwidth(cross over frequency). The frequency of lead and PI are based on rule of thumb(for lead, bandwidth/3 in the numerator, bandwidth*3 in the denominator and for integrator its bandwidth/5). How can I decide on the gain of the controller to obtain automatically just by mentioning desired bandwidth. Is there any rule of thumb to be followed? How does it change according to sampling frequency?

2 Answers2

0

PID controller design is an inherently difficult problem. You can't do it via simple matters unless your system allows you to derive certain expressions due to simplicity.

One way to do it is to resort back to nonconvex nonsmooth optimization algorithms such as Matlab's own systune or HIFOO or some other tools that solve for "a" solution but not "the" solution.

There are examples for loop shaping and bandwidth constraints on the documentation.

percusse
  • 3,006
  • 1
  • 14
  • 28
0

Well you could simply use your rules of thumb regarding for the I action and the lead filter. Then you simply check the bode diagram of the open-loop. Check the magnitude of the system at the frequency where you want your bandwidth. Then you can simply calculate how much gain you need to apply to move the point upwards to 0 dB, the bandwidth.

Furthermore, the rules of thumb assume a high enough sampling frequency. But, in general, if the sampling frequency becomes lower your gain also will be lower, however the frequencies of the I action and the lead filter will also change.

-edit-

I made a small script for you. The script is self explaining.

The same methods can be applied in the discrete domain. Furthermore, I would not design the controller in discrete domain, but rather in continuous time-domain. Following, I would use a discretization method to convert the controller from continuous time to discrete time, such as the Bilinear transform. http://nl.mathworks.com/help/control/ref/c2d.html provides information how you can do this in Matlab.

In addition, I would like to recommend this tool for you, http://cstwiki.wtb.tue.nl/index.php?title=Home_of_ShapeIt

clear all;
close all;
clc;

%% Initialize parameters
s = tf('s');

% Mass of plant
m = 10;

% Desired bandwidth
BW = 10;

%% Define plant
P = 1/(m*s^2);

%% Define filters
% Lead lag filter
f1 = (1/(2*pi*BW/3)*s + 1)/(1/(2*pi*BW*3)*s + 1);

% Integrator
f2 = (s + 2*pi*BW/5)/s;

% define Controller
C = f1*f2;

%% Determine gain
% Open loop
OL = C*P;

% Evaluate at bandwidth and get magnitude
mag = abs(evalfr(OL,2*pi*BW));

% Desired gain is 1/mag
C = 1/mag*C;

% Recalculate open loop
OL = C*P;

% Evaluate at bandwidth, magnitude should be 1
sprintf('Magnitude at bandwidth: %f\n',abs(evalfr(OL,2*pi*BW)));

%% Compute other stuff
% Sensnitivity
SS = 1/(1 + OL);

% Closed loop, complementary sensitivity
CL = OL*SS;

% Process sensitivity
PS = P*SS;

% Controller sensitivity
CS = C*SS;

%% Create some plots
% Open loop
figure(1);
bode(OL);
title('Open loop');

% Nyquist
figure(2);
nyquist(OL);

% Other sensitivities
figure(3);
subplot(2,2,1);
bodemag(CL);
title('Closed loop');
subplot(2,2,2);
bodemag(SS);
title('Sensitivity');
subplot(2,2,3);
bodemag(PS);
title('Process sensitivity');
subplot(2,2,4);
bodemag(CS);
title('Controller sensitivity');

% Step
figure(4);
step(CL);
title('Step response');
WG-
  • 1,046
  • 2
  • 14
  • 27
  • I am trying to compute gains for a discrete system with the same controllers as mentioned above. I am not finding enough material to compute analytically. Can you give some insights on the same? In case of s-domain i could find the gain by substituting s by j*w. I need help in finding gain of a discrete function(z-domain). I tried by substituting z by exp(j*w) but it doesnt give expected results. Any help will be appreciated.. – Somanna Thapanda Mar 07 '16 at 17:11