Strange Z error
-
@phaedrux thanks for your help. I am working on adapting your macro for myself, I hope that is ok. This is where I am currently at.
M291 P"Grid bed compensation map and Z Probe trigger height will be cleared. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel. G28 ; home all axis M561 ; Disable any current bed compensation G90 ; Absolute positioning T0 ; Activate first tool M203 Z500.00 ; Set lower speeds for Z homing and lower Z motor current M913 Z50 ; Drop motor current to 50mAh to prevent damage in case of head crash M291 P"Preheating to bed to 60 and nozzle to 210 for accurate probing" M104 S210 ; Set nozzle to 210 and release M190 S60 ; Set bed to 60 and wait M109 S210 ; Set nozzle to 210 and wait M98 P"0:/sys/playsound.g" M291 P"Nozzle will now move to center of bed to reset Z0 and calibrate probe" S3 xxxM98 P"0:/macros/Calibration/Bed Leveling/1_Center Nozzle on Bed" ;TODO<-------------<Manual G1 move? G90 G1 Z3 F400 ;Moves Z a bit up? M400 G92 Z4 ; Reset z to 8? to allow jogging up to touch bed to nozzle ;feeds arbitrary coordinate? M291 P"Jog the Z Axis until the bed and nozzle are touching and click OK" R"Setting Z=0" Z1 S3 M400 G92 Z0 ; Set z = 0 G90 G1 Z3 F400 M104 S0 ; Turn off hotend heater as it's no longer needed M291 P"Probe will now move to center of bed and measure trigger height 10 times" R"ZProbe Trigger Height Calibration" T3 M400 xxxM98 P"0:/macros/Calibration/Bed Leveling/1_Center Probe on Bed" ;TODO<--------------<Manual g1 move? G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-3 ; measure probe height and set it. M400 M500 P31 ; save trigger height to config-override.g ;need save babysteps macro anyway? G1 Z5 M98 P"0:/sys/playsound.g" M104 S0 ; Set nozzle to 0 and release M140 S0 ; Set bed to 0 and release M203 Z1000.00 ; return to normal speeds (better to revert to saved values than to set them manually?) M906 X1250 Y1250 Z650 ;return to normal currents M400 M291 P"Homing" G28 ; Home Z M84 ; turn off the motors M291 P"Probing complete. Turning off heaters and homing axis. Check log for trigger heights and execute Save Babysteps Macro" S2
There are some points I wonder about though. You use another macro to return the z motors to your previous mAh. Is there a reason behind it, like does that macro get automatically updated after a firmware update that might mess with the values, or what is the idea behind it?
Then the move to the center with nozzle and probe. Is there an elegant way to get the probe to that position? Like do you use a relative movement reflecting your xy offset after the nozzle was centered, maybe even by reading out that value instead of manually copying it? Or you simply calculate the center?
-
@suntoxx said in Strange Z error:
There are some points I wonder about though. You use another macro to return the z motors to your previous mAh. Is there a reason behind it, like does that macro get automatically updated after a firmware update that might mess with the values, or what is the idea behind it?
I do that so that there is only one place I have to change the values if I want to make adjustments and it will then reflect in all the other macros that call it. Make shift variable from before there were actual variables.
@suntoxx said in Strange Z error:
Then the move to the center with nozzle and probe. Is there an elegant way to get the probe to that position? Like do you use a relative movement reflecting your xy offset after the nozzle was centered, maybe even by reading out that value instead of manually copying it? Or you simply calculate the center?
Again the reason for the macro for this is that I can adjust it as needed incase the actual probe gets moved and I need to change the offset. I can just update the position in that one macro. But to be honest it doesn't matter so much if I set the Z0 at the nozzle position and then do the probe testing 1mm away from that spot. General vicinity is enough.
You can see the entire macro set here: https://github.com/Duet3D/RRF-machine-config-files/tree/master/DBotCoreXY/x0r-wifi-RRF3
-
@phaedrux said in Strange Z error:
I do that so that there is only one place I have to change the values if I want to make adjustments and it will then reflect in all the other macros that call it. Make shift variable from before there were actual variables.
Does that mean that now it would be possible to save the current state from within the macro, change it to a lower value and at the end return to the saved state?
Again the reason for the macro for this is that I can adjust it as needed incase the actual probe gets moved and I need to change the offset. I can just update the position in that one macro. But to be honest it doesn't matter so much if I set the Z0 at the nozzle position and then do the probe testing 1mm away from that spot. General vicinity is enough.
I want to do it the same way, because there is quite some distance between nozzle and probe on the caribou and the mesh compensation is not working as perfect as I would like. I assume there is no way to tell the head to make a relative movement based on the current g31 xy offset?
You can see the entire macro set here: https://github.com/Duet3D/RRF-machine-config-files/tree/master/DBotCoreXY/x0r-wifi-RRF3
I will check that out, thanks!
-
@suntoxx said in Strange Z error:
Does that mean that now it would be possible to save the current state from within the macro, change it to a lower value and at the end return to the saved state?
That may be possible with conditional gcode, but my example is not that fancy.
@suntoxx said in Strange Z error:
I assume there is no way to tell the head to make a relative movement based on the current g31 xy offset?
With conditional gcode and the object model that is possible, though I don't know the exact syntax off the top of my head. But if you're hte programmatic type, see here: https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands
-
@phaedrux i had a look at the metacommands, but it seems with the current level of documentation, the time needed to get that working probably outmatches the work it would save me. I got the macro working though and quite consistently at that. I keep ending up with either 2.777 or 2.78 in console and on multiple runs of the macro I end up with either g31 Z2.77 or Z2.78 which seems fine to me. Do you end up at the exact same G31 Z if you run the macro multiple times in a row? Is it just practice, or is that deviation to be expected and can't really be avoided?
Edit: I did the "touch down" by looking the the nozzle and confirming the height when the shadow disappears. Is this the correct way, or is the speed and motor current reduced, in order so that i can move the extruder downwards until it stops moving?
Edit2: The mesh compensation is active again after the macro finishes? Should I restart Duet after the macro?
-
@suntoxx said in Strange Z error:
Do you end up at the exact same G31 Z if you run the macro multiple times in a row? Is it just practice, or is that deviation to be expected and can't really be avoided?
There's always going to be some small variation. 0.01mm is pretty tight. Nothing to worry about.
@suntoxx said in Strange Z error:
the shadow disappears.
I use the same method. It helps to have a light source behind the printer so you can see the gap disappear. Maybe there's a better way, but it's good enough and works for me. It doesn't really matter so much because you're calibrating once and it stays set for a long time.
@suntoxx said in Strange Z error:
The mesh compensation is active again after the macro finishes? Should I restart Duet after the macro?
That depends on where you activate it in the first place. You can load it at the end of homeall, or at start of a print in start.g or in the slicer start gcode.
-
@phaedrux said in Strange Z error:
I use the same method. It helps to have a light source behind the printer so you can see the gap disappear. Maybe there's a better way, but it's good enough and works for me. It doesn't really matter so much because you're calibrating once and it stays set for a long time.
I got a number of nozzle sizes and print in a lot in varying layer heights. I want to take full advantage of how easy nozzle swapping is in the lgx, so as soon as my torque screwdriver arrives, I want to start using the optimal nozzle for each height. The macro sets me up very nicely for this!
That depends on where you activate it in the first place. You can load it at the end of homeall, or at start of a print in start.g or in the slicer start gcode.
I will check that out.
Thanks for the help!
-
Did you get an answer on how to center the probe without hardcoding?
This is my way:
G1 X{((move.axes[0].max + move.axes[0].min) / 2) - sensors.probes[0].offsets[0]}, Y{((move.axes[1].max + move.axes[1].min) / 2) - sensors.probes[0].offsets[1]}, F1800
Frederick
-
@fcwilt You need to change "axis" to "axes".
-
@fcwilt Thanks, this looks good. From where do you get for example the "sensors.probes[0].offsets[0]"? Is there a list somewhere?
-
@suntoxx said in Strange Z error:
@fcwilt Thanks, this looks good. From where do you get for example the "sensors.probes[0].offsets[0]"? Is there a list somewhere?
The DWC has a plug-in for browsing the object model:
If it is not started just start it and then you can browse through the object model.
Some of what I know is just from trial-and-error, other things were picked up here on the forum.
Frederick
-
This post is deleted! -
@fcwilt said in Strange Z error:
The DWC has a plug-in for browsing the object model:
Oh, I completely missed that part of dwc somehow, as the plug in section in machine specific was empty. But from where in there do you get that with sensors.probes[0].offsets[0] you can refer to the current value? This is probably possible with most variables?
-
@suntoxx said in Strange Z error:
@fcwilt said in Strange Z error:
The DWC has a plug-in for browsing the object model:
Oh, I completely missed that part of dwc somehow, as the plug in section in machine specific was empty. But from where in there do you get that with sensors.probes[0].offsets[0] you can refer to the current value? This is probably possible with most variables?
Did you browse to that part of the object model?
Frederick
-
@fcwilt to which part?
-
-
@fcwilt but I do not see the names you can use to call for those values there. That's what I was refering to. A list of those.
-
@suntoxx said in Strange Z error:
@fcwilt but I do not see the names you can use to call for those values there. That's what I was refering to. A list of those.
The names you need are shown in the browser.
The order is shown by the position.
For example:
sensors.probes[0].diveHeight
When you can have multiple things, like probes, you will see a number like the 0 beneath probes. You use that number in the square brackets as shown above.
Or are you talking about something else?
Frederick
-
@fcwilt ah, damn, i missed that all the way up there to the right. The disadvantage of 43" screens Thanks!
Do you by any chance know how to use the Echo command to create a macro?
-
@suntoxx said in Strange Z error:
Do you by any chance know how to use the Echo command to create a macro?
I have no idea - I didn't even know that was possible.
Why do you need to do that?
Frederick