The following is a plot of the defocus as a function of time with only the proportional gain being nonzero. Only three cases were run before the program crashed.

The dotted line indicates the setpoint.
One can clearly see the loop becomes unstable and oscillates out of control at a proportional gain of 240, and can see the characteristic steady-state offset of the P-controller from the set point develop in the other cases. |