Applying PSO for tuning a compensator for double integrator plant

I was reading a book on control systems by Richard Dorf and he lists procedure for designing a lead compensator for a double integrator plant. Using the method I developed models in Matlab and it works fine. But I am unable to to tune the system with constraints for time and frequency domain performance. I would like to tune the system for specific rise, fall , zeta, bandwidth, phase and gain margin requirements. I was thinking of PSO algorithm, but it requires an objective function in the first place. I require guidance for deriving the objective function for the constraints listed above.

• Regarding the actual question, this paper as well as others suggest that the objective function with PSO is simply an ad-hoc weighted average of any desired measures of performance (they must all have the same sign convention for what is "good") May 25 '21 at 19:17

This doesn't address the optimization, but is a follow-up to the comment about the system itself. Below are the 2 qualitative scenarios for a lead compensator with a double-integrator plant.

In the first case, the "best" damping ratio is limited because the root locus can only come so close to the real axis. You may also be limited by max practical gain or frequency.

As you continue to spread apart the zero and pole of the lead, it transitions into the shape of the second example. That second root locus can get you to the real axis, but you can't turn the gain up too high or else the poles depart the real axis again, as seen on the vertical branches on the left. However if the gain is not high enough, there is too much space between the zero and the CL's dominant pole, so you get mid-band gain (step response overshoot) because of that. You can eliminate the overshoot by moving the zero to the feedback path, but then you ruin your bandwidth.

So with a lead compensator it's a tradeoff. Any optimization could reflect that, just be sure to think about the constraints you give it.

Example 1: $$\frac{(1+s/2)}{(s^2)(1+s/10)}$$ Example 2: $$\frac{(1+s/1)}{(s^2)(1+s/10)}$$ 