Issues setting up duet wifi with dual x axis motors and endstops



  • Newbie here to the duet wifi and reprap but im trying to get it configured on a custom 3d printer and im running into some issues… I was following this video https://youtu.be/R_geyTBExVU as a guide and now nothing is working

    my setup is basically:
    2 motors x axis plugged into drive 0 and drive 4 (the Extruder 1 channel)
    1 motor y, drive 1
    2 motors z (to be used with a bl touch once installed) drive 2
    1 motor extruder drive 3

    for now all i have hooked up are the x motors and endstops for each. i had these working but when i started doing the joining and splitting of the two x motors with the scripts suggested in the video mentioned above now nothing moves. Can someone take a peek at my coding and tell me where i screwed up?
    homex.g config.g

    enclosure 01.JPG
    IMG_3786.JPG
    IMG_3788.JPG



  • @wingtip said in Issues setting up duet wifi with dual x axis motors and endstops:

    now nothing is working

    can you be more specific.
    nothing could mean your board broke and does not turn on



  • also you seem to have reformated your power recovery at the end of your config.

    remove that completly for now.



  • I am including my Config G file as a reference
    I have a 2 heater bed so be carful with that

    ;******************************************************************************************
    ;******************************** General preferences**************************************
    ;******************************************************************************************
    M111 S0 ; Debugging off
    G21 ; Work in millimeters
    G90 ; Send absolute coordinates...
    M83 ; ...but relative extruder moves
    M208 X-40 Y0 Z-2 S1 ; Set axis minima
    M208 X565 Y300 Z280 S0 ; Set axis maxima
    ;********************************************************************************************
    ;Endstops****
    ;********************************************************************************************
    M574 X0 Y0 Z0 S0 ; Define active low and unused micro-switches
    M307 H7 A-1 C-1 D-1 ; assign heater H5 to servo for probe
    M558 P9 X0 Y0 Z1 H10 F200 T4600 A20 S0.02 ; BL touch Z probe, used for homing Z axis, dive height 3mm, probe speed 200mm/min, travel speed 4600mm/min, 2 measure average, tolerance 25µm (assuming mm as the unit)
    ;G31 P1 X43 Y0 Z2.3; Set Z probe trigger value, offset and trigger
    G31 P1 X43 Y0 Z2.05; Set Z probe trigger value, offset and trigger height (lower offset brings it further away from bed)
    ;********************************************************************************************
    ;Drives****
    ;********************************************************************************************
    M569 P0 S1 ; Drive 0 goes forwards
    M569 P1 S1 ; Drive 1 goes forwards
    M569 P2 S1 ; Drive 2 goes forwards
    M569 P3 S1 ; Drive 3 goes forwards
    M569 P4 S1 ; Drive 4 goes forwards
    M569 P5 S1 ; Drive 5 goes forwards
    M569 P6 S0 ; Drive 6 goes forwards
    M569 P7 S1 ; Drive 7 goes forwards
    M569 P8 S1 ; Drive 8 goes forwards
    M584 X1:2 Y0 Z3:4 E5 ; Apply custom drive mapping
    M350 X16 Y16 Z16 E16 I1 ; Configure microstepping without interpolation
    M92 X80 Y80 Z1600 E484 ; Set steps per mm
    M566 X1500 Y1500 Z100 E2000 ; Set maximum instantaneous speed changes (mm/min) This is temporary test
    M203 X4000 Y4000 Z800 E4000 ; Set maximum speeds (mm/min)
    M201 X2000 Y2000 Z25 E3500 ; Set accelerations (mm/s^2)
    M906 X1200 Y1200 Z1400 E1000 I50 ; Set motor currents (mA) and motor idle factor in per cent
    M84 S30 ; Set idle timeout
    ;********************************************************************************************
    ;Bed Leveling**
    ;************************************** Bed Leveling 2 Screw ******************************************************
    ;M671 X-100:730 Y141:141 S5 p2; Z leadscrews are at x(-100:730), y(141:141)
    ;********************************************************************************************
    ;Manual Bed Screw Level
    ;M671 x73:73:533:533 Y305:-5:305:-5 P1.058
    ;Heaters

    ;
    ******************************************************** ******* *********************
    M143 S280 ; Set maximum heater temperature to 280C
    M305 P0 T100000 B3750 C0 R4700 ; Set thermistor + ADC parameters for heater 0 Primary Bed heater
    M305 P1 T100000 B3750 C0 R4700 ; Set thermistor + ADC parameters for heater 1 Secondary Bed Heater
    M305 P3 305 P1 B4725 C7.060000e-8 R4700
    ;M305 P3 T100000 B4710 C7.060000e-8 R4700; Set thermistor + ADC parameters for heater 3 Tool 1
    ; M305 P1 B4725 C7.060000e-8
    M570 H3 P40 T40
    M570 H0 P500 T40
    M570 H1 P500 T40
    M140 P0 H0 ; first bed heater is on heater 0 output
    M140 P1 H1 ; second bed heater is on heater 1 output

    ;********************************************************************************************
    ;Tools*
    ;********************************************************************************************
    M563 P0 D0 H3 ; Define tool 0 Drive 0 is master drive 1 is slave
    G10 P0 X0 Y0 ; Set tool 0 axis offsets
    G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
    ;********************************************************************************************
    ;Network*
    ;********************************************************************************************
    M111 S0 ; Debug off
    M550 PMakerSlide ; Machine name (can be anything you like)
    ;Mac Address 60:01:94:0c:58:84
    M552 S1 ; Enable WiFi
    M555 P2 ; Set output to look like Marlin
    M575 P1 B57600 S1 ; Set auxiliary serial port baud rate and require checksum (for PanelDue)
    ;********************************************************************************************
    ;Fans
    ;********************************************************************************************
    M106 P0 S1 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
    M106 P3 S1 I0 F500 H3 T60 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
    ;M106 P3 S1 I0 F500 H4 T60; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned on
    ; Custom settings are not configured
    ;M280 P3 S90 I1 ; retractprobe
    ;*******************************************************************************************
    ;Miscellaneous
    ;
    ***************************************************************************************
    T0 ; Select first tool
    M555 P2 ; Set output to look like Marlin
    M140 P0 S80
    M140 P1 S80



  • @Veti
    i dont recall changing that but will check right now. Also, when i said nothing is working i mean it powers up but move commands do nothing now... it makes the sound like its moving but it doesnt... its weird...



  • @percar
    why do you have a -40 in your x min axis setting? other than that the only thing i see is your not defining an extra axis for the extra x motor... i was told to assign it to U. so you have
    M584 X1:2 Y0 Z3:4 E5 ; Apply custom drive mapping

    and i have
    M584 X0:4 Y1 Z2 E3 U4 ; drivers 0&4 for x, driver 1 for y, driver 2 for z, driver 3 for Extruder

    Do i not need to assign it to U... i want each post to have its own endstop... i could easily reconfig it back to so both are working again without tieing them together but then they both home on one endstop, i want them to home independently on their own endstop so if one gets slightly out of sync it can realign the next time its homed.. if that makes sense..

    all ive ever used before now is marlin and honestly it setup pretty straight forward and i've not had to touch it in two years, but i want this duet working as it will be more of what i need going forward.



  • @wingtip said in Issues setting up duet wifi with dual x axis motors and endstops:

    M584 X0:4 Y1 Z2 E3 U4 ; drivers 0&4 for x, driver 1 for y, driver 2 for z, driver 3 for Extruder

    For dual motors on a single axis, define the motors as you have for X. As you intend to home each X motor individually, setting up the U axis for driver 4 is also correct. However, this axis needs to be hidden except for when you home X. So you need to add 'P3' to the M584 command, which makes the firmware show the first three defined axes (excluding the extruder drives). eg

    M584 X0:4 Y1 Z2 E3 U4 P3 ; drivers 0&4 for x, driver 1 for y, driver 2 for z, driver 3 for Extruder

    I think without adding P3 you won't be able to move the X axis, as the U axis also uses the same driver.

    You'll need to make some changes to your homing files; there's a guide here that covers this, though it's related to the Z axis: https://duet3d.dozuki.com/Guide/Independent+Z+motors+and+endstop+switches/18

    I had a look through the rest of your config.g and couldn't see any show stoppers! Though I think you're using the default thermistor settings, which are unlikely to be correct.

    Ian



  • @droftarts
    thank you for the reply and i had originally had the p3 in my config but was told to remove it... I will put it back. And i have read that article you posted so again im just at a loss on why i cant get either motor to move now... they make the sounds like theyre moving but they just sit there and thats only when i do an M564 H0 command to allow moving before being homed... if i dont do that they just sit there and hum a little when asked to move.... could my issues be that i have things out of order compared to the example given above? or does that matter?



  • @wingtip

    You can hide it or not, it really doesn't matter.

    Frederick



  • Still looking for some answers .... Thank you



  • You have M264 H0 ; allows movement without being homed first in your config. M264 is not a valid gcode. It should be M564. Perhaps that's why it's not moving when you expect it to?



  • @Phaedrux

    lol that was an error on my part and me being lazy... but even when i take that out nothing is moving... i may just start back over and do it the way i had it working with just one endstop since nobody on the actual duet forums has a clue to why its not working...



  • How's are you trying to move the motors? Are you trying to send a G1 command? The jogging controls? Homing macro?

    We need some more info.

    If it was working before what did you change to stop it working?

    The dual endstop thing could explain it but we need some more detail. If you send m119 to get endstop status what does it say?



  • @Phaedrux

    as i said , when i started tweaking the script as demonstrated in the video link i provided to do a dual motor setup properly is when things stopped working. more specifically the combine axis command x:4 and assigning the U4....



  • when doing M119 i get this:

    Endstops - X: not stopped, Y: not stopped, Z: at min stop, U: not stopped, Z probe: at min stop

    cause the vertical posts are near mid travel and just sitting



  • The only difference I can see between your config and the example config from @percar is that you have the U axis defined in config.g whereas he does not.

    M584 X0:4 Y1 Z2 E3 U4 ; drivers 0&4 for x, drivers 1 for y, drivers 2 for z, drivers 3 for Extruder, P shows home for U

    M584 X1:2 Y0 Z3:4 E5 ; Apply custom drive mapping

    So perhaps you'll have better luck emulating his setup. It should still work to split the axis for homing as you do in homex.



  • Actually, I think this is your problem. The weird formatting of your config.g.

    ; Miscellaneous
    
    M911 S10 R11 P"
    M913 X0 Y0 
    G91 
    M83 
    G1 Z3 E-5 F1000"                                   ; set voltage thresholds and actions to run on power loss
    

    The powerloss command has been split up onto multiple lines, so the command M913 X0 Y0 is now it's own command not conainted within the quotes of the M911 command. M913 X0 Y0 is setting your motor currents to nothing.

    To verify, send M913 by itself in the console. It should reply with the motor current percentage. Then send M913 X100 Y100 to set it to 100 and try to move again.



  • @Phaedrux

    that was mentioned above and i have since quoted those commands out as instructed. but when i get home from work this evening i will try removing the u axis as you suggest but doesnt that nullify that endstop as well?



  • ok i couldnt wait till after work and i tested this before leaving for work and its moving again!!!!! I didnt remove the U drives and just checked the motor currents as you suggested even though i had them quoted out and sure enough they were zero... unfortuneatly i smashed the x2 motor endstop again when i asked it to home x lol.... so i need to tweak the settings there..

    im not sure why that power off setting command has x0 and y0 as ive never messed with it



  • I just ran your original config.g and get these errors in the console:

    M98 P"/sys/TEST/config.g"
    HTTP is enabled on port 80
    FTP is disabled
    TELNET is disabled
    Warning: M264 command is not supported
    Error: GCodes: Attempt to read a GCode unsigned array that is too long: M350 X16 Y16 Z16 U16 E16:16 I1                     
    Error: M911: No power fail script provided
    Error: G0/G1: insufficient axes homed
    

    As @Phaedrux has already pointed out, and I missed earlier, M264 is incorrect, and should be M564. And really shouldn't be in config.g anyway, as leaves the machine in a potentially vulnerable state at start up. Delete, or change to:
    M564 H0

    The M350 error is because you're setting the microstepping mode for two extruders, when only one is defined. The command is being ignored. However, x16 with interpolation is the default anyway. Change to:
    M350 X16 Y16 Z16 U16 E16 I1

    The problem with M911 has already been covered, and sorry for missing that, too. Make sure to edit it back to one line, or comment all the moves out. I expect it was the M913 command setting the motor currents to zero that really caused your problems. Make sure ALL those last 5 commands are commented out, or write it as:
    M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss

    I've also just tested having a U axis defined as you had it. It doesn't cause any problems for me. If I send M584 X0 Y1 Z2:3 E4 U3 (which suits my machine) I get an extra U axis in the console. After running M564 H0 I can jog any axis. Jogging Z, both motors move, jogging U, one Z motor moves; as @fcwilt said, hiding/showing it doesn't stop the combined axis moving. I can't see why having the U axis in your config.g would cause the printer to stop. I would hide the axis as standard, though, and only unhide it for homing, so you don't accidentally move it and get your axis out of sync. You do need to have the U motor settings in your config.g, so you may as well define the axis there, too, just hide it. So try changing M584 to:
    M584 X0:4 Y1 Z2 U4 E3 P3

    Some other minor things:
    In the network section, comment out or delete M587 (Add WiFi host network to remembered list). As it says in the Gcode dictionary: Important! Do not use M587 within config.g. As well as being a security hazard, writing the access point parameters to WiFi chip every time you start the Duet may eventually wear out the flash memory. Also, the wifi module does not get enabled until the end of running config.g. It is better to use a macro to send M587 (source: https://forum.duet3d.com/post/42798)

    You don't need the M111 S0 (Debug) or M555 P1 (Set compatibility) codes.

    Thermistor settings: you are using the default values, M305 P1 T100000 B4138 R4700, which are probably incorrect.

    I'm not sure where all the extra spaces in your config.g came from. Did you edit it in a text editor that converted the line endings to two returns? Or just spaced it out for your visibility? It's not a problem, but just make sure when you do this that you are breaking the lines in the right place! All lines need to start with either a gcode, or a comment mark ";".

    Hope that helps. It's been good for me to test some of these things out!


Log in to reply