Challenge

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

%DC Motor

% This file contains the design parameters for designing the DC motor
J = 0.01; %Moment of inertia of the rotor in kg-m2
B = 0.1; %Motor viscous frition constant in N-m-s
Km=0.01; %Back emf constant in v/rad/s
Kt = 0.01; %motor torque constant in N-m/amp
Ra=1; %Armature resistance in ohm
La=0.5; %Armature inductance in Henries
%Pole Placement Method
m=100.0; % mass of spring mass system
k=3944.0; % stiffness constant of spring mass system
%design parameters
zeta=0.5;%underdamped system design
%Equivalent to wn
wn = 6.2832; %sqrt(k/m) rad/seconds
fn=1; %wn/(2*pi)
%desired poles
p1=(-zeta*wn)-wn*sqrt(zeta^2-1);
p2=(-zeta*wn)+wn*sqrt(zeta^2-1);
p=[p1;p2];
% A and B Matrix
A=[0 1;-k/m 0];
B=[0;1/m];
% pole placement
K=place(A,B,p);
%best values of Kp,Kd are obtained by using pole placement command
Kp=3.86;
Kd=100;
Ki=armature current;
% dynamics
%x1_dot=x2
%x2_dot=(-k/m)*x1+(1/m)*u
%x2_dot=(-k/m)*x1+(1/m)*(Kp*(x1ref-x1)-Kd*x2+Ki*int(x1ref-x1)*dt)
%Plots
subplot(321);plot(out.time,out.Vs);grid;title('Supply Voltage(V)');
subplot(322);plot(out.time,out.ia);grid;title('armature current(A)');
subplot(323);plot(out.time,out.torque);grid;title('Torque(N-m)');
subplot(324);plot(out.time,out.speed);grid;title('Speed(rad/s)');
subplot(325);plot(out.time,out.back_emf);grid;title('Back EMF(V)');
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.