acceleration control

marcc's icon

hi,
I'm controlling a motor by trying to avoid inertia when it has reached its target value.
In order to do that, I used the line object en the bline one but none of them allowed me to really smooth the movement. I can't realy get rid of steps in the motor trajectory.
I would like to create a smooth acceleration at the beginning and a smooth decelaration a the end.
Ideally the trajectory would be a sigmoid curve.
is there better solutions than line or bline to do such a thing?
thanks a lot for your help

brendan mccloskey's icon

A number of 'smoothing' solutions were suggested here

Brendan

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Marc, You can calculate the desired acceleration/deceleration curve using expr. Someone who knows physics better than I do might disagree with me, but I believe that the "smoothest" acceleration/deceleration is exhibited by simple harmonic motion (like the swinging of a pendulum), which would be a sinusoidal curve rather than a sigmoid curve (and a sigmoid is theoretically asymptotic, i.e. never truly reaches its goal). But you can calculate either with expr. Here's an example comparing the two. --Chris

marcc's icon

thanks brendan for your link and chrisopher for your patch. Actually expr is the perfect solution for me.
I will play with functions to find the best for my application.
time to revise my maths....

seejayjames's icon
Max Patch
Copy patch and select New From Clipboard in Max.

here's an addendum which puts those curves into a table and lets you invert the values:

959.screenshot_expr_curves.PNG
PNG
marcc's icon

thanks seejayjames for this inverting tip....