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.
Answer:-

Matalb code:-

Simulink Model:-

Result:-


The above desing gives the best performance. As the overshoot is minimum and settling time is less. As per the application we can set the gains. For example some application needs very fast response. so if we change the gains to get fast rsponse, the overshoot will be high. So it is totally depend on the application requirement.
The PID gain can be set with the trial and error method as below:
Case1:-
For
Kp=5;
Kd=1;
Ki=50;

For
Kp=50;
Kd=1;
Ki=10;

For
Kp=100;
Kd=5;
Ki=5;

For
Kp=3;
Kd=-0.9;
Ki=1;

Conclusion:-
Here we have simulated the DC motor with PID controller. The mathematical model of DC motor has been simulated. By trial and error method we can set the value of PID gains in order to get the best response with minimum overshoot and less settling time. The same has been simulated and analysed.