Project - Speed Control of a Direct Current (DC) motor
Aim : To create 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.
Figure :

Theory:
- Here the Speed control of a DC motor is either done manually by the operator or by means of an automatic control device.
- This is different to speed regulation where the speed is trying to be maintained or regulated against the natural change in speed due to a change in the load on the shaft
-
so the speed can be varied by changing:
- The terminal voltage of the armature V
- The external resistance in armature circuit Ra
- The flux per pole
-
So Terminal voltage and external resistance involve a change that affects the armature circuit while flux involves a change in the maginetic field
-
so Therefore speed control of DC motor can be classified into:
- Armature Control Methods
- Field Control Methods
Simulink Model:

Step carried out in Similink :
- Here first we need to creat simulink model of the DC motor and make it as subsytem called the DC motor
- So next the subsytem of DC motor is connected to the discrete PID controller which helps in maintaining the desired speed
- So after the PID controller we need to start with the kp ki kd such as 1.0 1.0 0 after tunin accordingly so by this we can adjust the kp ki kd values as 31.5 82.3 2.3
- Which is used to obtaine the control design objectives
Function code:
% Dc motors parameters
J = 0.01; % moment of inertia of the rotor in kg-m^2
B = 0.1; % Motor viscous friction 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.0; % Resistance of the armature circuit in ohms
La = 0.5; % Inductance of 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;
p1 = -zeta*wn+wn*sqrt(zeta^2-1);
p2 = -zeta*wn-wn*sqrt(zeta^2-1);
P = [p1;p2]
K = place(A,b,P)
Kp=K(1)
Kd=K(2)
figure(1)
subplot(3,2,1);plot(out.time,out.Vs);grid on;title('Supply Voltage');
subplot(3,2,2);plot(out.time,out.W);grid on;title('Angular velocity');
subplot(3,2,3);plot(out.time,out.Vb);grid on;title('Back emf');
subplot(3,2,4);plot(out.time,out.I);grid on;title('Armature Current');
subplot(3,2,5);plot(out.time,out.T);grid on;title('Torque ');
Output results for the subsystem DC_motor:

Now for the Design of the DC motor with Discrete PID ccontroller:


Plot for when tuning settling :


Conclusion:
we have desined In this project a Simulink model for the DC motor as shown in Figure 1.and also we 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