Challenge

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

Aim:

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

Objective:

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.

Solutions:

MATLAB Code:

%% DC Motor parameters

J=0.01; %Intertia of motor

B=0.1; %Motor viscus friction

Kb=0.01; %Back EMF

Kt=0.01; %Motor torque constant

Ra=1.0; %Armature resistancde

La=0.5; %Inductance of the motor

%% PID Design

A=[-B/J Kt/J; -Kb/La -Ra/La];

D=[0 ; 1/La];

%% Poles of systema

Fn=1;

Wn=2*pi*Fn;

zeta=0.5;

p1=-zeta*Wn+Wn*sqrt(zeta^2-1);

p2=-zeta*Wn-Wn*sqrt(zeta^2-1);

p=[p1;p2];

P=place(A,D,P);

%PID constants

Ki=0;

Kp=38.3133;

Kd=-2.8584;

%% Placing poles and zeros system

K=1; %The DC gain of the system

s=tf('s');

G=K*Wn^2/(s^2 + 2*zeta*Wn^2 + Wn^2);

pzmap(G,'r'); grid on;

Here with poles placement, we can find Kp and Kd gains for controller of the system

Pole of the system lies on the axis of the graph, hence we can conclude that the system is critically stable . . . . .

SIMULINK Model:

  • Designing a PID controller:
  • MATLAB code:

%% Poles of systema

Fn=1;

Wn=2*pi*Fn;

zeta=0.5;

p1=-zeta*Wn+Wn*sqrt(zeta^2-1);

p2=-zeta*Wn-Wn*sqrt(zeta^2-1);

p=[p1;p2];

P=place(A,D,P);

%PID constants

Ki=0;

Kp=38.3133;

Kd=-2.8584;

  1. According to the values that we have got in above equations for Kp & Kd gains
  2. Take three gain constants Kp, Ki & Kd.

Where, as Kp is Proportional gain

Ki is Integral Gain

Kd is Differential Gain

  1. For Integral gain add an Integrator block ahead of Ki from SIMULINK model.

For Differential gain either keep a feedback or use a differential block from SIMULINK model ahead of Kd gain block.

  1. Connect the blocks accordingly forming a PID controller
  • Designing a DC motor:

MATLAB script:

%% DC Motor parameters

J=0.01; %Intertia of motor

B=0.1; %Motor viscus friction

Kb=0.01; %Back EMF

Kt=0.01; %Motor torque constant

Ra=1.0; %Armature resistancde

La=0.5; %Inductance of the motor

  1. Write a MATLAB script as shown above
  2. Take a transfer function block of 1 wrt La Ra refer fig (A)
  3. Take a transfer function block of 1 wrt J B refer fig (B)
  4. Take two gain blocks Kt & Kb.
  5. Where as Kt is motor torque & Kb is back emf which us here for negative feedback
  6. Connect the parameters accordingly
  7. Along the second transfer function we get W

Fig (A) Fig (B)

SIMULINK Model:

Connect the parameters accordingly,

Input signal Control Signal


Back EMF Torque

W:

Rise time: 0.1 to 0.3

Peak: 250

Peak time: 0.3

Settling max:250

Settling min:165

Settling time: 1.0 to 1.8

SIMULINK Model:

For the below mode we are using a discrete PID controller a MATLAB block

As the same results can be obtained by using a PID controller block

Reference:

DC model link:

https://skill-lync.com/knowledgebase/modeling-of-dc-motor

PID controller design for DC motor:

https://skill-lync.com/knowledgebase/pid-controller-design-for-dc-motor

MATLAB script:

https://drive.google.com/file/d/1KLRI80rYyLGg5pOW9fRRUhmOtETH9Kt4/view?usp=share_link

SIMULINK model:
https://drive.google.com/file/d/14IedyxL-y_pPuZVPe8YWSzl-ytPjI6as/view?usp=share_link

_____________________________________________________________________________________________________________________

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.