Artificial Intelligence Applications in Engineering (MUH-920), week 6 of 14: interactive lab

Swarm lab: Particles, a motor controller and an ant colony

Prof. Dr. Utku Kose, Süleyman Demirel University

Part A shows a particle swarm on a two-dimensional landscape with controls for inertia, cognitive and social coefficients [1, 2]. Part B decomposes every velocity update of a small particle swarm into inertia, cognitive and social terms and computes the constriction factor [1, 3]. Part C runs the PID loop of the DC motor sample by sample. Part D tunes the PID speed controller of a DC motor with the parameters of the Control Tutorials for MATLAB and Simulink and a 24-volt limit, and compares the swarm's gains with a reference tuning [4]. Part E evaluates the decision probabilities and pheromone updates of the Ant System, and Part F runs an ant colony on a drilling sequence and shows pheromone trails forming [5]. Part G performs the three phases of the artificial bee colony [6].

Part A: The swarm on a landscape

Part B: Inside one particle swarm update

A small swarm searches a two-dimensional function. Each press moves one particle and lists the random numbers, the inertia, cognitive and social terms of both velocity components, the new position and the update of the personal and global best; the chart draws the three terms as arrows that add up to the new velocity. The panel below computes the constriction factor for any coefficients [1, 3].

Constriction factor

Part C: The PID loop of the DC motor, sample by sample

The speed controller and the DC motor are computed one sample at a time with the formulas of the lecture: the error, the running integral, the filtered derivative, the limited voltage, the two motor equations and the growing ITAE sum. The first two samples reproduce the worked example, and the chart shows the response as it builds up [4, 7].

Part D: PID tuning of a DC motor

Part E: Ant decisions and pheromone updates

The holes of the worked example form the default instance, and any coordinates can be entered. The table gives the decision probabilities of an ant at the chosen hole with every factor. The first button lets the ants build complete tours with their random numbers, and the second applies evaporation and deposit to every edge; the width of each edge in the chart shows its pheromone [5, 8].

Part F: Ant colony for a drilling sequence

Part G: The three phases of the artificial bee colony

The buttons run the employed, onlooker and scout phases separately on the function x1² + x2². Every candidate shows the chosen component, the partner, the random factor φ and the greedy decision; the table holds the fitness, the selection probability and the trial counter of each source [6].

References

[1] Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In Proceedings of ICNN'95, International Conference on Neural Networks, Vol. 4 (pp. 1942-1948). IEEE. https://doi.org/10.1109/ICNN.1995.488968

[2] Shi, Y., & Eberhart, R. (1998). A modified particle swarm optimizer. In 1998 IEEE International Conference on Evolutionary Computation Proceedings (pp. 69-73). IEEE. https://doi.org/10.1109/ICEC.1998.699146

[3] Clerc, M., & Kennedy, J. (2002). The particle swarm: Explosion, stability, and convergence in a multidimensional complex space. IEEE Transactions on Evolutionary Computation, 6(1), 58-73. https://doi.org/10.1109/4235.985692

[4] University of Michigan, Carnegie Mellon University, & University of Detroit Mercy (2026). Control Tutorials for MATLAB and Simulink: DC motor speed, system modeling. https://ctms.engin.umich.edu

[5] Dorigo, M., Maniezzo, V., & Colorni, A. (1996). Ant system: Optimization by a colony of cooperating agents. IEEE Transactions on Systems, Man, and Cybernetics, Part B, 26(1), 29-41. https://doi.org/10.1109/3477.484436

[6] Karaboga, D., & Basturk, B. (2007). A powerful and efficient algorithm for numerical function optimization: Artificial bee colony (ABC) algorithm. Journal of Global Optimization, 39(3), 459-471. https://doi.org/10.1007/s10898-007-9149-x

[7] Åström, K. J., & Hägglund, T. (1995). PID Controllers: Theory, Design, and Tuning (2nd ed.). Instrument Society of America.

[8] Dorigo, M., & Stützle, T. (2004). Ant Colony Optimization. MIT Press.

[9] Sörensen, K. (2015). Metaheuristics: The metaphor exposed. International Transactions in Operational Research, 22(1), 3-18. https://doi.org/10.1111/itor.12001