Sorry if any of this duplicates something already in this long thread…
I’ve been playing with engraving in F360 and discovered that some of corner cuts, when it moves x, y and z at the same time we’re violating z max cut speed of the MPCNC.
I believe @jeffeb3 suggested that setting the max speed in Marlin would be a possible work around. While this may work it started me on a path to understand the post processor and the F360 API that drives the post processor. In the process I also discovered Autodesk’s extension for VSCode specially for building and testing post processors.
I now have a post processor that understands its current position and where it is moving to. With this information I can understand the type of move being made. If these moves are vertical retractions or horizontal moves above a safe height (a parameter zSafe) I turn these back into rapids. This corrects for most rapids and make the GCode much cleaner and faster. Since Marlin’s handling of G0 rapids is hit and miss I output the G0s with explicit feedrates.
While I was in the code I’ve reviewed the G1 code and how it handled feedrate. I found if you were moving in x, y and z at the same time (like during an engrave corner cut or any 3D cut) the feedrate for z was greater then the MPCNC max. Nothing I did in F360 solved this, except limiting all feedrates to be limited by max z.
I’ve now added code that takes every G1 cut and projects the federate into its x, y and z component and then scales these not to exceed the axis’s max feedrate then recalculated the resulting G1 vector’s feedrate.
The result is that a G1 can move in x, y and z at the same time and have a high feedrate when z is changing only a little relative to x and y. It z is changing a lot relative to x and y, like a corner engrave cut, then the feedrate gets scaled more heavily so not to exceed z max. These calculation seem to work well.
Originally I had hoped to do a pull request to add these changes back to guffy’s post processor but when I started to use Autodesk’s VSCode extension it required all the code to be one file. From that point the changes just started to increase and I now plan to just put this up on GitHub as a fork of guffy’s.
I still have cleanup work to do. Probing or any commands where the post processor outputs gcode that changes x, y, z position currently happens without F360 knowing this which messes up F360’s understanding of current position. The F360 API does have calls to tell F360 about these changes - I just need to insert these in the correct places when commands like probing are added to the GCode.
I’m busy a work currently so my time is limited in finishing what was a Xmas project. The reality is it will be several weeks more to complete this. Once it’s ready I’ll post more info.