Abstract
Direct current (DC) motors have superior features such as operating at different speeds, being affordable and easily controllable. Therefore, DC motors have many uses, such as machine tools and robotic systems in many factories up to the textile industry. The PID controller is one of the most common methods used to control DC motors. PID is a feedback controller with the terms Proportional, Integral, and Derivative. The proper selection of P, I, and D parameters is critical for achieving the desired control in the PID controller. In this study, the transfer function of a DC motor is first obtained, and the speed of the DC motor is controlled by the PID controller using this transfer function. Then, Particle Swarm Optimization (PSO), an optimization method based on swarm intelligence, is used to adjust the P, I, and D parameters. By using the obtained P, I, and D coefficients, the speed of the DC motor is tried to be controlled, and the effect of the filter coefficient on the system output is examined. The performance of the proposed PSO-PID controller with successful results is given in tables and graphics. Control and optimization studies are carried out with MATLAB Simulink.
1 Introduction
At the present time, direct current (DC) motors have a wide range of uses, from machine tools to robotic systems. In some unique and sensitive systems, it is critical that the motor provides the desired speed output. However, obtaining the desired speed output in open loop systems is difficult, especially due to external disturbances. As a result, a controller is needed for DC motor speed control. There are two types of control systems: open loop and closed loop. The Proportional Integral Derivative (PID), a closed-loop controller, is one of the approaches used to control systems. PID calculates the difference between the desired output and the actual output, called the error, and a control signal is generated according to this error value. It is essential to adjust the PID parameters to obtain the desired output. For this purpose, various optimization algorithms are used. One of them is particle swarm optimization (PSO) [1, 2].
PID is used in many applications such as control of bus suspension systems [3, 4], tracking problems of a mobile robot [5], upper limb rehabilitation robot [6], hybrid energy storage system for electric vehicles [7], trajectory tracking control of robot manipulator [8]. Baidya et al. used firefly-PID controller to reduce system error between the reference and output signals in electric vehicles [9]. The results obtained from the proposed controller are compared with classical PID control, firefly-PID controller, teaching learning-based optimization-PID controller, and PSO-PID controller. Ibrahim et al. used bacterial foraging and PSO technique to find the best PID controller parameters for controlling the speed of a brushless DC motor that is modeled in Simulink [10]. Lins and Krishnakumar presented tuning of PID controller for a PV-fed BLDC motor using PSO and teaching-learning-based optimization (TLBO) algorithm in their paper [11]. Gokce et al. analyzed PID control of brushed DC motor in their paper [12]. PID controller parameters are tuned with PSO and Ziegler-Nichols (ZN). Results show that PSO approach has clearly higher performance. In this study, firstly, a DC motor transfer function is obtained. Afterwards, this transfer function is controlled with PID, and PID parameters are optimized with PSO algorithm. The effect on the output has been examined by changing the N (filter coefficient) value.
In addition, the optimization performance of the PSO algorithm has been demonstrated in articles in which experimental studies have been carried out. Vishal et al. studied the determination of control parameters of an experimental DC motor using different optimization algorithms by minimizing Integral Time Absolute Error (ITAE) [13]. Payakkawan et al. used AI-based heuristic optimization techniques based on particle swarm optimization (PSO) in their studies. On-line tuning has also been performed on a real DC motor [14]. Rahayu et al. used PSO to optimize the rise time value, settling time and overshoot values in the speed control of an Arduino-controlled DC motor [15]. Palma et al. proposed an on-line optimization approach based on particle swarm optimization (PSO) for an experimental DC motor speed control. In this work both PID controllers and sliding mode controllers (SMC) are considered [16].
2 Materials and method
2.1 DC motor
DC motors widely used today generate rotational motion directly. This movement is used by transmitting with elements such as gears or belts. The electrical equivalent circuit of the armature is given in Fig. 1. This section [17] explains how to extract the DC motor transfer function used in this study.
The electrical equivalent circuit of the armature
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
The DC motor parameters used in this study are given in Table 1 [18].
DC motor parameters
Parameter | Symbol | Value |
Motor inertia | J | 0.01 (kg m2 s−2) |
Motor inductance | L | 0.5 (H) |
Motor resistance | R | 1 (ohm) |
Viscous friction | b | 0.1 (N m s) |
Torque constant | K | 0.01 (N m/Amp) |
The DC motor parameters given in Table 1 are used while creating the simulink model. J, L, R, b, and K represent motor inertia, motor inductance, motor resistance, viscous friction, torque constant, respectively.
2.2 PID control
Block diagram representation of the PID control scheme
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
When designing PID control systems, the main purpose is to set PID parameters and apply them to the system so that the desired output can be obtained.
2.3 Particle swarm optimization
The widespread use of PID controllers in the industry has increased the interest in tuning their parameters. Particle swarm optimization algorithm is proposed by Kennedy and Eberhart in 1995 [22]. PSO is developed by drawing on the foraging behavior of bird flocks. PSO is a calculation method that progresses the solution recursively, starting from a candidate solution to reach the best solution while optimizing the problem [23].
In PSO, particles represent the possible solutions, and the particle community refers to the flock. The particle symbolizes any bird in the search space. While birds in nature act based on their own experiences while searching for food, they also show the behavior of following the bird closest to food. Thus, the value of each particle reaches a better point with the effect of the flock memory [24]. Flowchart representation of the PSO algorithm is given in Fig. 3. A long distance of movement works in the first iterations, while this distance should be shortened in the last iterations. Thus, it will be easier to find the optimum value. Therefore, different PSO methods have come to the fore recently [25–27].
Flowchart representation of the PSO algorithm
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
In PSO algorithm, the initial positions of the particles are randomly generated in the relevant search space. Generally, the initial velocities of the particles are taken as zero. The fitness values of randomly generated positions are calculated using the objective function of the problem. According to the fitness values, the best position of each particle so far (xbest,i) and the position of the best of the population (gbest) are determined. The velocities of the particles are updated using these positions [28].
3 Simulation and results
In this study, the DC motor, whose transfer function is obtained, is tried to be controlled with a speed of 50 rad s−1. First of all, the DC motor is operated with open loop. The graphic obtained is given in Fig. 4. As can be seen from the graph, the DC motor cannot provide the speed output as desired. The DC motor is controlled with PID control to achieve the desired output. The effect of PID parameters on the max overshoot, rise time, settling time, and steady-state error is enormous. Therefore, the PID parameters are optimized by the PSO method. For this optimization process, 50 particles (n = 50) are first used, then the same optimization process is carried out for 100 particles (n = 100). The PSO algorithm is run at 1000 iterations for both n values. The system is controlled using the PID parameters obtained for both. PID parameters obtained as a result of PSO are given in Table 2.
Velocity of DC motor for open loop
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
Optimized PID parameters with PSO
Number of particles | P | I | D |
PSO-PID1 (n = 50) | 167.3316 | 249.9998 | 12.8416 |
PSO-PID2 (n = 100) | 249.7886 | 249.9960 | 18.0796 |
The MATLAB Simulink model used in this study is given in Fig. 5.
Simulink model of PID control
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
The model in Fig. 5 is run using the PSO parameters in Table 2. In addition, different N (filter coefficient) values are used. Three different values are used for the N value as 1, 10, and 100. These N values have been tested for both PSO-PID1 and PSO-PID2. The results obtained for max overshoot, rise time, settling time, and steady-state error are given in Table 3. The graphic obtained for PSO-PID1 is given in Fig. 6, and the graphic obtained for PSO-PID2 is given in Fig. 7. In Fig. 8, all results are given in a single graphic.
DC motor parameters
N (filter coefficient) | Max overshoot (%) | Rise time (s) | Settling time (s) | Steady-state error (rad s−1) | |
Open loop | – | – | – | – | 45.01 |
PSO-PID1 | 1 | 39.98 | 0.0935 | 0.3975 | 0 |
10 | 37.98 | 0.0756 | 0.3001 | 0 | |
100 | 0 | 0.0668 | 0.0668 | 0 | |
PSO-PID2 | 1 | 43.58 | 0.0744 | 0.3316 | 0 |
10 | 37.66 | 0.0600 | 0.2585 | 0 | |
100 | 1.86 | 0.0450 | 0.0450 | 0 |
PSO-PID1 control of DC motor velocity
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
PSO-PID2 control of DC motor velocity
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
PSO-PID1 and PSO-PID2 control of DC motor velocity
Citation: International Review of Applied Sciences and Engineering 15, 3; 10.1556/1848.2023.00698
As can be seen in Fig. 6, the maximum overshoot gets its best value when N is at its lowest value. For N = 1, the maximum overshoot is 39.98%, while for N = 10, the maximum overshoot decreased to 37.98%. When N = 100, no maximum overshoot is observed. The rise time is 0.0935 for N = 1 and 0.0668 for N = 100. Similarly, settling time decreased from 0.3975 to 0.0668. No steady state error occurred for any N value.
As can be seen in Fig. 7, the maximum overshoot got its best value when N was at its lowest value. While the maximum overshoot is 43.58% for N = 1, the maximum overshoot decreased to 1.86% for N = 100. The rise time is 0.0744 for N = 1 and 0.045 for N = 100. Similarly, settling time decreased from 0.3316 to 0.045. No steady state error occurred for any N value.
4 Conclusions
This paper has presented a proposed controller approach for DC motor velocity control. The PSO-PID controller results have better performance than the standard PID controller. The increase in the number of n particles in the PSO algorithm has not significantly contributed to finding the optimum PID parameters while increasing the computational load. Increasing the N (filter coefficient) value at a specific rate is crucial for the DC motor output to give the desired output. Although the same PID parameters are used, increasing the N value has resulted in a serious decrease, especially in the max overshoot. Also, rise time and settling time have decreased. This proposed controller structure will be employed in real-time applications of such systems.
References
- [1]↑
S. M. H. Mousakazemi and N. Ayoobian, “Robust tuned PID controller with PSO based on two-point kinetic model and adaptive disturbance rejection for a PWR-type reactor,” Prog. Nucl. Energy, vol. 111, pp. 183–194, 2019. https://doi.org/10.1016/j.pnucene.2018.11.003.
- [2]↑
J. Wang, B. Qiang, W. Du, Z. He, S. Dong, and B. Guan, “Control technology for overhead crane system based on particle swarm algorithm optimization PID control,” in AIP Conference Proceedings, vol. 2073, no. 1, p. 020095, AIP Publishing LLC, 2019. https://doi.org/10.1063/1.5090749.
- [3]↑
S. Gaur and S. Jain, “Vibration control of bus suspension system using PI and PID controller,” Int. J. Adv. Eng. Sci., vol. 3, no. 3, pp. 94–99, 2013.
- [4]↑
A. Karthikraja, G. Petchinathan, and S. Ramesh, “Stochastic algorithm for PID tuning of bus suspension system,” in 2009 International Conference on Control, Automation, Communication and Energy Conservation, IEEE, 2009, pp. 1–6.
- [5]↑
M. Gheisarnejad and M. H. Khooban, “An intelligent Non-integer PID controller-based deep reinforcement learning: implementation and experimental results,” IEEE Trans. Ind. Electron., vol. 68, no. 4, pp. 3609–3618, 2020. https://doi.org/10.1109/TIE.2020.2979561.
- [6]↑
M. K. Joyo, Y. Raza, S. F. Ahmed, M. M. Billah, K. Kadir, K. Naidu, and Z. Mohd Yusof, “Optimized proportional-integral-derivative controller for upper limb rehabilitation robot,” Electronics, vol. 8, no. 8, p. 826, 2019. https://doi.org/10.3390/electronics8080826.
- [7]↑
K. Ye and P. Li, “A new adaptive PSO-PID control strategy of hybrid energy storage system for electric vehicles,” Adv. Mech. Eng., vol. 12, no. 9, 2020, 1687814020958574. https://doi.org/10.1177/1687814020958574.
- [8]↑
F. Loucif, S. Kechida, and A. Sebbagh, “Whale optimizer algorithm to tune PID controller for the trajectory tracking control of robot manipulator,” J. Braz. Soc. Mech. Sci. Eng., vol. 42, no. 1, pp. 1–11, 2020. https://doi.org/10.1007/s40430-019-2074-3.
- [9]↑
D. Baidya, S. Dhopte, and M. Bhattacharjee, “Sensing system assisted novel PID controller for efficient speed control of DC motors in electric vehicles,” IEEE Sensors Lett., vol. 7, no. 9, pp. 1–4, 2023. https://doi.org/10.1109/LSENS.2023.3234400.
- [10]↑
H. E. A. Ibrahim, F. N. Hassan, and A. O. Shomer, “Optimal PID control of a brushless DC motor using PSO and BF techniques,” Ain Shams Eng. J., vol. 5, no. 2, pp. 391–398, 2014. https://doi.org/10.1016/j.asej.2013.09.013.
- [11]↑
A. W. Lins and R. Krishnakumar, “Tuning of PID controller for a PV-fed BLDC motor using PSO and TLBO algorithm,” Appl. Nanoscience, vol. 13, no. 4, pp. 2911–2934, 2023. https://doi.org/10.1007/s13204-021-02272-x.
- [12]↑
C. O. Gokce, V. Durusu, and R. Unal, “Disturbance rejection performance comparison of PSO and ZN methods for various disturbance frequencies,” Int. J. Comput. Exp. Sci. Eng., vol. 9, no. 1, pp. 17–19, 2023. https://doi.org/10.22399/ijcesen.1202255.
- [13]↑
V. Vishal,V. Kumar, K. P. S. Rana, and P. Mishra, “Comparative study of some optimization techniques applied to DC motor control,” in 2014 IEEE International Advance Computing Conference (IACC), Gurgaon, India, 2014, pp. 1342–1347. https://doi.org/10.1109/IAdCC.2014.6779522.
- [14]↑
P. Payakkawan, K. Klomkarn, and P. Sooraksa, “Dual-line PID controller based on PSO for speed control of DC motors,” in 9th International Symposium on Communications and Information Technology, Icheon, Korea (South), 2009, pp. 134–139. https://doi.org/10.1109/ISCIT.2009.5341272.
- [15]↑
E. Rahayu, A. Ma'arif, and A. Çakan, “Particle swarm optimization (PSO) tuning of PID control on DC motor,” Int. J. Robotics Control Syst., vol. 2, no. 2, pp. 435–447, 2022. https://doi.org/10.31763/ijrcs.v2i2.476.
- [16]↑
L. B. Palma, F. V. Coito, B. G. Ferreira, and P. S. Gil, “PSO based on-line optimization for DC motor speed control,” in 9th International Conference on Compatibility and Power Electronics (CPE), Costa da Caparica, Portugal, 2015, pp. 301–306. https://doi.org/10.1109/CPE.2015.7231090.
- [17]↑
DC Motor Speed, System Modeling, 2023. https://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed§ion=SystemModeling.
- [19]↑
T. Ahmet, O. Çakmak, and M. Gökbulut, “Tachogenerator DC motor speed control with PID and fuzzy logic,” J. Eng. Technol., vol. 1, no. 1, pp. 24–31. https://doi.org/20.500.12402/2274.
- [20]↑
T. Koçal and A. Muğan, “PID control of humidity and temperature exchange in a ship,” Gemi ve Deniz Teknolojisi, vol. 209, pp. 44–54, 2017.
- [21]↑
K. Aziz, “Comparative study on the tuning of the PID flight controllers using swarm intelligence,” Int. J. Aviation Sci. Technol., vol. 1, no. 02, pp. 80–91. https://doi.org/10.23890/IJAST.vm01is02.0205.
- [22]↑
R. Eberhart and J. Kennedy, “Particle swarm optimization,” in Proceedings of the IEEE International Conference on Neural Networks, vol. 4, 1995, pp. 1942–1948. https://doi.org/10.1109/ICNN.1995.488968.
- [23]↑
H. R. Yazgan, F. Yener, S. Soysal, and A. E. Gür, “Comparison performances of PSO and GA to tuning PID controller for the DC motor,” Sakarya Univ. J. Sci., vol. 23, no. 2, pp. 162–174, 2019. https://doi.org/10.16984/saufenbilder.376464.
- [24]↑
M. Özmen, Y. Delice, and E. K. Aydoğan, “Customer segmentation with PSO in telecommunication sector,” Bilişim Teknolojileri Dergisi, vol. 11, no. 2, pp. 163–173, 2018. https://doi.org/10.17671/gazibtd.368460.
- [25]↑
H. L. Minh, S. Khatir, R. V. Rao, M. Abdel Wahab, and T. Cuong-Le, “A variable velocity strategy particle swarm optimization algorithm (VVS-PSO) for damage assessment in structures,” Eng. Comput., vol. 39, no. 2, pp. 1055–1084, 2023. https://doi.org/10.1007/s00366-021-01451-2.
- [26]
Z. Xing, J. Zhu, Z. Zhang, Y. Qin, and L. Jia, “Energy consumption optimization of tramway operation based on improved PSO algorithm,” Energy, vol. 258, 2022, Art no. 124848. https://doi.org/10.1016/j.energy.2022.124848.
- [27]
B. Wang, Z. S. Wu, Z. Zhao, and H. G. Wang, “Retrieving evaporation duct heights from radar sea clutter using particle swarm optimization (PSO) algorithm,” Prog. Electromagnetics Res., vol. 9, pp. 79–91, 2009. https://doi.org/10.2528/PIERM09090403.
- [28]↑
A. Ayari and S. Bouamama, “A new multiple robot path planning algorithm: dynamic distributed particle swarm optimization,” Robotics Biomimetics, vol. 4, pp. 1–15, 2017.