-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Description
Did you test the latest bugfix-2.1.x code?
Yes, and the problem still exists.
Bug Description
When you call the P000 command to pause or hold motion, it does not decelerate—it stops the motors immediately. This sudden stop causes positional errors because ongoing inertia physically moves the machine beyond the last commanded position, unless the motion is very slow.
English is not my native language, so please excuse any inaccuracies. When I read “instant pause/hold,” I expect a command that safely stops motion and maintains a trustworthy position for later continuation, especially since in CNC terminology, “hold” strongly implies an instant pause that does not cause positional error.
I examined the code to see what actually happens.
The P000 command redirects to this line in e_parser.cpp:
case EP_GRBL_PAUSE: quickpause_stepper(); break;
In the quickpause_stepper function in motion.cpp, there is only one line:
planner.quick_pause();
In planner.quick_pause() (found in planner.cpp), two steps occur:
- Call stepper.suspend()
- Report the pause
In stepper.h, the suspend() method looks like this:
static bool suspend() {
const bool awake = is_awake();
if (awake) DISABLE_STEPPER_DRIVER_INTERRUPT();
return awake;
}
Following the code beyond this gets complicated for me. but it looks like intentionally disables step pulses immediately, causing an abrupt stop.
I have been working on Marlin to control a custom machine with a custom host software, relying on P000 to provide a hold feature assuming it is the same with the CNC HOLD concept, then I found that it doesn't.
I am not sure if this feature coded intentionally this way or if it is an oversee. I think either the feature or the description should be fixed.
Bug Timeline
I realised the issue with 2.1.3 b3... it seems goes back to as far as the very existence of P000
Expected behavior
When it is called in realtime, it would provide a pause with deceleration while staying on the intended path. So following R000 command would continue on the same path without positional error.
Actual behavior
It stops the motors immediately, causing ongoing inertia to cause positional error.
Steps to Reproduce
Activate EMERGENCY_PARSER in the Configuration_adv.h
Make the machine move at a certain speed that would cause inertial load at sudden stop.
Call P000 command to make it pause/hold while the machine is moving.
Version of Marlin Firmware
2.1.3-beta3
Printer model
A custom cartesian machine. Not a 3D printer.
Electronics
BTT SKR 2.0
LCD/Controller
none
Other add-ons
Spindle
Bed Leveling
None
Your Slicer
Other (explain below)
Host Software
Other (explain below)
Don't forget to include
- A ZIP file containing your
Configuration.handConfiguration_adv.h.
Additional information & file uploads
It is a custom machine to perform a custom task. Therefore I write G-codes by hand. There is no slicer information to provide.
I use a host software coded by myself. It is pretty much an automated serial terminal. A serial terminal could do the same to replicate the issue.