0% found this document useful (0 votes)
44 views7 pages

Ece206 Mini Project Pd-Picontroller Design

Uploaded by

api-595474257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views7 pages

Ece206 Mini Project Pd-Picontroller Design

Uploaded by

api-595474257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

ECE206 Project Option #2

Proportional Derivative (PD) and Proportional Integral (PI)


Controller in a Negative Feedback System

______________________________________________________________________
(1) Up to 2 students per group
(2) Follow the description in the handout to complete the project.
(3) No sharing of MATLAB codes and SIMULINK models with other groups. Your
work won’t be graded without independent work statement in your report.
______________________________________________________________________

Design description:
5 s +5
An open loop system is described by H ( s )= 2 .
s + 2 s+5
(1) Design a compensator feedback system using the PD control G( s)=K p + K d s .
Construct the SIMULINK model above and obtain the unit step response of the
closed-loop system. Search for admissible P and D gains to reduce the overshoot
in the unit step response to less than 10 % of the steady state value and settling
time to be no greater than 2 seconds. Validate your design in Simulink.

Overall transfer function with the PD control:

% Method #1 : PD control example using Simulink


%
% open loop transfer function H(s) = (5s+5)/(s^2+2s+5)

%% Call your simulink model using a set of Kp and Kd


%%

Kp = 5;% Supply your Kp.


Kd = 0.25;% Supply your Kd.
DC_gain_adjustment = den_closed(1)/num_closed(1);
sim('open_loop_closed_loop_control_PD'); % open the simulink model.

figure(1)
plot(closed_loop.time, open_loop.signals.values, 'r', closed_loop.time,
closed_loop.signals.values, 'b')
grid, title('open and closed loop system responses – PD control'),
xlabel('time in seconds')
legend('open loop system response', 'closed loop system response')
Simulink model name : open_loop_closed_loop_control_PD.slx

open and closed loop system responses


2
open loop system response
1.8 closed loop system response - PD control

1.6

1.4

1.2

0.8

0.6

0.4

0.2

0
0 1 2 3 4 5 6 7 8
time in seconds

% Method #2 : design using MATLAB script file directly

% ECE 206 Computer project


% Type "help series", "help parallel", or "help feedback" for blocks to
% be combined

clear all
close all

Kp = 1; % proportional gain
Kd = 0.5; % derivative gain

plant = tf([5 5], [1 2 5]); % open loop system G(s)


controller = tf([Kd Kp], [1]); % PD controller
feed_back = 1; % unity feedback
open_loop = series(controller, plant); % construct the open loop
forward path TF
closed_loop = feedback(open_loop, feed_back);

time = 0:0.0001:10; % simulation time in seconds


Y = step(closed_loop, time); % unit step response
DC_gain_adj = 1/Y(end); % get the last value of the output.
figure(1), plot(time, DC_gain_adj * Y), grid, title('output response')
xlabel('time in seconds')

output response of closed-loop system


1.5

1.4

1.3

1.2

1.1

0.9
0 2 4 6 8 10
time in seconds
KI
(2) Design a compensator feedback system using the PI control G(s)=K p + .
s
Search for admissible P and I gains to reduce the overshoot in the unit step
response to less than 10 % of the steady state value and settling time to be no
greater than 2 seconds. Validate your design in Simulink. Worked independently
open and closed loop system responses
2
open loop system response
1.8 closed loop system response - PI control

1.6

1.4

1.2

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25
time in seconds

(3) Discuss the results of the PD and PI controls in your report.


It was found that the provided signal could be replicated
from the existing code with minor changes. I also
attempted to make the PI controller but got stuck.

You might also like