Is that the whole code?

Maybe I have been looking at a green screen to long but I do not see where "setpoint" is being used.