Challenge

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

In this project, a Simulink model for the DC motor will be first developed per the schematic shown in Figure 1.

Use the Proportional, Integral, and Derivative (PID) control design knowledge gained in the training to design, develop and test a controller to maintain a desired speed for the motor.

Key Highlights:

Mathematical modeling from the first principles

Modeling an Electrical Engineering system

Simulink based modeling

Control law design and test

Stability of a dynamic system


Deliverables:

Matlab script to define modeling and control design parameters

Simulink model to simulate and verify the design

Ans:

Modelling of a DC Machine

A DC machine can work 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) eq(1)

As per Newtons Law

J (d2θ/dt2) + B (dθ/dt) = KT * I eq(2)

Converting above equations to S domain (Laplace Transform)

Laplace of eq- (1)

LsI(s) + RI(s) = V(s) - Kbsθ(s) eq(3)

I(s) = V(s) - Kbsθ(s)/Ls + R eq(4)

Laplace of eq- (2)

Js2 θ(s) + Bs θ(s) = KT * I(s) eq(5)

ωs = s θ(s) = KT * I(s)/Js+B eq(6)

Substitute I(s) value in eq-(5)

Js2 θ(s) + Bs θ(s) = KT * I(s) eq(5)

Js2 θ(s) + Bs θ(s) = KT * (V(s) – Kbsθ(s))/ (Ls + R) eq(7)

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)] eq(8)

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)] eq(9)

Simulink model of dc motor with out pid control

Parameters are shown below

For plotting the results i am using code as shown below

After run the simulation the results are shown below

In this above plot i am giving the ref as 230 in the step block but the speed is not reached to reference so it is not controlled.the step block parameters are shown below

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.

Increasing the proportional gain () has the effect of proportionally increasing the control signal for the same level of error. The fact that the controller will "push" harder for a given level of error tends to cause the closed-loop system to react more quickly, but also to overshoot more. Another effect of increasing is that it tends to reduce, but not eliminate, the steady-state error.

The addition of a derivative term to the controller () adds the ability of the controller to "anticipate" error. With simple proportional control, if is fixed, the only way that the control will increase is if the error increases. With derivative control, the control signal can become large if the error begins sloping upward, even while the magnitude of the error is still relatively small. This anticipation tends to add damping to the system, thereby decreasing overshoot. The addition of a derivative term, however, has no effect on the steady-state error.

The addition of an integral term to the controller () tends to help reduce steady-state error. If there is a persistent, steady error, the integrator builds and builds, thereby increasing the control signal and driving the error down. A drawback of the integral term, however, is that it can make the system more sluggish (and oscillatory) since when the error signal changes sign, it may take a while for the integrator to "unwind."

The general effects of each controller parameter (, , ) on a closed-loop system are summarized in the table below. Note, these guidelines hold in many cases, but not all. If you truly want to know the effect of tuning the individual gains, you will have to do more analysis, or will have to perform testing on the actual system.

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

The above model paramters code is shown below

the solver settings are shown below

the code is shown below

the reference speed is i am giving step input as shown below

Now i am giving the some values for

Kp=30,

Kd=-1.0,

Ki=25,

Running the simulation by using this values and the results shown below

The above plot we can observed that first one is reference speed and actual speed ref speed in blue colour and actual speed in cyan colour the ref speed is 10 the actual speed is slowly it comes to steady state at 9.5 sec finally it reached to reference speed as 10.by conrolling the PID.

After running the simulation we observed the results through plot by creating a code for this the values are below

kp=38.13,

kd=-2.85,

ki=0.04,

the results are shown below

The above plot we can observed that first one is reference speed and actual speed ref speed in blue colour and actual speed in cyan colour the ref speed is 10 the actual speed is achived above 10 that is called vpeak over shoot at 5 sec and then it comes to undershoot for 1 sec and it comes to steady state at 7.5 sec finally it reached to reference speed as 10.by conrolling the PID.

second one is armature current it is also some oscillations are there and finally it reaches to steady state.

third one is torque and fourth one is back emf both are comes to staedy state at 8 sec.

Now i am changing the values to

Kp=20,

kd=-0.8,

Ki=60,

The results are shown below

The above plot we can observed that first one is reference speed and actual speed ref speed in blue colour and actual speed in cyan colour the ref speed is 10 the actual speed is achived above 10 that is called peak over shoot at 5 sec and then it comes to steady state at 6.5 sec finally it reached to reference speed as 10.by conrolling the PID. we reduced the undershoot and settling time

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.