I would like to use heuristic optimization methods (like PSO) for online optimization of control parameters? How can it be possible? Should additional micro calculate the optimal gains in any different situation? I mean is it necessary for gains that become optimal for the different tasks. image in a robot is working in predefined situation, or tracking special path with optimal gains which have been obtained with PSO algorithm, what happens for previous optimal gains if the path changes for example?