Prusa Firmware 3.9.0 Relative Extrusion Support

Hello!

Context
Prusa recently released a new firmware (ver. 3.9.0) for their MK3, MK3S, MK2.5 and MK2.5S printers.

Amongst the changes, the release notes mention that their firmware now decouples XYZ relative and E relative commands. In other words, this means that G91 no longer sets extrusion to relative, and that must be done now via M83. This specific change can be seen in the code here.

Problem
What is the issue? The OctoPrint core "Extrude" command in the Control tab now behaves in an absolute manner when sending extrusion commands to these Prusa printers. Users who manually extrude via OctoPrint may find this UX counter-intuitive and not ideal, as their printer may not extrude because of the absolute behaviour, whereas the previous firmware versions treated it as relative. Prusa printers are widely used in the community, so I assume this would affect many OctoPrint users as well, which is why I am bringing up this issue here.

Solution
I'd like to propose wrapping the OctoPrint core extrusion commands with M83 and M82, similar to how it's currently being done with G91 and G90. Although this approach would in fact support the most recent Prusa firmware, it will also be a preventive fix for any future firmware that may decide to decouple XYZ from E relatives.

The fix is fairly trivial and I have a branch up with a proposed solution. I didn't submit a PR yet because I wanted to check in with the OctoPrint community first.

Testing
I've tested my proposed fix on a separate branch off of the maintenance branch (ver. 1.5.0.dev242+g2e5d97e9), on a Prusa i3 MK3 running the latest 3.9.0 firmware and on a MakerGear M2. It indeed fixed the relative extrusion issue on the Prusa. I also tested it on the M2 to make sure it wouldn't break things for other printers.

I'm open to hearing your thoughts on this situation!

Groan. Yes, this is what 3d printing needs: manufacturers that unilaterally decide to break existing gcode by interpreting existing gcode commands differently from other manufacturers. Awesome!

5 Likes

Any objections to me making a pull request for this?

Send a PR against maintenance please.