I’ve got a script on my sd card that’s just “G92 X0 Y0” (and another that’s “G92 Z0”, no end stops), which I tried to use to cut a bunch of copies of a part. After the first part, I move the machine over a bit past where I was cutting, then ran G92 X0 Y0 again to re-home it while leaving the Z how it was, and run another part. This worked the first few times, but maybe the third time suddenly the info screen on the LCD read X=0, Y=7, Z=0 after running G92 X0 Y0. I tried running it again, same issue. Ran G0 X0 Y0 and the machine moved -7Y as you’d expect, so it’s not just a glitch with the position display or something. Am I understanding how G92 should work correctly? I’d think that after running it your position should always match what you specified…
I wonder if you are having the same problem with your script that I detail here.
If you are running a script from a file, and the last line of the file is not terminated with a linefeed, then that line is not run.
@zacaj Robert 100 percent nailed this! Hoping its the same issue and his fix will help you clear it up!
I’ll give it a shot but, wouldn’t it not have affected the X either then?
In all the issues that are similar to yours I’ve seen on this forum, none have been traced back to buggy firmware. If you execute the same g-code from the same state, you get the same result. So, something is strange here. Some possibilities:
- There is something wrong with the g-code in the file. My previous answer listed one such problem, but it is not the only one. If you upload your g-code to a post, someone on the forum can take a look.
- The display is out of sync with the real coordinates. The only coordinate values I would trust are the ones displayed by Marlin. The ones in Repetier-Host or the ones displayed on the TTF screen with an SRK Pro board are suspect. If you are using an SKR Pro, put the screen in Marlin mode (hold the knob down for a few seconds) and retest the situation.
- User error of some sort. You are not really repeating the same steps, or you don’t understand something about the steps you are doing.
I’m sure we can figure it out, but we will likely need more information.
Alright, I ran into the issue again. This time I was at X150 Y95, then I ran the command. The info screen on the display (Full Graphic Smart Controller, Big – V1 Engineering Inc) then read X0 Y2. I then took the SD card, opened the file, and found that as you said, there wasn’t a newline. And there wasn’t in ANY of my other commands (like ‘G0 X0 Y0’) either, although they all work fine. I added a newline, ran G92 X0 Y0 again, and now it reports X0 Y0 as it should. Unless that was blind luck, it seems you were right, but there’s gotta be something even weirder than just “it ignores the last line if it doesn’t have a newline” to cause results like this.
While I don’t think it is the case, I can imagine a “bug” in Marlin where non-terminated lines might get executed because of later lines (other files) finish the termination, or where Marlin is buggy about such lines depending on the exact command sequence. I don’t know this to be the case. I know about the last-line-not-terminated problem because I’ve run into it myself. I don’t want a computer in my shop area, so I run everything from an SD card.