-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Can I change the Z-Offset via Gcode? #4266
Comments
In the official firmware released by Prusa Research, the gcode If I were you I'd look into these functions: You could "patch" the firmware by rewriting the M851 gcode to do whatever you want :) There is some debugging code you could enable in #if 0
SERIAL_ECHO("Z baby step: ");
SERIAL_ECHO(babystepLoadZ);
SERIAL_ECHO(", current Z: ");
SERIAL_ECHO(current_position[Z_AXIS]);
SERIAL_ECHO("correction: ");
SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_unit[Z_AXIS]));
SERIAL_ECHOLN("");
#endif Hopefully this helps 👍 |
Thanks for the fast answer and the suggestion. I will look into it and see if this is a viable solution. |
I strongly believe that there should be an option to adjust the z-offset directly from the GCODE. The current options provided, such as "Live adjust Z" and "Z Offset" under Printer Settings -> General -> Size and coordinates, are not always effective. For instance, I am using this guide (https://blog.prusa3d.com/how-to-print-on-t-shirts_55588/) to print on t-shirts. To achieve the desired z-offset, I initially reset it to +0.0000 from the printer menu, but then, before each print, I have to manually set it to around -0.5000. This repetitive process becomes cumbersome as I have to reset and adjust the z-offset each time, or add another -0.5000 to the existing value. Unfortunately, the options currently available do not allow for automation. Therefore, we need alternative methods to set the z-offset according to individual preferences, rather than being restricted to Prusa's predefined options. |
This issue has been flagged as stale because it has been open for 60 days with no activity. The issue will be closed in 7 days unless someone removes the "stale" label or adds a comment. |
We have implemented The Gcode is case sensitive so please ensure that you don't use a serial terminal that UPPERCASE automatically, like Pronterface (PLEASE don't use it at all), OctoPrint. In OctoPrint you can add Set sheet data
Examples:
Sending Sending Be careful with setting the sheets via Gcode as this may cause issue. Side note we will update the documentation and report in the next release. |
@tdortton Please let us know if the question has been answered and consider to close this issue. |
Thanks for implementing this in the code. I'm looking forward to testing it with the next release. |
Pretext
For my bachelor thesis Im working on automating a Prusa MK3S+. I have installed a MMU2S for material selection and a bed changing mechanism to enable continuous printing. The criteria is that I want to use both smooth and textured printing beds, depending on the selected material without having to manually change the Z-Offset. I’ve been looking into a way to set up different printer profiles for the corresponding print surface, with the goal to send the correct z-offset to the printer during the start Gcode.
Questions
Is there a clean way or a workaround to set the z-offset via gcode?
What I tried already
I appreciate all the tips I can get!
Thanks alot!
The text was updated successfully, but these errors were encountered: