Project 2 - Speed Control of a Direct Current (DC) motor
Simulink model for DC motor:

Over all Simulink block:

%design parameters
Jm=0.01;
Bm=0.1;
Km=0.01;
Kt=0.01;
Ra=1;
La=0.5;
%load the Dc motor characteristcis
run dcmotor_parameter.m;
%PD design
%A = [-B/J kt/J; -km/La -Ra/La]
%B = [0; 1/La]
A = [-Bm/Jm Kt/Jm ; -Km/La -Ra/La];
B = [0; 1/La];
%pole placement
fn=1;
wn=2*pi*fn;
zeta=0.5;
p1=-zeta*wn+wn*(zeta^2-1);
p2=-zeta*wn-wn*(zeta^2-1);
P=[p1;p2];
K = place(A,B,P)

Output Waveform:
speed reference given as 5:

speed reference given as 55:

By optimising the Ki value, the Steady state response error is minimised.
