Challenge

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

Project: Speed Control of a DC motor

DC motor Parameters:

J=0.01; %Moment of Inertia of the rotor-kgm^2
B=0.1; %Motor viscous friction constant-Nms
Km=0.01; %Back EMF constant-V/rad/s
Kt=0.01; %Motor Torque constant-Nm/A
Ra=1; %Armature resistance-ohm
La=0.5; %Armature Inductance-Henry
PID Design:
Basic eqn: u(t) = Kp*e(t) + Ki*int(e(t)dt) + kd*diff e(t)/dt
Modified eqn: Vs = Kp*(wref - w) + Ki*int((wref - w)dt) - Kd*Ia
Matrix A and B are found from the state space model of a DC motor,

(d/dt)*[teta_dot;i] = [-B/J Kt/J;-Km/La -Ra/La]*[teta_dot;i] + [0 1/La]*Vs

y = [1;0] * [teta_dot;i]

%Matrix - Plant model
A=[-B/J Kt/J;-Km/La -Ra/La];
C=[0;1/La];
%Poles
Matrix P is found from the open loop Transfer function of the DC motor denominator
Eqn: w(S)/Vs(S) = Kt/(J*La(S^2) + J*Ra+B*La(S) + B*Ra+Kt*Km)
P=roots([J*La J*Ra+B*La B*Ra+Kt*Km]);
K=place(A,C,P);
K= -1.4606e-15, 2.2204e-16
Script:
DC_motor_parameters.m
J=0.01; %Moment of Inertia of the rotor-kgm^2
B=0.1; %Motor viscous friction constant-Nms
Km=0.01; %Back EMF constant-V/rad/s
Kt=0.01; %Motor Torque constant-Nm/A
Ra=1; %Armature resistance-ohm
La=0.5; %Armature Inductance-Henry
%Matrix - Plant model
A=[-B/J Kt/J;-Km/La -Ra/La];
C=[0;1/La];
%Poles
P=roots([J*La J*Ra+B*La B*Ra+Kt*Km]);
K=place(A,C,P);
DC_motor_plot.m
close all;
subplot(321);plot(out.time,out.vs);grid;title('Supply Voltage (V)');
subplot(322);plot(out.time,out.vb);grid;title('Back EMF (V)');
subplot(323);plot(out.time,out.ia);grid;title('Armature Current (A)');
subplot(324);plot(out.time,out.t);grid;title('Motor torque (N-m)');
subplot(325);plot(out.time,out.w);grid;title('Speed (rad/s)');
Model 1:
Scope:
Plot:
Model 2:
After changing Kp, Kd, Ki:
Kp=10, Kd=0.13, Ki=24
Scope:
Plot:
Summary:
Initially, the DC motor model was made and the values for PID design were calculated and the PID model was incorporated into the DC motor model. The supply voltage was set to 30 and the simulation time was 10s. The solver was set to Fixed-type and to be solved by ode4(Runge-Kutta method). The parameters of the dc motor were given. The poles were calculated using the place function and Ki was set to 1 and the model was run. The result was unstable and the required constant speed was not achieved. So, the next step was to iterate the values of Kp, Kd, and Ki to get a stable speed. After many iterations, the required stable speed was achieved with settling time <2s, Overshoot<5%, and Steady state error<1%. The found values were Kp=10;Kd=0.13;Ki=24;
Therefore, the speed of the dc motor was controlled and made to run at the desired speed.
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.