Duet3 + 3HC Dual Y-Axis CAN Problem



  • Hello forum,

    As in the previous threads and proposed by @dc42, here is a new thread for the problem with the homing of a dual Y-axis which is connected to the 3HC expansion board.

    here are my old posts which also deal with the problems with the CAN bus:

    https://forum.duet3d.com/topic/17313/rrf3-z-probe-was-not-triggered-during-probing-move/37?_=1594209206159

    Now I have changed my setup (Big Cartesian IDEX with dual y-axis and triple Z-Axis) like in this Post

    https://forum.duet3d.com/topic/17153/duet3-expansion-board-3hc-no-can-connection/21?_=1594209206157

    to the following PIN assignment:

    Mainboard -> U, E1, E2 and the three Z-axis

    Expansion board 3HC -> X and the both Y-axis

    The endstops correspond to the restrictions of RFF3 like that:

    End-U -> Mainboard
    End-X and End-Y -> Expansionboard 3HC

    I checked all endstops on the dashboard, every sensor triggers when passed. End stops all work perfectly!

    What happens when I home the printer (G28)

    The X axis and the U axis work fine.

    The Y-axis first moves towards the endstop and this triggers (first pass) and then as soon as it goes back to the second pass the Y-endstop no longer triggers and it drives against the end of the axis. So the firmware does not recognize the second pass of the Y-endstop (in the Dash it is triggered)!

    after the Y-axis has not tripped for a long time, the Z-axis suddenly begins to move towards the Z-probe.

    I noticed that I can stop everything by manually triggering the Z-probe.

    after that, however, the printer moves uncontrolled ...

    You can see everything in this video:

    https://youtu.be/nnHo67SHAdw

    To explain, we had to do this Sutup with the motors and endstops again, because it leads to a bigger error with the variant with all Z-motors and Z-probe on the expansion board.

    The printer itself has already printed and everything works so far and is configured correctly ...

    This must be an error with the CAN bus!

    And here the configs:

    Config.g

    ; Configuration file for Duet 3 (firmware version 3)
    
    
    ; General preferences
    G90            ; send absolute coordinates...
    M82            ; and absolute extruder moves
    M550 P"I444-S" ; set printer name
    
    ; Network
    M552 S1        ; enable network 
    M586 P0 S1     ; enable HTTP
    M586 P1 S0     ; disable FTP
    M586 P2 S0     ; disable Telnet
    
    
    
    ; Drives
    
    M569 P0.0 S1   ; physical drive 0.0 goes forwards Z0
    M569 P0.1 S1   ; physical drive 0.1 goes forwards Z1
    M569 P0.2 S1   ; physical drive 0.2 goes forwards Z2
    M569 P0.3 S0   ; physical drive 0.3 goes forwards X0 
    M569 P0.4 S0   ; physical drive 0.4 goes backwards E0
    M569 P0.5 S0   ; physical drive 0.5 goes backwards E1
    
    M569 P1.0 S0   ; physical drive 1.0 goes forwards X1 (U)
    M569 P1.1 S0   ; physical drive 1.0 goes backwards Y0
    M569 P1.2 S1   ; physical drive 1.0 goes forwards Y1
    
    
    ;New Mapping
    M584 X1.0 Y1.1:1.2 U0.3 Z0.0:0.1:0.2 E0.4:0.5  ; set drive mapping
    
    M350 X16 Y16 U16 Z16 E16:16 I1  ; configure microstepping 
    M92 X80.00 Y35.56 U80 Z1600 E415:415 ;set steps per mm
    M566 X200 Y200 U200 Z12 E300:300   ;set maximum instantaneous speed changes (mm/min)
    M203 X60000 Y60000 U60000 Z1000 E9000:9000      ;set maximum speeds (mm/min)
    M201 X1000 Y1000 U1000 Z200 E1000:1000            ;set accelerations (mm/s^2)
    M906 X1200 Y3900 U1200 Z1500 E1000:1000 I30  ;set motor currents (mA)
    M84 S30             		    ; Set idle timeout
    
    ; Axis Limits
    M208 X0 Y0 U91 Z0 S1     ; set axis minima
    M208 X460 Y500 U551 Z420 S0         ; set axis maxima
    
    ; Endstops
    M574 X1 S1 P"!io0.in" ; active-high endstop for low end on X via pin io0.in
    M574 U2 S1 P"!1.io4.in" ; active-high endstop for high end on U via pin 1.io1.in
    M574 Y2 S1 P"!1.io5.in" ; active-high endstop for high end on Y via pin 1.io2.in
    M574 Z1 S2
    
    ; Z-Probe 
    M558 K0 P8 C"^!io2.in" H5 F400 T10000 ; Z probe type -> Induktiv
     
    
    
    ;Z-Probe Piezo
    ;M558 P5 C"!io3.in" R1.0 K0 H5 F200 T6000 ; Z probe type -> Piezo
    ;M558 P5 C"!io4.in" R1.0 K1 H5 F200 T6000 ; Z probe type -> Piezo
    ;G31 K0 P100 X0.0 Y0.0 Z-0.30
    ;G31 K1 P100 X0.0 Y0.0 Z-0.30
    
    M557 X80:330 Y30:310 P04:04      ; define mesh grid
    
    ; Heaters
    M308 S0 P"temp0" Y"thermistor" T100000 B4092          ; configure sensor 0 as thermistor on pin temp0
    M950 H0 C"out0" T0                                    ; create bed heater output on out0 and map it to sensor 0
    M307 H0 B0 S1.00                                      ; disable bang-bang mode for the bed heater and set PWM limit
    M140 H0                                               ; map heated bed to heater 0
    M143 H0 S120                                          ; set temperature limit for heater 0 to 120C
    
    M308 S1 P"temp1" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin temp1
    M950 H1 C"out1" T1                                    ; create nozzle heater output on out1 and map it to sensor 1
    M307 H1 B0 S1.00                                      ; disable bang-bang mode for heater  and set PWM limit
    
    M308 S2 P"temp2" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 2 as thermistor on pin temp2
    M950 H2 C"out2" T2                                    ; create nozzle heater output on out2 and map it to sensor 2
    M307 H2 B0 S1.00                                      ; disable bang-bang mode for heater  and set PWM limit
    
    ; Fans
    
    M950 F0 C"out4"                                   ; create fan 2 on pin out4 and set its frequency
    M106 P0 S0 H-1                                        ; set fan 2 value. Thermostatic control is turned off
    M950 F1 C"out5"                                  ; create fan 3 on pin out5 and set its frequency
    M106 P1 S1 H2:1 T50                                   ; set fan 3 value. Thermostatic control is turned off
    
    ; Tools
    M563 P0 S"Links" D0 H1 F0  ; define tool 0
    G10 P0 X0 Y0 Z0 S0 R0        ; set tool 0 axis offsets
    M563 P1 S"Rechts" D1 H2 X3 F0   ; define tool 1
    G10 P1 Y0 U0 Z0 S0 R0        ; set tool 1 axis offsets
    
    
    
    
    ; Custom Safety Settings 
    
    ; Open Door Switch
    
    M950 J0 C"!1.io0.in" 
    M950 J1 C"!1.io1.in"
    M950 J2 C"!1.io2.in"
    
    M581 P"1.io0.in" S1 T1 C0
    M581 P"1.io1.in" S1 T1 C0
    M581 P"1.io2.in" S1 T1 C0
    
    ; Emergency Stop
    M950 J3 C"!1.io3.in"
    M581 T0 C"1.io3.in"  S0 C0		;trigger #0 (calls trigger0 -> Emergency-Stop)
    M582 T0
    
    ; Filament sensor
    M950 J4 C"!io3.in"			;left Filament Sensor 
    M581 P4 T4 R0	
    
    M950 J5 C"!io4.in"			;right Filament Sensor
    M581 P5 T4 R0	  
    
    
    ; LEDs
    ; Farbe Blue
    M950 F2 C"out3" Q500  ; create fan 3 on pin out5 and set its frequency
    M106 P2 S119     ;set fan 3 value. Thermostatic control is turned off
    ; Farbe Red
    M950 F3 C"1.out0" Q500  ; create fan 3 on pin out5 and set its frequency
    M106 P3 S0     ;set fan 3 value. Thermostatic control is turned off
    ; Farbe Green
    M950 F4 C"1.out1" Q500  ; create fan 3 on pin out5 and set its frequency
    M106 P4 S117     ;set fan 3 value. Thermostatic control is turned off
    ; Farbe White
    M950 F5 C"1.out2" Q500  ; create fan 3 on pin out5 and set its frequency
    M106 P5 S0     ;set fan 3 value. Thermostatic control is turned off
    
    
    ; Miscellaneous
    
    M501          ; load saved parameters from non-volatile memory
    
    
    M572 D0 S0.03
    

    homeall.g

    ; homeall.g
    ; called to home all axes
    
    if sensors.gpIn[0].value==1 & sensors.gpIn[1].value==1 & sensors.gpIn[2].value==1 & sensors.gpIn[3].value==1  ;If the Doors are closed make following
    
    
    	M106 P0 S0		; Part cooling Fan off 
    
    	M98 P"homex.g"
    	M98 P"homeu.g"
    	M98 P"homey.g"
    	M98 P"homez.g"
    

    Homey.g

    ; homey.g
    ; called to home the Y axis
    ;
    G91              ; relative positioning
    G1 H2 Z5 F6000   ; lift Z relative to current position
    G1 H1 Y550 F5000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Y-5 F6000  ; go back a few mm
    G1 H1 Y455 F360  ; move slowly to Y axis endstop once more (second pass)
    G1 H2 Z-5 F6000  ; lower Z again
    G90              ; absolute positioning
    

    I hope we can find a solution for this!

    Many thanks 🙂

    Regards Christian (CR-3D)


  • administrators

    Thanks, next step is for me to put your config and homing files on my bench system an reproduce this.


  • administrators

    I have not been able to reproduce this issue on my bench setup. I think this is because it is sensitive to timing, and I am not able to operate the endstop switches by hand as quickly as they are activated in your printer. Additionally, my bench setup uses normally-closed endstop switches, so I had to change the M574 command to accept active high inputs.

    What type of endstop switches are they? They appear to have active low outputs. If they are plain microswitches, then you appear to be using the normally-open (NO) contacts. I recommend you use the NC contacts instead (and then remove the leading ! from the pin names in the M574 commands) because this will make them less sensitive to noise pickup. This does not apply if you are using the Makerbot-style endstop switches with resistors and LED mounted on a small PCB.

    The firmware checks the endstops prior to starting a G1 H1 move, and also during the move. I have identified that there may be a small time window while the move is starting during which a transition on a remote endstop input might not be recognised. It is possible that your machine configuration and homing files are resulting in the endstop transition occurring during this window. If that is the case, we should be able to work around the problem by adjusting the homey.g file. Currently you use:

    G1 H1 Y550 F5000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Y-5 F6000 ; go back a few mm
    G1 H1 Y455 F360 ; move slowly to Y axis endstop once more (second pass)

    Please try the following changes, individually:

    • Replace F6000 in the second line by a lower speed, for example F360
    • Replace Y-5 in the second line by a larger value, for example Y-10
    • Between the second and third lines, insert a new line: G4 P100


  • @dc42 Thank you for your answer!

    I use NPN inductive sensors on all axes.

    I will test the changes in my homey.g file and give you feedback! 🙂


  • administrators

    @CR3D said in Duet3 + 3HC Dual Y-Axis CAN Problem:

    I use NPN inductive sensors on all axes.

    Thanks. An inductive sensor should provide a clean transition. However, when it is not triggered the sensor is essentially open circuit, so the endstop input is held high only by the 27K pullup resistor in the Duet. So the wire connecting it to the Duet endstop input may pick up noise, especially if it is an unshielded cable and it runs close to a stepper motor wire.

    I recommend that you you use shielded cable for these wires. Another possibility is to connect a lower value pullup resistor between the IN and +5V pins of the endstop IO_x connector.



  • I tested the changes at the homey.g file

    here the new one:

    ; homey.g
    ; called to home the Y axis
    ;
    G91              ; relative positioning
    G1 H2 Z5 F6000  ; lift Z relative to current position
    G1 H1 Y550 F5000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Y-10 F360  ; go back a few mm
    G4 P100
    G1 H1 Y455 F360  ; move slowly to Y axis endstop once more (second pass)
    G1 H2 Z-5 F6000  ; lower Z again
    G90              ; absolute positioning
    

    unfortunately, this change did not help either.


  • administrators

    Thanks. With that Y homing file, I can reproduce the problem - probably because I no longer need to release the Y endstop switch as quickly as I needed to using your original file. I will investigate it tomorrow.

    PS - I can see what is happening. When the firmware executes the second G1 H1 move, which involves only stepper drivers connected to the expansion board, it doesn't wait for that move to complete before scheduling the next move - and in scheduling the next move, it disables the endstop.


  • administrators

    I'm on the way to solving this, but meanwhile I have a temporary workaround. Between every pair of G1 H1/H2 moves that involve only drivers on the expansion board, insert a move that involves a motor on the main board. For example, this works for me:

    ; homey.g
    ; called to home the Y axis
    ;
    G91              ; relative positioning
    G1 H2 Z5 F6000  ; lift Z relative to current position
    G1 H1 Y550 F5000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Z0.1
    G1 H2 Y-10 F360  ; go back a few mm
    G1 H2 Z-0.1
    G1 H1 Y50 F360  ; move slowly to Y axis endstop once more (second pass)
    G1 H2 Z0.1
    G1 H2 Y-10
    G1 H2 Z-5.1 F6000  ; lower Z again
    G90              ; absolute positioning
    

  • administrators

    This is getting strange! The problem goes away if I reduce the length of the second homing move slightly, or I increase the speed of that move slightly. For example, this homing file fails:

    ; homey.g
    ; called to home the Y axis
    ;
    G91              ; relative positioning
    G1 H2 Z5 F6000  ; lift Z relative to current position
    G1 H1 Y550 F5000 ; move quickly to Y axis endstop and stop there (first pass)
    G1 H2 Y-10 F360  ; go back a few mm
    G1 H1 Y455 F360  ; move slowly to Y axis endstop once more (second pass)
    G1 H2 Z-5 F6000  ; lower Z again
    G90              ; absolute positioning
    

    but it works if I reduce Y455 in the second G1 H1 line to Y450, or if I increase F360 to F361.


  • administrators

    Found it! It was a subtle timing issue. Fixed firmware build at https://www.dropbox.com/s/p28vp6fbnkc4rbz/Duet3Firmware_MB6HC.bin?dl=0.



  • @dc42 said in Duet3 + 3HC Dual Y-Axis CAN Problem:

    Found it! It was a subtle timing issue. Fixed firmware build at https://www.dropbox.com/s/p28vp6fbnkc4rbz/Duet3Firmware_MB6HC.bin?dl=0.

    @dc42 Might that be the reason why my Z homing switch doesn't work at 600mm/min minute but works fine at 300mm/min (yet XY and U all work at 1200 mm/min+) as per this thread https://forum.duet3d.com/topic/17404/z-switch-on-expansion-board-latency-issue/20


  • administrators

    It might be if your Z drivers are not on the main board.



  • Ok thank you very much! I will test it 😉



  • sensational david ... you did it!

    thank you for this !!!! 🙂

    Now it works...


Log in to reply