Project - Speed Control of a Direct Current (DC) motor
Aim: To develop a Simulink model for the DC motor using the Proportional, Integral, and Derivative (PID) control to design, develop and test a controller to maintain a desired speed for the motor.
Objective:
- Mathematical modeling from the first principles
- Modeling an Electrical Engineering system
- Simulink based modeling
- Control law design and test
- Stability of a dynamic system
Solution:

Mathematical modeling from the first principles:
- Using Kirchoff's voltage law
The algebraic sum of all voltage around any closed loop in a circuit is equal to zero.
Vs=Ra*ia+La(dia/dt)+Vb
- Back EMF, angular velocity & torque are related
Vb=Km(dθ/dt)
T=Kt*ia
Here, km and kt are the back emf and torque constants respectively
Angular velocity,ω=θdot
- The open loop transfer function for the motor with the speed (w) and supply voltage (vs) can be derived as
w(s)/Vs(s)=Kt/((J*La*S^2)+(J*Ra+B*La)S+(B*Ra+Kt*Km))
where,
Vs = Supply Voltage
Ra = Armature Resistance
ia = Armature Current
La = Armature Inductance
Vb = Back EMF
Modeling an Electrical Engineering system
- Parameters
(Jm) Moment of inertia of the rotor 0.01 kg.m^2
(Bm) Motor viscous friction constant 0.1 N.m.s
(Kf) Electromotive force constant 0.01 V/rad/sec
(Km) Motor torque constant 0.01 N.m/Amp
(Ra) Electric resistance 1 Ohm
(La) Electric inductance 0.5 H
- Control Design Objectives
Settling time < 2s
Overshoot < 5%
Steady-state error < 1%
- State Space Model



Design a PID controller to regulate the speed of the DC Motor.
- Consider the mathematical model of a DC motor.
- Select the P, I, and D gains such that the control design objectives for settling time, overshoot, and steady-state error are met.
- Simulation time(s)
- Start time: 0.0
- Stop time: 10.0
- Solver Selection
- Type: Fixed step
- Solver: ode4(Runge kutta)
- The reference signal is a Step Input signal
- Step time:5s
- Initial value:0
- Final value:5
Kp and Kd value after pole placement method:

- The above plot shows the Speed signal with respect to the reference signal.
- The Blue signal is the reference signal from the step signal input.
- The red signal is obtained from the above circuit when feedback control gains Kd, Kp, Ki are applied.
- Here Kp=20.00 and Kd=-0.90 are found using the place command.
- By tracking accurate ki manually, the best signal is plotted in the above plot/graph at Ki=4.00.
Conclusion:
- Overshoot can be observed at less than 5%.
- Rise time can vary by controlling the Ki value.
- The settling time is less than 2s.
- Steady-state error is less than 1%.
- Equilibrium conditions are when it obtains a straight constant signal.