Duet Wifi independent dual X & Y Axis + Endstops configuration

This is a very useful thread. I will be setting up my Duet hopefully by next weekend. I’m waiting for the motor cable and connectors to arrive. I have been staring at this thing too long, and it needs to start moving :wink:

I have three Duet boards now, so I’m pretty comfortable. So much so that it’s all I will buy. But so far just 3D printing. I bought a Maestro board to free up the WiFi for the CNC. The WiFi has more motor current capacity, and I need the wireless so the CNC can move out to the work shed.

Could you by any chance share your config and home files to get me started with mine? It would likely be a big time saver to just tweak an existing setup.

I home Z with G92 Z0

This is the start of my Gcode from Estlcam:

;Project test
;Created by Estlcam version 11 build 11,105
;Machining time about 00:03:30 hours

G90
G00 X0.0000 Y0.0000 Z0.0000
G00 Z5.0000

;No. 1: Gravur 1
G00 X100.0000 Y100.0000
G00 Z0.5000
G01 Z-0.0100 F1200 S1
G01 Y363.9995
G01 X364.0001
G01 Y100.0000
G01 X100.0000
G00 Z5.0000

;No. 2: Gravur 6
G00 X100.0000 Y231.9997 Z5.0000
G00 Z0.5000
G01 Z-0.0100 F1200
G01 X364.0001
G00 Z5.0000

 

I changed the config to:

; Axis Limits
M208 X0 Y0 Z-100 U0 V0 S1 ; Set axis minima
M208 X731 Y731 Z108 U731 V731 S0 ; Set axis maxima

 

I just want to test something, to see if it works and then finetune from there. First I want to draw this picture with a pen to see if its square and later I want to try it with the spindle:

After the outer square is done the Z axis rises unreasonably high and I get the error message “G0/G1 outside machine limits”.

Hey There,

 

There’s nothing obvious there. Maybe if you attach the full file I could take a look?

 

Looking at the screenshot your (0,0) point (the blue cross) is on the outside square. Try moving that down and left a little to ensure the outside square isn’t right on the border.

Also, check what you have in your cancel, pause, resume, etc files. By default I have a feeling some of these move up when a “print” is canceled. I’d start by commenting out everything in those.

I’ll post my config when I get a chance, but be warned I have things like spindle speed control, feed back from the VFD and a custom version of the firmware with “sticky” spindle speed (so you can restart previous speed with just an M3) and spindle speed correction to remove the non-linearity of my PWM converter. It’s not going to just run for you without some tweaking but at least it’s a reference.

 

~

Mike

1 Like

I got it working now.

There was a endstop set for the z axis

; Endstops
M574 X1 S1 C0
M574 Y1 S1 C1
M574 Z2 S1 C2
M574 U1 S1 C4
M574 V1 S1 C3

So I changed it to

M574 X1 S1 C0
M574 Y1 S1 C1
M574 Z0
M574 U1 S1 C4
M574 V1 S1 C3

and now it’s working. Thanks for your awesome help, Mike.

1 Like

Hello,

 

I started printing/building my MPCNC a few weeks ago, while waiting for the parts to arrive. Yesterday I started wiring my control box. I also use a Duet WiFi as control board and this thread has been very helpful for configuring my board.

I managed to get the z and x axes working fine, but the y axis is causing trouble. Whenever I try to move the axis, the steppers start to vibrate and stall, cuasing the Duet to reset.

My config is as follows:

; General preferences
M584 X2 Y0:1 Z3 ; set drive mapping
G90 ; send absolute coordinates…
M83 ; …but relative extruder moves
M550 P"MPCNC" ; set printer name

; Network
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet

;CNC Mode
M453

; Drives
M569 P0 S1 ; physical drive 0 goes forwards
M569 P1 S0 ; physical drive 1 goes backwards
M569 P2 S1 ; physical drive 2 goes forwards
M569 P3 S1 ; physical drive 3 goes backwards
M350 X256 Y256 Z256 I0 ; configure microstepping without interpolation
M92 X1600.00 Y1600.00 Z6400.00 ; set steps per mm
M566 X900.00 Y900.00 Z12.00 ; set maximum instantaneous speed changes (mm/min)
M203 X6000.00 Y6000.00 Z180.00 ; set maximum speeds (mm/min)
M201 X100.00 Y100.00 Z20.00 ; set accelerations (mm/s^2)
M906 X1500 Y1500 I30 Z1500 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout

; Axis Limits
M208 X0 Y0 Z0 S1 ; set axis minima
M208 X500 Y500 Z70 S0 ; set axis maxima

; Endstops
M574 X0 Y0 Z0 S0 ; set active low and disabled endstops

; Z-Probe
M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed
M557 X15:215 Y15:195 S20 ; define mesh grid

; Heaters
M140 H-1 ; disable heated bed

; Fans

; Custom settings
M587 S"xxxxxx" P"xxxxx"
M552 S1

I use the following steppers:

I have already checked the wiring to rule out any issues there and it seems to be fine. I also tried reconfiguring the y axis to different drivers, but that did not help. The interessting thing is that one of the y steppers is working fine, but the other one just vibrates an stalls causing the Duet to reset. I swapped the cables for x and y, which causes one of the x steppers to stall. This also happens without any load/belts attached.

Any hints would be apprechiated :slight_smile:

 

-chrzr

 

Edit: I did some more googling and found a few posts on how to map drives for a single axis. I adjusted the config accordingly, but still nothing

; General preferences
M584 X2 Y1:3 Z4 U1 E5:6 P4 ; set drive mapping
G90 ; send absolute coordinates…
M83 ; …but relative extruder moves
M550 P"MPCNC" ; set printer name

; Network
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet

;CNC Mode
M453

; Drives
M569 P0 S1 ; physical drive 0 goes forwards
M569 P1 S0 ; physical drive 1 goes backwards
M569 P2 S1 ; physical drive 2 goes forwards
M569 P3 S0 ; physical drive 3 goes forwards
M350 X256 Y256:256 U256 Z256 E256 I0 ; configure microstepping without interpolation
M92 X1600.00 Y1600.00:1600.0 U1600.0 Z6400.00 ; set steps per mm
M566 X400.00 Y400.0:400.0 U400.0 Z12.00 ; set maximum instantaneous speed changes (mm/min)
M203 X6000.00 Y6000.00:6000.00 U6000.0 Z180.00 ; set maximum speeds (mm/min)
M201 X100.00 Y100.00:100.00 U100.0 Z20.00 ; set accelerations (mm/s^2)
M906 X1500 Y750:750 U1500 Z1500 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout

; Axis Limits
M208 X0 Y0:0 U0 Z0 S1 ; set axis minima
M208 X500 Y500:0 U500 Z70 S0 ; set axis maxima

; Endstops
M574 X0 Y0:0 U0 Z0 S0 ; set active low and disabled endstops

 

Hi,

 

Your steps/mm looks too high for 1.8 degree motors. I’m on a phone right now so can’t post my settings but try scrolling up this thread.

 

 

The duet crashing isn’t normal either.

~Mike

2 Likes

Thanks for the reply!

 

I’ll try adjusting the steps/mm again.

What is weird is that the same steps/mm values work without any problems for the x axis?

The problem does not seem to be related to the stepper itself, as I tried swapping it without any success. The wiring is also fine, as it shows the same behavior when I swap the cables between x and y. I think it is also not related to the driver (at first I thought that I have a faulty driver), as it also does not work on different drivers which work fine for the other axes.

So my conclusion is that it must be related to the config, but I just can’t figure it out.

I’ll try to adjust the steps/mm first.

Double check that your grub screws are tight. You can see those symptoms if one pulley is slipping on the stepper shaft.

1 Like

Okay, so I have found the problem…

It seems that the high power draw of the motors at 1.5A each was causing the output voltage of my 24V PSU to drop, which resulted in the stepper stalling and the Duet resetting. I’ve now reduced the currents to 1A and all axes work just fine.

So I think I’ll have to get a higher wattage PSU in order to drive the steppers at higher currents. Should have thought about that initially while ordering the parts ¯_(ツ)_/¯

Nevetheless, thanks for your inputs!

Maybe I’ll be able to cut some wood this week! :slight_smile:

What are the motor mounts made of? At 1.5 amps the steppers are going to get hot!

Since there are so many knowledgeable people in this thread, can some of you gurus take a look at my script in a separate thread so not to take away from this thread… Im not getting any responses over there at all… thank you… its a similar dual axis issue… thank you

/t/duet-wifi-dual-x-motor-config-help-needed/13204 (it wont let me post the full link)

Mike,

Would you be able to post your config.g file for dual x, dual y, and z steppers with dual X and dual y endstops somewhere?

Brian.

Hi Guys,
Would these configs work with RRF3 on SKR1.4 with RPI4 using 2209 sensorless homig?

Cheers

Dardan

I know this is an old thread but I have the solution that alluded 3drikat and I want it to be documented since this thread is one of the first to come up on Google. Sooo maybe mark it as the solution so it appears near the top?

Symptoms of the problem:
You can reset the board and use G92 to set HOME for all axes. Everything works and you can jog the machine around. But when you click Home Y it goes wonky. The second motor on the U or V axes does little to nothing and only the first motor on the Y will move. After that the U or V motor never moves with Y.

The root cause of the problem:
The drivers are “in use” when you unbond/reassign them off the Y axes. The firmware cannot support that so the motor control is disabled. This is a quote from the bottom of M584 - Duet3D (dozuki.com), “*If you assign an axis or extruder to one or more drivers, and later you want to reassign it to a different driver, then to ensure correct operation you must disable those axes/extruders using M18 before using M584 to reassign them… *”

How to solve the problem:
In HomeY.g you need to add this…

M18 Y U ; Disable Axis Stepper motors MUST COME BEFORE M584
M584 Y1 P5 ; Decouple Axes for Homing & display all Axes

;Do your homing work

;no need to disable steppers again.
M584 Y1:2 P3 ; set drive mapping back to normal & hide the extra axes

The online documentation for M584 also says that you need to redefine the motor current and microstepping but this is not true if you setup your config.g correctly. What do I mean by that? If you set all of those for X, Y, Z, U, V in the config.g then they are all set. By first disabling the motors for Y & U then removing U from the Y axes the system will default back to the Microsteps/currents previously set. If you forget to disable first then all of those settings are lost for the U driver and you would need to set them again. So make it easy on yourself and just disable them before you unbond them the M584.

Don’t really know. But this will solve the issue.

It is a really old thread, and should no longer be an issue, since the newer RRF doesn’t need any of this stuff anymore. Define the axis as using multiple drives

M584 X0:3 Y1:4 Z2                               ; set drive mapping: X on drives 0 and 3, Y on 1 and 4, Z on 2

then define multiple endstops

M574 X1 S1 P"^xstop+^e0stop"                    ; configure active-high endstop for low end on X via pin ^xstop+^e0stop
M574 Y1 S1 P"^ystop+^e1stop"                    ; configure active-high endstop for low end on Y via pin ^ystop+^e1stop

and homing with autosquaring just works. No need to deal with the decoupling stuff needed in the older firmware anymore.

1 Like

In my situation I was using Sensorless Homing. Is that possible using the method you suggested here?

I don’t know, but I think it’s just a matter of changing the stop pins to the TMC stall pins. RRF3 support for multiple motors per axis is pretty good. Should be fine, so long as you drop the motor current in your homex.g, homey.g and homeall.g files.

Hi, I’m new here. I’m trying to set up a Duet board to control my MPCNC with 2 motors per axis and separate endstops for each but I keep getting errors I don’t understand - I’m a bit old so be gentle with me please… I am trying to use the Workbee version of firmware as I like it’s web interface but the fact that it splits the config.g up into lots of separate files may be what’s confusing me. I’ve read all that has been said on here before and tried the suggestions but I still can’t get two motors to work together properly. I’ve included the contents of what I think are the relevant files here if someone could please comment on them. As they are I’m getting an error of ‘failed to enable endstops’. When I tried to change things to [Dan][SupraGuy]'s suggestion I got the error that ‘insufficient axes were defined’. Thanks for your help. Ian

Sorry, I forgot to include the file…

config.g
; Configuration file for Duet
; executed by the firmware on start-up
; WorkBee Firmware Version 1.1

global systemSettingsVersion={1.2}

; Configuration files
M98 P"config-network.g"
M98 P"config-drives.g"
M98 P"config-axes.g"
M98 P"config-axes-limits.g"
M98 P"config-axes-calibration.g"
M98 P"config-axes-endstops.g"
M98 P"config-probe.g"
M98 P"config-spindle.g"
M98 P"config-laser.g"

; Other Settings
M453 ; Put the machine into CNC Modes
G90 ; Set absolute coordinates
M140 H-1 ; Disable heated bed
M564 S1 H1 ; Disable jog commands when not homed
M911 S21.0 R23 P"G91 G1 Z3 F1000" ; Configure power loss resume
M575 P1 S1 B57600
M584 X0:4 Y1:3 Z2; Apply drive mapping to axes

M574 X1 S1 C0
M574 Y1 S1 C1
M574 Z0
M574 U1 S1 C4
M574 V1 S1 C3

; User Configuration files
M98 P"config-user-settings.g"

config-drives.g
; Drive configuration executed by config.g

M569 P0 S1 ; Drive 0 goes forwards
M569 P1 S1 ; Drive 1 goes forwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S0 ; Drive 3 goes backwards
M569 P4 S0

config-axes.g
; Axes configuration executed by config.g

M584 X0:4 Y1:3 U4 V3 Z2; Apply drive mapping to axes
M906 X1000 Y1000 Z1000 U1000 V400 I100 ; Set motor currents (mA)
M92 X400 Y400 Z1280 U400 V400; Set steps per mm
M350 X16 Y16 Z16 U16 V16 I1 ; Configure microstepping
M203 X3000 Y3000 Z2500 U3000 V3000; Set maximum speeds (mm/min)
M201 X150 Y150 Z150 U150 V150; Set accelerations (mm/s^2)
M566 X500 Y500 Z500 U500 V500; Set maximum instantaneous speed changes (mm/min)

config-axes-limits.g
; Axes Limits configuration executed by config.g

M208 X-650 Y-600 Z-200 U-650 V-600 S1 ; Set axis minima
M208 X650 Y600 Z200 U650 V600; Set axis maxima

config-axes-calibration.g
; Axes Calibration configuration executed by config.g

M92 X100 Y100 Z1280 U100 V100; Set steps per mm

config-endstops.g
; Endstop configuration executed by config.g

M574 X1 S1 P"!xstop + !e1stop" C0
M574 Y1 S1 P"ystop + !e0stop" C1
M574 Z0
;M574 U1 S1 P"ustop" C4
;M574 V1 S1 P"vstop" C3

homex.g
; homex.g
; called to home the X axis

M584 X0 P5; split X axis
G91 ; relative positioning
G21 ; Set units to mm
M574 X0 S1 P"!xstop + !e1stop"
G1 H2 Z5 F900 ; move quickly to Z axis endstop and stop there (first pass)
G1 H1 X-670 U-670 F1500 ; move quickly to X axis endstops and stop there (first pass)
G1 H2 X5 U5 F2400 ; go back a few mm
G1 H1 X-600 U-600 F300 ; move slowly to X axis endstops once more (second pass)
G1 H2 X300 U300 F1500 ;
M584 X0:1 P3 ; join axis
G92 X0 ; Set Home Position
G90 ; absolute positioning