Jump to content

Linear ramp output

Recommended Posts

This is a UDFB for linear ramp output with rise and fall time.


The program detects change in the target value and ramps the output until it reaches the set point.

If the new target value is greater than the current value, it makes a rising ramp.

If the new target value is less than the current value, it makes a falling ramp.

Calculates the relative ramp time according to maximum ramp and fall time given by the user.


Function Inputs:

Target value

Rise time (This is the maximum rise time from the minimum output value to the maximum in msec)

Fall time  (This is the maximum fall time from the Maximum output value to the Minimum in msec)

Maximum value of output

Minimum value of output


Function Output:

Ramped output register



I wrote this UDFB to control hydraulic pressure using proportional valve via analog output. It could also be used to drive a stepper motor with acc/dec using pulse width modulation.

  • Like 1
  • Upvote 3

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...