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

    G38 + idex + multiple probes = insanity ?

    Scheduled Pinned Locked Moved
    General Discussion
    4
    12
    210
    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 @dwuk3d
      last edited by

      @dwuk3d To be clear, the printer itself is working well. I can print dual material/colour prints with it. I'm just running into difficulties when I am trying to add the pin probing functionality to it. All the axes move correctly, I can move X/U individually using G1 H2 (which I do as part of the tool cleaning process before probing Z or the pin).

      The kinematics are plain old boring cartesian:

      m669
      Kinematics is Cartesian, no segmentation, matrix:
      1.00 0 0 0
      0 1.00 0 0
      0 0 1.00 0
      0 0 0 1.00
      

      The reason for the global-* is that I have 5 printers which share 95% of their configuration in a common git repository to make maintaining them much simpler. The global configuration parameterizes the common functionality (e.g. the location of the wiping pad to use to clean the nozzle, where to move the tool when a print completes, etc). The links in the last line of the first post are to the machine repo (config.g and global-defaults.g) and the common config repo (all the rest of /sys/).

      1 Reply Last reply Reply Quote 0
      • dwuk3dundefined
        dwuk3d
        last edited by

        Ok - beats me them why G38.2 isn't working - for my IDEX like printer I am using G1 H4's instead of G38's, and swapping probes and end stops around rather than using T commands.

        Example attached is for a ball probe alignment on a Gantry with U (X) and V(Y) and it also uses Z to initially check it is on the probe - so not quite the same as your requirement - but might be of some use.

        ;AlignUVZ.g
        ;
        ;if exists(global.ballProbeX) == false
        ;    abort "XY alignment not found"
        
        M98.1 A"Probe Out"
        
        G90
        T0
        G1 Z50 F10000
        
        G1 X30 Y30 F20000
        
        M400
        M98 P"0:/macros/FindProbeUV.g"
        M574 Z1 S2 K3; Set Z to Ball Probe
        G1 H4 Z{global.zHit-1} F300
        
        if sensors.probes[3].value[0] = 0
            echo "Probe not found"
            break
        ;G1 U204 V149 F10000
        
        
        
        ; Find basic Z position
        
        var Zpos = {50,49,48,48,48}
        var Zrate = {300,200,100,100,100}
        var Upos = {10,8,8,8,8}
        var Vpos = {10,8,8,8,8}
        var UVrate = {1000,800,300,300,300}
        
        var prev = false
        var pVM = 0
        var pUM = 0
        
        var VM=0
        var UM=0
        
        
        while iterations < 2
            M574 Z1 S2 K3; Set Z to Ball Probe
        
            G90
            G1 Z{var.Zpos[iterations]} F300
            G91 
            G1 H4 Z-12 F{var.Zrate[iterations]}
            ;echo "Z", {move.axes[2].userPosition}
        
        
            var ZP = move.axes[2].userPosition
        
            G1 Z5 F5000
        
            M574 Z1 S2 K0; configure Z axis endstop
        
            ; Now find U middle
        
            G91
            G1 U{0-var.Upos[iterations]} F2500
            G90
            G1 Z{var.ZP-0.2} F300
        
        
            G91
            M574 U1 S2 K3 ; Configure U axis with Z ball probe
            G1 H4 U+10 F{var.UVrate[iterations]}
        
            ;echo "X1", {move.axes[0].userPosition}
            M400
            var U1 = move.axes[3].userPosition
        
            G1 Z5 F300
            G1 U{var.Upos[iterations]}  F2500
            G1 Z-5 
            M400
            
            G1 H4 U-10 F{var.UVrate[iterations]}
            ;echo "X2", {move.axes[0].userPosition}
            M400
            var U2 = move.axes[3].userPosition
        
            G1 Z5
        
            G90
            set var.UM = (var.U1+var.U2)/2
           
        
            ;echo "XM", {var.XM}
            G1 U{var.UM}
        
            M574 U2 P"!122.io0.in" S1 ; configure U axis endstop
        
            ; Now V
            G91
        
            G1 V{0-var.Vpos[iterations]} F5000
            G1 Z-5 F300
            M574 V1 S2 K3
        
            G1 H4 V+10 F{var.UVrate[iterations]}
            ;echo "Y1", {move.axes[1].userPosition}
            M400
            var V1 = move.axes[4].userPosition
        
            G1 Z5 F300
            G1 V{var.Vpos[iterations]} F5000
            G1 Z-5 F300
        
            G1 H4 V-10 F{var.UVrate[iterations]}
            ;echo "Y2", {move.axes[1].userPosition}
            M400
            var V2 = move.axes[4].userPosition
        
            set var.VM = (var.V1 + var.V2) / 2
        
            echo "UM", {var.UM},"VM", {var.VM},"ZP", {var.ZP},"---U1,2",{var.U1},{var.U2},"--V1,2",{var.V1},{var.V2}
            if (var.prev == true)
                echo "variation U:",{var.pUM-var.UM}, "V:", {var.pVM-var.VM}
                
            set var.pVM = var.VM
            set var.pUM = var.UM
            set var.prev = true
        
            G1 Z5 F300
        
            G90 
            G1 U{var.UM} V{var.VM} F2000
        
        
            M574 V2 P"io4.in" S1 ; U Axis optical
        
        
        M574 Z1 S2 K3; Set Z to Ball Probe
        G91
        G1 H4 Z-5 F300
        var Z1 = move.axes[2].machinePosition
        echo "z1",{var.Z1}
        
        G1 Z5 F1000
        G1 U4 F2500
        G1 H4 Z-10 F300
        var Z2 = move.axes[2].machinePosition
        echo "z2",{var.Z2}
        
        G1 U-4 F2500
        
        G1 Z5 F1000
        
        M574 Z1 S2 K0; configure Z axis endstop
        
        if var.Z1-var.Z2 < 1
            echo "z1,z2",{var.Z1},{var.Z2}
            abort "possible issue with UV alignment"
        
        
        if exists(global.ballProbeU) == false
            global ballProbeU = -1
            global ballProbeV = -1
        
        set global.ballProbeU = var.UM
        set global.ballProbeV = var.VM
        
        
        
        
        G90
        ;var adjust = var.UM - global.ballProbeX
        ;echo "adjusting U",{global.ballProbeX - var.UM},"V",{global.ballProbeY - var.VM}
        ;G92 U{global.ballProbeX} V{global.ballProbeY}
        
        ;if exists(global.UVAdjusted) == false
        ;    global UVAdjusted = true
        
        
        
        
        
        
        crpalmerundefined 1 Reply Last reply Reply Quote 0
        • crpalmerundefined
          crpalmer @dwuk3d
          last edited by

          @dwuk3d Thanks for looking. I'm afraid it's a bug but I wanted to reach out here to see if anyone had experience doing something similar.

          Unfortunately, I don't think I can use G1 H4 as I need to move X/Y until a probe is triggered, not the moving axis' endstop.

          dwuk3dundefined 1 Reply Last reply Reply Quote 0
          • dwuk3dundefined
            dwuk3d @crpalmer
            last edited by dwuk3d

            @crpalmer OK - I am pretty new to RRF - and I am not really sure what the difference is between a probe and an endstop unless your probe is something analog.

            I'm switching around the configuration between Inductive Probes, Ball probes and endstops in quite a few places in my homing and alignment macros - in fact I had to set one of my 5 probes as an end stop because I reached the limit on the maximum number of probes allowed.

            1 Reply Last reply Reply Quote 0
            • droftartsundefined
              droftarts administrators @crpalmer
              last edited by

              @crpalmer said in G38 + idex + multiple probes = insanity ?:

              T0 G38.2 X150 K0 ; Moves X until probe 0 is triggered
              T1 G38.2 X150 K1 ; Moves X & U until probe 1 is triggered
              T0 G38.2 U150 K0 ; Moves U until probe 0 is triggered
              T1 G38.2 U150 K1 ; Moves X until probe 1 is triggered

              T1 G53 G38.2 U150 K1

              The first line is what I'd expect (probe X by moving X when tool 0 is selected).
              The second command, however, is a mystery.
              To make sure G38.2 wasn't expectding unmapped axes to be specified, I also tried the G38.2 commands using the U axis which certainly didn't help me understand what was happening.
              Finally, I also tried machine coordinates for the U moves in case it was some discrepancy between machine positions vs. mapped axes (I can't say for sure what happened as I didn't record it in my notes but I expecdt it was the same as not using machine coordinates).

              Are you saying that, for the second command T1 G38.2 X150 K1, both tools are being moved? Because when any tool is mapped from it's usual axis (ie U) to X, it will update the position of both axes (even though only the U axis should physically move, the position on X is updated). If both X/T0 and U/T1 are physically moving, then yes, I'd think this was a bug.

              Your third command doesn't make any sense to me, ie you're trying to use a tool and move the axis that is not associated with it. RRF will probably let you do this, just because someone will probably want that functionality at some point. Caveat operator!

              I would imagine that your fourth command should work, but I'm not sure how the recorded position will relate to the X axis. I don't have an IDEX to test, to see what happens to the T1 X position when you command a U axis movement directly. I think what is supposed to happen with G1 moves is the the U axis will move independently, and the X axis position is not updated. However, when an X axis move is requested, the U axis will return to the previous position (where it left position with the X axis), then perform the expected X axis move, updating the U axis position as well. So it won't be useful for determining the X offset for T1.

              If you can confirm this is what you see, I can raise it with @dc42.

              Ian

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

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

                @droftarts I tried all 4 combinations of U vs. X and specifying T0 vs. T1's probe to see if I could make any sense of it. I couldn't. I really don't want to run any strange combination of moving a tool and triggering a different endstop!

                What I really want to run is "G38.2 X150 Kx " and have it move whichever tool is active toward 150 until probe #x is triggered. To confirm the behaviour I reported, I just ran the following sequence of commands:

                G28
                T0
                G1 X150 F24000
                T1
                G1 X150 F24000
                G1 X0
                G38.2 X150 K1
                G38.2 U150 K1
                

                The G1 commands are to be 100% sure that the axes move as expected (T0 moves to 150 for the first G1 and then T1 moves to 150 for the second G1). The first G38.2 command moves both T0 and T1 until probe 1 is triggered. The second G38.2 command moves only T0 (T1 doesn't move even though it is both active and the tool driven by the U axis).

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

                  @crpalmer I confirm this is a bug. I have implemented a fix in the 3.6 source code, which will be in the next 3.6.0 RC or internal build I make available.

                  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 Wow, that was a fast fix! Thanks!

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

                      @crpalmer I have provided main board firmware 3.6.0-rc.2+2 binaries at https://www.dropbox.com/scl/fo/nlkfneaas1osgtdw37s17/AIS_H0KSAKCmfYSjSRTSOAE?rlkey=ad4omnq36zkdz3wl8i7kthqqt&dl=0 which incude this fix.

                      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 Again, thanks! I can confirm that this fixes my probing issue.

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