Electrical – Control loop for finding maximum value

control systempid controller

I'm trying to build a control system which I control variable x with a feedback y, goal is to find the maximum value of y while avoiding overshooting as much as possible. Assume y has a well defined shape with one maximum (so there're no local maximums to confuse the system), like the one shown below.

enter image description here

I looked up PID control loop and while the principle seems to apply but it requires a user defined set point, but in my case the target is the maximum which is unknown. How can I modify PID for it to work in my case?

On a separate note, the feedback value y has noise on it. It is not a big issue when x is away from the maximum as the slope is high, but it becomes an issue when getting close to the maximum as the slope becomes flat. How can I mitigate the noise issue and make sure the system is stable at the top?

Best Answer

I'm assuming X starts at zero or full-scale.

Set X to ramp at a predetermined rate and look at the rate of change in Y with respect to time - when it starts to approach zero, reduce X's rate and recalc the now-much-slower rate of change of Y as it approaches the peak.

I suspect that with a parabola, that if any two points measured in Y with respect to X you can make a near instant computation to predict the peak. Both points need to be on one side of the paraboa of course.

The noise on top of the parabola can be mitigated by a proper digital filter.