FT Motion ultra smooth pulse trains (silent, better surface quality)#28115
Conversation
e4f88cb to
29aad5d
Compare
|
With the latest optimisations, the |
|
I just gave it a try. Motion on each axis is fine. Sensorless homing is broken with |
900d0d1 to
64192a2
Compare
|
Compilation fails in |
|
Sensorless homing fails, Z homing with BLTouch fails, manual motions are fine. |
I'm not considering homing & probing yet. Homing and probing never worked well for me so still on classic for that. I do think that will be easier once this is ready |
you should make ftm_buffer_size a power of two , otherwise the buffer may wrap around in a weird way |
|
I use de default |
|
I know you don't have issues, but I do, so imo still experimental
true, I have not updated defaults yet. I have it my printer's settings. thanks for reminding me of that. Still, don't use the default iin this branch |
|
After robherc pointed out to me that we should do everything possible to never ever leave any chance open of having step drift, I put more thought on the bresenham dividend calculations, and changed it to use integers with fixed point arithmetic and an exact tracking of steps. Actually, not only steps, but fractions of steps. Also, fixed the runout block in the presence of axis shaping. |
|
Just a little information, during sensorless homing, the axis moves fine, the motor then grinds until the end of the theoretical |
I have to modify the stall sensitivity when switching to FT Motion generally, but mainly to avoid false positives. Is there any range of sensitivity that causes sensorless homing to stop at or before the end? |
|
My stallguard sensitivity is fine for homing with ou without |
33a34c4 to
e0c008c
Compare
| // FBS / post processing. | ||
| if (batchRdy && !batchRdyForInterp) { | ||
|
|
||
| // Call Ulendo FBS here. |
There was a problem hiding this comment.
Ulendo themselves may need this hook for their own internal stuff.
There was a problem hiding this comment.
Our recent optimizations are also fixing critical motion shortcomings so we hope to move forward and get this thing shipped with these improvements. But this and the updated M493 means more work for you with FBS @ulendoalex . Can you work with these changes?
There was a problem hiding this comment.
It should involve only adding your buffer between these two calls:
xyze_float_t traj_coords = calc_traj_point(currentGenerator->getDistanceAtTime(tau));
traj_coords = add_to_ulendo_buffer_and_return_a_transformed_coord_point
stepper_plan_t plan = calc_stepper_plan(traj_coords);and adding an extra waiting time as big as your buffer to the runout.
You'll also benefit from all the time resolution, perf and ram improvements (including ultra clean & silent pulse trains, increased surface quality, reduced resonances, better linear advance, etc).
There was a problem hiding this comment.
I dunno, the smoothness of this smoothing is now so good it might make FBS obsolete! ;-)
dc6c438 to
0b50d4d
Compare
0b50d4d to
4667d72
Compare
c70caa1 to
8c66611
Compare
|
Had some very nasty divergences between my private branch (the one i trust because it is where I can do the logic analyser data acquisition and test prints) and this one. I lost way to much time trying to reconcile and not trusting it, so I just grabbed everything back from my trusted branch. Tomorrow I'll continue testing and if everything goes well I should be able to update the PR description and mark it as ready for review. Thanks for all the feedback! |
I have amazing facility in reconciliation with git, so don't hesitate to ask if you want your changes isolated from adjustments and bug fixes that were made while studying the code. In most cases you can just force-push your "trusted" code, and I can use |
|
With the last code, when you compile Marlin with Changing to previous code works like a charm |
|
Oh, it's missing .A |
|
It's bonkers how smooth it runs |
|
Surface quality is also unreal |
|
|
| #define _SET_MOVE_END(A) do{ \ | ||
| if (moveDist.A) { \ | ||
| axis_move_end_ti.A = move_end_ti; \ | ||
| axis_move_dir.A = moveDist.A > 0; \ | ||
| } \ | ||
| }while(0); | ||
|
|
||
| LOGICAL_AXIS_MAP(_SET_MOVE_END); |
There was a problem hiding this comment.
@thinkyhead , you can remove PR #28125 and perhaps we could only keep axis_move_dir = current_block->direction_bits.
| #define _SET_MOVE_END(A) do{ \ | |
| if (moveDist.A) { \ | |
| axis_move_end_ti.A = move_end_ti; \ | |
| axis_move_dir.A = moveDist.A > 0; \ | |
| } \ | |
| }while(0); | |
| LOGICAL_AXIS_MAP(_SET_MOVE_END); | |
| axis_move_dir = current_block->direction_bits; | |
| #define _SET_MOVE_END(A) do{ \ | |
| if (moveDist.A) { \ | |
| axis_move_end_ti.A = move_end_ti; \ | |
| } \ | |
| }while(0); | |
| LOGICAL_AXIS_MAP(_SET_MOVE_END); |
There was a problem hiding this comment.
I think we should revise the axis move ti thing completely (not within this pr). Now there is a single buffer so this whole time math is most likely not even needed. We could just set the last moved buffer index when a block is loaded, and clear it when that index is dequeued.
There was a problem hiding this comment.
Actually we could do that from within the queue and dequeue functions. Axis that move have a non zero dividend
There was a problem hiding this comment.
It's just temporary unless this can be refactored. I've found a solution in current bugfix but i always loose a ftmotion_stepper() call.
There was a problem hiding this comment.
Interesting, for me (with the other probe patch on top) it works as is. Should I apply your patch as is or does it require extra stuff?
There was a problem hiding this comment.
For axis_move_dir only the diff above. In the current bugfix, I create an empty command which marks the start of the block. When losing one ftmotion_stepper() call, everything is fine but not when I try to process the next command if the buffer is not empty.
There was a problem hiding this comment.
The main thing is to make sure the "is moving" and "current direction" are related to the immediate state, where "is moving" refers to the block currently being stepped.
Strictly speaking, all an endstop check wants to know is, "is the step count on the axis closer to the endstop end than it was the last time I checked?" and the same goes for probes wanting to check if the new position is lower.
There isn't much besides endstop checking that cares about having these states prepared, so if it is possible to refactor endstops and probes to use these counts instead, that would free up a few cycles from the motion code and localize more of the endstop / probe logic in their respective classes.
|
Just for fun (or upcoming thing) Not so smooth and noiseless VID_20251101.mp4 |
|
You can remove PROPBATCHES definition in |
Review adjustments for FTM Variable Rate
Description
This PR:
The smooth pulse train means higher surface quality, more silent steppers, less VFAs and less resonances.
It also makes step timings of each axis independent of the rest, eliminating a limitation of the classic motion system where the slower axes had slower time resolution (jittery rates) than the fastest one.
Below a comparison of the step trains of the classic motion system vs FTMotion before vs FTMotion after
(Note that the bands in classic are because of the oversampling from dynamic smooth stepping)
It is also a lot more ram efficient:
Before
After
Extras
This is quite a sizeable refactoring, it also:
probing.mp4
Requirements
Benefits
Configurations
Related Issues