[FW 3.5.2] High jerk good for circular path not for corners
-
@dc42 thanks for the feedback!
-
@leone for small changes in direction I think the concept of jerk works reasonable well; but for larger changes (especially square corners) I think it ss better to accept a greater slowdown. The question is, what sort of curve should be used in between, and what parameters of that curve need to be configurable? For simplicity and ease of understanding, I'd prefer to use just 2 parameters, possibly jerk and square corner speed.
-
@dc42 Thinking in abstract terms, to completely describe and have full control of such a transition, the total amount of parameters might be: max speed change, min speed change (square corner speed), angle threshold (to determine at which angle the curve has to drop), and the slope of the curve.
Focusing on the parameters and not on the type of curve now, I agree that for simplicity two parameters are preferable, but if we use max speed change and min speed change, the user doesn't have control over the transition between the two speeds. I think the slope of the curve can be hard coded (with a parameter or by the type of the curve itself), but if I had to choose a second parameter, between a min speed change or an angle threshold, I would rather prefer to have control on the angle threshold and have the min speed change decided by the FW (it might also be the minJerk). -
I'd like to share some the results of some tests I've been running which may be of interest. The test fall into two parts, the first stage is to investigate the current RRF implementation, the second is to compare that to a Klipper/grbl style junction deviation system.
I have my printer configured with a jerk setting of 500mm/min on X and Y and an acceleration of 8000mm/s/s on X and Y.
M566 X500 Y500 M201 X8000 Y8000
I have two simple test files, the first moves the head in a square, the second uses a series of short lines to simulate a circle. I've modified the firmware to print out the destination X, Y, the move start/end speed, the top speed, the requested speed, the acceleration, deceleration and move length. The results when simulating the square test are as follows:
X 1.00e+2 Y 0.00e+0 start 0.00e+0 end 8.33e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 1.00e+2 Y 1.00e+2 start 8.33e+0 end 8.33e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 0.00e+0 Y 1.00e+2 start 8.33e+0 end 8.33e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 0.00e+0 Y 0.00e+0 start 8.33e+0 end 0.00e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2
Which is pretty much what we might expect (though with the current jerk settings it is rather hard to predict what the start/end speeds might be).
However when I run the circle test things look a little odd (at least to me):
X 1.40e+2 Y 9.02e+1 start 0.00e+0 end 6.79e+0 ts 1.50e+2 rs 1.50e+2 acc 9.53e+3 dec 9.53e+3 dist 1.66e+2 X 1.41e+2 Y 8.90e+1 start 6.79e+0 end 8.64e+1 ts 1.50e+2 rs 1.50e+2 acc 1.10e+4 dec 1.10e+4 dist 1.79e+0 X 1.42e+2 Y 8.79e+1 start 8.64e+1 end 7.83e+1 ts 1.50e+2 rs 1.50e+2 acc 9.89e+3 dec 9.89e+3 dist 1.79e+0 X 1.44e+2 Y 8.71e+1 start 7.83e+1 end 7.36e+1 ts 1.49e+2 rs 1.50e+2 acc 9.13e+3 dec 9.13e+3 dist 1.80e+0 X 1.46e+2 Y 8.64e+1 start 7.36e+1 end 6.95e+1 ts 1.43e+2 rs 1.50e+2 acc 8.61e+3 dec 8.61e+3 dist 1.79e+0 X 1.47e+2 Y 8.60e+1 start 6.95e+1 end 6.77e+1 ts 1.40e+2 rs 1.50e+2 acc 8.26e+3 dec 8.26e+3 dist 1.80e+0 X 1.49e+2 Y 8.57e+1 start 6.77e+1 end 6.65e+1 ts 1.38e+2 rs 1.50e+2 acc 8.06e+3 dec 8.06e+3 dist 1.80e+0 X 1.51e+2 Y 8.57e+1 start 6.65e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.53e+2 Y 8.60e+1 start 6.65e+1 end 6.77e+1 ts 1.38e+2 rs 1.50e+2 acc 8.06e+3 dec 8.06e+3 dist 1.80e+0 X 1.54e+2 Y 8.64e+1 start 6.77e+1 end 6.95e+1 ts 1.40e+2 rs 1.50e+2 acc 8.26e+3 dec 8.26e+3 dist 1.80e+0 X 1.56e+2 Y 8.71e+1 start 6.95e+1 end 7.35e+1 ts 1.43e+2 rs 1.50e+2 acc 8.61e+3 dec 8.61e+3 dist 1.79e+0 X 1.58e+2 Y 8.79e+1 start 7.35e+1 end 7.87e+1 ts 1.49e+2 rs 1.50e+2 acc 9.13e+3 dec 9.13e+3 dist 1.80e+0 X 1.59e+2 Y 8.90e+1 start 7.87e+1 end 8.61e+1 ts 1.50e+2 rs 1.50e+2 acc 9.89e+3 dec 9.89e+3 dist 1.79e+0 X 1.60e+2 Y 9.02e+1 start 8.61e+1 end 9.09e+1 ts 1.50e+2 rs 1.50e+2 acc 1.10e+4 dec 1.10e+4 dist 1.79e+0 X 1.62e+2 Y 9.16e+1 start 9.09e+1 end 8.24e+1 ts 1.50e+2 rs 1.50e+2 acc 1.04e+4 dec 1.04e+4 dist 1.79e+0 X 1.63e+2 Y 9.31e+1 start 8.24e+1 end 7.54e+1 ts 1.50e+2 rs 1.50e+2 acc 9.48e+3 dec 9.48e+3 dist 1.80e+0 X 1.63e+2 Y 9.47e+1 start 7.54e+1 end 7.12e+1 ts 1.46e+2 rs 1.50e+2 acc 8.84e+3 dec 8.84e+3 dist 1.79e+0 X 1.64e+2 Y 9.64e+1 start 7.12e+1 end 6.89e+1 ts 1.41e+2 rs 1.50e+2 acc 8.41e+3 dec 8.41e+3 dist 1.79e+0 X 1.64e+2 Y 9.82e+1 start 6.89e+1 end 6.65e+1 ts 1.39e+2 rs 1.50e+2 acc 8.14e+3 dec 8.14e+3 dist 1.79e+0 X 1.64e+2 Y 1.00e+2 start 6.65e+1 end 6.68e+1 ts 1.37e+2 rs 1.50e+2 acc 8.02e+3 dec 8.02e+3 dist 1.80e+0 X 1.64e+2 Y 1.02e+2 start 6.68e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.02e+3 dec 8.02e+3 dist 1.80e+0 X 1.64e+2 Y 1.04e+2 start 6.65e+1 end 6.89e+1 ts 1.39e+2 rs 1.50e+2 acc 8.14e+3 dec 8.14e+3 dist 1.79e+0 X 1.63e+2 Y 1.05e+2 start 6.89e+1 end 7.12e+1 ts 1.41e+2 rs 1.50e+2 acc 8.41e+3 dec 8.41e+3 dist 1.79e+0 X 1.63e+2 Y 1.07e+2 start 7.12e+1 end 7.54e+1 ts 1.46e+2 rs 1.50e+2 acc 8.84e+3 dec 8.84e+3 dist 1.79e+0 X 1.62e+2 Y 1.08e+2 start 7.54e+1 end 8.24e+1 ts 1.50e+2 rs 1.50e+2 acc 9.48e+3 dec 9.48e+3 dist 1.80e+0 X 1.60e+2 Y 1.10e+2 start 8.24e+1 end 9.09e+1 ts 1.50e+2 rs 1.50e+2 acc 1.04e+4 dec 1.04e+4 dist 1.79e+0 X 1.59e+2 Y 1.11e+2 start 9.09e+1 end 8.64e+1 ts 1.50e+2 rs 1.50e+2 acc 1.10e+4 dec 1.10e+4 dist 1.79e+0 X 1.58e+2 Y 1.12e+2 start 8.64e+1 end 7.83e+1 ts 1.50e+2 rs 1.50e+2 acc 9.89e+3 dec 9.89e+3 dist 1.79e+0 X 1.56e+2 Y 1.13e+2 start 7.83e+1 end 7.36e+1 ts 1.49e+2 rs 1.50e+2 acc 9.13e+3 dec 9.13e+3 dist 1.80e+0 X 1.54e+2 Y 1.14e+2 start 7.36e+1 end 6.95e+1 ts 1.43e+2 rs 1.50e+2 acc 8.61e+3 dec 8.61e+3 dist 1.79e+0 X 1.53e+2 Y 1.14e+2 start 6.95e+1 end 6.77e+1 ts 1.40e+2 rs 1.50e+2 acc 8.26e+3 dec 8.26e+3 dist 1.80e+0 X 1.51e+2 Y 1.14e+2 start 6.77e+1 end 6.65e+1 ts 1.38e+2 rs 1.50e+2 acc 8.06e+3 dec 8.06e+3 dist 1.80e+0 X 1.49e+2 Y 1.14e+2 start 6.65e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.47e+2 Y 1.14e+2 start 6.65e+1 end 6.77e+1 ts 1.38e+2 rs 1.50e+2 acc 8.06e+3 dec 8.06e+3 dist 1.80e+0 X 1.46e+2 Y 1.14e+2 start 6.77e+1 end 6.95e+1 ts 1.40e+2 rs 1.50e+2 acc 8.26e+3 dec 8.26e+3 dist 1.80e+0 X 1.44e+2 Y 1.13e+2 start 6.95e+1 end 7.35e+1 ts 1.43e+2 rs 1.50e+2 acc 8.61e+3 dec 8.61e+3 dist 1.79e+0 X 1.42e+2 Y 1.12e+2 start 7.35e+1 end 7.87e+1 ts 1.49e+2 rs 1.50e+2 acc 9.13e+3 dec 9.13e+3 dist 1.80e+0 X 1.41e+2 Y 1.11e+2 start 7.87e+1 end 8.61e+1 ts 1.50e+2 rs 1.50e+2 acc 9.89e+3 dec 9.89e+3 dist 1.79e+0 X 1.40e+2 Y 1.10e+2 start 8.61e+1 end 9.09e+1 ts 1.50e+2 rs 1.50e+2 acc 1.10e+4 dec 1.10e+4 dist 1.79e+0 X 1.38e+2 Y 1.08e+2 start 9.09e+1 end 8.22e+1 ts 1.50e+2 rs 1.50e+2 acc 1.04e+4 dec 1.04e+4 dist 1.79e+0 X 1.37e+2 Y 1.07e+2 start 8.22e+1 end 7.67e+1 ts 1.50e+2 rs 1.50e+2 acc 9.48e+3 dec 9.48e+3 dist 1.77e+0 X 1.37e+2 Y 1.05e+2 start 7.67e+1 end 7.03e+1 ts 1.47e+2 rs 1.50e+2 acc 8.85e+3 dec 8.85e+3 dist 1.82e+0 X 1.36e+2 Y 1.04e+2 start 7.03e+1 end 6.89e+1 ts 1.41e+2 rs 1.50e+2 acc 8.41e+3 dec 8.41e+3 dist 1.79e+0 X 1.36e+2 Y 1.02e+2 start 6.89e+1 end 6.65e+1 ts 1.39e+2 rs 1.50e+2 acc 8.14e+3 dec 8.14e+3 dist 1.79e+0 X 1.36e+2 Y 1.00e+2 start 6.65e+1 end 6.68e+1 ts 1.37e+2 rs 1.50e+2 acc 8.02e+3 dec 8.02e+3 dist 1.80e+0 X 1.36e+2 Y 9.82e+1 start 6.68e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.02e+3 dec 8.02e+3 dist 1.80e+0 X 1.36e+2 Y 9.64e+1 start 6.65e+1 end 6.89e+1 ts 1.39e+2 rs 1.50e+2 acc 8.14e+3 dec 8.14e+3 dist 1.79e+0 X 1.37e+2 Y 9.47e+1 start 6.89e+1 end 7.03e+1 ts 1.41e+2 rs 1.50e+2 acc 8.41e+3 dec 8.41e+3 dist 1.79e+0 X 1.37e+2 Y 9.31e+1 start 7.03e+1 end 7.67e+1 ts 1.47e+2 rs 1.50e+2 acc 8.85e+3 dec 8.85e+3 dist 1.82e+0 X 1.38e+2 Y 9.17e+1 start 7.67e+1 end 8.65e+1 ts 1.50e+2 rs 1.50e+2 acc 9.48e+3 dec 9.48e+3 dist 1.67e+0 X 1.40e+2 Y 9.02e+1 start 8.65e+1 end 0.00e+0 ts 1.50e+2 rs 1.50e+2 acc 1.03e+4 dec 1.03e+4 dist 1.89e+0
As you can see we have start/end speeds that vary from 6.65mm/s to over 9mm/s and there is a similar variation in the acceleration/deceleration values being used. Further thought/investigation shows that RRF applies the jerk/acceleration limits per motor/driver rather than along the actual path of the printer head. This means that because (depending on kinematics) we sometimes have just a single motor moving the print head while at other times we use two motors we have different "limits" being applied to each move. RRF does allow you to specify an acceleration limit that applies along the path of the move by using the m204 command. If we apply this:
M204 P8000 T8000
then run the test again we get:
X 1.40e+2 Y 9.02e+1 start 0.00e+0 end 6.79e+0 ts 1.50e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.66e+2 X 1.41e+2 Y 8.90e+1 start 6.79e+0 end 8.64e+1 ts 1.35e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.42e+2 Y 8.79e+1 start 8.64e+1 end 7.83e+1 ts 1.45e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.44e+2 Y 8.71e+1 start 7.83e+1 end 7.36e+1 ts 1.42e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.46e+2 Y 8.64e+1 start 7.36e+1 end 6.95e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.47e+2 Y 8.60e+1 start 6.95e+1 end 6.77e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.49e+2 Y 8.57e+1 start 6.77e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.51e+2 Y 8.57e+1 start 6.65e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.53e+2 Y 8.60e+1 start 6.65e+1 end 6.77e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.54e+2 Y 8.64e+1 start 6.77e+1 end 6.95e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.56e+2 Y 8.71e+1 start 6.95e+1 end 7.35e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.58e+2 Y 8.79e+1 start 7.35e+1 end 7.87e+1 ts 1.42e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.59e+2 Y 8.90e+1 start 7.87e+1 end 8.61e+1 ts 1.45e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.60e+2 Y 9.02e+1 start 8.61e+1 end 9.09e+1 ts 1.49e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.62e+2 Y 9.16e+1 start 9.09e+1 end 8.24e+1 ts 1.48e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 9.31e+1 start 8.24e+1 end 7.54e+1 ts 1.44e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.63e+2 Y 9.47e+1 start 7.54e+1 end 7.12e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 9.64e+1 start 7.12e+1 end 6.89e+1 ts 1.39e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 9.82e+1 start 6.89e+1 end 6.65e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 1.00e+2 start 6.65e+1 end 6.68e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.64e+2 Y 1.02e+2 start 6.68e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.64e+2 Y 1.04e+2 start 6.65e+1 end 6.89e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 1.05e+2 start 6.89e+1 end 7.12e+1 ts 1.39e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 1.07e+2 start 7.12e+1 end 7.54e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.62e+2 Y 1.08e+2 start 7.54e+1 end 8.24e+1 ts 1.44e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.60e+2 Y 1.10e+2 start 8.24e+1 end 9.09e+1 ts 1.48e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.59e+2 Y 1.11e+2 start 9.09e+1 end 8.64e+1 ts 1.49e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.58e+2 Y 1.12e+2 start 8.64e+1 end 7.83e+1 ts 1.45e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.56e+2 Y 1.13e+2 start 7.83e+1 end 7.36e+1 ts 1.42e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.54e+2 Y 1.14e+2 start 7.36e+1 end 6.95e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.53e+2 Y 1.14e+2 start 6.95e+1 end 6.77e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.51e+2 Y 1.14e+2 start 6.77e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.49e+2 Y 1.14e+2 start 6.65e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.47e+2 Y 1.14e+2 start 6.65e+1 end 6.77e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.46e+2 Y 1.14e+2 start 6.77e+1 end 6.95e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.44e+2 Y 1.13e+2 start 6.95e+1 end 7.35e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.42e+2 Y 1.12e+2 start 7.35e+1 end 7.87e+1 ts 1.42e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.41e+2 Y 1.11e+2 start 7.87e+1 end 8.61e+1 ts 1.45e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.40e+2 Y 1.10e+2 start 8.61e+1 end 9.09e+1 ts 1.49e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.38e+2 Y 1.08e+2 start 9.09e+1 end 8.22e+1 ts 1.48e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 1.07e+2 start 8.22e+1 end 7.67e+1 ts 1.43e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.77e+0 X 1.37e+2 Y 1.05e+2 start 7.67e+1 end 7.03e+1 ts 1.41e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.82e+0 X 1.36e+2 Y 1.04e+2 start 7.03e+1 end 6.89e+1 ts 1.39e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.36e+2 Y 1.02e+2 start 6.89e+1 end 6.65e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.36e+2 Y 1.00e+2 start 6.65e+1 end 6.68e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.36e+2 Y 9.82e+1 start 6.68e+1 end 6.65e+1 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.36e+2 Y 9.64e+1 start 6.65e+1 end 6.89e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 9.47e+1 start 6.89e+1 end 7.03e+1 ts 1.39e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 9.31e+1 start 7.03e+1 end 7.67e+1 ts 1.41e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.82e+0 X 1.38e+2 Y 9.17e+1 start 7.67e+1 end 8.65e+1 ts 1.42e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.67e+0 X 1.40e+2 Y 9.02e+1 start 8.65e+1 end 0.00e+0 ts 1.37e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.89e+0
As you can see we now have constant acceleration values, but the start/end speeds still vary from 6.65 to 9.09mm/s (note that we now no longer reach our requested velocity due to the reduction in acceleration).
I find this a little concerning, I would have thought that to get the best surface finish it would be better to minimise the variation in velocity as much as possible.
-
Part two of the previous post:
As an experiment I have implemented a grbl/Klipper style junction deviation algorithm (they are both very similar, the major difference is that Klipper specifies the allowed junction deviation in terms of square corner velocity, which I think is probably a better way to express what is happening). Using this algorithm with the square corner velocity set to 5mm/s (and with the m204 settings from above) I get the following results for the square:
X 1.00e+2 Y 0.00e+0 start 0.00e+0 end 5.00e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 1.00e+2 Y 1.00e+2 start 5.00e+0 end 5.00e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 0.00e+0 Y 1.00e+2 start 5.00e+0 end 5.00e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2 X 0.00e+0 Y 0.00e+0 start 5.00e+0 end 0.00e+0 ts 1.00e+2 rs 1.00e+2 acc 8.00e+3 dec 8.00e+3 dist 1.00e+2
Here you can see that the start/end speed for the right angle corners is indeed being limited to 5mm/s (which is slower then the same corners using RRF jerk settings). If I then run the circle test:
X 1.40e+2 Y 9.02e+1 start 0.00e+0 end 6.20e+0 ts 1.50e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.66e+2 X 1.41e+2 Y 8.90e+1 start 6.20e+0 end 7.26e+1 ts 1.30e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.42e+2 Y 8.79e+1 start 7.26e+1 end 7.21e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.44e+2 Y 8.71e+1 start 7.21e+1 end 7.27e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.46e+2 Y 8.64e+1 start 7.27e+1 end 7.20e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.47e+2 Y 8.60e+1 start 7.20e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.49e+2 Y 8.57e+1 start 7.25e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.51e+2 Y 8.57e+1 start 7.24e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.53e+2 Y 8.60e+1 start 7.24e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.54e+2 Y 8.64e+1 start 7.25e+1 end 7.20e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.56e+2 Y 8.71e+1 start 7.20e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.58e+2 Y 8.79e+1 start 7.25e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.59e+2 Y 8.90e+1 start 7.25e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.60e+2 Y 9.02e+1 start 7.24e+1 end 7.23e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.62e+2 Y 9.16e+1 start 7.23e+1 end 7.26e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 9.31e+1 start 7.26e+1 end 7.21e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.63e+2 Y 9.47e+1 start 7.21e+1 end 7.22e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 9.64e+1 start 7.22e+1 end 7.28e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 9.82e+1 start 7.28e+1 end 7.19e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.64e+2 Y 1.00e+2 start 7.19e+1 end 7.29e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.64e+2 Y 1.02e+2 start 7.29e+1 end 7.19e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.64e+2 Y 1.04e+2 start 7.19e+1 end 7.28e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 1.05e+2 start 7.28e+1 end 7.22e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.63e+2 Y 1.07e+2 start 7.22e+1 end 7.21e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.62e+2 Y 1.08e+2 start 7.21e+1 end 7.26e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.60e+2 Y 1.10e+2 start 7.26e+1 end 7.23e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.59e+2 Y 1.11e+2 start 7.23e+1 end 7.26e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.58e+2 Y 1.12e+2 start 7.26e+1 end 7.21e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.56e+2 Y 1.13e+2 start 7.21e+1 end 7.27e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.54e+2 Y 1.14e+2 start 7.27e+1 end 7.20e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.53e+2 Y 1.14e+2 start 7.20e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.51e+2 Y 1.14e+2 start 7.25e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.49e+2 Y 1.14e+2 start 7.24e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.47e+2 Y 1.14e+2 start 7.24e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.46e+2 Y 1.14e+2 start 7.25e+1 end 7.20e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.44e+2 Y 1.13e+2 start 7.20e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.42e+2 Y 1.12e+2 start 7.25e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.41e+2 Y 1.11e+2 start 7.25e+1 end 7.24e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.40e+2 Y 1.10e+2 start 7.24e+1 end 7.23e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.38e+2 Y 1.08e+2 start 7.23e+1 end 7.25e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 1.07e+2 start 7.25e+1 end 7.32e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.77e+0 X 1.37e+2 Y 1.05e+2 start 7.32e+1 end 7.12e+1 ts 1.41e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.82e+0 X 1.36e+2 Y 1.04e+2 start 7.12e+1 end 7.28e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.36e+2 Y 1.02e+2 start 7.28e+1 end 7.19e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.36e+2 Y 1.00e+2 start 7.19e+1 end 7.29e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.36e+2 Y 9.82e+1 start 7.29e+1 end 7.19e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.80e+0 X 1.36e+2 Y 9.64e+1 start 7.19e+1 end 7.28e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 9.47e+1 start 7.28e+1 end 7.12e+1 ts 1.40e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.79e+0 X 1.37e+2 Y 9.31e+1 start 7.12e+1 end 7.33e+1 ts 1.41e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.82e+0 X 1.38e+2 Y 9.17e+1 start 7.33e+1 end 7.65e+1 ts 1.38e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.67e+0 X 1.40e+2 Y 9.02e+1 start 7.65e+1 end 0.00e+0 ts 1.34e+2 rs 1.50e+2 acc 8.00e+3 dec 8.00e+3 dist 1.89e+0
The start/end speeds are now much more consistent (for why they are not identical see below), as is the top speed. I tried to choose the square corner velocity setting to make the speeds match the speeds obtained using RRF on the circle test as well as I could, which on my printer produces "smooth sounding motion", interestingly this ended up being the value that Klipper uses by default.
I'm not totally sure what to conclude from this. Personally I think that junction deviation provides a better overall way of managing the velocity at a junction than the current RRF jerk system, with a slower speed being used at sharper corners and a more consistent speed on the shallow corners of the circle. I appreciate that the curve used may not be "correct" for all printers, but the nice thing about the grbl algorithm is that it seems to be reasonably efficient (and has been tested on a wide variety of machines). If we plan to replace jerk I'd certainly suggest that we use something that can be applied to the velocity of the move rather than to the motors/drivers (though perhaps the current jerk mechanism could be used as a per motor upper limit rather like m201 acceleration is used when combined with M204 limits).
NOTE 1: I'm currently not 100% sure why the start/end speeds are not identical when using the junction deviation code. I suspect it is mainly down to the variation in segment length (this circle was taken from slicer generated gcode). It may also possibly be caused by the type of approximation used by the grbl based code?
Note 2: Amusing to see that it looks like the forum considers "jerk" to be a "rude" word!
-
@gloomyandy it's so weird jerk was not on the list, only spam sites
-
undefined gloomyandy referenced this topic
-
@gloomyandy May I ask what has been already implemented, today 6 months later?
I am not asking out of mere curiosity. I am struggling with jerk values that are low enough at square corners (in order to avoid ringing) but are at the same time high enough to allow printing smooth curves. A kind of adaptive jerk would be the obvious solution (depending on the angle and speed difference between every two consecutive segments). Call it junction deviation if you like.
-
@Triet Which firmware version are you using. The new 3.6.beta4 firmware (findable in the beta firmware forum category) is absolutely fantastic as it has a new input shaping methodology, You may find this helps your issues.
-
@Triet Pretty much nothing more from me than I described above, which is all on an experimental branch of the stm32 port. I've been busy working on 3.6 (as the changes there seemed more important) and not really had a chance to get back to this (plus there did not seem to be much interest in discussing the results of the tests I've been running so far).
-
@Notepad I am using last stable version from Dec. 2024 (I think it was December).
Yes I will jump into the beta version. I read that the modulation of nozzle temperature depending on flow has been implemented. I have been doing experiments with varying temperature during the print using a postprocessor script and believe me, that is a great feature.
But I will have to update the PanelDue firmware first.
-
@gloomyandy Perhaps you are drawing wrong conclusions from lack of participation of other developers. Some of them modify the firmware for their particular interests, so they just do their own thing and don't care (my speculation).
In any case, mortal users would definitely welcome that kind of adaptive jerk.
Let me try to emphasize. I don't know how to explain my point. Haven't you noticed? Half a world of 3d printing people is talking about things like pressure advance, retraction, flow, speed and acceleration - the key elements to control for a succesfull print. With junction deviation (or something similar) one more advanced mechanism would enable to get rid of defects commonly found everywhere.
Klipper is becoming overwhelmingly popular and is considered the firmware of choice for ambitioned users, but every time I check and compare to RRF I have come to the same conclusion: no reason to switch, and RRF is more polished and reliable.
Until now. Why this adaptive jerk has not been done after years of RRF development... I can't understand. In my naivity, I was even asuming there is some gcode command to tune that, but no.
In my particular case, my prints tend to come out flawlessly, except I get caught by the jerk dilemma. Either low jerk and jerky, stuttering curves with artifacts , or high jerk with smooth, uniform curves but visible ringing around corners. I am constantly changing jerk settings, depending on whether the model has many corners or many curves... Seems not acceptable to me after the underlying factors have been clearly understood. Roughly: Next segment moving in same direction? High jerk! Otherwise: Low jerk! That is not rocket science.
So again, the impact of this feature is not trivial. It is not just "nice to have" but a plain necessity.
Sorry if I my statements are too blunt.
Right now we can see how a certain proprietary printer brand allows itself to treat their clients as slaves, but only because they did many things just right and conquered the market. Open systems, to which Duet3d belongs, can and should perform better.
I said what I said. Let's paint the town red.
-
@Triet Just to clarify, I do not work for or have any direct association with Duet3D. I am the main developer for the stm32 port of RRF firmware and in general I try to keep that code as close as possible to the Duet3D version (particularly for things like motion control). As such I have no direct influence over what goes into the Duet version of RRF firmware. If you wish that version to change then you need to convince @dc42 or @T3P3Tony that this is an area that needs attention. These things typically come down to time and priorities (and to some extent interest), we have all been busy working on changes in 3.6 (which have been pretty major), to some extent we are still catching up on the that in terms of understand how this new code interacts with things like jerk, PA etc. As mentioned above the changes in 3.6 over a big improvement in terms of ringing and I'd encourage you to test that version.
Also I'm not sure that the way that Klipper handles jerk is really much different to RRF, it may be a little smoother (see my tests above), but it is not fundamentally different.
-
@gloomyandy Gotcha. Let's hope @dc42 or @T3P3Tony are reading this.
I will try the last beta and report. But I would rather avoid resonance vibrations by fighting their cause in the first place, better than trying to compensate them.
It is my understanding that junction deviation takes the angle of movement change into account in order to calculate and apply the jerk value, and RRF does not do that. For me, that is an essential difference (caveat: I am not very familiar with Klipper, I just try to assess its advantages).
-
@Triet Your understanding of what RRF does is not correct, it does take the angle of the junction into account. You can see the RRF code here: https://github.com/Duet3D/RepRapFirmware/blob/3.6-dev/src/Movement/DDA.cpp#L1082
As you can see it uses the direction vector of the two moves to calculate the jerk for each axis and applies the configured jerk limits to this.
You can see this in action in my previous post: https://forum.duet3d.com/post/345258
For the square the velocity at the junction is limited to 8.33mm/s, but for the circle the junction is limited to between 60 and 90mm/s, so the junction angle is clearly being used to limit the junction velocity.In the above case Klipper would limit the speed at the corners of the square to 5mm/s while limiting the junctions on the circle to 72.5mm/s. There are differences between how Klipper and RRF handle junctions (see my previous posts for more details), but I don't think they are as big as you think they are.
-
@gloomyandy I have to believe you, anything else would be my blatant arrogance. At the same time, my experience with the firmware release 3.5.4 fails to confirm that.
The resolution of this contradiction is simple. I will install that beta version right now. I will let you know the outcome.
May I assume then that the feature as you described it will be in the next stable (official) release?
-
@Triet said in [FW 3.5.2] High jerk good for circular path not for corners:
May I assume then that the feature as you described it will be in the next stable (official) release?
What feature?
-
@gloomyandy The angle dependent jerk.
-
@Triet That is already present in RRF (and pretty much always has been).
-
@gloomyandy That implies that this thread, including your postings, are senseless.
Let me quote @leone :
"I am doing some motion tuning for a quite big and heavy machine. In general I noticed that having high values of jerk (about 500-600 mm/min) are good enough to travel circular paths smoothly (even tough it depends a lot on the mesh quality), but they are a bit high when printing corners"This is what this whole discussion is about: Same jerk values don't fit well in corners AND curves, and should be made adaptive. This is exactly my concern, as I explained. You can read the details above.
So I cannot follow.
-
@Triet, what @gloomyandy correctly explained is how the jerk is implemented in RRF 3.5.x and also 3.6 betas. The jerk set from the configuration is the max allowable speed change that a specific axis can do between two consecutive moves: RRF checks the components of the direction vector between two consecutive moves to understand how much each axis has to change in speed, if this change is greater than the threshold (jerk), then the threshold itself will be used.
What I proposed as adaptive jerk meant to change dynamically this threshold, based on a non linear relationship with the direction angle. It's one layer of logic above what RRF is already doing, maybe something like "adaptive MAX jerk" would have been more clear
I actually paused this investigation because the results I got with the 3.6 betas and the new input shaping are very good and fixed most of my issues.
I can confirm that find a reliable logic to implement here is more difficult than it might seems. Maybe in future I'll give another chance to the junction deviation or the "adaptive MAX jerk" on top of 3.6 to see if there are real benefits.