Hi JW
Duet is a Constant Acceleration controller. It cannot control Jerk. Accelerations are allowed to change abruptly = "infinite" Jerk. See also specifically:
https://en.wikipedia.org/wiki/Jerk_(physics)#In_motion_control
On super stiff machines (expensive, and/or made by mechanics wizards) this does not matter much. On everybody else's machines it might cause vibrations/swinging, which might affect computer vision and pick/place precision (sideways-swinging nozzle). This is especially bad for affordable DIY-designs like Liteplacer.
If your machine is super stiff, you can use ConstantAcceleration,
i.e.. OpenPnP sending the predicted attainable feed-rate maximum
(ramp peak), given the distance. Or, as you proposed, you can set
EuclideanAxisLimits, i.e., OpenPnP sending the
theoretical maximum allowed by the Speed % set. The end result
should not actually differ between the two, i.e., with EuclideanAxisLimits
the controller should come to the same conclusion when calculating
the maximum attainable feed-rate given the distance. The
only difference is that you don't see the attainable
feed-rate in the G-code/log.
If your machine does suffer from vibrations/swinging to some
degree, there are some means to try and remedy it. If it is
relevant, it will become visible in Camera Settling. Watch the
first part of this video:
https://youtu.be/Pxg6g3KI5_E
Apply motion planning assuming a controller with constant acceleration motion control but moderate the acceleration and velocity to resemble those of 3rd order control, resulting in a move that takes the same amount of time and has similar average acceleration.
This will reduce vibrations to a degree.
Why? The moderation means that short moves accelerate more gently, as the acceleration is quickly followed by deceleration, which seems to agitate the machine more. Long moves are allowed to accelerate and decelerate much harder, but as they do so longer, this seems to induce less vibrations. If you think of the acceleration/deceleration ramp as a "half wave", the long move has a longer wave-length i.e. lower frequency and therefore seems to resonate less with the machine frame. Well, it helps on my machine.
On some better controllers (this should include newer Duet models), you can also use Simulated3rdOrderControl. Again you can then find suitable Jerk limits. That's what you see in the above-linked video. Quoting the Wiki:
Apply motion planning assuming a controller with constant acceleration motion control but simulating 3rd order control with time step interpolation. Watch a video to see the effect of Simulated3rdOrderControl on oscillations/vibrations. You also need to setup the Interpolation.
Wiki:
https://github.com/openpnp/openpnp/wiki/GcodeAsyncDriver#motion-control-type
Alternative:
Duet has controller based input shaping, but AFAIK it is mostly
aimed at the rather slow and regulated feed-rates in 3D-printing,
in order to fight so-called Ringing/Ghosting, I'm skeptical it can
help with pick&place where we want the highest attainable
speed (unregulated), i.e. shaping has nothing to "shape" or it
would be costing us speed during the whole move, not just at the
beginning/end as it does in 3D printing. On a machine like
Lightplacer it would also have to support axis dependent
frequencies (Y swings much slower than X) which AFAIK Duet does
not yet do. Ask the Duet guys.
_Mark
--
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/93eea5b5-8558-4ae2-b20c-c941a968fb5fn%40googlegroups.com.
> Watching your video it looks like M204 is being rapidly issued to reset the acceleration limit.
> The only way I can see this works, is if the accel set by M204 can be set on the fly, i.e. mid-move? Presumably this is how the system works?
That's exactly how it works, see the fainter red steps trying to mimic the bold red curve in the diagnostic graph (you can enable diagnostics on the OpenPnP Motion Planner tab on the Machine):

https://github.com/openpnp/openpnp/wiki/GcodeAsyncDriver#interpolation
On my Liteplacer (with Smoothieware controller) it helped tons.
Note 1, the original Liteplacer comes with TinyG which has native
S-Curves. I don't understand how these work, so I reserve
comments.
Note 2, the Marlin S-Curves are not 7-segment 3rd order, only
5-segment (no constant acceleration segments), which makes long
moves slow, which may be okay for 3D-printing, but sucks for PnP.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/574284f3-8efe-4272-8475-146af7e24785n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/53b7b3cd-bebb-4199-a51c-673115491558n%40googlegroups.com.
> The Duet manual says "RepRapFirmware applies the M204 accelerations to the move as a whole", which seems to contradict the ability to constantly update acceleration mid-move, as does the fact that in your video there are lots of G1s being issued which seem to be a broken up movement.
Duet provided me with a free controller so I could optimize it
for OpenPnP and vice versa. Aside from working closely together
with dc42 for him to make it more standards compliant, I
contributed a PR to the RepRap firmware:
https://github.com/openpnp/openpnp/wiki/Motion-Controller-Firmwares#duet3d
I remember that at a time I tested the firmware and recorded/printed some timing values. The move with the shaped acceleration took exactly (down to the MCU timer resolution!) as long as predicted in OpenPnP. This would not have been the case if acceleration was only applied as a constant.
> One weird Duet phenomenon that occurs about 1 in 10 is when I park the head at the maxima XY 400mm and then attempt to return to home, the head accelerates as usual, but hits a slow motion wall the middle 3rd of travel between Park (400,400) and visual home (75,75). This is not repeatable and has only happened a couple times.
That PR I mentioned above, adds a configurable grace period to wait for the whole interpolation command sequence to be received (over serial) before starting into the move. It it does not wait long enough, it might rush into premature deceleration, as it does not know yet, that the move will continue into the same direction. Unfortunately, Duet's USB serial implementation was not the fastest at the time, don't know how it is today. So you need a certain grace period (the much older Smoothie had much, much faster USB serial then).
What you're observing might be because of your grace period not being configured high enough. Or there was a regression on the firmware...
Note the grace period can be configured to be quite long without
ill effect, as it is immediately forfeited when an M400 is
received, or when the motion queue is full. Plus this wait is also
only relevant for the first leg in a move segment after the
machine stood still.
Speaking of the motion queue: make sure yours is configured large enough.
Also: don't overdo it on interpolation steps. There is a point when it takes longer to receive all that chatter over serial than what is saved by optimizing the motion speed.
I don't know if the example here...
https://github.com/openpnp/openpnp/wiki/Duet3D-Openpnp-Example
...includes all this, i.e. I don't know if the user contributing
this ever used Simulated3rdOrder. If you figure it out,
please help improve it.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/53b7b3cd-bebb-4199-a51c-673115491558n%40googlegroups.com.
My machine is not Duet driven (the Duet board is only on my test rig).
But there are other users out there. I hope this call reaches them too!
The Liteplacer swinging is very low frequency. It is somewhat visible in video scenes here (see how the nozzle swings):
https://youtu.be/5QcJ2ziIJ14?feature=shared&t=167
Also somewhat visible in Camera Settling:
https://youtu.be/Pxg6g3KI5_E?feature=shared&t=31
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/55e4ede6-5593-47ae-976f-bdc490b978f7n%40googlegroups.com.
That PR I mentioned above, adds a configurable grace period to wait for the whole interpolation command sequence to be received (over serial) before starting into the move. It it does not wait long enough, it might rush into premature deceleration, as it does not know yet, that the move will continue into the same direction. Unfortunately, Duet's USB serial implementation was not the fastest at the time, don't know how it is today. So you need a certain grace period (the much older Smoothie had much, much faster USB serial then).
What you're observing might be because of your grace period not being configured high enough. Or there was a regression on the firmware...
Thanks Mark! Great insight and makes a lot of sense. Honestly not sure what duet FW Im running at the moment. One thing when configuring Duet CAN expansion boards the FW rev needs to be the same between the main and dtr boards. Or at least that's how I remember it. I'll take a look at things and see what I'm actually running in terms of Duet RRF FW.
Re accelerometer testing, I'd be happy to do this in future when the machine is back together, currently it is not.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/10b28b83-492a-4623-8c47-b0f289960307n%40googlegroups.com.
