Challenge

Project - Speed Control of a Direct Current (DC) motor

Simulink Model 

Script File 

% DC_Motor_Parameters
J=0.01; % Moment of inertia of the rotor given in kg.m^2
Bm=0.1; % Motor viscous friction constant given in N.m.s
Km=0.01; % Back EMF constant given in V/radians/s
Kt=0.01; % Motor torque constant given in N.m/A
Ra=1.0; % Resistance in armature circuit given in Ohms
La=0.5; % Inductance in armature circuit given in Henry
 
% For poles placement and PID Controller
fn=1; % Frequency given in Hz
wn=2*pi*fn; % Angular velocity given in rads/sec
zeta=0.5; % Damping ratio is 0.5 (underdamped system)
k_dc=1; % The DC gain of this system is one
s=tf('s');
G= k_dc*wn^2/(s^2+2*zeta*wn*s+wn^2); % Transfer function of the system
A=[-Bm/J Kt/J;-Km/La -Ra/La]; % Design of A matrix
B=[0;1/La]; % Design of B matrix
[p,z]=pzmap(G) % A syntax used to return the system poles and zeros
pzmap(G,'b') % To locate the system poles on a pole-zero map
grid on
p=[p(1);p(2)];% p matrix
k=place(A,B,p) % Command used to determine kp and kd of the controller
ki=0.0; % Integral gain
 
Command Window
 
 
 
Reference Speed 
 
 
Case I (kp and kd are identified from pole placement, and ki=0)
 
 
Case II (kp=1200, ki=8000, kd=10)
 
 
Observation
 
This project aims to use a PID controller to regulate the DC motor speed at the desired reference speed (step). The kp and kd were initially determined from pole placement using the "place" command in Matlab, and the system was tested against stability using the "pzmap" command in Matlab (poles lie on the left s-plane and the system is stable). In this case (case I), there was a very high steady-state error and overshooting and a slightly high settling time. Therefore, the kp, kd, and ki gains were varied several times, until reaching a condition that satisfies the design constraints (case II). In case II, the kp=1200, ki=8000, and kd=10. The use of these gain values has resulted in a steady-state error of <1%, an overshooting of <5%, and a settling time of <5s.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.