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

    1HCL position failure home position G-code

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    25
    544
    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.
    • supertb1undefined
      supertb1
      last edited by

      Hello, where do I find the correct g-code example to tell my 1HCL boards to move my printer to home position on failure to maintain position fault. At one point this featured worked and I think after an update a while back it stopped. Currently my printer experiences the fault and it simply stops at the end of a command line and rests at that position awaiting the resume command.

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

        @supertb1 assuming you are running RRF 3.4.x you need to create an event handler macro in /sys. See https://docs.duet3d.com/en/User_manual/RepRapFirmware/Events to get started.

        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

        supertb1undefined 3 Replies Last reply Reply Quote 0
        • supertb1undefined
          supertb1 @dc42
          last edited by

          @dc42 Awesome, yes, it is up to date. Thank you

          1 Reply Last reply Reply Quote 0
          • supertb1undefined
            supertb1 @dc42
            last edited by

            @dc42 So I am sorry for being a little naive about this but it looks like someplace in the sys. folder or a macro I need to set up an M505 D (canbus 50-51) ; Pause print using pause.g and inform user via message box... I am not sure I understand where to put this line of code or how exactly it is supposed to look. I have 1HCLs on both my X,Y drives. What would an example of this code look like? or if it exists where do I find it to change the behavior?.. again I am sorry for not understanding this.

            OwenDundefined 1 Reply Last reply Reply Quote 0
            • OwenDundefined
              OwenD @supertb1
              last edited by OwenD

              @supertb1
              You need to create a macro for each of the events you want to handle.
              The names are in the left-most column here from the link DC42 gave you.

              So for example you need
              driver-stall.g to be located in your /sys directory and within that put whatever action you want to take on a driver stall.
              Note that it takes some tuning of your M915 settings to get stall detection working well.

              This is my driver-stall.g
              There's probably bunch of superfluous code in it that I was using to understand what was going on when it was called. I'm also undecided whether the M400 is a good idea or not.

              ;0:/sys/driver-stall.g
              echo " A driver stall has occured on driver " ^ param.D
              echo "Layer shifting may have occured at X:",move.axes[0].machinePosition, "Y:", move.axes[1].machinePosition, "Z:", move.axes[2].machinePosition
              echo "Requested speed is " , move.currentMove.requestedSpeed, "mm/sec. Top speed is", move.currentMove.topSpeed, "mm/sec"
              ; check if a driver stall is already being acted on by looking at  global variable we created in config.g.
              if global.InMacro=true
              	echo "Driver stall macro already running - no further action taken"
              	M99 ; exit macro
              M400 ; finish current moves
              if job.file.fileName!= null ; check if we are printing
              	set global.InMacro=true	; stop the macro being run multiple times
              	G60 S3 ; save position to slot 3
              	echo "File position is ", job.filePosition, "bytes"
              	echo "Physical position is X:",move.axes[0].machinePosition, "Y:", move.axes[1].machinePosition, "Z:", move.axes[2].machinePosition
              	G4 P5
              	; if a tool is selected and the heater is up to temp we'll retract
              	if heat.heaters[tools[max(state.currentTool,0)].heaters[0]].current > heat.coldRetractTemperature
              		G10
              	G1 F1800 ; reduce speed before homing
              	G28 X Y ; home X & Y
              	G1 F1200 ; reduce speed when travelling back to saved slot
              	G1 R3 X0 Y0 Z5; travel to 5mm above stall position
              	M400
              	G1 F60 ; reduce speed
              	G1 R3 X0 Y0 Z0 ; move to stall position
              	M400
              	; if a tool is selected and the heater is up to temp, we'll un-retract if required.
              	if (heat.heaters[tools[max(state.currentTool,0)].heaters[0]].current > heat.coldExtrudeTemperature) && (tools[max(state.currentTool,0)].isRetracted)
              		G11
              	set global.InMacro = false ; unset the flag
              

              You would create the other macros and code them to suit your needs.

              • driver-error.g
              • driver-warning.g
              • heater-fault.g
              • filament-error.g
              supertb1undefined 1 Reply Last reply Reply Quote 0
              • supertb1undefined
                supertb1 @OwenD
                last edited by supertb1

                @OwenD Thanks for the example, so by this to me looks like you are operating in open loop and your command ("X:",move.axes[0].machinePosition, "Y:", move.axes[1].machinePosition, "Z:", move.axes[2]) is calling the physical address on your main board for your steppers, Correct? so for me it would be "X:",move.axiz[50].machinePosition, "Y:", move.axes[51].machinePosition, "Z:", move.axes[2]).....
                Does that look correct @dc42 & @OwenD ? or am I good to just plug this in and run with it?

                OwenDundefined 1 Reply Last reply Reply Quote 0
                • OwenDundefined
                  OwenD @supertb1
                  last edited by

                  @supertb1
                  move.axes[n] is an object model array.
                  There will be one array item for each configured axis.
                  move.axes[0].machinePosition simply reports the position of the X axis.
                  Likewise the others report the position of the Y & Z axis at the time the macro was run.
                  So unless you have 52 axes, then your example would give an error.

                  Perhaps start with something like

                  ;driver-stall.g
                  G60 S3 ; save position to slot 3
                  G28 X Y ; home X & Y
                  G1 R3 X0 Y0 Z0 ; Move back to saved position
                  

                  You can test it by sending M957 to simulate a fault (or deliberately cause a stall by hand)
                  M957 E"driver-stall" D1

                  supertb1undefined 1 Reply Last reply Reply Quote 0
                  • supertb1undefined
                    supertb1 @OwenD
                    last edited by supertb1

                    @OwenD P50-P51 are my 1HCL CANBUS drive addresses.. the question was weather or not I needed to put that information in place of the mainboard driver addresses or if the line codes as you have them listed would work as they are... see what I am looking for is someone who knows the code architecture well enough on MB6HC that I can create whatever directory needed in the .sys and then dump the example in there with the correct format to keep my system from crashing... what can I give you or @dc42 that can help me with that... as I have stated before I am a noob when it comes to this issue... I have no formal education on this system, everything has been trial and error..lol... I just want my system to return to the home position when it runs into a position failure like it did 5 or 6 updates ago

                    OwenDundefined 1 Reply Last reply Reply Quote 0
                    • OwenDundefined
                      OwenD @supertb1
                      last edited by

                      @supertb1
                      You have been provided multiple links to the relevant documentation and have been given examples of possible code and how to test it.
                      Until you read the documentation and apply the examples then I can't help any further as I don't have an identical system.

                      supertb1undefined 2 Replies Last reply Reply Quote 0
                      • supertb1undefined
                        supertb1 @OwenD
                        last edited by

                        @OwenD Ok, thank you for your help on this.. I will give it a shot and get back to you.

                        1 Reply Last reply Reply Quote 0
                        • supertb1undefined
                          supertb1 @OwenD
                          last edited by supertb1

                          @OwenD Hello, I made a file (driver-stall.g) in my .sys directory and dropped the example in there. then I entered M957 E"driver-stall" D1 in my command line and it returned "M957 E"driver-stall" D1
                          Warning: Driver 0.1". now it does not recognize my tool, it immediately causes my X axis to fail to maintain position. so the settings in the stall file need to be adjusted. Ok I have a Duet 3 6HC, "2" 1HCL boards (P50,P51) X and Y respectively. "2" Z axis motors (0,1) on the main board. The extruder is on (4). do I need to place the physical address of the drives that are on the boards inside the [0] on the command lines for this driver stall.g and how would the Z axis look on the command line? move.axes[0,1]? I tried to enter the actual board addresses in the command lines and it still does not recognize the tool. ok.. so I don't think your model as it is will work for my setup. I tried your ";driver-stall.gG60 S3 ; save position to slot 3G28 X Y ; home X & YG1 R3 X0 Y0 Z0 ; Move back to saved position" line and it causes my machine to forget the X and Z axis home at the start of my print end the program and then home the X and Z axis so that is not going to work either. What changes need to be made to these examples to help make them work for my applications? what information can I give to you to help with this process?

                          OwenDundefined 1 Reply Last reply Reply Quote 0
                          • supertb1undefined
                            supertb1 @dc42
                            last edited by supertb1

                            @dc42 you know what would make this all alot easier is if I could simply change the default process from "Pause print without running pause.g and inform user via message box" to "Pause print using pause.g and inform user via message box" How do I do that? Or better yet, can I get a firmware update that has that change in it?

                            1 Reply Last reply Reply Quote 0
                            • OwenDundefined
                              OwenD @supertb1
                              last edited by

                              @supertb1
                              I cannot work out exactly what you are doing by your answers.
                              You appear to be mixing all sorts of things together.

                              You need to read and understand the documentation given to you so that you can grasp the way the firmware works.
                              There are two possible work flows with any of the events.
                              One will happen if you have not created a macro to handle the event and the other will happen if you have created a macro to handle it
                              Screenshot 2022-11-07 112106.png

                              So in the case of a DRIVER ERROR, then if there is no file in the/sys directory called driver-error.g, then the firmware will pause the print without running pause.g and a message box will appear. It will just stop.
                              If there IS a file called driver-error.g in the /sys directory, then you determine what happens by the contents of your macro.

                              The parameters mentioned are NOT parameters that you send.
                              They are parameters that you can access within your macro so that you can have one macro but take different actions depending where the fault was.
                              So for example in my driver-error.g macro I could put

                              echo "Fault on driver" ^ param.D
                              

                              and it would report which driver number the error happened on.

                              You are going to need to post the following files.
                              config.g
                              driver-error.g
                              driver-stall.g
                              homeall.g
                              homex.g
                              homey.g
                              pause.g

                              When you post them, please ensure that you use the </> button so the contents appear is a code box like this

                              code box
                              

                              This will make them readable.

                              Also post the firmware version you are using on all attached boards, by sending
                              M115 B0
                              M115 B1
                              M115 B2
                              one command at a time from the console.

                              After all that we will need to know exactly what problem(s) you are trying to fix?
                              There is no point for example focusing on a driver-stall.g file, if your problem is actually a driver error, and not a stall.

                              supertb1undefined 1 Reply Last reply Reply Quote 0
                              • supertb1undefined
                                supertb1 @OwenD
                                last edited by supertb1

                                @OwenD

                                code_text
                                ```; Configuration file for Duet 3 (firmware version 3)
                                ; executed by the firmware on start-up
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                
                                ; General preferences
                                G90                                          ; send absolute coordinates...
                                M83                                          ; ...but relative extruder moves
                                M550 P"Colossus Openbuild"                   ; set printer name
                                
                                ; Network
                                M552 P192.168.1.65 S1                             ; enable network and acquire dynamic address via DHCP
                                M586 P0 S1                                   ; enable HTTP
                                M586 P1 S0                                   ; disable FTP
                                M586 P2 S0                                   ; disable Telnet
                                
                                ; Drives
                                G4 S1                                        ;wait for expansion boards to start
                                M569.1 P50.0 T2 C5 E5:10            ; Configure the 1HCL board at CAN address 50 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                M569.1 P51.0 T2 C5 E5:10            ; Configure the 1HCL board at CAN address 51 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                M569 P50.0 D4 S1                             ; Configure the motor on the 1HCL at can address 50 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) X axis
                                M569 P51.0 D4 S1                             ; Configure the motor on the 1HCL at can address 51 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) Y axis 
                                M569 P0.0 S1                                 ; physical drive 0.0 goes forwards Z 1-2 axis
                                M569 P0.4 S1                                 ; physical drive 0.4 goes forwards Extruder
                                M584 X50.0 Y51.0 Z0.0:0.1 E0.4               ; set drive mapping
                                M671 X-122.25:689.20 Y0:0 S3.0               ; leadscrews at left (connected to Z0) and right (connected to Z1) of X axis
                                M350 X32 Y32 Z32 E16 I1                      ; configure microstepping with interpolation
                                M92 X106.5 Y257 Z795.00 E339.00              ; set steps per mm
                                M566 X900.00 Y900.00 Z60.00 E120.00          ; set maximum instantaneous speed changes (mm/min)
                                M203 X6000.00 Y6000.00 Z180.00 E1200.00      ; set maximum speeds (mm/min)
                                M201 X500.00 Y500.00 Z20.00 E250.00          ; set accelerations (mm/s^2)
                                M906 X1000 Y3000 Z3000 E800 I30              ; set motor currents (mA) and motor idle factor in per cent
                                M84 S30                                      ; Set idle timeout
                                M917 X10 Y0                                   ; Set the closed loop axes to have a holding current of zero
                                
                                ; Axis Limits
                                M208 X0 Y0 Z0 S1                             ; set axis minima
                                M208 X609 Y609 Z762 S0                       ; set axis maxima
                                
                                ; Endstops
                                M574 X1 S1 P"!^io1.in"                       ; configure active-high endstop for low end on X via pin !^io1.in
                                M574 Y1 S1 P"!^io2.in"                       ; configure active-high endstop for low end on Y via pin !^io2.in
                                M574 Z1 S2                                   ; configure Z-probe endstop for low end on Z
                                M591 D0 P7 C"io5.in" L7 R55:150 E22 S1       ;Bigtree smart filament moniter v2 set to moniter between 55%-150% of 7 counts over a distance of 22mm
                                
                                M591 D0                                      ; display filament sensor parameters for extruder drive 4
                                M950 S0 C"io7.out"                           ; create servo pin 0 for BLTouch
                                M558 P9 C"^io7.in" H5 F120 T6000             ; set Z probe type to bltouch and the dive height + speeds
                                G31 P100 X60 Y0 Z2.68                         ; set Z probe trigger value, offset and trigger height
                                M557 X100:500 Y100:500 S100                  ; define mesh grid
                                
                                ; Heaters
                                M308 S0 P"temp0" Y"thermistor" T100000 B4138 ; configure sensor 0 as thermistor on pin temp0
                                M950 H0 C"out1" T0                           ; create bed heater output on out1 and map it to sensor 0
                                M307 H0 B1 S10.00                            ; enable bang-bang mode for the bed heater and set PWM limit
                                M140 H0                                      ; map heated bed to heater 0
                                M143 H0 S110                                 ; set temperature limit for heater 0 to 120C
                                M308 S1 P"temp1" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin temp1
                                M950 H1 C"out2" T1                           ; create nozzle heater output on out2 and map it to sensor 1
                                M307 H1 B0 S1.00                             ; disable bang-bang mode for heater  and set PWM limit
                                M143 H1 S280                                 ; set temperature limit for heater 1 to 280C
                                
                                ; Fans
                                M950 F0 C"out8" Q500                         ; create fan 0 on pin out8 and set its frequency
                                M106 P0 C"Tool Fan" S0 H-1                   ; set fan 0 name and value. Thermostatic control is turned off
                                M950 F1 C"out6" Q500                         ; create fan 1 on pin out6 and set its frequency
                                M950 F2 C"out7" Q500                         ; create fan 2 on pin out7 and set its frequency
                                M106 P1 C"Extruder" S1 H1 T45                ; set fan 1 name and value. Thermostatic control is turned on
                                
                                ; Tools
                                M563 P0 S"Hemera" D0 H1 F0                   ; define tool 0
                                G10 P0 X0 Y0 Z0                              ; set tool 0 axis offsets
                                G10 P0 R0 S0                                 ; set initial tool 0 active and standby temperatures to 0C
                                
                                ; Custom settings are not defined
                                
                                ; Miscellaneous
                                M575 P1 S1 B57600                            ; enable support for PanelDue
                                
                                
                                </>drive-error.g
                                ; pause.g
                                ; called when a print from SD card is paused
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                M83            ; relative extruder moves
                                G1 E-10 F3600  ; retract 10mm of filament
                                G91            ; relative positioning
                                G1 Z5 F360     ; lift Z by 5mm
                                G90            ; absolute positioning
                                G1 X0 Y0 F6000 ; go to X=0 Y=0
                                </>driver-stall.g
                                ; pause.g
                                ; called when a print from SD card is paused
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                M83            ; relative extruder moves
                                G1 E-10 F3600  ; retract 10mm of filament
                                G91            ; relative positioning
                                G1 Z5 F360     ; lift Z by 5mm
                                G90            ; absolute positioning
                                G1 X0 Y0 F6000 ; go to X=0 Y=0
                                </>homeall.g (wich I do not use because it doesn't work)
                                ; homeall.g
                                ; called to home all axes
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                G91                     ; relative positioning
                                G1 H2 Z5 F6000          ; lift Z relative to current position
                                G1 H1 X-605 Y-605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
                                G1 H2 X5 Y5 F6000       ; go back a few mm
                                G1 H1 X-605 Y-605 F360  ; move slowly to X and Y axis endstops once more (second pass)
                                G90                     ; absolute positioning
                                G1 X10 Y10 F6000        ; go to first bed probe point and home Z
                                G30                     ; home Z by probing the bed
                                
                                ; Uncomment the following lines to lift Z after probing
                                ;G91                    ; relative positioning
                                ;G1 Z5 F100             ; lift Z relative to current position
                                ;G90                    ; absolute positioning
                                
                                </>; homex.g
                                ; called to home the X axis
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                M569 P50.0 D0           ; Turn off closed loop
                                
                                G91                     ; relative positioning
                                G1 H2 Z5 F6000          ; lift Z relative to current position
                                G1 H1 X-240 F3000       ; move quickly to X axis endstop and stop there (first pass)
                                G1 H2 X5 F6000          ; go back a few mm
                                G1 H1 X-240 F240        ; move slowly to X axis endstop once more (second pass)
                                
                                G90                     ; absolute positioning
                                G1 X50 F3000            ; Move to a known-safe position
                                M400                    ; Wait for the move to complete
                                G4 P500                 ; Wait for the motor to settle
                                M569 P50.0 D4           ; Turn closed loop back on
                                M569.6 P50.0 V31        ; Perform the tuning manoeuvres for a quadrature encoder
                                G1 X0                   ; Move back to X0
                                
                                G1 H2 Z0 F6000          ; lower Z again
                                </>Home Y
                                ; homey.g
                                ; called to home the Y axis
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                M569 P51.0 D0           ; Turn off closed loop
                                
                                G91                     ; relative positioning
                                G1 H2 Z5 F6000          ; lift Z relative to current position
                                G1 H1 Y-240 F3000       ; move quickly to X axis endstop and stop there (first pass)
                                G1 H2 Y5 F6000          ; go back a few mm
                                G1 H1 Y-240 F240        ; move slowly to X axis endstop once more (second pass)
                                
                                G90                     ; absolute positioning
                                G1 Y25 F3000            ; Move to a known-safe position
                                M400                    ; Wait for the move to complete
                                G4 P500                 ; Wait for the motor to settle
                                M569 P51.0 D4           ; Turn closed loop back on
                                M569.6 P51.0 V31        ; Perform the tuning manoeuvres for a quadrature encoder
                                G1 Y0                   ; Move back to X0
                                
                                G1 H2 Z0 F6000          ; lower Z again
                                </> pause.g
                                ; pause.g
                                ; called when a print from SD card is paused
                                ;
                                ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                M83            ; relative extruder moves
                                G1 E-10 F3600  ; retract 10mm of filament
                                G91            ; relative positioning
                                G1 Z5 F360     ; lift Z by 5mm
                                G90            ; absolute positioning
                                G1 X0 Y0 F6000 ; go to X=0 Y=0
                                /
                                </>11/6/2022, 7:38:44 PM	M115 B0
                                FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.4.4 ELECTRONICS: Duet 3 MB6HC v1.01 FIRMWARE_DATE: 2022-10-20 16:19:01
                                /
                                </>11/6/2022, 7:39:24 PM	M115 B1
                                Error: M115: Response timeout: CAN addr 1, req type 6024, RID=14
                                /
                                </>11/6/2022, 7:40:03 PM	M115 B2
                                Error: M115: Response timeout: CAN addr 2, req type 6024, RID=15
                                /
                                Issue at hand: when my printer fails to maintain position or the X-Y steppers stalls I want it to move my print head to home position Z+5 like it used to do.
                                OwenDundefined 2 Replies Last reply Reply Quote 0
                                • OwenDundefined
                                  OwenD @supertb1
                                  last edited by OwenD

                                  @supertb1
                                  I meant for you to put each file in its own code block so we could know exactly what you are working with.
                                  I will try to separate and comment as I can.

                                  Config.g

                                  ; Configuration file for Duet 3 (firmware version 3)
                                  ; executed by the firmware on start-up
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                  
                                  ; General preferences
                                  G90                                          ; send absolute coordinates...
                                  M83                                          ; ...but relative extruder moves
                                  M550 P"Colossus Openbuild"                   ; set printer name
                                  
                                  ; Network
                                  M552 P192.168.1.65 S1                             ; enable network and acquire dynamic address via DHCP
                                  M586 P0 S1                                   ; enable HTTP
                                  M586 P1 S0                                   ; disable FTP
                                  M586 P2 S0                                   ; disable Telnet
                                  
                                  ; Drives
                                  G4 S1                                        ;wait for expansion boards to start
                                  M569.1 P50.0 T2 C5 E5:10            ; Configure the 1HCL board at CAN address 50 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                  M569.1 P51.0 T2 C5 E5:10            ; Configure the 1HCL board at CAN address 51 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                  M569 P50.0 D4 S1                             ; Configure the motor on the 1HCL at can address 50 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) X axis
                                  M569 P51.0 D4 S1                             ; Configure the motor on the 1HCL at can address 51 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) Y axis 
                                  M569 P0.0 S1                                 ; physical drive 0.0 goes forwards Z 1-2 axis
                                  M569 P0.4 S1                                 ; physical drive 0.4 goes forwards Extruder
                                  M584 X50.0 Y51.0 Z0.0:0.1 E0.4               ; set drive mapping
                                  M671 X-122.25:689.20 Y0:0 S3.0               ; leadscrews at left (connected to Z0) and right (connected to Z1) of X axis
                                  M350 X32 Y32 Z32 E16 I1                      ; configure microstepping with interpolation
                                  M92 X106.5 Y257 Z795.00 E339.00              ; set steps per mm
                                  M566 X900.00 Y900.00 Z60.00 E120.00          ; set maximum instantaneous speed changes (mm/min)
                                  M203 X6000.00 Y6000.00 Z180.00 E1200.00      ; set maximum speeds (mm/min)
                                  M201 X500.00 Y500.00 Z20.00 E250.00          ; set accelerations (mm/s^2)
                                  M906 X1000 Y3000 Z3000 E800 I30              ; set motor currents (mA) and motor idle factor in per cent
                                  M84 S30                                      ; Set idle timeout
                                  M917 X10 Y0                                   ; Set the closed loop axes to have a holding current of zero
                                  
                                  ; Axis Limits
                                  M208 X0 Y0 Z0 S1                             ; set axis minima
                                  M208 X609 Y609 Z762 S0                       ; set axis maxima
                                  
                                  ; Endstops
                                  M574 X1 S1 P"!^io1.in"                       ; configure active-high endstop for low end on X via pin !^io1.in
                                  M574 Y1 S1 P"!^io2.in"                       ; configure active-high endstop for low end on Y via pin !^io2.in
                                  M574 Z1 S2                                   ; configure Z-probe endstop for low end on Z
                                  M591 D0 P7 C"io5.in" L7 R55:150 E22 S1       ;Bigtree smart filament moniter v2 set to moniter between 55%-150% of 7 counts over a distance of 22mm
                                  
                                  M591 D0                                      ; display filament sensor parameters for extruder drive 4
                                  M950 S0 C"io7.out"                           ; create servo pin 0 for BLTouch
                                  M558 P9 C"^io7.in" H5 F120 T6000             ; set Z probe type to bltouch and the dive height + speeds
                                  G31 P100 X60 Y0 Z2.68                         ; set Z probe trigger value, offset and trigger height
                                  M557 X100:500 Y100:500 S100                  ; define mesh grid
                                  
                                  ; Heaters
                                  M308 S0 P"temp0" Y"thermistor" T100000 B4138 ; configure sensor 0 as thermistor on pin temp0
                                  M950 H0 C"out1" T0                           ; create bed heater output on out1 and map it to sensor 0
                                  M307 H0 B1 S10.00                            ; enable bang-bang mode for the bed heater and set PWM limit
                                  M140 H0                                      ; map heated bed to heater 0
                                  M143 H0 S110                                 ; set temperature limit for heater 0 to 120C
                                  M308 S1 P"temp1" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin temp1
                                  M950 H1 C"out2" T1                           ; create nozzle heater output on out2 and map it to sensor 1
                                  M307 H1 B0 S1.00                             ; disable bang-bang mode for heater  and set PWM limit
                                  M143 H1 S280                                 ; set temperature limit for heater 1 to 280C
                                  
                                  ; Fans
                                  M950 F0 C"out8" Q500                         ; create fan 0 on pin out8 and set its frequency
                                  M106 P0 C"Tool Fan" S0 H-1                   ; set fan 0 name and value. Thermostatic control is turned off
                                  M950 F1 C"out6" Q500                         ; create fan 1 on pin out6 and set its frequency
                                  M950 F2 C"out7" Q500                         ; create fan 2 on pin out7 and set its frequency
                                  M106 P1 C"Extruder" S1 H1 T45                ; set fan 1 name and value. Thermostatic control is turned on
                                  
                                  ; Tools
                                  M563 P0 S"Hemera" D0 H1 F0                   ; define tool 0
                                  G10 P0 X0 Y0 Z0                              ; set tool 0 axis offsets
                                  G10 P0 R0 S0                                 ; set initial tool 0 active and standby temperatures to 0C
                                  
                                  ; Custom settings are not defined
                                  
                                  ; Miscellaneous
                                  M575 P1 S1 B57600                            ; enable support for PanelDue
                                  

                                  </>drive-error.g
                                  Is this a typo?
                                  The file should be driver-error.g

                                  ; pause.g
                                  ; called when a print from SD card is paused
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                  M83            ; relative extruder moves
                                  G1 E-10 F3600  ; retract 10mm of filament
                                  G91            ; relative positioning
                                  G1 Z5 F360     ; lift Z by 5mm
                                  G90            ; absolute positioning
                                  G1 X0 Y0 F6000 ; go to X=0 Y=0
                                  

                                  This would try to go to X0 Y0 for any driver error, but if a driver is in error state, that may not be possible.

                                  driver-stall.g

                                  ; pause.g
                                  ; called when a print from SD card is paused
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                  M83            ; relative extruder moves
                                  G1 E-10 F3600  ; retract 10mm of filament
                                  G91            ; relative positioning
                                  G1 Z5 F360     ; lift Z by 5mm
                                  G90            ; absolute positioning
                                  G1 X0 Y0 F6000 ; go to X=0 Y=0
                                  

                                  Again, you are trying to go to X0 Y0
                                  What happens when you force a driver to stall?
                                  Does the machine move to X0 Y0?
                                  Note, that you have not re-homed the axis, so it may move to where it "thinks" X0 Y0 is, but if it had already skipped many steps then it may end up somewhere entirely different.
                                  EDIT: I don't know exactly how running closed loop will fit into this. It's possible the motor can stall and not lose track of position. That's the whole idea I guess.

                                  </>homeall.g (wich I do not use because it doesn't work)
                                  What doesn't work?
                                  What happens when you issue G28?
                                  I note you have no M569.1 commands in this file, but yo do in homex.g and homey.g

                                  ; homeall.g
                                  ; called to home all axes
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                  G91                     ; relative positioning
                                  G1 H2 Z5 F6000          ; lift Z relative to current position
                                  G1 H1 X-605 Y-605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
                                  G1 H2 X5 Y5 F6000       ; go back a few mm
                                  G1 H1 X-605 Y-605 F360  ; move slowly to X and Y axis endstops once more (second pass)
                                  G90                     ; absolute positioning
                                  G1 X10 Y10 F6000        ; go to first bed probe point and home Z
                                  G30                     ; home Z by probing the bed
                                  
                                  ; Uncomment the following lines to lift Z after probing
                                  ;G91                    ; relative positioning
                                  ;G1 Z5 F100             ; lift Z relative to current position
                                  ;G90                    ; absolute positioning
                                  

                                  </>; homex.g

                                  ; called to home the X axis
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                  M569 P50.0 D0           ; Turn off closed loop
                                  
                                  G91                     ; relative positioning
                                  G1 H2 Z5 F6000          ; lift Z relative to current position
                                  G1 H1 X-240 F3000       ; move quickly to X axis endstop and stop there (first pass)
                                  G1 H2 X5 F6000          ; go back a few mm
                                  G1 H1 X-240 F240        ; move slowly to X axis endstop once more (second pass)
                                  
                                  G90                     ; absolute positioning
                                  G1 X50 F3000            ; Move to a known-safe position
                                  M400                    ; Wait for the move to complete
                                  G4 P500                 ; Wait for the motor to settle
                                  M569 P50.0 D4           ; Turn closed loop back on
                                  M569.6 P50.0 V31        ; Perform the tuning manoeuvres for a quadrature encoder
                                  G1 X0                   ; Move back to X0
                                  
                                  G1 H2 Z0 F6000          ; lower Z again
                                  

                                  </>Home Y

                                  ; homey.g
                                  ; called to home the Y axis
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                  M569 P51.0 D0           ; Turn off closed loop
                                  
                                  G91                     ; relative positioning
                                  G1 H2 Z5 F6000          ; lift Z relative to current position
                                  G1 H1 Y-240 F3000       ; move quickly to X axis endstop and stop there (first pass)
                                  G1 H2 Y5 F6000          ; go back a few mm
                                  G1 H1 Y-240 F240        ; move slowly to X axis endstop once more (second pass)
                                  
                                  G90                     ; absolute positioning
                                  G1 Y25 F3000            ; Move to a known-safe position
                                  M400                    ; Wait for the move to complete
                                  G4 P500                 ; Wait for the motor to settle
                                  M569 P51.0 D4           ; Turn closed loop back on
                                  M569.6 P51.0 V31        ; Perform the tuning manoeuvres for a quadrature encoder
                                  G1 Y0                   ; Move back to X0
                                  
                                  G1 H2 Z0 F6000          ; lower Z again
                                  

                                  </> pause.g

                                  ; pause.g
                                  ; called when a print from SD card is paused
                                  ;
                                  ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:32 GMT-0600 (Central Standard Time)
                                  M83            ; relative extruder moves
                                  G1 E-10 F3600  ; retract 10mm of filament
                                  G91            ; relative positioning
                                  G1 Z5 F360     ; lift Z by 5mm
                                  G90            ; absolute positioning
                                  G1 X0 Y0 F6000 ; go to X=0 Y=0
                                  

                                  </>11/6/2022, 7:38:44 PM M115 B0
                                  FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.4.4 ELECTRONICS: Duet 3 MB6HC v1.01 FIRMWARE_DATE: 2022-10-20 16:19:01

                                  </>11/6/2022, 7:39:24 PM M115 B1
                                  Error: M115: Response timeout: CAN addr 1, req type 6024, RID=14
                                  /
                                  </>11/6/2022, 7:40:03 PM M115 B2
                                  Error: M115: Response timeout: CAN addr 2, req type 6024, RID=15

                                  I don't know enough about the 1HCL boards to interpret these errors.

                                  Issue at hand: when my printer fails to maintain position or the X-Y steppers stalls I want it to move my print head to home position Z+5 like it used to do.

                                  Again, what does it do now when there is a stall.
                                  "Like it used to"?
                                  When did it do that?
                                  What has changed since then? e.g. Firmware? From what version to what version?

                                  1 Reply Last reply Reply Quote 0
                                  • OwenDundefined
                                    OwenD @supertb1
                                    last edited by OwenD

                                    @supertb1
                                    In addition to above, I suggest you put the following lines at the start of your diver-error.g and driver-stall.g files.
                                    This will help identify which is being called and what the fault is.
                                    This is because the macro called will be dependent on whether the loss of position is greater than or less than the E parameter in your M569.1 for that axis.

                                    ;driver-stall.g
                                    echo "Driver stall has occurred"
                                    echo param.S      ; send error message to console
                                    
                                    ;driver-error.g
                                    echo "Driver error has occurred"
                                    echo param.S     ; send error message to console
                                    

                                    EDIT.
                                    Also the code for the firmware on the expansion boards should be
                                    M115 B50
                                    M115 B51
                                    You have to send the CAN address for these boards.

                                    supertb1undefined 1 Reply Last reply Reply Quote 0
                                    • supertb1undefined
                                      supertb1 @OwenD
                                      last edited by supertb1

                                      @OwenD
                                      "</>drive-error.g
                                      Is this a typo?
                                      The file should be driver-error.g"
                                      no this was me learning to use this sites text box.

                                      "This would try to go to X0 Y0 for any driver error, but if a driver is in error state, that may not be possible.

                                      driver-stall.g"
                                      in closed loop the machine knows where it is at all times. however if the motor failed or the drive board "1HC" failed I am sure the system wouldn't function as intended, I have not had this issue yet.
                                      "Again, you are trying to go to X0 Y0
                                      What happens when you force a driver to stall?
                                      Does the machine move to X0 Y0?
                                      Note, that you have not re-homed the axis, so it may move to where it "thinks" X0 Y0 is, but if it had already skipped many steps then it may end up somewhere entirely different.
                                      EDIT: I don't know exactly how running closed loop will fit into this. It's possible the motor can stall and not lose track of position. That's the whole idea I guess."
                                      Correct.

                                      "</>homeall.g (wich I do not use because it doesn't work)
                                      What doesn't work?
                                      What happens when you issue G28?
                                      I note you have no M569.1 commands in this file, but yo do in homex.g and homey.g

                                      ; homeall.g
                                      ; called to home all axes
                                      ;
                                      ; generated by RepRapFirmware Configuration Tool v3.2.3 on Mon Mar 08 2021 08:53:31 GMT-0600 (Central Standard Time)
                                      G91                     ; relative positioning
                                      G1 H2 Z5 F6000          ; lift Z relative to current position
                                      G1 H1 X-605 Y-605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
                                      G1 H2 X5 Y5 F6000       ; go back a few mm
                                      G1 H1 X-605 Y-605 F360  ; move slowly to X and Y axis endstops once more (second pass)
                                      G90                     ; absolute positioning
                                      G1 X10 Y10 F6000        ; go to first bed probe point and home Z
                                      G30                     ; home Z by probing the bed
                                      
                                      ; Uncomment the following lines to lift Z after probing
                                      ;G91                    ; relative positioning
                                      ;G1 Z5 F100             ; lift Z relative to current position
                                      ;G90                    ; absolute positioning
                                      

                                      It causes the machine to wait for a count of 2 minutes and then it homes the X axis, then the Z axis, then the X axis again, and then the Z axis again. this feature has never worked correctly while the 1HC boards have been in use. It worked fine when I had the axis drivers on the main board.

                                      "Again, what does it do now when there is a stall.
                                      "Like it used to"?
                                      When did it do that?
                                      What has changed since then? e.g. Firmware? From what version to what version?"
                                      Before 3.0 the system would send the axis back to home on a "failure to maintain position" I believe. it is only been in the last year that I have began to have this problem.

                                      11/7/2022, 8:51:38 AM	M115 B50
                                      Duet EXP1HCL firmware version 3.4.4 (2022-10-14 11:45:14)
                                      11/7/2022, 8:52:07 AM	M115 B51
                                      Duet EXP1HCL firmware version 3.4.4 (2022-10-14 11:45:14)
                                      

                                      with the stall and error.g files as they are, a manual move from position generates a "Error: attempting to extrude with no tool selected." fault on the PanelDue 7.
                                      Running a simple bed leveling program and causing a stall causes the print head to move toward home but then it raises the print head 5mm and then it goes back out to print... so wierd.

                                      11/7/2022, 9:04:07 AM	Resume state saved
                                      11/7/2022, 9:03:46 AM	Driver error has occurred
                                      Driver 50.0 error: failed to maintain position
                                      11/7/2022, 9:03:29 AM	Driver error has occurred
                                      Driver 50.0 error: failed to maintain position
                                      11/7/2022, 9:02:54 AM	Driver error has occurred
                                      Driver 50.0 error: failed to maintain position
                                      11/7/2022, 9:00:02 AM	Error: Attempting to extrude with no tool selected.
                                      11/7/2022, 8:57:24 AM	Driver error has occurred
                                      Driver 50.0 error: failed to maintain position
                                      11/7/2022, 8:54:27 AM	Driver error has occurred
                                      Driver 50.0 error: failed to maintain position
                                      Error: Attempting to extrude with no tool selected.
                                      11/7/2022, 8:54:06 AM	Error: Attempting to extrude with no tool selected.
                                      11/7/2022, 8:53:58 AM	Driver error has occurred
                                      Driver 51.0 error: failed to maintain position
                                      

                                      so the drive-error.g and the driver-stall.g will not work as they are currently. But we are getting somewhere, at least it isn't just stopping in the middle of the print anymore.

                                      OwenDundefined 1 Reply Last reply Reply Quote 0
                                      • OwenDundefined
                                        OwenD @supertb1
                                        last edited by OwenD

                                        @supertb1 said in 1HCL position failure home position G-code:

                                        with the stall and error.g files as they are, a manual move from position generates a "Error: attempting to extrude with no tool selected." fault on the PanelDue 7.

                                        Are you saying an attempt to move X and Y by say G1 X100 Y100 returns that error?

                                        Running a simple bed leveling program and causing a stall causes the print head to move toward home but then it raises the print head 5mm and then it goes back out to print... so wierd.

                                        11/7/2022, 9:04:07 AM	Resume state saved
                                        11/7/2022, 9:03:46 AM	Driver error has occurred
                                        Driver 50.0 error: failed to maintain position
                                        11/7/2022, 9:03:29 AM	Driver error has occurred
                                        Driver 50.0 error: failed to maintain position
                                        11/7/2022, 9:02:54 AM	Driver error has occurred
                                        Driver 50.0 error: failed to maintain position
                                        11/7/2022, 9:00:02 AM	Error: Attempting to extrude with no tool selected.
                                        11/7/2022, 8:57:24 AM	Driver error has occurred
                                        Driver 50.0 error: failed to maintain position
                                        11/7/2022, 8:54:27 AM	Driver error has occurred
                                        Driver 50.0 error: failed to maintain position
                                        Error: Attempting to extrude with no tool selected.
                                        so the drive-error.g and the driver-stall.g will not work as they are currently. But we are getting somewhere, at least it isn't just stopping in the middle of the print anymore.
                                        

                                        So when you run the bed levelling, did you first select a tool and get the extruder up to temp?
                                        In your stall.g and error.g you have simply copied your pause.g

                                        This will make it
                                        move to X0 Y0
                                        raise Z
                                        Retract 10mm
                                        Then return to print job

                                        You can't retract (extrude) without a tool selected!

                                        So it sounds like it's doing what you told it to do.
                                        You must either re-home it to ensure that the position is now correct or pause it if that's what you want.
                                        Any retraction etc should first have a check that a tool is selected and up to temp.

                                        I'll have to leave any behaviour differences in firmware to @DC42

                                        supertb1undefined 1 Reply Last reply Reply Quote 0
                                        • supertb1undefined
                                          supertb1 @OwenD
                                          last edited by

                                          @OwenD
                                          No what I am saying is that while the system is running a program a manual move from intended path returns the ""Error: attempting to extrude with no tool selected." fault on the PanelDue 7." and then the aforementioned behavior ensues. And no I usually do not preheat the tool, that is in the gcode of the slicer app and yes the overall behaviour of any kind of motor stall of the X-Y axis needs to be "Go to the pause location" IE home Z+5. That is the ultamate goal

                                          OwenDundefined dc42undefined 2 Replies Last reply Reply Quote 0
                                          • OwenDundefined
                                            OwenD @supertb1
                                            last edited by

                                            @supertb1
                                            I don't know if there is a language barrier, or if you're being deliberately obtuse.
                                            If you want it to go to X0 Y0 Z+5, then wait, you must tell it that and only that!
                                            I'm afraid I have nothing more to offer you.

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