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

    Duet3 Executing moves out of order - 3.1.1 W/ SBC

    Scheduled Pinned Locked Moved
    Beta Firmware
    3
    7
    294
    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.
    • Luke'sLaboratoryundefined
      Luke'sLaboratory
      last edited by Luke'sLaboratory

      Hi!

      After significantly slowing down my COVID-19 Shield Clip printing, its time to get back into toolchanging!

      However, after I updated to 3.1.1, I have a very frustrating bug(s???) and need some help.

      When I start a print, if my axes are not homed, my printer reports: Error:

      G0/G1: insufficient axes homed
      

      However - here's my starting Gcode:

      M107
      M190 S60 ; set bed temperature and wait for it to be reached
      G10 T0 S195 R175
      T0 P0 ; Activate tool but don't run any macros
      G28
      G32 ; auto-magic levelling
      M558 H3 F240 A1
      M557 X263:330 Y281:319 S19.0
      G29
      ;M572 D0 S0.01; Set K-factor PLA
      ;M572 D2 S0.01; Set K-factor PLA
      M572 D2 S0.022; Set K-factor PLA
      ;M572 D3 S0.01; Set K-factor PLA
      ;M572 D4 S0.01; Set K-factor PLA
      ;M572 D5 S0.01; Set K-factor PLA
      M106 P15 S255;  TURN ON THE LIGHTS
      T-1 P0 ; turn off the tool(s) that you didn't actually grab, just to make sure all are in standby
      T0 ; real tool
      M117 We Prantin
      G21 ; set units to millimeters
      G90 ; use absolute coordinates
      M82 ; use absolute distances for extrusion
      G92 E0
      ; Filament gcode
      G1 Z0.300 F9000.000
      
      

      The first real movement command that it gets SHOULD be to home - my machine cannot home with tools on without damaging results.

      I've read that in 3.1 the toolchange behavior changed so that they would run even if the machine wasn't homed. So I thought, maybe T0 P0 isn't honored anymore, so I should ask for the tool only after homing - So that's what I did, removed the initial T0 P0 command and the T-1 P0 command and tried again. Same issue.

      So I then manually homed the machine, and started a print with the single T0 command at the end of the starting script. To be clear, that means it should run a G28 and home, and then a G29 mesh probe before ever thinking to do anything with the tool.

      It proceeds to immediately Yeet on over to the tool and pick it up, and once the tool change macro is complete, it goes for a nice G28 home, with my tool attached! not good!

      I'm curious if there is something I'm doing wrong, but this setup is something I was using fine on older RRF versions, so I wanted to share my experience and see if I'm missing something with the upgraded firmware or if this is a bug. I'll be reverting to older firmware sometime later this week to make sure.

      The nitty gritty:

      Config:

      ; Configuration file for Duet 3 (firmware version 3)
      ; executed by the firmware on start-up
      ;
      ; generated by RepRapFirmware Configuration Tool v2.1.4 on Thu Dec 26 2019 17:05:21 GMT-0600 (Central Standard Time)
      
      ; General preferences
      G90                                          ; send absolute coordinates...
      M83                                          ; ...but relative extruder moves
      M550 P"StableBot"                               ; set printer name
      
      M667 S1                                      ; select CoreXY mode
      
      ;+++++++++++++++++++++++++++++++++++MOTION SYSTEM++++++++++++++++++++++++++++++
      
      ; Drives
      M569 P0.1 S1                    ; physical drive 0.1 goes forwards XY
      M569 P0.0 S0                    ; physical drive 0.0 goes forwards XY
      M569 P0.2 S0                    ; physical drive 0.2 goes forwards Coupler
      M569 P0.3 S1				    ; physical drive 0.3 goes backwards Z
      M569 P0.4 S1				    ; physical drive 0.4 goes backwards Z
      M569 P0.5 S0                    ; physical drive 0.5 goes backwards Z
      M569 P1.0 S0					; Extruder 1
      M569 P1.1 S0					; Extruder 2
      M569 P1.2 S0					; Extruder 3
      M584 X0.1 Y0.0 Z0.3:0.4:0.5 C0.2 E1.0:1.1:1.2                     ; set drive mapping
      M350 X16 Y16 E16:16:16 I1                      						  ; configure microstepping with interpolation
      M350 Z16 C8 I0														  ; No interpolation on Z Axis
      M92 X160.00 Y160.00 Z1600.00 E409.00:409.00:409.00 C100         ; set steps per mm
      M566 X300 Y300 Z600 E1800:1800:1800 C2          ; set maximum instantaneous speed changes (mm/min)
      M203 X50000.00 Y50000.00 Z840 E10800.00:10800:10800 C5000   ; set maximum speeds (mm/min)
      M201 X2000.00 Y2000.00 Z18 E2500:2500:2500 C400      ; set accelerations (mm/s^2)
      M906 X1800 Y1800 Z1800 E1100:1100:1100 C600 I60             ; set motor currents (mA) and motor idle factor in per cent
      M84 S120                                      ; Set idle timeout
      
      
      ; Axis Limits
      M208 X-17 Y-15 Z0 C0 S1                             ; set axis minima
      M208 X622 Y660 Z950 C500 S0                       ; set axis maxima
      M671 X290.0:-32:627 Y658:185:186 S20 ; leadscrews at rear middle, front left+right
      
      ; Endstops
      M574 X1 S1 P"io2.in"                         ; configure active-low endstop for low end on X via pin io2.in
      M574 Y1 S1 P"io0.in"                         ; configure active-low endstop for low end on Y via pin io0.in
      ;M574 Y2 S1 P"!io1.in"			      ; configure active-low endstop for high end on Y via pin io1.in
      
      ;Tool Presence Checking
      M950 J"io4.in"
      
      ; Z-Probe
      
      M558 P5 C"io3.in" H10 F120 T3600      ; set Z probe type to simp switch and the dive height + speeds
      G31 X0 Y0 Z0 P200                        ; set Z probe trigger value, offset and trigger height
      ;M557 X15:600 Y15:600 S30                     ; define mesh grid - Whole Bed
      M557 X10:590 Y10:590 P21:21                     ; define mesh grid - Center Small
      
      ; Bed Heater
      M308 S0 P"temp3" Y"thermistor" T100000 B4138 A"Bed1" ; configure sensor 0 as thermistor on pin temp0
      M950 H0 C"out1" T0                           ; create bed heater output on out0 and map it to sensor 0
      M143 H0 S120                                 ; set temperature limit for heater 0 to 120C
      M307 H0 A133.1 C1828.2 D2.6 V12.3 B0 S0.75    ; disable bang-bang mode for the bed heater and set PWM limit
      M140 H0                                      ; map heated bed to heater 0
      
      ; Lights
      M950 F15 C"out9" Q500                         ; create fan 2 on pin out7 and set its frequency
      M106 P15 S0 C"LEDS" H-1                               ; set fan 2 value. Thermostatic control is turned off
      
      ;+++++++++++++++++++++++++++++++++Hotends++++++++++++++++++++++++++++++++++++++++++++++
      ;MOVED TO MACRO BELOW - allows for scripting updates <-LIAR
      ;M98 P"/macros/tool_conf"
      ;+++++++++++++++++++++++++++++++++Hotends++++++++++++++++++++++++++++++++++++++++++++++
      ;Each Tool Needs a Hotend Fan, Part Fan, Heater, Thermistor, and offsets
      
      ;====Tool 0======
      M308 S1 P"1.temp0" Y"thermistor" T100000 B4725 C7.060000e-8 A"T0" ; configure sensor 1 as thermistor on pin temp2
      M950 H1 C"1.out0" T1                           ; create nozzle heater output on out2 and map it to sensor 1
      ;M143 H1 P1 S285 A0                                  ; set temperature limit for heater 1 to 280C
      ;M307 H1 B0 S1.00                             ; disable bang-bang mode for the nozzle heater and set PWM limit
      
      ;====Tool 1======
      M308 S2 P"1.temp1" Y"thermistor" T100000 B4725 C7.060000e-8 A"T1"; configure sensor 1 as thermistor on pin temp2
      M950 H2 C"1.out1" T2                           ; create nozzle heater output on out2 and map it to sensor 1
      ;M143 H2 P2 S285 A0                                 ; set temperature limit for heater 1 to 280C
      ;M307 H2 B0 S1.00                             ; disable bang-bang mode for the nozzle heater and set PWM limit
      
      ;====Tool 2======
      M308 S3 P"1.temp2" Y"thermistor" T100000 B4725 C7.060000e-8 A"T2 Supervolcano"; configure sensor 1 as thermistor on pin temp2
      M950 H3 C"1.out2" T3                           ; create nozzle heater output on out2 and map it to sensor 1
      ;M143 H2 P2 S285 A0                                 ; set temperature limit for heater 1 to 280C
      ;M307 H2 B0 S1.00                             ; disable bang-bang mode for the nozzle heater and set PWM limit
      
      ; Fans T0
      M950 F0 C"1.out7"                         ; create fan 0 on pin out7 and set its frequency
      M106 P0 C"Part_Cool0 FAN"           ; set fan 0 value. Thermostatic control is turned off
      M950 F1 C"1.out6"                        ; create fan 1 on pin out8 and set its frequency
      M106 P1 S255 H1 T45                            ; set fan 1 value. Thermostatic control is turned on
      ; Fans T1
      M950 F2 C"1.out8"                         ; create fan 2 on pin out3 and set its frequency
      M106 P2 C"Part_cool1 FAN"           ; set fan 0 value. Thermostatic control is turned off
      M950 F3 C"1.out3"                        ; create fan 1 on pin out3 and set its frequency
      M106 P3 S255 H2 T45                          ; set fan 1 value. Thermostatic control is turned on
      
      ; Fans T2
      M950 F4 C"1.out4"                         ; create fan 2 on pin out3 and set its frequency
      M106 P4 C"Part_cool2 FAN"           ; set fan 0 value. Thermostatic control is turned off
      M950 F5 C"1.out5"                        ; create fan 1 on pin out3 and set its frequency
      M106 P5 S255 H3 T45                          ; set fan 1 value. Thermostatic control is turned on
      
      ; Filament Endstop
      ;M591 D2 P1 C"0.io5.in" S1						; sets a filament sensor on io5
      
      ; Positioning T0
      M563 P0 D0 H1 F0 S"T0"                             ; define tool 0
      G10 P0 X0 Y0 Z-5.47                              ; set tool 0 axis offsets - Negative=nozzle below switch, Positive = nozzle above switch, larger negative, lower below - to make more space, go more negative
      G10 P0 R170 S215                                 ; set initial tool 0 active and standby temperatures to 0C
      
      ; Positioning T1
      M563 P1 D1 H2 F2 S"T1"                            ; define tool 1
      G10 P1 X0.1 Y0.4 Z-5.1                              ; set tool 1 axis offsets Negative=nozzle below switch, Positive = nozzle above switch, larger negative, lower below - to make more space, go more negative
      G10 P1 R170 S215                                 ; set initial tool 1 active and standby temperatures to 0C
      
      ; Positioning T2
      M563 P2 D2 H3 F4 S"T2 Supervolcano"                            ; define tool 1
      ;G10 P2 X30 Y30 Z-44.81                            ; set tool 1 axis offsets Negative=nozzle below switch, Positive = nozzle above switch, larger negative, lower below - to make more space, go more negative
      ;G10 P2 X0.0 Y0.0 Z-14 
      G10 P2 X0.0 Y0.0 Z-14.5
      G10 P2 R170 S215                                 ; set initial tool 1 active and standby temperatures to 0C
      
      ; Filament Endstop
      ;M591 D1 P1 C"1.io1.in" S1						; sets a filament sensor on io5
      
      

      M122:

      M122
      === Diagnostics ===
      RepRapFirmware for Duet 3 MB6HC version 3.1.1 running on Duet 3 MB6HC v0.6 or 1.0 (SBC mode)
      Board ID: 08DGM-9T66A-G63SJ-6J1DG-3SD6K-9V0MA
      Used output buffers: 1 of 40 (13 max)
      === RTOS ===
      Static ram: 154604
      Dynamic ram: 164108 of which 20 recycled
      Exception stack ram used: 304
      Never used ram: 74180
      Tasks: NETWORK(ready,1972) HEAT(blocked,1188) CanReceiv(suspended,3512) CanSender(suspended,1488) CanClock(blocked,1436) TMC(blocked,204) MAIN(running,4928) IDLE(ready,76)
      Owned mutexes:
      === Platform ===
      Last reset 00:17:21 ago, cause: software
      Last software reset at 2020-06-17 03:49, reason: User, spinning module LinuxInterface, available RAM 73432 bytes (slot 0)
      Software reset code 0x0010 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0444a000 BFAR 0x00000000 SP 0xffffffff Task MAIN
      Error status: 0
      MCU temperature: min 36.9, current 37.0, max 38.4
      Supply voltage: min 24.2, current 24.4, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes
      12V rail voltage: min 12.1, current 12.2, max 12.2, under voltage events: 0
      Driver 0: standstill, reads 10072, writes 14 timeouts 0, SG min/max 0/0
      Driver 1: standstill, reads 10072, writes 14 timeouts 0, SG min/max 0/0
      Driver 2: standstill, reads 10073, writes 14 timeouts 0, SG min/max 0/0
      Driver 3: standstill, reads 10073, writes 14 timeouts 0, SG min/max 0/0
      Driver 4: standstill, reads 10074, writes 14 timeouts 0, SG min/max 0/0
      Driver 5: standstill, reads 10074, writes 14 timeouts 0, SG min/max 0/0
      Date/time: 2020-06-17 04:06:43
      Slowest loop: 5.14ms; fastest: 0.14ms
      === Storage ===
      Free file entries: 10
      SD card 0 not detected, interface speed: 37.5MBytes/sec
      SD card longest read time 0.0ms, write time 0.0ms, max retries 0
      === Move ===
      Hiccups: 0(0), FreeDm: 375, MinFreeDm: 375, MaxWait: 0ms
      Bed compensation in use: none, comp offset 0.000
      === MainDDARing ===
      Scheduled moves: 0, completed moves: 0, StepErrors: 0, LaErrors: 0, Underruns: 0, 0  CDDA state: -1
      === AuxDDARing ===
      Scheduled moves: 0, completed moves: 0, StepErrors: 0, LaErrors: 0, Underruns: 0, 0  CDDA state: -1
      === Heat ===
      Bed heaters = 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
      === GCodes ===
      Segments left: 0
      Movement lock held by null
      HTTP* is ready with "M122" in state(s) 0
      Telnet is idle in state(s) 0
      File* is idle in state(s) 0
      USB is idle in state(s) 0
      Aux is idle in state(s) 0
      Trigger* is idle in state(s) 0
      Queue is idle in state(s) 0
      LCD is idle in state(s) 0
      SBC is idle in state(s) 0
      Daemon* is idle in state(s) 0
      Aux2 is idle in state(s) 0
      Autopause is idle in state(s) 0
      Code queue is empty.
      === Network ===
      Slowest loop: 1.50ms; fastest: 0.01ms
      Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions Telnet(0), 0 sessions
      HTTP sessions: 0 of 8
      - Ethernet -
      State: disabled
      Error counts: 0 0 0 0 0
      Socket states: 0 0 0 0 0 0 0 0
      === CAN ===
      Messages sent 4169, longest wait 2ms for type 6011
      === Linux interface ===
      State: 0, failed transfers: 0
      Last transfer: 22ms ago
      RX/TX seq numbers: 33575/33577
      SPI underruns 0, overruns 0
      Number of disconnects: 0
      Buffer RX/TX: 0/0-0
      === Duet Control Server ===
      Duet Control Server v3.1.1
      Code buffer space: 4096
      Configured SPI speed: 8000000 Hz
      Full transfers per second: 32.44
      

      Toolchange Script (carbon copies for all of my tools)

      ; tpre0.g
      ; called before tool 0 is selected
      
      ;Unlock Coupler
      M98 P"/macros/Coupler - Unlock"
      
      ;Move to location
      G53 G1 X38 Y623 F36000
      
      ;Move in
      G1 Y633 F36000
      
      ;Collect
      G1 Y640 F2500
      
      ;Close Coupler
      M98 P"/macros/Coupler - Lock"
      
      ;Need to update this to conditional and combine it in the move to pickup
      G91
      G1 Z10 F1000
      G90
      
      ;Move to Prime Location
      G1 Y625 F4000
      ======================================================================================
      ======================================================================================
      ; tpost0.g
      ; called after tool 0 has been selected
      
      ;heatup
      M116 P0 S10
      
      ;prime nozzle
      M98 P"/sys/Purge.g"
      
      ;Wipe
      M98 P"/sys/Wipe.g"
      M83 ; Extruder to relative
      G1 E-2 ; retract before last one
      M82 ; extrude to absolute
      M98 P"/sys/Wipe.g"
      
      ;Mesh on
      G29 S1
      
      ;Move out of wipe area
      G1 Y575
      
      ;PCF fan on
      M106 P1 S255
      
      

      Luke
      http://lukeslab.online

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

        The M109 command will select tool 0 implicitly. This is for compatibility with slicers that don't explicitly select a tool. Better to home the printer first, so that movement in your tool change files doesn't cause that error.

        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

        Luke'sLaboratoryundefined 1 Reply Last reply Reply Quote 0
        • Luke'sLaboratoryundefined
          Luke'sLaboratory @dc42
          last edited by Luke'sLaboratory

          @dc42 said in Duet3 Executing moves out of order - 3.1.1 W/ SBC:

          The M109 command will select tool 0 implicitly. This is for compatibility with slicers that don't explicitly select a tool. Better to home the printer first, so that movement in your tool change files doesn't cause that error.

          Hi DC32!

          Where are you seeing M109? I do not use that in my toolchange script nor my starting G-code. Regardless, even when I move my T0 P0 tool command to AFTER the G28 command (that is, the G28 is the first uncommented movement line in the entire file) the machine still goes to pick up the first tool without homing first.
          Below is the beginning of a file that I've tried printing, but it still will pick up the tool before homing, but ONLY if the machine was homed before starting the file.

          One additional question for clarification as well - does Tn P0 not work anymore for not calling any of the toolchange scripts? Just want to know if I should be trying to use them in the first place.

          M107
          M190 S60 ; set bed temperature and wait for it to be reached
          G10 T0 S195 R175
          G28
          G32 ; auto-magic levelling
          M558 H3 F240 A1
          M557 X263:330 Y281:319 S19.0
          G29
          ;M572 D0 S0.01; Set K-factor PLA
          ;M572 D2 S0.01; Set K-factor PLA
          M572 D2 S0.022; Set K-factor PLA
          ;M572 D3 S0.01; Set K-factor PLA
          ;M572 D4 S0.01; Set K-factor PLA
          ;M572 D5 S0.01; Set K-factor PLA
          M106 P15 S255;  TURN ON THE LIGHTS
          T0 ; 
          M117 We Prantin
          

          Luke
          http://lukeslab.online

          1 Reply Last reply Reply Quote 0
          • Luke'sLaboratoryundefined
            Luke'sLaboratory
            last edited by Luke'sLaboratory

            Alright - Got it -

            I had my T's and P's wrong - the gcode was interpreting the G10 line as " G10 || T0" instead of a G10 P0, because I missed that.
            Now that I printed with the correct file (having the correct G10 P0) we're good, nothing with the firmware.

            🙂

            Thank you for your time.

            Luke
            http://lukeslab.online

            deckingmanundefined 1 Reply Last reply Reply Quote 0
            • deckingmanundefined
              deckingman @Luke'sLaboratory
              last edited by

              @Luke-sLaboratory That's really spooky. I made exactly the same mistake using G10 "T" instead of "P" just a short time ago, but for completely different reasons. As an aside, G10 Tn Snnn Rnnn will always set the active and standby temperatures for Tool 0 regardless of the specified tool number. I too thought it must be a bug until I realised my error and used "P" (which works flawlessly) instead of "T" (which does very strange things) 🙂

              Ian
              https://somei3deas.wordpress.com/
              https://www.youtube.com/@deckingman

              1 Reply Last reply Reply Quote 0
              • Luke'sLaboratoryundefined
                Luke'sLaboratory
                last edited by

                Yep -

                Was from an earlier version of my M109->G10 conversion script, but now its fixed and we're all good!

                Luke
                http://lukeslab.online

                deckingmanundefined 1 Reply Last reply Reply Quote 0
                • deckingmanundefined
                  deckingman @Luke'sLaboratory
                  last edited by

                  @Luke-sLaboratory I don't have any excuse (unless senility counts).

                  Ian
                  https://somei3deas.wordpress.com/
                  https://www.youtube.com/@deckingman

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