A function to linearly increment (build a ramp) a variable to a desired value.
For example, it can be useful to bring the ideal velocity of an axis to 0 with constant deceleration.
Syntax |
real ramp (real value, real target, real acc [, real dec=acc]) |
---|---|
value |
Variable to be incremented (can be a register, a local variable, a kinematic unit, etc.) |
target |
Desired target value for the variable. The function will stop only when value equals target |
acc |
Acceleration value to reach target |
dec |
Deceleration value to reach target. (optional, default acc) |
Result |
Returns the updated value of the incoming variable |
Validity |
Rule |
Note |
Acceleration must mean value to move away from 0. Deceleration must mean value to move to 0 |
Example usage:
|