[Nozzle piezo] G31 Trigger Z-height being ignored
-
Good day,
I have a Piezo nozzle tip probe configured with bed compensation using G32 but when I print its printing in the air; I did babystepping and configured G31 and restarted the duet and it still prints in the air.
I checked:
- G31 appears after M558
- there are no other G31 commands in config.g or config-override.g
- restarted duet and rerun G32 everytime after changing G31 Z value
FYI babystepping was not moving down until I added M208 Z2 in config.g as suggested in the forum and I wonder if G31 should pick this up but its not
FYI I have a z max endstop and a z probe installed
m115 FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.4.5 ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2022-11-30 19:36:12
here are the configs:
1. bed.g; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool v3.3.12 on Tue Aug 09 2022 18:50:56 GMT+0200 (South Africa Standard Time) g28 g1 x50 y75 g30 M561 ; clear any bed transform G29 ; probe the bed and enable compensation
2.config-override.g
; config-override.g file generated in response to M500 at 2023-06-06 09:41 ; This is a system-generated file - do not edit ; Heater model parameters M307 H0 R0.443 K0.252:0.000 D1.41 E1.35 S1.00 B0 M307 H1 R2.160 K0.365:0.077 D5.86 E1.35 S1.00 B0 V23.9 ; Workplace coordinates G10 L2 P1 X0.00 Y0.00 Z0.00 G10 L2 P2 X0.00 Y0.00 Z0.00 G10 L2 P3 X0.00 Y0.00 Z0.00 G10 L2 P4 X0.00 Y0.00 Z0.00 G10 L2 P5 X0.00 Y0.00 Z0.00 G10 L2 P6 X0.00 Y0.00 Z0.00 G10 L2 P7 X0.00 Y0.00 Z0.00 G10 L2 P8 X0.00 Y0.00 Z0.00 G10 L2 P9 X0.00 Y0.00 Z0.00
- config.g
; Configuration file for Duet WiFi (firmware version 3.3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.12 on Tue Aug 09 2022 18:50:56 GMT+0200 (South Africa Standard Time) ; General preferences M575 P1 S1 B57600 ; enable support for PanelDue G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"" ; set printer name ; Network M551 P"" ; set password M552 S1 ; enable network M552 S1 P"" M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0 S2 ; physical drive 0 goes forwards M569 P1 S1 ; physical drive 1 goes forwards M569 P2 S1 ; physical drive 2 goes forwards M569 P3 S1 ; physical drive 3 goes forwards M584 X0 Y1 Z2 E3 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X94.42 Y94.42 Z514 E103 ; set steps per mm M566 X510.00 Y510.00 Z24.00 E300.00 ; set maximum instantaneous speed changes (mm/min) M203 X30000.00 Y30000.00 Z300.00 E2600.00 ; set maximum speeds (mm/min) M201 X3500.00 Y3500.00 Z100.00 E2000.00 ; set accelerations (mm/s^2) M906 X650 Y650 Z650 E700 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z-2 S1 ; set axis minima M208 X120 Y150 Z150 S0 ; set axis maxima ;axis offsets ;M206 X0 Y0 Z0.3 ; Endstops M574 X2 S1 P"xstop" ; configure switch-type (e.g. microswitch) endstop for high end on X via pin xstop M574 Y1 S1 P"ystop" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin ystop M574 Z2 S1 P"!zstop" ; configure switch-type (e.g. microswitch) endstop for high end on Z via pin zstop ; Z-Probe ;M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed M558 P8 C"!zprobe.in" R0. 4 F300 T300 X0 Y0 Z0 ; enable z probe Digital ACIVE low G31 X0 Y0 Z-0.96 ; set Z probe trigger value, offset and trigger height M557 X0:120 Y0:150 P4 ; define mesh grid ; Heaters M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0 M307 H0 B0 S1.00 ; enable PID mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S101 ; set temperature limit for heater 0 to 101C M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M307 H1 B0 S1.00 ; disable PID mode for heater and set PWM limit M143 H1 S300 ; set temperature limit for heater 1 ;Filament sensor M591 P2 C"e0stop" S1 D0 ; e0stop with low signal when filament present mapped to e0 hotend ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F2 C"fan2" ; create fan 1 on pin fan1 and set its frequency M106 P2 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on ; Tools M563 P0 D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Custom settings are not defined M307 H0 D5 ;M307 H1 D5 ; select tool T0 ;power failure auto save M911 S21.0 R23.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ;config ovveride M501
- homez.g
G91 ; relative positioning G1 H1 Z155 F33000 ; move quickly to Z axis endstop and stop there (first pass) G1 Z-5 ; go back a few mm G1 H1 Z10 F100 ; move slowly to Z axis endstops once more (second pass) G90 ; absolute positioning
-
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
forum
Post your homeall?
Can you post a screenshot of the heightmap?
-
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
forum
Post your homeall?
Can you post a screenshot of the heightmap?
please see below as requested.
for the homing files I try to reduce duplication of gcode by having a common file being called in individual axis homing files and homeall.g not sure if this might be causing an issue
1. homeall.g
G91 ; relative positioning M98 P"home-z-common.g" M98 P"home-x-common.g" M98 P"home-y-common.g" G90 ; absolute positioning
2. home-z-common.g
; called by homez.g and homeall.g G1 H1 Z155 F33000 ; move quickly to Z axis endstop and stop there (first pass) G1 Z-5 ; go back a few mm G1 H1 Z10 F100 ; move slowly to Z axis endstops once more (second pass)
3. homez.g
G91 ; relative positioning M98 P"home-z-common.g" G90 ; absolute positioning
4. I run G32 for z probing here is my bed.g
; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool v3.3.12 on Tue Aug 09 2022 18:50:56 GMT+0200 (South Africa Standard Time) g28 ; home all g1 x50 y75 ; go to center of the bed g30 M561 ; clear any bed transform G29 ; probe the bed and enable compensation
one thing that I noticed is if I put G31 Z25 in config.g and then run G32 I get below error meaning that when Z probing G31 is being considired but when I print its like G31 is set to zero again
07/06/2023, 18:15:06 g30 Error: Probe was not triggered during probing move 07/06/2023, 18:14:54 Error: Probe was not triggered during probing move 07/06/2023, 18:14:34 G32 Error: Probe was not triggered during probing move
when I run G31 in the console I do see the trigger height and it changes when I update it in config.g
Z probe 0: current reading 0, threshold 500, trigger height 25.000, offsets X0.0 Y0.0
-
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
M98 P"home-z-common.g"M98 P"home-x-common.g"M98 P"home-y-common.g"
Can you post the other X and Y common files?
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
M558 P8 C"!zprobe.in" R0. 4 F300 T300 X0 Y0 Z0
M558 P8 C"!zprobe.in" R0. 4 F300 T300 X0 Y0 Z0
You can remove the X0 Y0 Z0
There is a space between R0. and 4 which should be removed.
T300 is very slow travel speed between points. T3000 or 6000 would be more normal I think.
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
Z-0.96
How did you determine that value?
Use this to see if it is accurate.
What do you have in your slicer start gcode section?
Your mesh grid is pretty sparse. If there is a lot of uneveness of the bed, a sparse grid may miss detail. Once you have made those fixes and remeasured your trigger height you should create a new, more detailed mesh.
Something like
M557 X0:120 Y0:150 P9
It's hard to tell from your photo, but it looks like the mesh is very offset from the grid. What does it look like from a top view?
Can you also confirm for me that -X moves go to the left, +X moves go to the right, -Y moves go to the front, +Y moves go to the back?
-
- home-x-common
; called by homex.g and homeall.g G1 H1 X155 F3300 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X-5 F3300 ; go back a few mm G1 H1 X10 F100 ; move slowly to X axis endstop once more (second pass) G1 H2 X-155 F3300 ; move X 5mm away from endstop ;G1 H2 X-140 F3300 ; move X 5mm away from endstop G92 X0 ; make X=5mm the zero position
- home-y-common
; called by homey.g and homeall.g G1 H1 Y-155 F3300 ; move quickly to X axis endstop and stop there (first pass) G1 H2 Y5 F3300 ; go back a few mm G1 H1 Y-10 F100 ; move slowly to X axis endstop once more (second pass) ;G1 H2 y5 F3300 ;G92 Y-5
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
You can remove the X0 Y0 Z0
There is a space between R0. and 4 which should be removed.
T300 is very slow travel speed between points. T3000 or 6000 would be more normal I think.I fixed the mistakes and increased speed to T3000
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
How did you determine that value?
Use this to see if it is accurate.
https://docs.duet3d.com/en/User_manual/Connecting_hardware/Z_probe_testing#calibrate-the-z-probe-trigger-heightthe -0.96 comes from babystepping when I used this guide you provide i would get -0.36, but if I made that the babystepping value it still printed in the air.
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
What do you have in your slicer start gcode section?
here is the first few lines from slicer generated gcode which include the start code. I have tried a different slicer Cura where I don't even put in start gcode and it doesn't make a difference
; generated by PrusaSlicer 2.6.0-beta4+linux-x64-GTK3 on 2023-06-12 at 19:01:22 UTC ; external perimeters extrusion width = 0.45mm ; perimeters extrusion width = 0.45mm ; infill extrusion width = 0.45mm ; solid infill extrusion width = 0.45mm ; top infill extrusion width = 0.40mm M73 P0 R1 ;TYPE:Custom G90 ; use absolute coordinates M83 ; extruder relative mode ;M104 S170 ; set extruder temp for bed leveling M140 S100 ; set bed temp ;M109 R170 ; wait for bed leveling temp M190 S100 ; wait for bed temp ;M204 T1250 ; set travel acceleration G28 ; home all without mesh bed level ;G29 ; mesh bed leveling ;M204 T2500 ; restore travel acceleration M104 S260 ; set extruder temp G92 E0 M290 R0 Z-1.12 ;G1 Y-2 X179 F2400 G1 Z50.000 F420 M109 S260 ; wait for extruder temp ;Prime the extruder G92 E0 G1 F200 E3 G92 E0 ; intro line on X M73 P5 R1 G1 X120 F1000 M73 P6 R1 G1 Z0.2 F720 M73 P12 R1 G1 X110 E8 F900 M73 P16 R1 G1 X40 E10 F700 G92 E0 ;M221 S100 ; set flow to 100% G21 ; set units to millimeters G90 ; use absolute coordinates M83 ; use relative distances for extrusion M107 ;LAYER_CHANGE ;Z:0.2 ;HEIGHT:0.2 ;BEFORE_LAYER_CHANGE G92 E0.0 ;0.2
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
It's hard to tell from your photo, but it looks like the mesh is very offset from the grid. What does it look like from a top view?
I have since changed the extruder that has the piezo and forgort to take screenshot of mesh
@Phaedrux said in [Nozzle piezo] G31 Trigger Z-height being ignored:
Can you also confirm for me that -X moves go to the left, +X moves go to the right, -Y moves go to the front, +Y moves go to the back?
yes everything works fine. you will see from my start gcode I am inluding babystepping gcode in the start gcode with R0 and that how I am printing and the prints come out correct left side to left, right to right and so on.
One thing that I wonder about is does Duet support Z max endstop and z probe at the same time? so I home using Z max endstop and only use the z probe for bed leveling; when I read the guide below I don't think they mention the configuration I have . Configuration_cartesian
anyway my workaround at this time is using
M290 R0 Z-0.96
in the slicer start code and putG31 Z0
inconfig.g
and this works well -
@the-tinkerer said in [Nozzle piezo] G31 Trigger Z-height being ignored:
One thing that I wonder about is does Duet support Z max endstop and z probe at the same time? so I home using Z max endstop and only use the z probe for bed leveling;
This is likely the source of your offset. You can use the zmax endstop for homing, but it's best practice to use the probe to find Z0 point before creating the mesh, and again before loading a saved mesh, and indeed before starting the print. This is because the Zmax position is fixed in space, but the bed surface is likely to move slightly over time, especially with thermal changes. This is why Z probes came about, as they find Z0 based on the bed surface itself rather than an endstop position separate from the bed. You've worked around the offset by adding your own baby stepping offset. The reason the G31 doesn't seem to have an effect is because you're not actually applying it when you home with zmax.