Gcode sometimes switches to relative

I just completed my LR3 and have successfully pen drawn the crown pre-made gcode. I have tried generating gcode with Estlcam and with Fusion 360. I’ve run the gcode successfully and then sometimes the same gcode starts moving higher and higher. It’s like G91 (relative positioning) is sent to the machine. I examined the gcode and there is no G91. Only a G90 (absolute positioning) at the beginning of the program. At some point I need to halt execution because the the LR3 makes it near the end of the X or Y axis on my 4’x8’ bed. Any thoughts on how I could start debugging this issue?

Sometimes macros or other code sends G91 as a part of other code. This is useful for things like a relative lift of a print head by 5mm etc. Typically these restore absolute mode afterwards, but maybe that’s getting scrambled, or it isn’t sending a newline? Marlin shouldn’t switch on its own. Are you using any LCD commands other than a ‘Start program’?

Oh, also check your Estlcam start code. I specifically put a G90 in mine to ensure it is in absolute mode before it does anything else.

Big progress…I think I have narrowed it down to using the SKR/Marlin screen controls to position to the start position. Whenever I run the gcode after a reset of the SKR board and do my positioning via Repetier and DO NOT touch the movements controls in the SKR/Marlin, then the gcode runs correctly. But if I use the SKR/Marlin screen to position before running job, then I get the runaway relative (G91) mode. Do you know how to fix this?

Also, thanks to Dan for the response.

Well, the “easy” fix is to put a G90 in your start code in Estlcam. Thos will force it into absolute mode no matter what has happened in between.

I didn’t think the movement commands in Marlin mode set relative movements, but I could se it being so.

I know that my Slicer settings for 3D printing set absolute positioning as a matter of course, so no harm in adding that to your start code for CNC programs, and isn’t too hard to do.

Edit: just opened Estlcam and checked Setup | CNC programs | Texts | Program start

1 Like

Well, the “easy” fix is to put a G90 in your start code in Estlcam. Thos will force it into absolute mode no matter what has happened in between.

I wish it was that easy. I already verified that there’s a a G90 at the beginning of the gcode. This is the start code generated by Fusion 360

But somehow it’s ignored or overridden by Marlin if the in-controller move feature is used.

I didn’t think the movement commands in Marlin mode set relative movements, but I could se it being so.

I have learned a lot in the past few days. One of which is that care must be used when switching back and forth between using typed gcode commands in Repetier and the SKR/Marlin move screen. SKR/Marlin turns on relative mode which, if I don’t remember that, will have me crash my machine sometimes with some a typed G0 move commands. And if I enable absolute positioning (typed G90) then use the SKR/Marlin move Z to up/down xx amount, then the move Z is interpreted as “G0 Zxx” in absolute positioning (ie G0 Z-1/1 will try to move to absolute Z=-1/1 rather than relative move Z axis by -1/1).

2 Likes

Okay, well that’s a head scratcher. My Marlin based boards never had that problem, and the Duet / RepRapFirmware boards I’m using don’t use the same LCD controllers.

What controller board are you using? Sounds like an SKR, but is it a Pro? Turbo? Is that one of the touch screen LCDs?

I’m using the TFT35 purchased from V1 Engineering.