Untitled

Housekeeping

close all; clear; clc; s = tf('s');

The goal here is to demonstrate, visually, the effects of lead and lag controllers on a plant's Bode Plot

First we set up our Plant and our desired frequency range:

Plant = (2)/(s*(s+2)*(s+5));
 
w = (10^-3):(0.01):(10^3);

Next we generate our Lead Controller in the frequency domain:

where: , ,

and break frequencies of: ,

Lead_K = 1;
Lead_Zero_Break_Freq = 10^0;
Lead_Pole_Break_Freq = 10^1;
Lead_tz = 1/Lead_Zero_Break_Freq;
Lead_tp = 1/Lead_Pole_Break_Freq;
 
Lead = (s*Lead_tz+1)/(s*Lead_tp+1);

and then our Lead Controller in the frequency domain:

, where:

and break frequencies of: , and,

Lag_K = 1;
Lag_Zero_Break_Freq = 10^-1;
Lag_Pole_Break_Freq = 10^-2.5;
Lag_tz = 1/Lag_Zero_Break_Freq;
Lag_tp = 1/Lag_Pole_Break_Freq;
 
Lag = (s*Lag_tz+1)/(s*Lag_tp+1);

Now let's examine the Bode Plots of our Plant, our Lead Controller, and their Combination!

f1 = figure();
f1.Position = [0 0 1300 800];
 
bode(Plant, w), hold on;
bode(Lead, w), hold on;
bode(Lead*Plant, w), hold on;
legend('Plant', 'Lead', 'Lead*Plant', 'Location', 'northwest', 'FontSize', 10);

Next let's examine the Bode Plots of our Plant, our Lag Controller, and their Combination!

f2 = figure();
f2.Position = [0 0 1300 800];
 
bode(Plant, w), hold on;
bode(Lag, w), hold on;
bode(Lag*Plant, w), hold on;
legend('Plant', 'Lag', 'Lag*Plant', 'Location', 'northwest', 'FontSize', 10);

Lastly let's examine the effects on the Bode Plot of the Lead Controller, Lag Controller, and the whole Lead-Lag Controller!

f3 = figure();
f3.Position = [0 0 1300 800];
 
bode(Plant, w), hold on;
bode(Lead*Plant, w), hold on;
bode(Lag*Plant, w), hold on;
bode(Lead*Lag*Plant, w), hold off;
legend('Plant', 'Lead*Plant', 'Lag*Plant', 'Lead*Lag*Plant', 'Location', 'northwest', 'FontSize', 10);