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

Tool Change: Moving in axis without calling them

Scheduled Pinned Locked Moved
Beta Firmware
3
46
2.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.
  • undefined
    Danal
    last edited by 16 Nov 2019, 17:13

    This can be fixed two ways:

    1. Make every move in 'tpre' macros have a g53.

    2. Do very little in 'tpre' and do the actual mount and position of the tool in 'tpost'. During 'tpost', tool offsets will be active.

    There is no right or wrong between these two... still I personally prefer (2).

    Delta / Kossel printer fanatic

    undefined 1 Reply Last reply 16 Nov 2019, 17:17 Reply Quote 0
    • undefined
      smoki3 @Danal
      last edited by 16 Nov 2019, 17:17

      @Danal said in Tool Change: Moving in axis without calling them:

      This can be fixed two ways:

      1. Make every move in 'tpre' macros have a g53.

      2. Do very little in 'tpre' and do the actual mount and position of the tool in 'tpost'. During 'tpost', tool offsets will be active.

      There is no right or wrong between these two... still I personally prefer (2).

      Yes this is the workaround that I am actually using. But it is not possible for the Z axis because in a print the Z height is variable.

      But this a definitely a bug because in tpre.g tool offset is inactive so the should be no difference if I use a G53 or not. If you do a T-1 between the tool change you get a completely different behavior.

      1 Reply Last reply Reply Quote 0
      • undefined
        Danal
        last edited by 16 Nov 2019, 17:18

        Just for reference, here is a set of files that does minimal work in 'pre' and does most of the work in 'post'.

        http://danalspub.com/wp-content/uploads/2019/11/Backup-Toolchange-Jubilee-Nov-16-19-0945.zip

        Keep in mind these files are NOT "golden" in any way... they just work on my machine.

        Oh, and they are designed to move the new tool to the same position the old tool had before the tool change. If you don't want this, just take out the three G1 (or G0) commands at the end of 'post' that have the "R2" in them.

        Delta / Kossel printer fanatic

        undefined 1 Reply Last reply 16 Nov 2019, 17:26 Reply Quote 0
        • undefined
          smoki3 @Danal
          last edited by 16 Nov 2019, 17:25

          @Danal
          Why do you expect a Y movement?

          With the end of the tfree.g the tool offset is gone. So every move you do after this is in the global coordinate system, no matter it was before with the activated tool offset. And the tool offset of the new tool get activated after the tfree.g (before the tpost.g)
          And if I place my toolhead G53 G1 Y165 then it have to stay there until it gets another Y axis command. (same for the Z and X axis)

          1 Reply Last reply Reply Quote 0
          • undefined
            smoki3 @Danal
            last edited by 16 Nov 2019, 17:26

            @Danal said in Tool Change: Moving in axis without calling them:

            Just for reference, here is a set of files that does minimal work in 'pre' and does most of the work in 'post'.

            http://danalspub.com/wp-content/uploads/2019/11/Backup-Toolchange-Jubilee-Nov-16-19-0945.zip

            Keep in mind these files are NOT "golden" in any way... they just work on my machine.

            Oh, and they are designed to move the new tool to the same position the old tool had before the tool change. If you don't want this, just take out the three G1 (or G0) commands at the end of 'post' that have the "R2" in them.

            I know there are many workarounds but it does not change the fact that this behavior is normal 🙂

            1 Reply Last reply Reply Quote 0
            • undefined
              Danal
              last edited by 16 Nov 2019, 17:35

              I'd expect that move because that's my understanding of how g-code works, per the NIST standard.

              The NIST spec defines the exact sequence of how coordinates are calculated for every move. "Running" that sequence of events for a G1 after a tool offset is removed WILL result in a move of an axis that is "no longer where it should be".

              I could be wrong... but, given that the machine behaves the way the spec reads...

              Delta / Kossel printer fanatic

              1 Reply Last reply Reply Quote 0
              • undefined
                Danal
                last edited by 16 Nov 2019, 17:45

                Of course, now I'm sitting here issuing sequences of M114, G10, G1, etc, etc, and I can't reproduce what I'm theorizing... so I probably am wrong... 🙂

                I'll keep looking.

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 1
                • undefined
                  smoki3
                  last edited by 10 Dec 2019, 21:43

                  @dc42
                  I found a video on the e3d forum where you can see the issue:

                  https://youtu.be/5RXE5qRVJgI

                  At 0:33 you can see the tool change and the moving Z-axis.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Danal
                    last edited by 11 Dec 2019, 15:02

                    It seems likely to me that all the Z moves from between about :27 and :37 are coded into their pre/post/free macros. I have Z moves in mine, and they have to produce a good outcome no matter what the sequence of events. Therefore, moves occur during a regular single change that look a little weird. They are important when starting with no tool, or ending that way, or etc.

                    Delta / Kossel printer fanatic

                    undefined 1 Reply Last reply 13 Dec 2019, 11:22 Reply Quote 0
                    • undefined
                      Danal
                      last edited by 11 Dec 2019, 15:03

                      And, I have not had time to research this any further. I will be getting back to my toolchanging printer soon, to work out the final kinks. I will report back when I know something more about this issue.

                      Delta / Kossel printer fanatic

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        smoki3 @Danal
                        last edited by smoki3 13 Dec 2019, 11:22

                        @Danal
                        no they are not coded. Just the lift of the nozzle before the tool change starts. Anything else is due to the fact that there is an issue after the tfree.g script with calculating the position.

                        If you do a T-1 and then a T1 you get a different behaviour. Then you dont have the Z-movement even though are running exactly the same scripts.

                        When you go back to 2.02 there you see you dont have this movements.

                        undefined 1 Reply Last reply 13 Dec 2019, 12:31 Reply Quote 0
                        • undefined
                          smoki3 @smoki3
                          last edited by 13 Dec 2019, 12:31

                          @smoki3 said in Tool Change: Moving in axis without calling them:

                          @Danal
                          no they are not coded. Just the lift of the nozzle before the tool change starts. Anything else is due to the fact that there is an issue after the tfree.g script with calculating the position.

                          If you do a T-1 and then a T1 you get a different behaviour. Then you dont have the Z-movement even though are running exactly the same scripts.

                          When you go back to 2.02 there you see you dont have this movements.

                          I found this comment in the GCodes.cpp, which sound a bit like this bug @dc42

                          else if (rp != nullptr)
                          			{
                          				currentUserPosition[axis] = moveArg + rp->moveCoords[axis];
                          				// When a restore point is being used (G1 R parameter) then we used to set any coordinates that were not mentioned to the restore point values.
                          				// But that causes issues for tool change on IDEX machines because we end up restoring the U axis when we shouldn't.
                          				// So we no longer do that, and the user must mention any axes that he wants restored e.g. G1 R2 X0 Y0.
                          			}
                          
                          dc42undefined 1 Reply Last reply 13 Dec 2019, 15:18 Reply Quote 0
                          • undefined
                            Danal
                            last edited by 13 Dec 2019, 14:01

                            @smoki3 said in Tool Change: Moving in axis without calling them:

                            and the user must mention any axes that he wants restored

                            Very interesting. I will keep that in mind as I research this further.

                            When you go back to 2.02 there you see you dont have this movements.

                            I can't run any version of 2; I am on Duet 3 hardware.

                            Delta / Kossel printer fanatic

                            1 Reply Last reply Reply Quote 0
                            • dc42undefined
                              dc42 administrators @smoki3
                              last edited by 13 Dec 2019, 15:18

                              @smoki3 said in Tool Change: Moving in axis without calling them:

                              @smoki3 said in Tool Change: Moving in axis without calling them:

                              @Danal
                              no they are not coded. Just the lift of the nozzle before the tool change starts. Anything else is due to the fact that there is an issue after the tfree.g script with calculating the position.

                              If you do a T-1 and then a T1 you get a different behaviour. Then you dont have the Z-movement even though are running exactly the same scripts.

                              When you go back to 2.02 there you see you dont have this movements.

                              I found this comment in the GCodes.cpp, which sound a bit like this bug @dc42

                              else if (rp != nullptr)
                              			{
                              				currentUserPosition[axis] = moveArg + rp->moveCoords[axis];
                              				// When a restore point is being used (G1 R parameter) then we used to set any coordinates that were not mentioned to the restore point values.
                              				// But that causes issues for tool change on IDEX machines because we end up restoring the U axis when we shouldn't.
                              				// So we no longer do that, and the user must mention any axes that he wants restored e.g. G1 R2 X0 Y0.
                              			}
                              

                              That change was introduced way back in firmware 1.19.

                              @Danal said in Tool Change: Moving in axis without calling them:

                              @smoki3 said in Tool Change: Moving in axis without calling them:

                              and the user must mention any axes that he wants restored

                              Very interesting. I will keep that in mind as I research this further.

                              When you go back to 2.02 there you see you dont have this movements.

                              I can't run any version of 2; I am on Duet 3 hardware.

                              I think the change in behaviour must be connected with this change, in the upgrade notes for 2.03:

                              Tool changers, IDEX printers and similar using tfree#.g and tpost#.g files: tool offsets are now applied within the tfree#.g and tpost#.g macros (but not in the tpre#.g file because no tool is selected at that point).

                              Perhaps there is a G1 command in the tfree or tpost file that needs to be corrected for tool offset, or else a G53 prefix added?

                              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

                              undefined 2 Replies Last reply 13 Dec 2019, 15:30 Reply Quote 0
                              • undefined
                                smoki3 @dc42
                                last edited by smoki3 13 Dec 2019, 15:30

                                @dc42

                                No I don't think so!

                                I actually investigating:

                                So frist my config:

                                ; Configuration file for Duet WiFi (firmware version 1.21)
                                ; executed by the firmware on start-up
                                ;
                                ; generated by RepRapFirmware Configuration Tool on Wed Sep 19 2018 21:12:53 GMT+0200 (Mitteleuropäische Sommerzeit)
                                
                                ; General preferences
                                G90                                                ; Send absolute coordinates...
                                M83                                                ; ...but relative extruder moves
                                
                                ; Network
                                M550 PCoreXY                                   	   ; Set machine name
                                M552 S1                                        	   ; Enable network
                                M586 P0 S1                                         ; Enable HTTP
                                M586 P1 S0                                         ; Disable FTP
                                M586 P2 S0                                         ; Disable Telnet
                                
                                ; Drives
                                M584 X0 Y1 Z2 E3:4:5:6 U7                          		; Map Drives to Axis
                                M669 K1                                            		; Select CoreXY mode
                                M569 P0 S0                                         		; Drive 0 goes forwards
                                M569 P1 S0                                         		; Drive 1 goes forwards
                                M569 P2 S1                                         		; Drive 2 goes forwards
                                M569 P3 S0                                         		; Drive 3 goes forwards
                                M569 P4 S0                                         		; Drive 4 goes forwards
                                M569 P5 S0                                         		; Drive 5 goes forwards
                                M569 P6 S0                                         		; Drive 6 goes forwards
                                M569 P7 S0                                        		; Drive 7 goes forwards
                                M350 X16 Y16 Z16 E16:16:16:16 I1                   		; Configure microstepping with interpolation
                                M350 U8 I0					   		; Configure microstepping without interpolation
                                M92 X100 Y100 Z1600 U100 E460:460:460:460          		; Set steps per mm
                                M566 X600 Y600 Z18 U2 E100:100:100:100         		   		; Set maximum instantaneous speed changes (mm/min)
                                M203 X35000 Y35000 Z1200 U25000 E5000:5000:5000:5000    	; Set maximum speeds (mm/min)
                                M201 X6000 Y6000 Z400 U500 E2500:2500:2500:2500         	; Set accelerations (mm/s^2)
                                M906 X1650 Y1650 Z1100 U200 E1450:1450:1450:1450 I30    	; Set motor currents (mA) and motor idle factor in per cent
                                M84 S120                                           		; Set idle timeout
                                
                                ; Axis Limits
                                M208 X-13.5 Y-56 Z0 U0 S1                          		; Set axis minima
                                M208 X316 Y202 Z270.20 U500 S0                     		; Set axis maxima
                                
                                ; Thermal Sensors
                                M308 S0 P"bedtemp" Y"thermistor" T100000 B3950                   	; Set thermistor + ADC parameters for heater 0
                                M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.060000e-8       	; Set thermistor + ADC parameters for heater 1
                                M308 S2 P"e1temp" Y"thermistor" T100000 B4725 C7.060000e-8       	; Set thermistor + ADC parameters for heater 2
                                M308 S3 P"e2temp" Y"thermistor" T100000 B4725 C7.060000e-8      	; Set thermistor + ADC parameters for heater 3
                                M308 S4 P"e3temp" Y"thermistor" T100000 B4725 C7.060000e-8      	; Set thermistor + ADC parameters for heater 4
                                
                                ; Hardware
                                M950 H0 C"bedheat" T0
                                M950 H1 C"e0heat" T1
                                M950 H2 C"e1heat" T2
                                M950 H3 C"!exp.heater3" T3
                                M950 H4 C"!exp.heater4" T4
                                M950 F3 C"duex.fan3"
                                M950 F4 C"duex.fan4"
                                M950 F5 C"duex.fan5"
                                M950 F6 C"duex.fan6"
                                M950 F7 C"duex.fan7"
                                M950 F8 C"duex.fan8"
                                
                                ; Max Temp Protection
                                M143 H0 S140                                   ; Set temperature limit for heater 0 to 140C
                                M143 H1 S270                                   ; Set temperature limit for heater 1 to 270C
                                M143 H2 S270                                   ; Set temperature limit for heater 2 to 270C
                                M143 H3 S270                                   ; Set temperature limit for heater 3 to 270C
                                M143 H4 S270                                   ; Set temperature limit for heater 4 to 270C
                                
                                ; Fanmapping
                                M106 P0 S0 I0 F500 H-1 C"Tool 0"               ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
                                M106 P3 S0 I0 F500 H-1 C"Tool 1"               ; Set fan 3 value, PWM signal inversion and frequency. Thermostatic control is turned off
                                M106 P7 S0 I0 F500 H-1 C"Tool 2"               ; Set fan 7 value, PWM signal inversion and frequency. Thermostatic control is turned off
                                M106 P5 S0 I0 F500 H-1 C"Tool 3"               ; Set fan 5 value, PWM signal inversion and frequency. Thermostatic control is turned off
                                M106 P1 S1 I0 F500 H1 T55                      ; Set fan 1 value for Tool 0, PWM signal inversion and frequency. Thermostatic control is turned on
                                M106 P4 S1 I0 F500 H2 T55                      ; Set fan 2 value for Tool 1, PWM signal inversion and frequency. Thermostatic control is turned on
                                M106 P6 S1 I0 F500 H3 T55                      ; Set fan 6 value for Tool 2, PWM signal inversion and frequency. Thermostatic control is turned on
                                M106 P8 S1 I0 F500 H4 T55                      ; Set fan 8 value for Tool 4, PWM signal inversion and frequency. Thermostatic control is turned on
                                
                                ; Endstops
                                M915 X Y S5 H350 F0 R0           	       ; Set Stall detection sensitivity
                                M915 U S5 H200 F0 R0			       ; Coupler
                                M574 Y1 S3                                     ; Set endstops controlled by motor load detection
                                M574 X1 S3                                     ; Set endstops controlled by motor load detection
                                M574 U0                                        ; Set endstops controlled by motor load detection
                                
                                ; Z-Probe
                                M574 Z0 C"nil" 		                       ; no Z endstop switch, free up Z endstop input
                                M558 P5 C"!zstop" H3 F180 T25000	       ; Z probe connected to Z endstop input
                                G31 X0 Y0 Z0.00 P500          	               ; Set Z probe offset + naher ran - weiter weg
                                M557 X5:295 Y0:190 S48.33:47.5                 ; Define mesh grid
                                
                                ; Tools
                                M563 P0 D0 H1 F0                               ; Define tool 0, Fan 0
                                M563 P1 D1 H2 F3                               ; Define tool 1, Fan 3
                                M563 P2 D2 H3 F7                               ; Define tool 2, Fan 7
                                M563 P3 D3 H4 F5                               ; Define tool 3, Fan 5
                                
                                ; PID Settings Tools
                                M307 H1 A595.9 C199.5 D4.5 S1.00 V24.1 B0      ; Set PID settings tool 0
                                M307 H2 A775.0 C252.4 D8.2 S1.00 V24.1 B0      ; Set PID settings tool 1
                                M307 H3 A716.5 C237.1 D8.7 S1.00 V24.1 B0      ; Set PID settings tool 2
                                M307 H4 A567.7 C241.0 D6.7 S0.80 V24.1 B0      ; Set PID settings tool 3
                                M307 H0 A181.4 C631.5 D4.9 S1.00 V24.1 B0      ; Bed PID Settings
                                
                                ; Tooloffset
                                ;G10 P0 X0.00 Y34.50 Z-15.84                    ; Set tool 0 axis offsets
                                ;G10 P1 X0.55 Y34.50 Z-15.83                    ; Set tool 1 axis offsets
                                ;G10 P2 X0.16 Y34.50 Z-15.85                    ; Set tool 2 axis offsets
                                ;G10 P3 X0.25 Y34.50 Z-15.70                    ; Set tool 3 axis offsets
                                M98 Ptooloffset.g
                                
                                ; Tools Temperatures
                                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
                                G10 P2 R0 S0                                   ; Set initial tool 2 active and standby temperatures to 0C
                                G10 P3 R0 S0                                   ; Set initial tool 3 active and standby temperatures to 0C
                                
                                ; LED Strip
                                M950 F2 C"nil"				       ; Free fan 2 pin
                                M950 P2 C"fan2"				       ; create GPIO pin 2 attached to fan 2
                                M42 P2 S30				       ; Turn LEDs on 30% PWM
                                
                                ; Calibrate MCU Temperature
                                M912 P0 S-8
                                
                                ; DAA
                                M593 F80
                                
                                ; Load config override
                                M501
                                

                                Then I created a simple tpre.g (same for T0 and T1, just X0 for T0 and X50 for T1):

                                ; tpre0.g
                                ; called before tool 0 is selected
                                
                                
                                G1 X0 F5000
                                M400
                                M98 P"/macros/Toolhead/1. Toolhead unlock"
                                G4 P400
                                
                                G1 Y110 F5000
                                M400
                                
                                M98 P"/macros/Toolhead/2. Toolhead lock"
                                G4 P260
                                
                                G1 Y100 F5000
                                

                                Then the tfree.g (same X0 for T0 and X1 for T1):

                                ; tfree0.g
                                ; called when tool 0 is freed
                                
                                G91
                                G1 Z10 F7200
                                G90
                                
                                
                                G53 G1 X0 F5000 ;XPOS
                                G53 G1 Y110
                                M400
                                M98 P"/macros/Toolhead/1. Toolhead unlock"
                                G4 P320
                                G53 G1 Y100 F5000
                                M400
                                

                                tpost.g is completely empty for both.

                                the tool offsets are defines as followed:

                                ; Tooloffset
                                G10 P0 X20.00 Y15 Z-12.0                    ; Set tool 0 axis offsets
                                G10 P1 X20.00 Y15 Z-12.0                   ; Set tool 1 axis offsets
                                
                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  smoki3 @dc42
                                  last edited by smoki3 13 Dec 2019, 15:37

                                  @dc42

                                  I made some videos:

                                  First I have just clicked on T0 to pick it up:

                                  https://photos.app.goo.gl/ipCKj1bHJ15dw8NKA

                                  After this I picked up T1 by clicking on it in DWC:

                                  https://photos.app.goo.gl/yqMHUWQt5n7gYiPX6

                                  Last on I deactivated T1 by click again on T1 in DWC:

                                  https://photos.app.goo.gl/Nnn5NxX9C4Ph9WFx5

                                  So do you see this wired diagonal move with XY axis and Z Axis in the second video?

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    Danal
                                    last edited by 13 Dec 2019, 17:17

                                    I understand why offsets are/aren't applied. They correlate to the "what tool number is currently mounted" status of the printer.

                                    Therefore, I have G53 in front of the vast majority of the moves, because those moves need to deal with the parking posts in absolute terms.

                                    I'll see if I can reproduce what happens in the above vids.

                                    Delta / Kossel printer fanatic

                                    undefined 1 Reply Last reply 13 Dec 2019, 17:29 Reply Quote 0
                                    • undefined
                                      smoki3 @Danal
                                      last edited by 13 Dec 2019, 17:29

                                      @Danal said in Tool Change: Moving in axis without calling them:

                                      I understand why offsets are/aren't applied. They correlate to the "what tool number is currently mounted" status of the printer.

                                      Therefore, I have G53 in front of the vast majority of the moves, because those moves need to deal with the parking posts in absolute terms.

                                      I'll see if I can reproduce what happens in the above vids.

                                      As you can see in my tpre script I also have G53 in front of every move. That this diagonal move does not exist in the script and only happens if you directly move from T0 to T1 if you do a T0 → T-1 → T1 it does not happen.

                                      But I am not able to see at which coordinates. this diagonal move ends

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        smoki3
                                        last edited by 13 Dec 2019, 17:55

                                        So I adjusted the tool offset not to this:

                                        ; Tooloffset
                                        G10 P0 X0.00 Y50 Z0.0                    ; Set tool 0 axis offsets
                                        G10 P1 X0.00 Y0 Z0.0                   ; Set tool 1 axis offsets
                                        

                                        Then it looks like this:

                                        https://photos.app.goo.gl/MzJ7iRV5FMb3namx7

                                        As you can see the printer is moving diagonal 50mm in X axis (from the tpre.g) and Y axis (from removing the tool offset). The Z movement is gone because there is not Z tool offset defined.

                                        Normaly it should just release T0 and move just 50mm in X axis as defined in the tpre script.

                                        1 Reply Last reply Reply Quote 0
                                        • dc42undefined
                                          dc42 administrators
                                          last edited by 15 Dec 2019, 14:49

                                          Please try the firmware at https://www.dropbox.com/sh/3azy1njy3ayjsbp/AACquxr2m00eV568RZg5QG5wa?dl=0. Running the Duet 2 version of this firmware on my tool changer, I don't see any diagonal moves, where as I did when running RRF 2.

                                          Note, currently you cannot downgrade from this firmware via Duet Web Control when running with an attached SBC. That will be fixed shortly. Meanwhile, you can downgrade by running in standalone mode or by using Bossa.

                                          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

                                          undefined 2 Replies Last reply 15 Dec 2019, 14:58 Reply Quote 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA