Duet2: axies and tools motor mapping mismatch



  • So.. i have another super weird issue regarding multiple X carriages.
    I had a mishap, so i had to rewire stuff.

    All the axes move as they should. Home as they should. But tools.... tools are one weird stuff.

    I map the drives like so:

    M584 X0 Y2 Z1:4 U5 V4 A3 B6 E7:8:9:10 ; Drive mapping X=0, Y=2, Z=1 and 4, X2=U=5, X3=A=3, X4=B=6 and Z2=V=4,extruder motors 7,8,9,10. Drive 1 and 4 is combined Z.

    so this is:
    X is front left, X drives motor 0
    U is front right, X drives motor 5
    A is back left, X drives motor 3
    B is back right, X drives motor 6

    But when i map the X drives to tools, i have to swap the
    M563 P0 S"FrontLeft" D0 H1 F0
    M563 P1 S"FrontRight" D1 H2 F1 X3
    M563 P2 S"BackLeft" D2 H3 F2 X5
    M563 P3 S"BackRight" D3 H4 F3 X6

    For some weird reason, i have to switch the motor mapping of tools to work correctly. This will probably mess up my tool offsets and all.

    I have no idea why this is.

    Duet2, fw 3.2-beta2
    DWC 3.2.0-beta2


  • Moderator

    @MaracMB See note on X and Y parameters at https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M563_Define_or_remove_a_tool

    Axes are mapped in the order XYZUVWABC, where X=0, Y=1, Z=2, U=3 etc, not by driver number.

    You have defined axes XYZUVAB. I'm not sure if the axis numbers are X0, Y1, Z2, U3, V4, A5, B6 or X0, Y1, Z2, U3, V4, A6, B7 (because you skipped W). But those are the numbers you use to define the X parameter in M563, ie X5 (or 6) for A, and X6 (or 7) for B.

    Also see https://duet3d.dozuki.com/Wiki/ConfiguringMultipleIndependentXcarriagesCartesian#Section_Creating_a_tool_that_uses_more_than_one_carriage_to_print_multiple_copies_of_an_object

    Ian



  • @droftarts thanks, but this makes no sense. The axes U, A, B work and do ok on their own. They did alright before i had some mishap. The config was the same, nothing other than numbering changed.

    Also, if W counted, then everything else would just collapse. Now, i have to swap 3 and 5. These are not consequtive numbers. and i have to swap them within tools definitions.

    So... still nothing.

    At least offsets seem to work as set.


  • Moderator

    @MaracMB It looks like your first post has it correct, and axis numbering is X0, Y1, Z2, U3, V4, A5, B6. So...

    X is front left, X drives motor 0 (X is axis 0)
    U is front right, X drives motor 5 (U is axis 3)
    A is back left, X drives motor 3 (A is axis 5)
    B is back right, X drives motor 6 (B is axis 6)

    M563 P0 S"FrontLeft" D0 H1 F0
    M563 P1 S"FrontRight" D1 H2 F1 X3 ; X3 is is U
    M563 P2 S"BackLeft" D2 H3 F2 X5 ; X5 is A
    M563 P3 S"BackRight" D3 H4 F3 X6 ; X6 is B
    

    Is the question why has it changed from previous config? Because this looks correct. Probably need to see the previous configuration.

    Now, i have to swap 3 and 5. These are not consequtive numbers.

    Because you have the V axis between them.

    Ian



  • This post is deleted!


  • ; Configuration file for Duet WiFi (firmware version 3)
    ; executed by the firmware on start-up
    ; by MaracMB
    ; General preferences
    G90                                                         ; send absolute coordinates...
    M83                                                         ; ...but relative extruder moves
    M550 P"MarX-Quad"                                              ; 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 S0                                              ; physical drive 0 goes backwards - X0 X
    M569 P1 S1                                              ; physical drive 1 goes forwards - Z1
    M569 P2 S1                                              ; physical drive 2 goes forwards - Y
    M569 P3 S1 												; Physical drive 3 goes forwards - X2 A
    M569 P4 S1 												; Physical drive 4 goes forwards - Z2
    M569 P5 S1 												; Physical drive 5 goes forwards - X1 U
    M569 P6 S1 												; Physical drive 6 goes forwards - X3 B
    M569 P7 S0                                              ; physical drive 7 goes backwards - e1
    M569 P8 S0                                              ; physical drive 8 goes backwards - e2
    M569 P9 S0                                              ; physical drive 9 goes backwards - e3
    M569 P10 S0                                             ; physical drive 10 goes backwards - e4
    
    ; Drive mapping
    M584 X0 Y2 Z1:4 U5 A3 B6 E7:8:9:10  ; Drive mapping X=0, Y=2, Z=1 and 4, X2=U=5, X3=A=3, X4=B=6 and Z2=V=4,extruder motors 7,8,9,10. Drive 1 and 4 is combined Z.			
    M584 V4 P6 								; Drive mapping Z2=V=4, 6 axes are visible
    M350 X32 Y32 Z32 U32 A32 B32 V32 I1  	; Configure microstepping with interpolation
    M350 E16:16:16:16 I0  	        	; Configure microstepping without interpolation
    
    ; Motion parameters
    M92 X160.00 Y160.00 Z1600.00 U160.00 A160.00 B160.00 V1600.00 	; Set steps per mm
    M92 E396.00:396.00:396.00:396.00								; Set steps per mm
    M566 X420.00 Y420.00 Z15.00 U420.00 A420.00 B420.00 V15.00  	; set maximum instantaneous speed changes (mm/min)
    M566 E320.00:320.00:320.00:320.00 								; set maximum instantaneous speed changes (mm/min)
    M203 X12000.00 Y12000.00 Z1200.00 U12000.00 A12000.00 B12000.00 V1200.00 	; set maximum speeds (mm/min)
    M203 E1200.00:1200.00:1200.00:1200.00            						; set maximum speeds (mm/min)
    M201 X880.00 Y880.00 Z240.00 U880.00 A880.00 B880.00 V240.00 	; set accelerations (mm/s^2)
    M201 E6400.00:6400.00:6400.00:6400.00                  		; set accelerations (mm/s^2)
    M906 X950 Y1050 Z950 U950 A950 B950 V950 I30 	; set motor currents (mA) and motor idle factor in per cent
    M906 E950:950:950:950 I30                          	; set motor currents (mA) and motor idle factor in per cent
    M84 S30                                                     ; Set idle timeout
    ; Axis Limits
    M208 X-170 Y-165 Z0 U-135 A-157 B-112 V0 S1 		; Set axis minima
    M208 X115 Y155 Z350 U168 A112 B157 V350 S0 		; Set axis maxima
    ; Endstops
    M574 X1 S1 P"!xstop" 					; configure active-low endstop for low end on X via pin Xstop
    M574 Y1 S1 P"!zstop" 					; configure active-low endstop for low end on Y via pin Zstop
    M574 Z1 S1 P"!ystop" 					; configure active-low endstop for low end on Z via pin Ystop
    M574 U2 S1 P"!duex.e2stop" 					; configure active-low endstop for high end on X2 via pin duex.e2stop
    M574 A1 S1 P"!e0stop" 				; configure active-low endstop for low end on X3 via pin e0stop
    M574 B2 S1 P"!duex.e3stop" 				; configure active-low endstop for high end on X4 via pin duex.e3stop
    M574 V1 S1 P"!e1stop" 					; configure active-low endstop for low end on Z2 via pin e1stop
    ; Z-Probe
    ;M558 P0 H5 F120 T6000 					; disable Z probe but set dive height, probe speed and travel speed
    ;M557 X-125:125 Y-125:125 S125 				; define mesh grid
    ; Heaters and sensors
    M308 S0 P"bedtemp" Y"thermistor" T100000 B4138 	            ; configure sensor 0 as thermistor on pin bedtemp
    M308 S1 P"duex.e2temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin duex.e2temp
    M308 S2 P"duex.e3temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 2 as thermistor on pin duex.e3temp
    M308 S3 P"duex.e4temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 3 as thermistor on pin duex.e4temp
    M308 S4 P"duex.e5temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 4 as thermistor on pin duex.e5temp
    M308 S5 Y"mcu-temp" A"MCU" 				    ; Configure sensor for MCU
    M950 H0 C"bedheat" T0                                       ; create bed heater output on bedheat and map it to sensor 0
    M307 H0 B0 S1.00                                            ; disable bang-bang mode for the bed heater and set PWM limit
    M143 H0 S100                                                ; set temperature limit for heater 0 to 120C
    M140 H0                                                     ; map heated bed to heater 0
    M950 H1 C"duex.e2heat" T1                                   ; create nozzle heater output on duex.e3heat and map it to sensor 1
    M143 H1 S300                                                ; set temperature limit for heater 1 to 300C
    M307 H1 B0 S1.00                                            ; disable bang-bang mode for heater  and set PWM limit
    M950 H2 C"duex.e3heat" T2                                   ; create nozzle heater output on duex.e4heat and map it to sensor 2
    M143 H2 S300                                                ; set temperature limit for heater 2 to 300C
    M307 H2 B0 S1.00                                            ; disable bang-bang mode for heater  and set PWM limit
    M950 H3 C"duex.e4heat" T3                                   ; create nozzle heater output on duex.e5heat and map it to sensor 3
    M143 H3 S300                                                ; set temperature limit for heater 3 to 300C
    M307 H3 B0 S1.00                                            ; disable bang-bang mode for heater  and set PWM limit
    M950 H4 C"duex.e5heat" T4                                   ; create nozzle heater output on duex.e6heat and map it to sensor 4
    M143 H4 S300                                                ; set temperature limit for heater 4 to 300C
    M307 H4 B0 S1.00                                            ; disable bang-bang mode for heater  and set PWM limit
    ; Fans
    M950 F0 C"duex.fan4" Q1000                                  ; create fan 1 on pin duex.fan4 and set its frequency -- TOOL FAN 0
    M106 P0 S0 H-1 	                                         	; set fan 1 value. Thermostatic control is turned off -- TOOL FAN 0
    M950 F1 C"duex.fan5" Q1000                                   ; create fan 2 on pin duex.fan5 and set its frequency -- TOOL FAN 1
    M106 P1 S0 H-1                                         		; set fan 2 value. Thermostatic control is turned off -- TOOL FAN 1
    M950 F2 C"duex.fan6" Q1000                                   ; create fan 3 on pin duex.fan6 and set its frequency -- TOOL FAN 2
    M106 P2 S0 H-1                                         		; set fan 3 value. Thermostatic control is turned off -- TOOL FAN 2
    M950 F3 C"duex.fan7" Q1000                                   ; create fan 4 on pin duex.fan7 and set its frequency -- TOOL FAN 3
    M106 P3 S0 H-1                                         		; set fan 4 value. Thermostatic control is turned off -- TOOL FAN 3
    
    M950 F4 C"fan0" Q1000                                   ; create fan 5 on pin fan0 and set its frequency  -- HOTEND FAN tool 0
    M106 P4 S0 H1 T45                                           ; set fan 5 value. Thermostatic control is turned on -- HOTEND FAN tool 0
    M950 F5 C"fan1" Q1000                                   ; create fan 6 on pin fan1 and set its frequency -- HOTEND FAN tool 1
    M106 P5 S0 H2 T45                                          ; set fan 6 value. Thermostatic control is turned on -- HOTEND FAN tool 1
    M950 F6 C"fan2" Q1000                                   ; create fan 7 on pin fan2 and set its frequency -- HOTEND FAN tool 2
    M106 P6 S0 H3 T45                                          ; set fan 7 value. Thermostatic control is turned on -- HOTEND FAN tool 2
    M950 F7 C"duex.fan3" Q1000                                   ; create fan 3 on pin duex.fan3 and set its frequency -- HOTEND FAN tool 3
    M106 P7 S0 H4 T45                                          ; set fan 3 value. Thermostatic control is turned on -- HOTEND FAN tool 3
    
    
    ;Extra fan ports
    M950 F8 C"duex.fan8" Q500                                   ; create fan 8 on pin duex.fan8 and set its frequency -- HOTEND FAN tool 3
    M106 P8 S0 B0.5 L0.3 H4 T45 C"extFan"                                         ; set fan 8 value. Thermostatic control is turned on -- HOTEND FAN tool 3
    
    ;M950 F4 c"allwayson" Q500			; Assign Fan 4 to onboard Fan1 Port
    ;M106 P4 L0.2 X1 B0.1 H3 T40:65		; Set fan 4 PWR fan. Turns on when MCU temperature hits 40C and full when the MCU temperature reaches 65C	
    ;M950 F5 C"duex.pwm" 			; create port for LEDs on pin duex.fan8
    ;M106 P5 S0 C"LIGHTS" 			; LED control
    
    ; Tools
    M563 P0 S"FrontLeft" D0 H1 F0			; define tool 0
    G10 P0 X0 Y0 Z0 U0 A0 B0					; set tool 0 axis offsets
    G10 P0 R0 S0 								; set initial tool 0 active and standby temperatures to 0C
    M563 P1 S"FrontRight" D1 H2 F1 X3  			; define tool 1, ports X axis to U - motor 5
    G10 P1 X0 Y0 Z0 U0.44 A0 B0					; set tool 1 axis offsets
    G10 P1 R0 S0 								; set initial tool 1 active and standby temperatures to 0C
    M563 P2 S"BackLeft" D2 H3 F2 X5 			; define tool 3, ports X axis to A - motor 3
    G10 P2 X0 Y161.7 Z0 U0 A0.40 B0				; set tool 2 axis offsets
    G10 P2 R0 S0 								; set initial tool 1 active and standby temperatures to 0C
    M563 P3 S"BackRight" D3 H4 F3 X6 			; define tool 3, ports X axis to A - motor 6
    G10 P3 X0 Y175 Z0 U0 A0 B1.08 				; set tool 3 axis offsets
    G10 P3 R0 S0  								; set initial tool 1 active and standby temperatures to 0C
    
    ; Automatic saving after power loss is enabled
    M911 S23.00 R23.50 P"M913 X0 Y0 U0 V0 A0 B0 G91 M83 G1 Z3 E-5 F3000" ; Set voltage thresholds and actions to run on power loss
    ; Miscellaneous
    M501                                                        ; load saved parameters from non-volatile memory
    
    
    
    

  • Moderator

    @MaracMB said in Duet2: axies and tools motor mapping mismatch:

    If you tell me how to put it in that fancy little black bracket, i'd be thriled

    Well that I can help with... Highlight the text you want and click the </> symbol from the post composition toolbar, or enclose anything you want to highlight as code with three backticks: ```. (Alternatively known as acute, backtick, left quote, or an open quote, the back quote or backquote is a punctuation mark. It's on the same U.S. computer keyboard key as the tilde.). If you do them on a new line,

    you get a code box,
    

    if you do them inline, you get inline code.

    Ian



  • oh yeah.... i almost forgot about my issue with this...
    this is nice... *uck those motors. i can post readable config!!! 😄


  • Moderator

    @MaracMB Old config:

     ; Drive mapping
    M584 X0 Y1 Z2:4 U3 A5 B6 V4 E7:8:9:10 P7
    
    M563 P0 S"FrontLeft" D0 H1 F0 ; define tool 0
    M563 P1 S"FrontRight" D1 H2 X3 F1 ; define tool 1, ports X axis to A motor 3
    M563 P2 S"BackLeft" D2 H3 X5 F2 ; define tool 3, ports X axis to A motor 3
    M563 P3 S"BackRight" D3 H4 X6 F3 ; define tool 3, ports X axis to A motor 3
    

    New config:

    M584 X0 Y2 Z1:4 U5 A3 B6 E7:8:9:10  ; Drive mapping X=0, Y=2, Z=1 and 4, X2=U=5, X3=A=3, X4=B=6 and Z2=V=4,extruder motors 7,8,9,10. Drive 1 and 4 is combined Z.			
    M584 V4 P6 								; Drive mapping Z2=V=4, 6 axes are visible
    
    M563 P0 S"FrontLeft" D0 H1 F0			; define tool 0
    M563 P1 S"FrontRight" D1 H2 F1 X3  			; define tool 1, ports X axis to U - motor 5
    M563 P2 S"BackLeft" D2 H3 F2 X5 			; define tool 3, ports X axis to A - motor 3
    M563 P3 S"BackRight" D3 H4 F3 X6 			; define tool 3, ports X axis to A - motor 6
    

    The only thing I can see different is that you swapped the U and A stepper driver (and Y and one Z motor), and, presumably, the motor wiring. M563 still references the U (with X3) and A (with X5) axes, NOT the motor driver number, which should be correct. In the original config, motor driver number did match axis number, but does not in the new config.

    I'm still not sure what is not working for you with the tools. Is it moving the wrong motor?

    Ian



  • @droftarts yes. if i set it as it should be, then the U and A are swapped, so if i select T1, the T2 is moving and vice versa. The only thing i figured to do, to solve this, was to swap the X motor mapping for the tools.

    it does work, it does the offset right, but... it's weird, because tools 1 and 2 need to be set wrong to work right.



  • @droftarts i did not understand what you meant that first time. Now i get it.
    Thank you.

    @dc42 & @Phaedrux : issue has been resolved. One maps the axes not the motors. I get it now.


Log in to reply