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

    3.6.0-rc.2+2: more probing problems (G30 P0 K1 moves wrong tool)

    Scheduled Pinned Locked Moved
    Beta Firmware
    3
    5
    195
    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.
    • crpalmerundefined
      crpalmer
      last edited by

      @dc42 This seems like another instance of the same type of bug that you just recently fixed for me in M38.2 (when trying to probe using probe #1 attached to tool #1).

      I have an IDEX printer and each hotend has a probe attached to it (pz probes). Probe #0 is on tool #0 and probe #1 is on tool #1. In homez.g, I end up executing:

      G30 K{state.currentTool}
      

      which works correctly and homes Z using whichever tool is currently active. Now I'm trying to get G32 to do the mesh levelling using whichever tool is active but it is failing and moving the wrong tool to probe each point. The problem occurs when it executes (I echo'ed the command instead of running it to verify that my code was doing the right thing):

      G30 K1 P0 X150 Y50 Z-99999
      

      This G30 command moves tool #0 to (150, 50) then probes Z to but appears to be reading the value of probe #1 as the probe is never triggered and it crashes into the bed. This is reproducible without my bed.g as I can reproduce the problem running:

      G28 X Y U
      T1
      G28 Z
      T1   ; not needed for me, as T1 is already active at this point but better to be safe than sorry
      G30 K1 P0 X150 Y50 Z-99999
      

      Config.g:

      ;
      ; TODO
      ;
      
      ; -------------------------
      
      M98 P"/sys/global-declarations.g"
      
      ; General preferences
      G90                                                    ; send absolute coordinates...
      M83                                                    ; ...but relative extruder moves
      
      ; Drives
      M569 P0 S0 ; D3                                        ; physical drive 0 goes backwards, stealthchop
      M569 P1 S0 ; D3                                        ; physical drive 1 goes backwards
      M569 P2 S0 ; D3                                        ; physical drive 2 goes backwards
      M569 P3 S0 ; D3                                        ; physical drive 3 goes backwards
      M569 P4 S0 ; D3                                        ; physical drive 4 goes backwards
      M569 P1.0 S1 ; D3                                      ; physical drive 1.0 goes forwards
      M569 P1.1 S1 ; D3                                      ; physical drive 1.1 goes forwards
      M569 P1.2 S1 ; D3                                      ; physical drive 1.2 goes forwards
      M584 X0.2 Y0.1:1.2 u1.1 E0.0:1.0 Z0.3:0.4              ; set drive mapping
      M92 X160.00 Y160.00 U160.00 Z800.00 E680:680           ; set steps per mm (recommended; 690 orbiter)
      M350 X16 Y16 U16 Z16 E16 I1                            ; set microstepping to 256 interpolation
      M566 X300.00 Y300.00 U300.00 Z240.00 E300:300 P1       ; set maximum instantaneous speed changes (mm/min)
      M203 X12000.00 Y12000.00 U12000.00 Z600.00 E7200:7200  ; set maximum speeds (mm/min)
      M201 X2500.00 Y2500.00 U2500.00 Z500.00 E5000:5000     ; set accelerations (mm/s^2)
      ;M906 X1350 Y1350 U1350 Z1200 E850:850 I30              ; set motor currents (mA) and motor idle factor in per cent (orbiter supposed to be 1200)
      M906 X1200 Y1000 U1200 Z840 I30                        ; Set motor currents (mA) and motor idle factor in per cent
      M906 E850:850 I10                                      ; (orbiter supposed to be 1200)
      M84 S30                                                ; Set idle timeout
      
      ; Z drive
      ;M671 X{global.xCenter, global.xCenter} Y-35:385 S2  			                   ; motor order: front, back
      M671 X150:150 Y-35:385 S2  			                   ; motor order: front, back
      
      ; Axis Limits
      M208 X0 Y-10 Z0 U-50 S1                       ; set axis minima
      M208 X350 Y356 Z425 U305 S0                            ; set axis maxima
      
      ; Endstops
      M574 X2 S1 P"^0.io5.in"                                ; configure active-high endstop for high end on X
      M574 Y2 S1 P"^0.io6.in+^1.io0.in"                      ; configure active-high endstop for high end on Y
      M574 U1 S1 P"^1.io2.in"                                ; configure active-high endstop for high end on U
      
      ; Z-Probe
      M558 K0 P8 C"^!io1.in" R1.0 H5 F400 A5 T24000
      G31  K0 X0 Y0 Z0 P100
      M558 K1 P8 C"^!1.io5.in" R1.0 H5 F400 A5 T24000
      G31  K1 X0 Y0 Z0 P100
      
      M557 X0:325 Y5:355 P9                                  ; define mesh grid
      M376 H2
      
      ; Filament sensor (BTT SFS 2.0)
      M591 D0 P7 C"0.io3.in" L3 R50:150 E22 S1
      M591 D1 P7 C"1.io1.in" L3 R50:150 E22 S1
      
      ; Pressure advance
      M572 D0 S0.05
      M572 D1 S0.05
      
      ; Fans (tool 0)
      M950 F0 C"out5" Q250                                   ; create fan and set its frequency
      M106 P0 S0 H-1                                         ; set fan value (off). Thermostatic control is turned off
      M950 F1 C"out6" Q500                                   ; create fan and set its frequency
      M106 P1 S1 T45 H1                                      ; set fan value (on). Thermostatic control is turned on
      
      ; Fans (tool 1)
      M950 F2 C"1.out7" Q250                                 ; create fan and set its frequency
      M106 P2 S0 H-1                                         ; set fan value (off). Thermostatic control is turned off
      M950 F3 C"1.out6" Q500                                 ; create fan and set its frequency
      M106 P3 S1 T45 H2                                      ; set fan value (on). Thermostatic control is turned on
      
      ; Fans (board cooling)
      M950 F4 C"!1.out3" Q25000                              ; create fan and set its frequency
      M106 P4 S1 H-1                                         ; set fan value (on).  Thermostatic control is turned off
      
      ; Bed Heater
      M308 S0 P"temp0" Y"thermistor" T100000 B4092           ; configure sensor
      M950 H0 C"out0" T0                                     ; create bed heater output and map it to sensor 0
      M307 H0 R0.272 C349.6 D8.37 S1.00 V23.7
      M140 H0                                                ; map heated bed to heater 0
      M143 H0 S120                                           ; set temperature limit for heater 0 to 120C
      
      ; tool 0 thermistor
      M308 S1 P"temp1" Y"thermistor" T100000 B4725 C7.06e-8  ; configure sensor
      M950 H1 C"out1" T1                                     ; create nozzle heater output and map it to sensor 1
      
      ; tool 0
      M307 H1 R3.927 K0.564:0.293 D1.73 E1.35 S1.00 B0 V24.1
      M563 P0 S"E3Dv6" D0 H1 F0                              ; define tool 0
      G10 P0 X0 Y0 Z0                                        ; set tool 0 axis offsets
      
      ; tool 1 thermistor
      M308 S2 P"1.temp2" Y"thermistor" T100000 B4725 C7.06e-8; configure sensor
      M950 H2 C"1.out2" T2                                   ; create nozzle heater output and map it to sensor 2
      
      ; tool 1
      M307 H2 R3.401 K0.474:0.307 D1.67 E1.35 S1.00 B0 V24.2
      M563 P1 S"E3Dv6" D1 H2 X3 F2                           ; define tool 1
      G10 P1 X0.000 Y-0.05 Z-0.3 U-1.97                      ; set tool 1 axis offsets
      
      ; Set both tools to standby mode
      M568 A1 P0 R0 S0
      M568 A1 P1 R0 S0
      
      ; Tool (common)
      G10 P0 R0 S0                                           ; set initial tool 0 active and standby temperatures to 0C
      G10 P1 R0 S0                                           ; set initial tool 1 active and standby temperatures to 0C
      
      ; MCU DOES NOT WORK ON THE DUET 3 MINI 5+?
      M912 P0 S-12.5                                         ; Calibrate MCU temperature
      
      ; Miscellaneous
      M912 P0 S-1
      
      M98 P"/sys/global-defaults.g"
      

      All the rest of the config is also available on github HERE.

      jay_s_ukundefined 1 Reply Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @crpalmer
        last edited by

        @crpalmer said in 3.6.0-rc.2+2: more probing problems (G30 P0 K1 moves wrong tool):

        This G30 command moves tool #0 to (150, 50) then probes Z to but appears to be reading the value of probe #1

        That G30 has a K1 in it which means probe #1 so why wouldn't it be reading that?

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        crpalmerundefined 1 Reply Last reply Reply Quote 0
        • crpalmerundefined
          crpalmer @jay_s_uk
          last edited by

          @jay_s_uk The problem is that it moves tool #0 to read probe #1 (which is conveniently attached to tool #1 and nowhere near the bed that it's supposed to be probing).

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @crpalmer
            last edited by dc42

            @crpalmer when you use a G30 command with coordinates, those coordinates refer to raw axis positions, so the tool selected is irrelevant. If you want to use a probe attached to tool 1, and tool 1 is the tool that uses the U axis, then you must use a U coordinate in the G30 command, not an X coordinate. Just as if you want to probe a mesh for tool 1, your M557 command must provide U and Y limits instead of X and Y limits.

            That said, probing with a tool attached to tool 1 of an IDEX machine using G30 with coordinates has not been tested, so it might not work.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            crpalmerundefined 1 Reply Last reply Reply Quote 0
            • crpalmerundefined
              crpalmer @dc42
              last edited by

              @dc42 Thanks, that seems to have worked just fine. Using T1 I am able to execute G32 and get what seems to be the correct levelling (aka, it's within the normal values I expect to see when using T0).

              In case it helps anyone else, I replaced the G30 calls in my bed.g with calls to this macro which should work for machines with just one tool or two tools:

              ; Note: the params are all the same *EXCEPT* for P which is now I
              ;       (P is already used by M98 so we can't also use it here)
              
              if ! exists(param.X) || ! exists(param.Y) || ! exists(param.K) || ! exists(param.I)
                abort "Missing required argument (one of X / Y  / K / I)"
              
              G1 X{param.X} Y{param.Y} Z{sensors.probes[param.K].diveHeights[0]} F{sensors.probes[param.K].travelSpeed}
              if exists(param.S)
                if exists(move.axes[3])
                  G30 K{param.K} P{param.I} S{param.S} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} U{move.axes[3].machinePosition} Z-99999
                else
                  G30 K{param.K} P{param.I} S{param.S} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} Z-99999
              else
                if exists(move.axes[3])
                  G30 K{param.K} P{param.I} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} U{move.axes[3].machinePosition} Z-99999
                else
                  G30 K{param.K} P{param.I} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} Z-99999
              
              
              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA