Quote:
Originally Posted by Ether
Let's test that code.
inputs:
currentSetpoint = .1
lastSetpoint = 1
output:
currentSetpoint is not updated
|
I'm not sure why currentSetpoint wouldn't be updated.
currentSetpoint is updated before the if statement, so the condition for the if statement isn't met, it will use the value of currentSetpoint set in the first line.
It does only work in one direction though - if you wanted it to work in both directions for only decelerations, you'd need to know which way you were going.