# 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.

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?