×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

S-curve acceleration

S-curve acceleration

S-curve acceleration

(OP)
Does anyone know of an algorithm that would generate an S-curve pattern? I am trying to program a PLC to accelerate a machine component. Unfortunately, Allen-Bradley does not provide an exponential function in their instruction set, although they do have an x^y power instruction. I have some idea mathematically how to generate the curve; I thought someone might have ideas that substantiate my understanding of the programming requirements. Most motion controllers and VFD's provide s-curve capability, so the algorithm must be well understood. I simply can't find any code listings for ideas.

RE: S-curve acceleration

Try a logistic sigmoid function. It is s-shaped, and has the form:

y = 1/(1+e^(-x))

You may have to play around with scaling input and output and possibly adding a bias to get it to work the way you desire. You can add biases to change the y-intercept:

y = 1/(1+e^(-x))+b

or the x-intercept:

y = 1/(1+e^(-x+b))

or both, of course.
You'll have to use e = 2.71828 with your x^y function since there is no e in your controller.

xnuke

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: S-curve acceleration

(OP)
Thanks for the timely responses everyone.

I had read this app note previously. It provided insight and helped generate my request for an algorithm. So how would you implement a first order filter with PLC code? Obviously, it would be a digital filter. Any FIR filter programs I've seen were fairly elaborate. Any ideas?

Further, after finding an appropriate filter algorithm, I would have to "generate" an acceleration "signal" to "pass" through the filter. Sounds interesting...

Although I am interested in pursuing the code for a PLC filter implementation, I think XNUKE's suggestion to use the logistic sigmoid function is feasable as the curve readily mimics the shape of the veleocity profile I am seeking.

Thanks again. Any more suggestions will be appreciated.

RE: S-curve acceleration

The link given by IRstuff shows the z-domain equation for a low-pass filter, but not the time domain difference equation needed for programming in a PLC. In the discrete time domain, a low-pass filter can be programmed as:

y(k) = [c/(c+T)]*y(k-1)+[T/(c+T)]*x(k)

where c is the time constant, T is the sample period, k is the sample index, y is the filter output, and x is the filter input.

I think it might be easier to program the logistic sigmoid, although I have used this difference equation on a PLC to implement a low-pass filter, and it does work.

xnuke

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: S-curve acceleration

Hi, the old way is to intergrate the control signal twice.

RE: S-curve acceleration

Just to keep things straight.....

The derivative of Position... is Velocity
    The derivative of Velocity... is Acceleration
        The derivative of Acceleration  is the JERK
        function ... (change of acceleration per unit time)
from whence cometh the S-Curve ...

Ergo, the S-curve eminates from the 2nd derivative of Velocity.

RE: S-curve acceleration

(OP)
and to further clarify....

A linear increase in velocity implies -
  A constant acceleration (step function) implies -
     An "infinite" jerk function (impulse function) -

implies I do not want a linear increase in velocity
 but an S-curve velocity profile
  or a sawtooth acceleration profile
    or a little jerk.

RE: S-curve acceleration

too many little jerks around here

RE: S-curve acceleration

(OP)
Hear hear!

RE: S-curve acceleration

  There is a very simple way to do this, especially if you have a PLC.  Just use a loop where, when you want the linear part of the curve, you step the speed reference a fixed amount.  For the S part, you increase the reference is small amounts until it reachs the step size of the linear value. At the top end when you get withing a certain percent of the desired speed value, you decrease the step size.  This works very well and is quick to implement.  After you play with this you will see the S portion is adjustable, depending on what you want it to do.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources