#Automatic Z-offset

1 messages · Page 1 of 1 (latest)

zenith goblet
#

Why would you need if statements? G10 P1 Z{62 - move.axes[2].machinePosition}

#

why do you want to save it to a file?

sleek dawn
#

Then I don't have to do a calibration every single time. Or is this wrong?

zenith goblet
#

I think M500 saves tool offsets automatically

sleek dawn
#

I'll put all the offsets to 0 and try it out

sleek dawn
zenith goblet
#

You need to have M501 in config.g in order to read config-override.g

#

you can verify that M500 saved tool offsets by looking at config-override.g after sending M500

sleek dawn
#

I'll have a look, currently experimenting with g10

sleek dawn
#

Let me add one manually and see if that changes

zenith goblet
#

look at config-override.g

sleek dawn
zenith goblet
#

is there any G10 in there?

sleek dawn
#

Yeah all of them but I figured out what it was. There was a L2 in the G10 command that I looked over

#

I'll leave this thread open for a little bit until I have everything working. But this helps a lot

#

Thanks for the help

zenith goblet
#

👍

stoic prawn
#

M500 P31 is probably what you want

zenith goblet
#

P31 is for probe offsets, (mnemonic is G31), for tool offsets, you want M500 P10 (analog to is G10) -- but, once the stuff is present in config-override, it should be no longer necessary to use P31 or P10

sleek dawn
#

;move sensor in position
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; Check if axis are not homed
;If axis are not homed, home axis
echo "Axis are not homed, performing homing"
M98 P"0:/sys/homeall.g"

G01 V-10 F800;
G01 Z96 F6000;
G01 V34 F800;
G01 Z79 F6000;

T1; Pick up tool 1

G10 P1 Z0; Set offset to 0

G10 P1 S170; Set tool active temperature
M116 T1 S10; Wait for temperature to be reached

var SensX=136.6;
var SensY=184.3;
G01 X{var.SensX - global.OffsetX_Tool3} F6000;
G01 Y{var.SensY - global.OffsetY_Tool3} F6000;

G91
G01 Z-16 F200 H4;
G04 S1;
G01 Z2 F1000;
G01 Z-16 F100 H4;
G04 S1;
G01 Z2 F1000;
G01 Z-16 F100 H4
G04 S1;
G01 Z2 F1000;
G01 Z-16 F100 H4;
G04 S1;
G90;

G10 Z{move.axes[2].machinePosition-global.ProbeOffset};
M500;

G01 Z96 F6000;
M98 P"0:/sys/homev.g"

T-1;

G1 X0 Y0 F6000;

steady drumBOT
#

GG @sleek dawn, you just advanced to level 4!

sleek dawn
#

This is the current code

#

Much simpler then I initially thought

sleek dawn
#

When I send:

echo >"Parking position.g" "global ParkingPost4 = {move.axes[0].machinePosition-1}"

It of course write the exact thing written there understandably, is there a way to write the current position to the file in actual numbers?
I've been looking around everywhere but haven't found anything yet

sleek dawn
#

Found it

echo >"Parking position.g" "global ParkingPost4 = ", move.axes[0].machinePosition-1
zenith goblet
#

you just had to move the {} out of the quotes

#

the quotes escaped the meaning of {}