I might not be recalling correctly, but I was under the impression that step-like changes in PID_SETPOINT gave rise to the spikes, not PID_CUR_POINT, so maybe we don't need this?
I might not be recalling correctly, but I was under the impression that step-like changes in `PID_SETPOINT` gave rise to the spikes, not `PID_CUR_POINT`, so maybe we don't need this?
This is for when the PID block was just connected. Upon the first iteration, it does not know the previous input, so we cannot properly take the derivative. When dealing with error, we could simply set the last error to be 0, but we can't set the last input to be zero, because if we are currently at 1 meter, then upon the 2nd iteration, that would show up as a 1 meter change in position.
This is for when the PID block was just connected. Upon the first iteration, it does not know the previous input, so we cannot properly take the derivative. When dealing with error, we could simply set the last error to be 0, but we can't set the last input to be zero, because if we are currently at 1 meter, then upon the 2nd iteration, that would show up as a 1 meter change in position.