PDA

View Full Version : Decel Ramp based on position



Jeremy Kopicz
06-19-2013, 09:16 AM
This function will ramp an output value based on position. This can be used to 'cushion' the travel of hydraulic devices at end of travel.

POS = Actual axis position
CMD_SPEED = Current Speed Request (Ex: Joystick position, the function will output the MIN value of the CMD_SPEED and function output)
RAMP_START = Position value to start the decel
RAMP_END = Position value to end the decel
MAX_SPEED = Starting decel value
Min_SPEED = Ending decel value

EXAMPLE:
nOutput := DECEL_TO_POINT(
POS := nActualPosition,
CMD_SPEED := nRequestedSpeed
RAMP_START := nUpRampStart,
RAMP_END := nUpRampStop,
MAX_SPEED := nUpMaxspeed,
MIN_SPEED := nUpMinSpeed);