I have an Elegoo Neptune 4 Pro (love it), and I'm trying to set up a Raspberry Pi with a camera to take a photo every time a layer is complete (to build a time-lapse).
This means I'll have to edit the G-code to move the print head to the X-axis maximum to press a button (shutter release).
I'm using the web interface and would like to know how to get the X-axis position using G-code commands.
I've found Klipper documentation: G-Codes and have tried to run a few of the commands.
M114
gives the following line:
14:58:56 X:141.000 Y:98.000 Z:11.090 E:0.000
However, when I try to send the print head to that location from somewhere else, I get errors.
$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000
!! Unable to parse move 'G0 X:141.000 Y:98.000 Z:11.090 E:0.000'
$ G0 [X:141.000] [Y:98.000] [Z:11.090] [E:0.000]
// Unknown command:"G0 ["
$ G0 [141.000] [98.000] [11.090] [0.000]
// Unknown command:"G0 [141.000] [98.000] [11.090] [0.000]"
$ G0 141.000 98.000 11.090 E:0.000
// Unknown command:"G0 141.000 98.000 11.090"
$ G0 X:141.000 Y:98.000 Z:11.090 E:0.000
All of these tried with G1
as well as G0
Based on the error messages, it looks like the first line above is the way to go; But I'm not sure where to go from here.
G0 X141.000 Y98.000 Z11.090 E0.000
? $\endgroup$G1 X141 F5000
will send the head to X=141 without touching Y and Z, and do it fast. [also, while G0 and G1 can be used pretty much equally, it is "traditional" to use G0 for printing/cutting/work in general, G1 for free movement between work points.] $\endgroup$