In this assignment, I'm going to design a system using lead compensator with the help of root locus and check the final results using Matlab.
The system I'm going to design is as follows:
The damping ratio of closed loop poles is 0.5 and natural undamped frequency 2 rad/sec. It is desired to modify the closed loop poles so that natural undamped frequency becomes 4 rad/sec without changing the damping ratio.
Before adding a compensator, lets check the root locus of the system and its response first. We can simply do it by using Matlab command line.
>> s = tf('s');
>> G = 4/(s*(s+2));
>> % Plot root locus
>> rlocus(G)
>> % closed loop transfer function (unity feedback)
>> sys0 = feedback(G,1);
>> % Plot root locus
>> rlocus(sys0)
From the closed loop poles, we can see that our system's damping ratio is 0.5 and undamped frequency of 2 rad/sec which is the same as the given system characteristics.
>> % Plot step response
>> step(sys0)
Our goal is to add a compensator to meet the system requirements (which are 0.5 for damping ratio and 4 rad/sec for undamped frequency).
We can easily find our desired closed loop poles by using the system requirements:
Then, I'm going to draw our desired closed loop poles on the root locus and calculate the necessary angles to find the angle of deficiency.
Below are the calculations of the angle of deficiency:
If we choose the zero of the lead compensator at s = -2 so that it will cancel the plant pole at s =-2, then the compensator pole must be located at s =-4.
Lead compensator is represented by the following transfer function:
So we can calculate the gain K by using the magnitude condition as follows:
Now, we get our lead compensator transfer function. Lets check again our step response of the new compensator system.
>> original_sys = feedback(G,1);
>> % Compensator Gc
>> Gc = 4*(s+2)/(s+4);
>> % Unity feedback with compensator
>> compensated_sys = feedback(Gc*G,1);
>> % Plot step response
>> step(original_sys, compensated_sys)
We can clearly see that our new system is better than the previous uncompensated one. Now, lets check the characteristics of the response.
You can see that our new system has the undamped frequency of 4 rad/sec and damping ratio of 0.5 which meets the system requirements.
The static velocity error constant for the compensated system can be calculated as:
The steady state error is then calculated as:
There are many ways to achieve the system requirements such as adding a PID controller or others. In this system, I'll use the Lead Compensator. We can conclude that our control system design meets the system requirements by adding the lead compensator.