A similar approach as in https://www.mathworks.com/matlabcentral/fileexchange/65493-full-state-feedback-controller-tuning-using-pso, but this time to synthesize a servo drive, i.e. a position control task is solved.
Cons: finite time in the cost function.
Pros: optimized for a nonlinear plant, under specific reference and disturbance.
Bartlomiej Ufnalski (2020). Full-state feedback servo controller tuning using PSO (https://www.mathworks.com/matlabcentral/fileexchange/65668-full-state-feedback-servo-controller-tuning-using-pso), MATLAB Central File Exchange. Retrieved .