Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Z offset resets on every print or Homing and start gcode asking

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    start gcode z offset babystepping gcode config homeall
    3
    20
    3.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EEngineerundefined
      EEngineer
      last edited by

      Hello all,

      I am familiar with marlin but I chose DUET and RRF for my newly built IDEX.
      I have a strange problem where I use a macro to set the Z offset. I set it easily and then the Z0 position is fine until I start a print or home my axes. No matter what it changes back to old Z0 and can't even babystep down to the proper position.

      ; General preferences
      G90                                                ; send absolute coordinates...
      M83                                                ; ...but relative extruder moves
      M550 P"Printer"                         ; set printer name
      
      ; Network
      
      M552 S1 								; IP HERE
      M586 P0 S1					   					   ; Enable HTTP
      M586 P1 S0				           				   ; Disable FTP
      M586 P2 S0					  					   ; Disable Telnet
      
      ; Drives
      
      M569 P0.0 S0                                         ; physical drive 0.0 goes forwards E0
      M569 P0.1 S0                                         ; physical drive 0.1 goes forwards E1
      M569 P0.2 S0                                         ; physical drive 0.2 goes forwards  X1
      M569 P0.3 S0                                         ; physical drive 0.3 goes forwards X2 (U)
      M569 P0.4 S0                                         ; physical drive 0.4 goes forwards Y
      M569 P0.5 S1                                         ; physical drive 0.5 goes forwards Z
      M569 P0.6 S1                                         ; physical drive 0.6 goes forwards Z
      M584 X0.2 Y0.4 Z0.5:0.6 U0.3 E0.0:0.1                              ; set drive mapping
      M671 X-30:330 Y150:150 S2; leadscrews at left (connected to Z) and right (connected to E1) of X axis
      M208 X0:235 Y0:300 ; X carriage moves from 0 to 235, Y bed goes from 0 to 300
      
      
      M350 X16 Y16 Z16 U16 E16 I1                        ; configure microstepping with interpolation
      M92 X80 Y80 Z400 U80 E415:415                         ; set steps per mm
      M203 X12000 Y12000 Z6000 U12000 E5600:5600             ; set maximum speeds (mm/min)
      M201 X900 Y750 Z100 U900 E10000:10000                    ; set accelerations (mm/s^2)
      M566 X800 Y650 Z60 U8000 E1300:1300                     ; set maximum instantaneous speed changes (mm/min)
      M906 X1000 Y1000 Z800 U1000 E850:850 I50              ; set motor currents (mA) and motor idle factor in per cent
      M84 E0.0:0.1 X0.2 Y0.4 U0.3 S30                                            ; Set idle timeout
      
      ; Axis Limits
      
      M208 X0 Y0 Z-2.50 U65 S1  ; set axis lower limits
      M208 X235 Y310 Z300 U300 S0   ; set axis upper limits
      
      
      ; Endstops
                                    
      M574 X1 P"!io0.in" S1		  				       ; active-low endstop for low end on X via pin io0.in                             
      M574 Y1 P"!io1.in" S1		  					   ; active-low endstop for low end on Y via pin io1.in
      M574 U2 P"!io2.in" S1							   ; Use an endstop on U, stop at high end                            
      
      ; Z-Probe BLTouch
      
      M950 S0 C"io3.out"                           ; create servo pin 0 for BLTouch
      M558 P9 C"^io3.in" H10 F480 T12000 A5         ; set Z probe type to bltouch and the dive height + speeds
      G31 P25 X-29.75 Y-14.50 Z2.2                ; set Z probe trigger value, offset and trigger height
      M557 X40:180 Y40:260 S40 ; probe from X=10 to 190, Y=10 to 190mm with a mesh spacing of 20mm
      
      ; Heaters
      
      M308 S0 P"temp2" Y"thermistor" A"Bed" T100000 B3950             ; configure sensor 0 as thermistor on pin temp2
      M950 H0 C"out0" T0                                 				; create bed heater output on out0 and map it to sensor 0
      M140 H0   														; map heated bed to heater 0
      M143 H0 S120 
      M307 H0 S1.00 B0                                       				; set temperature limit for heater 0 to 120C
      M307 H0 A124.0 C184.6 D2.5 S1.00 B0						; disable bang-bang mode for heater  
      
      M308 S1 P"temp0" Y"thermistor" A"Hotend" T100000 B4450 C7.06e-8         ; configure sensor 1 as thermistor on pin temp0
      M950 H1 C"out1" T1                                 							  ; create nozzle heater output on out1 and map it to sensor 1
      M143 H1 S290
      M307 H1 S1.00 B0                                      		 					  ; set temperature limit for heater 1 to 290C
      M307 H1 A286.0 C164.4 D2.9 S1.00 V24.0 B0		         					  ; disable bang-bang mode for heater  and set PWM limit
      
      M308 S2 P"temp1" Y"thermistor" A"Hotend2" T100000 B4450 C7.06e-8            ; configure sensor 1 as thermistor on pin temp1
      M950 H2 C"out2" T2                                 							  ; create nozzle heater output on out3 and map it to sensor 2
      M143 H2 S290 
      M307 H2 S1.00 B0                                      		 					  ; set temperature limit for heater 1 to 290C
      M307 H2 A286.0 C164.4 D2.9 S1.00 V24.0 B0		         					  ; disable bang-bang mode for heater  and set PWM limit
      
      
      ; Fans
      M950 F0 C"out3" Q500                               ; create fan 0 on pin out3 and set its frequency
      M106 P0 S0 H-1                                     ; set fan 0 value. Thermostatic control is turned off
      M950 F1 C"out4" Q500                               ; create fan 1 on pin out4 and set its frequency
      M106 P1 S0 H1 T50                                ; set fan 1 value. Thermostatic control is turned on
      
      M950 F2 C"out5" Q500                               ; create fan 2 on pin out5 and set its frequency
      M106 P2 S0 H-1                                     ; set fan 0 value. Thermostatic control is turned off
      M950 F3 C"out6" Q500                               ; create fan 1 on pin out6 and set its frequency
      M106 P3 S0 H2 T50                                  ; set fan 1 value. Thermostatic control is turned on
      
      
      ; Tools
      M563 P0 D0 H1 X0.2 F0 S"X"						; Tool0 uses Extruder0, Heater1 and Fan0
      G10 P0 X0 Y0 Z0 R0 S0								; Set Tool0 axis offsets and temperatures
      
      M563 P1 D1 H2 X0.3 F2 S"U"						; Tool1 uses Extruder1, Heater2 and Fan2. X-axis is mapped to U
      G10 P1 X0 Y0 Z0 R0 S0								; Set Tool1 axis offsets and temperatures
      
      ;  Create a tool that prints 2 copies of the object using both carriages
      M563 P2 D0:1 H1:2 X0.2:0.3 F0:2 S"copy" ; tool 2 uses both extruders, hot end heaters and fans, and maps X to both X and U
      G10 P2 X107 Y0 U-77 S0 R0 ; set tool offsets and temperatures G10 P2 X115 Y0 U-80 S0 R0///G10 P2 X100 Y0 U-100 S0 R0
      M567 P2 E1:1 ; set mix ratio 100% on both extruders
      
      M563 P3 D0:1 H1:2 X0.2:0.3 F0:2 S"mirror" ; tool 2 uses both extruders, hot end heaters and fans, and maps X to both X and U
      G10 P3 X107 Y0 U-30 S0 R0 ; set tool offsets and temperatures TO CONFIG
      M567 P3 E1:1 ; set mix ratio 100% on both extruders
      
      
      ; Miscellaneous - Power Down! RECOVERY
      M911 S23 R24 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"  ; set voltage thresholds and actions to run on power loss
      M404 N1.75											; Define filament diameter for print monitor
      
      
      M575 P1 S1 B57600
      
      
      M308 S20 Y"mcu-temp" A"CPU" 				; CPU temp sensor
      M308 S21 Y"drivers" A"Duet_drv" 			; drivers temp sensor
      M308 S4 Y"drivers" A"TMC Drivers"			; Define Sensor4 as the TMC overheat sensor
      
      T0											; Activate T0 by default	
      
      ;M501
      
      
      ; homeall.g
      ; Called to home all axes
      
      ; BLTouch preperation
      M280 P0 S160												; Precautionary alarm release
      M280 P0 S90													; Ensure the pin is raised
      
      ; Home X, Y and U simultaneously
      G91															; Relative positioning
      G1 Z5 F4000 H2												; Lift Z relative to current position
      G1 X-999 Y-999 U999 F4000 H1								; Move Y-axis to the endstop and stop (first pass)
      G1 X5 Y5 U-5 F300											; Go back a few mm
      G1 X-999 Y-999 U999 F300 H1; Move Y-axis to the endstop once more (second pass)
      G90															; Absolute positioning
      
      ; Home Z using the Z-Probe
      T0 P0														; Ensure we are on Tool0 which carries the Z-Probe (P0 skips tool files)													; Reset baby-stepping to 0
      G1 X230.00 Y150.00 F4000									; Move T0 to probing point (X150, Y150), including probe offset
      G30															; Probe the bed and set Z to the probe offset
      
      G1 X100 Y100 Z50 F4000 
      

      I am curious, what can it be..

      I also would like to ask for some specific things that what should I include in my starting G-code? Now its only consist of homing and some small movements, nothing special.
      Could someone help a newbie there?
      Thanks in advance.

      fcwiltundefined peter247undefined 2 Replies Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt @EEngineer
        last edited by

        @eengineer

        You say you use a macro to set the Z offset.

        What Z offset are you talking about?

        How does the macro work?

        Thanks.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        1 Reply Last reply Reply Quote 0
        • peter247undefined
          peter247 @EEngineer
          last edited by peter247

          @eengineer I'm a little lost what you are asking ?.

          You have a bltouch which should set the same z offset with a differing bed height etc , so if you rehome you should get the same offset from the nozzle to the bed.
          BUT you will find that using baby-stepping you can 't go lower that zero Z.

          Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

          1 Reply Last reply Reply Quote 0
          • EEngineerundefined
            EEngineer
            last edited by EEngineer

            @fcwilt
            The Z-Offset between the nozzle and the bed which I would like to set with a BLtouch

            @peter247
            Sorry for the misunderstanding.
            Yes I have, and I can set it. Then I re-home, or start a print and the Z-offset changes back to some other value. Like it got a new Z0, thats why I cant babystep down more I think. So when I start a new print it only prints in the air well above the bed and in DWC it says its on Z0.3 on first layer.

            peter247undefined 1 Reply Last reply Reply Quote 0
            • peter247undefined
              peter247 @EEngineer
              last edited by

              @eengineer and the Z-offset changes back to some other value

              Does it show a different value on the screen or are you guessing ?

              in the air well above the bed and in DWC it says its on Z0.3 on first layer.

              Have you tried a homing paper test ?

              Which is in the centre of the bed , home and baby step down until a bit of paper grips the nozzle .
              if it doesn't grip the paper than you need the change the offset in G31

              Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

              EEngineerundefined 1 Reply Last reply Reply Quote 0
              • EEngineerundefined
                EEngineer @peter247
                last edited by

                @peter247

                It doesn't show value but I guess if after a G30 probing it stays well above the bed then the Z0 has changed.

                That's what I am doing in the Z-Offset macro yes. Babystepping down. Then it saves the Z0 until re-home or print start.

                peter247undefined 1 Reply Last reply Reply Quote 0
                • peter247undefined
                  peter247 @EEngineer
                  last edited by peter247

                  @eengineer What would do and how I do mine is :

                  Change your G31 P25 X-29.75 Y-14.50 Z2.2 and reduces the Z offset by say 0.5mm ( or more ) Z 1.7 and babystep down until it grips the paper , which it should just touch at 0.1mm and grip hard at zero.
                  Now if it grips the paper at 0.3mm just increase Z offset value by 0.2mm and try again.

                  YOU NEED TO LOWER THE G31 Z value and reboot.

                  Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

                  EEngineerundefined 1 Reply Last reply Reply Quote 0
                  • EEngineerundefined
                    EEngineer @peter247
                    last edited by

                    @peter247
                    I have tried so many ways now. In the beginning it was Z0.0 in G31.
                    I have to babystep down, usually it grips in -2.1.
                    But I will have a try again..

                    peter247undefined 1 Reply Last reply Reply Quote 0
                    • peter247undefined
                      peter247 @EEngineer
                      last edited by peter247

                      @eengineer

                      Have you any adjustment on the bltouch to move it down ?

                      Wow -2.1mm that must mean that the nozzle is almost hitting the bed when the probe retracts ?

                      Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

                      EEngineerundefined 1 Reply Last reply Reply Quote 0
                      • EEngineerundefined
                        EEngineer @peter247
                        last edited by

                        @peter247
                        The Z offset between the nozzle and BLTouch is at about 3mm

                        I don't know if it means this, but it is not near to hit the bed when it retracts

                        peter247undefined fcwiltundefined 2 Replies Last reply Reply Quote 0
                        • peter247undefined
                          peter247 @EEngineer
                          last edited by peter247

                          @eengineer said in Z offset resets on every print or Homing and start gcode asking:

                          The Z offset between the nozzle and BLTouch is at about 3mm

                          Not sure what you mean , is that on the screen or the distance between the nozzle and the bed which you have measured AND 3mm when ?

                          just thinking I'm wrong the probe to too few down !!!!

                          Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

                          EEngineerundefined 1 Reply Last reply Reply Quote 0
                          • EEngineerundefined
                            EEngineer @peter247
                            last edited by

                            @peter247
                            About 3mm Between the tip of the nozzle and the tip of the BLtouch. Thats what you define in G31, isn't it? Thats why it is off with X-29.75 and Y-14.5. Z-probe position from the nozzle's point of view.

                            peter247undefined 1 Reply Last reply Reply Quote 0
                            • fcwiltundefined
                              fcwilt @EEngineer
                              last edited by

                              @eengineer said in Z offset resets on every print or Homing and start gcode asking:

                              @peter247
                              The Z offset between the nozzle and BLTouch is at about 3mm

                              Are you referring to some distance between the nozzle and the BLTouch?

                              If so, why are you concerned with that?

                              The only thing of importance is the BLTouch Z Trigger Height setting in G31.

                              How are you determining that value?

                              Frederick

                              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                              EEngineerundefined 1 Reply Last reply Reply Quote 0
                              • peter247undefined
                                peter247 @EEngineer
                                last edited by peter247

                                @eengineer

                                if you set it to -2mm so it grip the paper how close is it to hitting the retracted probe ?

                                I can see now your bltouch is closer to the bed when it touches than mine, but your -2.1mm says not.

                                something is wrong I can't work it out !!!

                                Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

                                1 Reply Last reply Reply Quote 0
                                • EEngineerundefined
                                  EEngineer @fcwilt
                                  last edited by

                                  @fcwilt

                                  Now I set my Z Trigger height in G31 according to this:
                                  https://duet3d.dozuki.com/Wiki/Test_and_calibrate_the_Z_probe#Section_Calibrate_the_Z_probe_trigger_height

                                  After that my print start has began on the right Z height.. Thanks for the advices. As I see now, that was my problem..

                                  My other question is, what do you think, what should I include in my start or maybe end g-code on an idex.
                                  Is there something special for RRF that I should include in these?

                                  fcwiltundefined 1 Reply Last reply Reply Quote 1
                                  • fcwiltundefined
                                    fcwilt @EEngineer
                                    last edited by

                                    @eengineer said in Z offset resets on every print or Homing and start gcode asking:

                                    @fcwilt

                                    My other question is, what do you think, what should I include in my start or maybe end g-code on an idex.
                                    Is there something special for RRF that I should include in these?

                                    I have no idea as I do not have a printer like that.

                                    But someone here is sure to have ideas.

                                    Frederick

                                    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                    EEngineerundefined 1 Reply Last reply Reply Quote 0
                                    • EEngineerundefined
                                      EEngineer @fcwilt
                                      last edited by

                                      @fcwilt
                                      I think I read somewhere that I should use relative extrusion. is it right? Then I should include in the start g-code

                                      peter247undefined fcwiltundefined 2 Replies Last reply Reply Quote 1
                                      • peter247undefined
                                        peter247 @EEngineer
                                        last edited by

                                        @eengineer it should be in your config.g file

                                        G90 ; send absolute coordinates.
                                        M83 ; but relative extruder moves.

                                        but you have to tell the slicer to use relative extruder too.

                                        in cura it is in special modes

                                        Ender 5 plus linear rail and hemera powered by duet 2 wifi , CR10s pro v1 with bltouch mostly stock , BLV mgn Cube slowly being built powered by duet 3 mini 5+

                                        1 Reply Last reply Reply Quote 0
                                        • fcwiltundefined
                                          fcwilt @EEngineer
                                          last edited by fcwilt

                                          @eengineer said in Z offset resets on every print or Homing and start gcode asking:

                                          @fcwilt
                                          I think I read somewhere that I should use relative extrusion. is it right? Then I should include in the start g-code

                                          I make use of the slicer feature where you can enter you own code for print start and print end.

                                          I only enter M98 P"print_being.g" and M98 P"print_end.g"

                                          Everything I want to do is in those files BUT the slicer generates a bit of it's own code and the relationship of that code to the call to my code varies with the slicer and the slicer configuration.

                                          Here is some relevant info:

                                          ; S3D inserts the following before the call to print_beg.g
                                          ;G90                    ; absolute XYZ moves
                                          ;M83                    ; relative E   moves
                                          ;M106 S0                ; fan on to 0 (correct way to do fan off)
                                          ;M140 S60		; set bed      temp but don't wait
                                          ;M104 S190 T0		; set extruder temp but don't wait
                                          ;M98 P"print_begin.g"
                                          
                                          ; Cura (Repetier flavor - no temps) inserts the following around the call to print_beg.g
                                          
                                          ;M109 S0                        ; set extruder temp and wait (no wait with S0)
                                          ;M82                            ; absolute E moves
                                          ;M98 P"print_begin.g"
                                          ;G92 E0                         ; set E position
                                          ;G92 E0                         ; set E position again (have no idea why)
                                          ;G1 F1800 E-1                   ; do initial retract
                                          
                                          ; PrusaSlicer (RepRapflavor - no temps) inserts the following around the call to print_beg.g
                                          ;M107                           ; fan off (should be M106 S0)
                                          ;M98 P"print_begin.g"
                                          ;G21                            ; set units to millimeters
                                          ;G90                            ; absolute XYZ moves
                                          ;M83                            ; relative E moves
                                          

                                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                          EEngineerundefined 1 Reply Last reply Reply Quote 0
                                          • EEngineerundefined
                                            EEngineer @fcwilt
                                            last edited by

                                            @fcwilt

                                            This is very convenient, thank you for the tip.

                                            I had a few succesful print since I made the Z-offset correctly.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA