Best way to find max speed/accel/jerk for the steppers in place?

297 views
Skip to first unread message

vespaman

unread,
Nov 1, 2023, 3:28:42 PM11/1/23
to OpenPnP
Hi Guys!

I'm trying to squeeze the most of my setup of my machine, and while it is much better than when I started, I know there's more juice to squeeze.

So:-
Is there some kind of "best methodology" to find speed, acceleration and jerk?
In my case, I don't have any information about the motors, they are unmarked.

For example, should I set jerk to zero, or should I also add it to the recipe? Should I start finding the max speed (and how would I do that) I am currently using ModeratedConstantAcceleration, if that is part of the equation.

(This is a CHMT48VB, should someone already know the most optimal configuration)

 - Micael

Jan

unread,
Nov 2, 2023, 8:54:28 AM11/2/23
to ope...@googlegroups.com
Hi Micael!
IIRC ModeratedConstantAccleration does not use the Jerk parameter. Jerk
is only used for Simulated3dOrder or true 3d order (IIRC TinyG only).
At the end, you're looking for acceleration and speed limits, that you
can safely and repeatable drive. So without feedback you can go as fast
as you like before loosing steps. With feedback you could go a little
faster hoping that the feedback will help you out in case of trouble.
I've set max. step size and moved around adjusting the speed as
acceleration such, that I don't loose steps and that no unintended take
off happens. Later picking using a 502 nozzle tip did not work anymore
and after some investigation I lowered the limits for Z (tuned out that
I operated Z faster then the spring could retract the nozzle)...
As I wrote in an other thread, my machine was delivered with all motors
set to 1600 "Pulse (ppmm)", 800 "Speed (rpm)" and 80 "Acceleration
(rps2)" and that was incredible fast. I assume, that are the physical
limits of the controller/driver/motors/pulleys/belts at least with feedback.

Jan
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/93d4c142-a844-4649-998c-3138c6ad1067n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/93d4c142-a844-4649-998c-3138c6ad1067n%40googlegroups.com?utm_medium=email&utm_source=footer>.

vespaman

unread,
Nov 2, 2023, 9:59:24 AM11/2/23
to OpenPnP
Hi Jan,
Jerk is indeed used! I suspect that if it is zero, it is unlimited, but I am not sure. But if set, it very much changes the result.

Z is different of course, and thanks for the warning - I have a graveyard of broken nozzles on my table, don't need more (time to light a candle for them).

I guess the work order should be;
1. Find out max speed (starting with low acceleration and jerk 0)
2. Find out max acceleration (still jerk 0)

But here it is already a bit complex, because with the above, one can have success until for example tripple click on jog 100mm which will cause issues if acceleration is (too?) high, especially in breaking in my case. Here one can remedy with jerk instead. But is this better, or should acceleration be lowered instead? And how to determine actual resulting speed? Maybe someone has made a script or something that does some automatic testing/measuring?  There's a script "move machine" or something, that I suppose could be a basis, by adding M400 to it, and longer travels etc. But maybe this is not the way?

 -  Micael

mark maker

unread,
Nov 2, 2023, 10:58:27 AM11/2/23
to ope...@googlegroups.com

Hi,

Jerk cannot be truly controlled in most controllers. Most controllers are Constant Acceleration

So yes, in theory they have infinite Jerk. In reality it is dissipated in belts and magnetic fields etc. Mechanically challenged machines also vibrate like hell.

Those controllers that have Jerk Control (e.g. TinyG) often use so-called S-curves that are less than optimal for Pick & Place, because they become slow for long moves (they lack a constant acceleration segment, i.e. true 7-segment ramps, as discussed many times).

So on Constant Acceleration controllers like Smoothie and Duet, we can only emulate Jerk Control through something I call Simulated3rdOrderControl. The ramp is then interpolated with many very small segments, varying the acceleration step-wise.

https://youtu.be/cH0SF2D6FhM

However, this requires very fast USB serial transmission, so it only works well on true Smoothieboards (USB) and on Duets.

Therefore, there's another poor man's compromise that is called ModeratedConstantAcceleration

https://github.com/openpnp/openpnp/wiki/GcodeAsyncDriver#motion-control-type

It calculates the move as if it were Jerk controlled, then makes it into a constant acceleration controlled move with the same average acceleration. This means that short moves accelerate more gently, because acceleration is quickly followed by deceleration, which seems to agitate machines more. Long moves are allowed to accelerate and decelerate much harder, but also longer, which seems to induce less vibrations (if you think of the ramps as "sine curves", the long moves have lower "frequency" and therefore resonate less).

Whatever, they both help on my Liteplacer with Smoothie clone, as you see in its side effect of Camera Settling here:

https://youtu.be/Pxg6g3KI5_E

One needs to realize that the same vibration also likely happens in picks and placements, so it makes sense to use Camera Settling as the guide.

If your machine is very stiff (which might be the case with CHMTs), then you should set Jerk to 0.

_Mark

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1c3f3765-baa9-4c01-ad56-bf69242a8bc5n%40googlegroups.com.

vespaman

unread,
Nov 2, 2023, 11:32:29 AM11/2/23
to OpenPnP
OK, so Jerk setting on ModeratedConstantAcceleration machines should start with 0, but could be changed into something else, in order to fix vibrations and such. Not as a means to fix (de-)acceleration stalls and skips. Did I understand you correctly?

(I tried Simulated3rdOrderControl on my machine about a year ago (think it might work with my serial speeds), but found that it was way over my head. But at some point I will give it another go, slowly slowly things stick to my brain, and at some point, actually I might understand parts of it (Simulated3rdOrderControl, that is).. :-) )

 - Micael

mark maker

unread,
Nov 2, 2023, 2:54:04 PM11/2/23
to ope...@googlegroups.com

> OK, so Jerk setting on ModeratedConstantAcceleration machines should start with 0, but could be changed into something else, in order to fix vibrations and such. Not as a means to fix (de-)acceleration stalls and skips. Did I understand you correctly?

Yes, I guess you put it that way. 

First you would set jerk to 0.

The find the maximum acceleration that the steppers can take, not looking at vibrations yet.

Then, as long as you see excessive vibrations (through Camera Settling perhaps), experiment with jerk, perhaps starting with 500000 mms-3 and then going down until fine. 

There are controls in Camera Settling that quickly perform a back-and-forth move of the length set in the Jog Controls.

I only have experience with the Liteplacer, where a quick series of 1mm Y back-and-forth with max acceleration can almost make the machine fall apart. 😬

AdvancedCameraSettleSmall

_Mark

Jan

unread,
Nov 2, 2023, 5:56:11 PM11/2/23
to ope...@googlegroups.com
Hi Mark!
Many thanks for your elaborate explanation! Its always so valuable to
so much to learn from!

On 02.11.2023 15:58, 'mark maker' via OpenPnP wrote:
[...]
> Therefore, there's another poor man's compromise that is called
> *ModeratedConstantAcceleration*
>
> https://github.com/openpnp/openpnp/wiki/GcodeAsyncDriver#motion-control-type
>
> It calculates the move as if it were Jerk controlled, then makes it into
> a constant acceleration controlled move with the same *average*
> acceleration. This means that short moves accelerate more gently,
> because acceleration is quickly followed by deceleration, which seems to
> agitate machines more. Long moves are allowed to accelerate and
> decelerate much harder, but also longer, which seems to induce less
> vibrations (if you think of the ramps as "sine curves", the long moves
> have lower "frequency" and therefore resonate less).
>

This information is what I was missing in the Wiki. It would be cool if
you could add that. It explains why the release move after dragging is
so slow with very low acceleration for me.
May I assume, that ModeratedConstantAccleration with Jerk == is the
same as EuclideanAxisLimits?
Did you by chance ever tried to limit just the feed-rate on short
moves? This should still reduce the jerk between acceleration and
deceleration and likely execute the move quicker.

Jan
>> https://groups.google.com/d/msgid/openpnp/93d4c142-a844-4649-998c-3138c6ad1067n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/93d4c142-a844-4649-998c-3138c6ad1067n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/93d4c142-a844-4649-998c-3138c6ad1067n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "OpenPnP" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to openpnp+u...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/openpnp/1c3f3765-baa9-4c01-ad56-bf69242a8bc5n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/1c3f3765-baa9-4c01-ad56-bf69242a8bc5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/8ce49f2d-fc98-493e-938a-309d0a30258d%40makr.zone <https://groups.google.com/d/msgid/openpnp/8ce49f2d-fc98-493e-938a-309d0a30258d%40makr.zone?utm_medium=email&utm_source=footer>.

vespaman

unread,
Nov 3, 2023, 3:38:06 AM11/3/23
to OpenPnP
I second Jan's comment!

Now I know how to work the motors :-)

 - Micael


mark maker

unread,
Nov 3, 2023, 6:50:41 AM11/3/23
to ope...@googlegroups.com

The Wiki can be edited by everybody, just ask here, if you haven't yet: 😎

https://github.com/openpnp/openpnp/issues/1526

But I've added it now.

_Mark

Reply all
Reply to author
Forward
0 new messages