Challenge

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

Modelling of a DC Machine

A DC machine can function as generator and motor.

A DC machine has a rotor with an armature winding providing the electrical circuit.

It also has a stator with field winding serving as a magnet with energized.

While operating in generator mode, a prime mover is coupled to the rotor allowing it to rotate in magnetic field created by the field winding.

This mechanism induces an electromagnetic force (emf) in the conductors on the rotor and contributes to voltage generation.

While operating in motor mode, the electrical energy supplied to the armature winding and the field winding contributes to rotating magnetic field that forces the rotor to rotate, which generates a mechanical torque.

Modelling of a DC Motor

J = Moment of Inertia of Rotor.

B = Damping Coefficient.

R = Armature resistance

L = Armature Inductance

Vb = Back emf constant

KT = Motor Torque Constant

V = Supply Voltage

Motor Torque T = KT * I

Back EMF Vb = Kb * ω = Kb * dθ/dt

Steps to find equation

As per Kirchhoff’s Voltage Law

V = IR + L (di/dt) + Vb

L (di/dt) + IR = V - Kb (dθ/dt) ----equ-(a)

As per Newtons Law

J (d2θ/dt2) + B (dθ/dt) = KT * I ----equ-(b)

Converting above equations to S domain (Laplace Transform)

Laplace of equ – (a)

LsI(s) + RI(s) = V(s) - Kbsθ(s) ----equ-(c)

I(s) = V(s) - Kbsθ(s)/Ls + R ---- equ-(d)

Laplace of equ – (b)

Js2 θ(s) + Bs θ(s) = KT * I(s) ---equ-(e)

ωs = s θ(s) = KT * I(s)/Js+B ----equ-(f)

Substitute I(s) value in equ-(e)

Js2 θ(s) + Bs θ(s) = KT * I(s) ---equ-(e)

Js2 θ(s) + Bs θ(s) = KT * (V(s) – Kbsθ(s))/ (Ls + R) ---equ-(g)

s θ(s)[(Js+B) * (Ls+R)] = KTV(s) – KT * Kbsθ(s)

s θ(s)[(Js+B) * (Ls+R)] + KT * Kbsθ(s)= KTV(s)

s θ(s)[(Js+B) * (Ls+R) + (KT * Kb)]= KT V(s)

Transfer function of output angle θ(s) to the input angle V(s) given by

Ga(s) = θ(s)/V(s) = KT / s[(Ls+R) * (Js+B) + (KT * Kb)] ----equ-(h)

Transfer function of output angle ω(s) to the input angle V(s) given by

Ga(s) = (s)/V(s) = KT / [(Ls+R) * (Js+B) + (KT * Kb)] ----equ-(i)

Simulink Modelling of DC Motor

DC Motor Parameters

%This file contains the design parameters to model a DC motor
J=0.01; % Moment of inertia of the rotor in kg-m^2
B=0.1; % Motor viscous friction constant in N-ms
Km=0.01; % Back EMF constant in V/rad/s
Kt=0.01; % Motor torque constant in N-m/amp
Ra=1.0; % Resistance of the armature circuit in ohms
La=0.5; % Inductance of the armature circuit in henries
%%
subplot(321);plot(out.time,out.Vs);grid;title('Supply Voltage (Vs)');
subplot(322);plot(out.time,out.Vb);grid;title('Back EMF (Vb)');
subplot(323);plot(out.time,out.ia);grid;title('Armature Current (ia)');
subplot(324);plot(out.time,out.T);grid;title('Torque (T)');
subplot(325);plot(out.time,out.w);grid;title('speed (w)');

Result

The plots for Simulation time Vs Supply Voltage (Vs), Back EMF (Vb), Armature Current (ia), Torque(T), speed(W) was plotted using Subplot command

Observation

This is the response of the DC motor with given supply voltage 230V by using Step signal. The below response of the DC motor is without PID controller. From the results we can observe that Back EMF of the motor is 20V, Armature current is 200A and Speed of the DC motor is 20 rpm it is very less so, we need to regulate the speed by designing a proper PID controller. We see that in next case.

Modelling of a DC Motor with PID controller

State Space equations for the DC Motor

State equations will be derived from equations (a) and (b)

dI/dt = - (R/L) I + (1/L) V – (Kb/L) d/dt

dI/dt = - (R/L) I + (1/L) V – (Kb/L) ω dI/dt

dω/dt= - (B/J) ω + (1/J) KTI

Y(t) = ω = d/dt

A state space representation of the DC motor from above equations

Modelling of DC Motor with PID Controller

What is PID Controller?

A proportional-integral-derivative controller (PID controller or three-term controller) is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control. The proportional integral derivative controller produces an output, which is the combination of the outputs of proportional, integral, and derivative controllers. The feedback from the plant whichever is a controllable parameter is given as input to the PID controller and the processed error is minimized to get the desired output if tuning of the parameter is done optimally. The mathematically PID controller can be defined by the following equation where e(t) is the error signal with respect to time, Kp, Ki and KD are PID constants.

Apply Laplace transform on both sides.

The parameter which is under control must have some properties or free from some properties such as rise time, settling time, overshoot and steady state error. The impact of PID parameters on such properties can be found in the below table.

Rise Time

Rise time is defined as the time taken for a signal to cross from a specified low value to a specified high value. In analog and digital electronics, the specified lower value and specified higher value are 10% and 90% of the final or steady-state value. So, the rise time is typically defined as how long it takes for a signal to go from 10% to 90% of its final value.

Settling Time

The settling time of a dynamic system is defined as the time required for the output to reach and steady within a given tolerance band. It is denoted as Ts. Settling time comprises propagation delay and time required to reach the region of its final value. It includes the time to recover the overload condition incorporated with slew and steady near to the tolerance band.

The tolerance band is a maximum allowable range in which the output can be settle. Generally, the tolerance bands are 2% or 5%.

Peak Over Shoot

(MP) is defined as the deviation of the response at the peak time from the final value of the response. it is also called the maximum overshoot. We can write it as

Steady State Error

Steady-state error is defined as the difference between the desired value and the actual value of a system output in the limit as time goes to infinity (i.e., when the response of the control system has reached steady-state).

Steady-state error is a property of the input/output response for a linear system. In general, a good control system will be one that has a low steady-state error.

Stability of the System

A system is stable if every bounded input yields a bounded output. We call this statement the bounded-input, bounded-output (BIBO) definition of stability.

The stability of a linear closed loop system can be determined from the locations of the closed loop poles in the s-plane.

The location of poles of the transfer function decides the stability of the system. Which is shown in the above figure for critically stable, unstable, and stable systems.

For our case, the transfer function is determined from the constants of motor and state space equations,

Simulink Modelling of DC Motor with PID Controller

Case-1 For overdampedamped case zeta = 1.1

DC Motor with PID Controller Parameters

%This file contains the design parameters to model a DC motor with PID
J=0.01; % Moment of inertia of the rotor in kg-m^2
B=0.1; % Motor viscous friction constant in N-ms
Km=0.01; % Back EMF constant in V/rad/s
Kt=0.01; % Motor torque constant in N-m/amp
Ra=1.0; % Resistance of the armature circuit in ohms
La=0.5; % Inductance of the armature circuit in henries
%% Design of PID Controller
A=[-B/J Kt/J;  -Km/La -Ra/La];
b=[0;1/La];
%% Placement of Poles
fn=1;
wn=2*pi*fn;
%zeta=0.5; % For underdamped case
%zeta=1.0; % For critically case
zeta=1.1; % For underdamped case 
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
P=[p1;p2]
K=place(A,b,P)

%%
subplot(321);plot(out.time,out.Vs);grid;title('Supply Voltage (Vs)');
subplot(322);plot(out.time,out.Vb);grid;title('Back EMF (Vb)');
subplot(323);plot(out.time,out.ia);grid;title('Armature Current (ia)');
subplot(324);plot(out.time,out.T);grid;title('Torque (T)');
subplot(325);plot(out.time,out.w);grid;title('speed (w)');

To design a closed loop control scheme for a DC motor the following changes need to be done in the model in the previously created model.

  • Speed is the controllable parameter, so we will set the reference speed in step block as 10.20, 40 whichever you want.
  • Subtract the actual speed from the reference speed to generate the error signal e(t)
  • Add Kp as K(1) and Kd as K(2) parameter determined from place command (K-place(A.B.P)). (use gain block to mention values of Kp, Kd, and Ki)
  • The feedback for Kd is provided from the error speed signal.
  • Add Ki manually with gain and integrator block and tune different values of Ki and check the impact of it on results.

Values of Kp Ki & Kd choose for Controller Design

Kp = 0.6142

Ki = 10

Kd = 0.9115

Result

The plots for Simulation time Vs Supply Voltage (Vs), Back EMF (Vb), Armature Current (ia), Torque(T), speed(W) was plotted using Subplot command.

Observation

From the above graph we can observe that for the speed of the motor is following the reference speed of 20rad/sec by satisfying the control design objectives of Overshoot (< 5s) Steady State error (< 1%) but it is not satisfying the Settling time (<2s) as the system is overdamped, we know that in overdamped case the system reaches to stability with low oscillations but it takes more time to reach the stability.

Case-2 For underdamped case zeta = 0.5

DC Motor with PID Controller Parameters

%This file contains the design parameters to model a DC motor with PID
J=0.01; % Moment of inertia of the rotor in kg-m^2
B=0.1; % Motor viscous friction constant in N-ms
Km=0.01; % Back EMF constant in V/rad/s
Kt=0.01; % Motor torque constant in N-m/amp
Ra=1.0; % Resistance of the armature circuit in ohms
La=0.5; % Inductance of the armature circuit in henries
%% Design of PID Controller
A=[-B/J Kt/J;  -Km/La -Ra/La];
b=[0;1/La];
%% Placement of Poles
fn=1;
wn=2*pi*fn;
zeta=0.5; % For underdamped case
%zeta=1.0; % For critically case
%zeta=1.1; % For underdamped case 
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
P=[p1;p2]
K=place(A,b,P)

%%
subplot(321);plot(out.time,out.Vs);grid;title('Supply Voltage (Vs)');
subplot(322);plot(out.time,out.Vb);grid;title('Back EMF (Vb)');
subplot(323);plot(out.time,out.ia);grid;title('Armature Current (ia)');
subplot(324);plot(out.time,out.T);grid;title('Torque (T)');
subplot(325);plot(out.time,out.w);grid;title('speed (w)');

To design a closed loop control scheme for a DC motor the following changes need to be done in the model in the previously created model.

  • Speed is the controllable parameter, so we will set the reference speed in step block as 10.20, 40 whichever you want.
  • Subtract the actual speed from the reference speed to generate the error signal e(t)
  • Add Kp as K(1) and Kd as K(2) parameter determined from place command (K-place(A.B.P)). (use gain block to mention values of Kp, Kd, and Ki)
  • The feedback for Kd is provided from the error speed signal.
  • Add Ki manually with gain and integrator block and tune different values of Ki and check the impact of it on results.

Values of Kp Ki & Kd choose for Controller Design

Kp = 38.3133

Ki = 55

Kd = -2.8584

Control Design Objectives to Meet

Settling time < 2s

Overshoot < 5%

Steady State error < 1%

Result

The plots for Simulation time Vs Supply Voltage (Vs), Back EMF (Vb), Armature Current (ia), Torque(T), speed(W) was plotted using Subplot command.

Observation

From the above graph we can observe that for the speed of the motor is following the reference speed of 20rad/sec by satisfying the control design objectives of settling time (< 2s) Overshoot (< 5s) Steady State error (< 1%) was achieved for the control parameters values of

Kp = 38.3133

Ki = 55

Kd = -2.8584

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.