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

    Syringes printer, adjust different offset

    Scheduled Pinned Locked Moved
    Firmware installation
    4
    26
    1.3k
    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.
    • FJ3Dundefined
      FJ3D
      last edited by

      Hello.

      Well I recently started building a printer based on E3D Toolchanger with 3 different syringe tools.

      I use the endstop that comes by default in the E3D kit for Z.

      I have everything more or less working, but I am not able to adjust the Z of each tool.

      Any configuration example?
      I have read the forum a lot for a few days, and I have seen an option (although code is not shared) in which they add an optical sensor so that the point of the needle passes through there and establishes the offset in Z, but I don't even know why where to start...

      BED.G

      ; Bed Mesh Leveling
      
      G1 S2 Z3 F5000		; lift Z 3mm
      
      G29
      
      ;disable mesh leveling, needs to be enabled at the start of your print and disabled again when finished.
      G29 S2
      
      ; Park the head
      G1 X150 Y-49 F50000
      

      EXAMPLE T0 TOLL

      ; tpre0.g
      ; called before tool 0 is selected
      
      ;Ensure no tool is selected
      ;T-1
      
      ;Unlock Coupler
      M98 P/macros/Coupler - Unlock
      
      ;Move to location
      G1 X-10.5 Y130 F20000
      
      ;Collect
      G1 Y170 F20000
      
      G1 Y183.5 F20000
      
      ;Close Coupler
      M98 P/macros/Coupler - Lock
      
      ;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
      ;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool!
      
      ;G91
      G1 Z60 F1000
      G90
      
      ; tfree0.g
      ; called when tool 0 is freed
      
      ;Drop the bed
      G91
      G1 Z20 F1000
      G90
      
      ;mesh levelling off
      ;G29 S2
      
      ;Purge nozzle
      ;M98 Ppurge.g
      
      ;Move In
      G53 G1 X-10.5 Y130 F50000
      G53 G1 Y150 F50000
      G53 G1 Y183.5 F5000
      
      
      ;Open Coupler
      M98 P/macros/Coupler - Unlock
      
      ;fan off
      M106 P2 S0
      
      ;Move Out
      G53 G1 X-10.5 Y150 F50000
      
      ;Exit tool coordinate system and show machine coordinates
      ;T-1 P0
      
      ; tpost0.g
      ; called after tool 0 has been selected
      
      ;heatup
      M116 P0
      
      ;prime nozzle
      ;M98 P"prime.g"
      
      M106 R1	; restore print cooling fan speed
      
      jay_s_ukundefined 1 Reply Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @FJ3D
        last edited by

        @fj3d you set the Z offset of each tool in G10 for each tool in config.g

        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

        FJ3Dundefined 1 Reply Last reply Reply Quote 0
        • FJ3Dundefined
          FJ3D @jay_s_uk
          last edited by

          @jay_s_uk said in Syringes printer, adjust different offset:

          @fj3d you set the Z offset of each tool in G10 for each tool in config.g

          You mean here right?

          ; Tools
          M563 P0 S"T0" D0         ; Define tool 0 
          [[[In this:]]]  G10 P0 X0 Y0 Z20 	; Reset tool 0 axis offsets
          G10 P0 R0 S0 		
          
          

          I have Z20 on but it doesn't do anything different when it starts printing...

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

            @fj3d said in Syringes printer, adjust different offset:

            [[[In this:]]]

            yes, thats where you set the offset, although I don't know what that bit is that you highlighted.
            this is also from the changelog of 3.4.0

            After changing tool, RRF no longer moves the new tool head to the coordinates at which the old tool head as at when the Tn command was actioned. In most situations this should not matter, because GCode enerators usually generate commands to move to the correct XYZ position after generating a Tn command. Usually, they restore XY before Z. However, Cura does it the other way round, which risks dragging the tool head across the print. Therefore when using Cura, or in any other situations in which you want to restore the old ehaviour, we suggest you add command G1 R2 X0 Y0 Z2 Fxxx followed by G1 R2 Z0 Fxxx to the end of your post#.g files, if you don't already use those or similar commands
            

            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

            FJ3Dundefined 1 Reply Last reply Reply Quote 0
            • FJ3Dundefined
              FJ3D @jay_s_uk
              last edited by

              @jay_s_uk sorry, the "[[[in this]]]" was just to highlight it for you to see.

              I use RepRapFirmware for Duet 2 WiFi/Ethernet version 3.2.2 running on Duet WiFi 1.02 or later + DueX5

              should i update? do i have to install everything again?

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

                @fj3d i would update.
                check the changelog to see if any changes affect you. there may be, its been a while since i ran 3.2.2

                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

                FJ3Dundefined 2 Replies Last reply Reply Quote 0
                • FJ3Dundefined
                  FJ3D @jay_s_uk
                  last edited by FJ3D

                  @jay_s_uk I have updated to 3.4.4, but it still ignores the Z parameter. Put 5, 20 or 40 it always stays at the same height

                  :::::::EDIT::::

                  Fixed, I had repeated the command at the end of config.g

                  1 Reply Last reply Reply Quote 1
                  • FJ3Dundefined
                    FJ3D @jay_s_uk
                    last edited by

                    @jay_s_uk

                    Hello.
                    I was wondering how to assign an endstop to act as a leveler for each tool.
                    I have a tool with syringes, which have to be changed often and the sizes are different, sometimes shorter and sometimes longer. As initial configuration, I have assigned offset for each tool with EXAMPLE

                    G10 P0 X-9 Y39 Z-17.5
                    

                    Well, if now I want to change the needle in that tool and calculate the z offset so that I know and save that value? Is there any way to do it, creating a macro or similar?

                    HebigTundefined 1 Reply Last reply Reply Quote 1
                    • HebigTundefined
                      HebigT @FJ3D
                      last edited by HebigT

                      @fj3d

                      Yes, you can create a macro to do it. Here is a potential procedure, and probably not the only, or best way to do it.

                      This is mostly from memory so it will need tweaking.

                      Also be sure to update to the latest stable firmware version first, if possible. In the gcode examples below, i'm assuming at least RRF v3.0

                      1. Mount a switch somewhere on the build plate where every tool can reach.

                      2. Define an additional Z-endstop in the console. Add this line to the beginning of your macro, later on, as well.
                        (e.g. M574 Z0 P"pin_name" S1)

                      • Before proceeding, you need to measure the height at which your z-offset probing switch actuates (e.g. "z_switch_actuation_height")
                      • Pickup any tool with a syringe tip and clear the existing Z-offset
                      • move the tip above the switch
                      Tx ; Pick up a tool with syringe tip
                      G10 Px Z0 ; clear z-offset for active tool
                      G1 Xx Yx ; move syringe tip over z-offset switch
                      
                      
                      • manually jog the bed upward until the switch actuates (use M119 in the console to determine the endstop state and note at which height it changes. Always use M114 in the console to check axes positions, the positions in the DWC dashboard are rounded numbers)

                      • write down the current z-position (for instance 40mm)

                      • move off the switch and manually jog the buildplate up to the syringe tip (use a sheet of paper, if needed, to feel when the tip is close to touching the build plate).

                      • write down the current z-position (for instance, 25mm)

                      • Initiate a global variable for the actuation height. This will always be the same unless you change something about your z-switch mount.

                      global z_switch_actuation_height = 40 - 25 ; minus the thickness of the sheet of paper, too , if needed
                      
                      
                      • Put this global variable at the end of your config.g

                      The Automatic offset macro:

                      1. Write some gcode to pick up a tool (with newly installed syringe tip), move the syringe tip over the switch and probe the switch
                      Tx ; pick up a tool
                      G1 Z10 ; Move the bed down (probably taken care of by your tpostx.g macros already, just need to more the bed to a safe position to prevent crashes)
                      G10 Px Z0 ; clear the previous Z-offset for the active tool
                      G1 Xx Yx ; move over the switch
                      G91 ; set to relative positioning
                      G1 Z-10 H4 ; Syringe tip probes the switch and stops when the switch actuates (that's what the H4 does)
                      G90 ; set to absolute positioning
                      

                      Query the object model for the current position of the Z-axis and initiate a variable. An if statement checks if the variable already exists, and will overwrite it if so, or initiate it if not. This is useful if you are running the macro multiple times; otherwise RRF will give you an error that a variable already exists.

                      if exists (var.current_z_pos)
                          set var.current_z_pos = move.axes[2].machinePosition 
                      else
                          var current_z_pos = move.axes[2].machinePosition
                      
                      1. Take the measured z-position and subtract your pre-determined z-switch 'actuation height'
                      var Tx_z_offset = var.current_z_pos - global.z_switch_actuation_height
                      
                      
                      1. The difference calculated in step 4 should be your new z-offset for the active tool. Add this to the active tool's G10 command, ENSURE IS IT NEGATIVE, and save with M500 to the config-override.g
                      G10 Px Z{var.Tx_z_offset} ; set new z-offset
                      M500 ; save the offset (will appear in config-override.g)
                      
                      T-x ; return the tool to the dock
                      
                      FJ3Dundefined 2 Replies Last reply Reply Quote 3
                      • FJ3Dundefined
                        FJ3D @HebigT
                        last edited by

                        @hebigt

                        Wow!! It is brilliant, i'll try next week.

                        1 Reply Last reply Reply Quote 0
                        • FJ3Dundefined
                          FJ3D @HebigT
                          last edited by

                          @hebigt said in Syringes printer, adjust different offset:

                          {1}

                          Hello.

                          I have been this afternoon testing and understanding a little the operation.

                          I have followed all the steps, the macro works but when it reaches the limit switch and activates it, this message appears:

                          M98 P"0:/macros/Prueba Z TOOL CALIBRACION"
                          Error: Bad command: {1}
                          Error: in file macro line 16 column 37: meta command: unknown variable 'current_z_pos'
                          

                          My Macro:

                          T0 ; pick up a tool
                          G1 Z30 ; Move the bed down (probably taken care of by your tpostx.g macros already, just need to more the bed to a safe position to prevent crashes)
                          G10 P0 Z0 ; clear the previous Z-offset for the active tool
                          G1 X-12.5 ; move X over the switch
                          G1 Y-2 ; move X over the switch
                          G91 ; set to relative positioning
                          G1 Z-10 H4 ; Syringe tip probes the switch and stops when the switch actuates (that's what the H4 does)
                          G90 ; set to absolute positioning
                          {1}
                          
                          if exists (var.current_z_pos)
                              set var.current_z_pos = move.axes[2].machinePosition 
                          else
                              var current_z_pos = move.axes[2].machinePosition
                          	
                          var T0_z_altura = var.current_z_pos - global.z_switch_actuation_height	
                          

                          I have added at the end of my config.g the following:

                          global z_switch_actuation_height = 38 - 19 ; minus the thickness of the sheet of paper, too , if needed
                          

                          And in the config.g:

                          ;OFFSET TOOLS
                          
                          G10 P0 X-9 Y39 Z-18.5				; T0
                          ;PARA OFFSET HERRAMIENTA
                          G10 P0 Z{var.T0_z_altura} ; set new z-offset
                          M500 ; save the offset (will appear in config-override.g)
                          T-1 ; return the tool to the dock
                          
                          HebigTundefined 1 Reply Last reply Reply Quote 0
                          • HebigTundefined
                            HebigT @FJ3D
                            last edited by

                            @fj3d If you haven't already, you can safely delete the {1} from your macro.

                            I don't know why it showed up in the formatting for my last message but it popped in there.

                            Phaedruxundefined FJ3Dundefined 2 Replies Last reply Reply Quote 0
                            • Phaedruxundefined
                              Phaedrux Moderator @HebigT
                              last edited by

                              @hebigt I think that's the forum software adding the {1}
                              I haven't seen that happen in a while.

                              Z-Bot CoreXY Build | Thingiverse Profile

                              1 Reply Last reply Reply Quote 1
                              • FJ3Dundefined
                                FJ3D @HebigT
                                last edited by FJ3D

                                @hebigt
                                The error must be something else, I keep getting the same error:

                                ERROR.PNG

                                I am reviewing the macro, and it may be that what I highlight is the error? it seems that the var.current_z_pos is in parentheses and makes it a comment, I think that's the error!

                                MACRO.PNG

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

                                  @fj3d you're missing a dot after var on line 14

                                  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

                                  FJ3Dundefined 1 Reply Last reply Reply Quote 0
                                  • FJ3Dundefined
                                    FJ3D @jay_s_uk
                                    last edited by FJ3D

                                    @jay_s_uk
                                    It is true!! changing that now these appear:

                                    Error: Bad command: var.current_z_pos = move.axes[2].machinePosition
                                    Error: in file macro line 15 column 37: meta command: unknown variable 'current_z_pos'
                                    

                                    CODE

                                    T0 ; pick up a tool
                                    G1 Z30 ; Move the bed down (probably taken care of by your tpostx.g macros already, just need to more the bed to a safe position to prevent crashes)
                                    G10 P0 Z0 ; clear the previous Z-offset for the active tool
                                    G1 X-12.5 ; move X over the switch
                                    G1 Y-2 ; move X over the switch
                                    G91 ; set to relative positioning
                                    G1 Z-10 H4 ; Syringe tip probes the switch and stops when the switch actuates (that's what the H4 does)
                                    G90 ; set to absolute positioning
                                    
                                    if exists (var.current_z_pos)
                                        set var.current_z_pos = move.axes[2].machinePosition 
                                    else
                                        var.current_z_pos = move.axes[2].machinePosition
                                    	
                                    var T0_z_altura = var.current_z_pos - global.z_switch_actuation_height
                                    
                                    

                                    MACRO.PNG

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

                                      @fj3d actually, it was right the first time without the dot as thats setting the variable up, so i was wrong on that one.
                                      Just thinking about it, you don't need to run an exists on a variable in a macro as you're only using it in that macro.
                                      The one that may be causing you the issue is the global. does that one exist?

                                      best to change your macro to

                                      var current_z_pos = 0
                                      T0 ; pick up a tool
                                      G1 Z30 ; Move the bed down (probably taken care of by your tpostx.g macros already, just need to more the bed to a safe position to prevent crashes)
                                      G10 P0 Z0 ; clear the previous Z-offset for the active tool
                                      G1 X-12.5 ; move X over the switch
                                      G1 Y-2 ; move X over the switch
                                      G91 ; set to relative positioning
                                      G1 Z-10 H4 ; Syringe tip probes the switch and stops when the switch actuates (that's what the H4 does)
                                      G90 ; set to absolute positioning
                                      set var.current_z_pos = move.axes[2].machinePosition
                                      var T0_z_altura = var.current_z_pos - global.z_switch_actuation_height
                                      

                                      I suppose the next question is what are you going to do with the variable T0_z_altura as after the macro finishes its gone

                                      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

                                      FJ3Dundefined 1 Reply Last reply Reply Quote 0
                                      • FJ3Dundefined
                                        FJ3D @jay_s_uk
                                        last edited by

                                        @jay_s_uk

                                        With this code I no longer get an error.

                                        • Picks up the tool, positions itself at the endstop
                                        • Activates it and here the maro is over, it does nothing else

                                        Inside config I have the following:

                                        ;OFFSET TOOLS
                                        
                                        G10 P0 X-9 Y39 Z-18.5				; T0
                                        ;PARA OFFSET HERRAMIENTA
                                        G10 P0 Z{var.T0_z_altura} ; set new z-offset
                                        M500 ; save the offset (will appear in config-override.g)
                                        T-1 ; return the tool to the dock
                                        
                                        
                                        global z_switch_actuation_height = 38 - 19 ; minus the thickness of the sheet of paper, too , if needed
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • jay_s_ukundefined
                                          jay_s_uk
                                          last edited by

                                          @fj3d you can't reference a variable like that as its only present during the macro its ran so you'd have to make it a global instead.

                                          and what do you mean you have that inside config.g? and changes to a G10 tool offset won't get saved in config.g unless M500 P10 is used

                                          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

                                          FJ3Dundefined 1 Reply Last reply Reply Quote 0
                                          • FJ3Dundefined
                                            FJ3D @jay_s_uk
                                            last edited by FJ3D

                                            @jay_s_uk

                                            Ok, I misunderstood the explanation @HebigT

                                            What I have inside config.g goes inside the macro, of course, it's logical now thought. Sorry but I don't understand programming of this type...

                                            I have executed the macro and it seems that now it does everything.

                                            • Picks up the tool, positions itself at the endstop
                                            • Activate endstop and return execute T-1

                                            Now my question is, am I supposed to save myself with M500 the value in config-override.g right?

                                            But I go in and this is what I see and I have:

                                            ; config-override.g file generated in response to M500 at 2022-09-28 10:15
                                            ; This is a system-generated file - do not edit
                                            ; Heater model parameters
                                            M307 H4 R2.430 K0.560:0.000 D5.50 E1.35 S1.00 B0 V0.0
                                            ; Workplace coordinates
                                            G10 L2 P1 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P2 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P3 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P4 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P5 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P6 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P7 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P8 X0.00 Y0.00 Z0.00 C0.00
                                            G10 L2 P9 X0.00 Y0.00 Z0.00 C0.00
                                            

                                            My macro looks like this:

                                            var current_z_pos = 0
                                            T0 ; pick up a tool
                                            G1 Z30 ; Move the bed down (probably taken care of by your tpostx.g macros already, just need to more the bed to a safe position to prevent crashes)
                                            G10 P0 Z0 ; clear the previous Z-offset for the active tool
                                            G1 X-12.5 ; move X over the switch
                                            G1 Y-2 ; move X over the switch
                                            G91 ; set to relative positioning
                                            G1 Z-10 H4 ; Syringe tip probes the switch and stops when the switch actuates (that's what the H4 does)
                                            G90 ; set to absolute positioning
                                            
                                            set var.current_z_pos = move.axes[2].machinePosition
                                            var T0_z_altura = var.current_z_pos - global.z_switch_actuation_height
                                            
                                            ;PARA OFFSET HERRAMIENTA
                                            G10 P0 Z{var.T0_z_altura} ; set new z-offset
                                            M500 ; save the offset (will appear in config-override.g)
                                            T-1 ; return the tool to the dock
                                            

                                            ** Ingnore {1}, is added in the forum...**

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