What is the "best" positive and negative Z axis settings?

  • Hi
    Sorry for the newbie question but cant get my head around this, and the more I read at forums the more confused I get…
    I former had problem understanding the y & x axis on my newly built CoreXY (400x400x400mm build-space).
    Now I cant understand how to configure the Z-axis. The printer has 3 optical end stops for homing and also an DC Mini Differential IR probe.
    First of all what is the best approach:
    negative z axis = bed moves (up) towards the extruders and the probe, should I use the probe as Z0 and the opto switch (in + direction Z400) for homing?
    positive z axis = bed moves (up) towards the extruders and the probe, should I then use the opto switch as origin Z0 and probe as Z400?
    And second how do I set it up and where in the config.g, homeall.g, homey.g, homex.g and homez.g?
    Hope that someone understand what I mean?!
    You probably think it simple but I am stuck...
    Best regards

  • administrators

    The usual practice if you have a Z probe is to use it for Z homing. To do that you need to lower the bed a few mm, move the head to the preferred XY position for Z homing (typically the centre of the bed), then do a G30 command. This is what the standard homez.g file does. The homeall.g file also needs to home Z at the end using G30.

    If you want to use your opto switch for Z homing instead, see the section in https://duet3d.com/wiki/Configuring_RepRapFirmware_for_a_Cartesian_printer#Homing_files about using a Z microswitch.

  • Hi David and thanks!
    I almost got it working, x and y axis homes fine, the z axis also homes ok. When I home them one after another (x y z) all goes fine, until the probe signals, then the z axis starts to lower the bed all the way down to 380.
    When I "Home all" all goes fine, and the z axis stops just under the extruders, but when I want to lower the bed with the head control (just 1mm) it starts to lower the bed all the way down again…
    Here is my Config.g:

    [c]; CoreXY sample config file for dc42 Duet firmware

    M111 S0 ; Debug off
    M550 PMyCoreXY ; Machine name (can be anything you like)
    M551 Preprap ; Machine password (used for FTP connections)
    M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED ; MAC Address
    ;*** Adjust the IP address and gateway in the following 2 lines to suit your network
    M552 P0.0.0.0 ; IP address (0 = use DHCP)
    M554 P192.168.1.1 ; Gateway
    M553 P255.255.255.0 ; Netmask
    M555 P2 ; Set output to look like Marlin
    M575 P1 B57600 S1 ; Comms parameters for PanelDue

    ; Machine configuration
    M569 P0 S1 ; Drive 0 goes forwards (change to S0 to reverse it)
    M569 P1 S0 ; 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
    ; If you use an endstop switch for Z homing, change Z0 to Z1 in the following line, and see also M558 command later in this file
    M574 X1 Y1 Z0 S1 ; set endstop configuration (X and Y and endstops only, at low end, active high)
    M667 S1 ; set CoreXY mode
    M92 X80 Y80 Z800 ; Set axis steps/mm
    M92 E417:417 ; Set extruder steps/mm
    M906 X800 Y800 Z800 E800 ; Set motor currents (mA)
    M201 X800 Y800 Z25 E1000 ; Accelerations (mm/s^2)
    M203 X15000 Y15000 Z500 E3600 ; Maximum speeds (mm/min)
    M566 X600 Y600 Z30 E20 ; Maximum jerk speeds mm/minute
    M208 X360 Y380 Z-380 ; set axis maxima (adjust to suit your machine)
    M208 X-8 Y0 Z-0.5 S1 ; set axis minima (adjust to make X=0 and Y=0 the edges of the bed)
    G21 ; Work in millimetres
    G90 ; Send absolute coordinates…
    M83 ; ...but relative extruder moves

    ; Z probe
    M558 P1 X0 Y0 Z1 ; Analog Z probe, also used for homing the Z axis
    G31 Z1.20 P500 ; Set the probe height and threshold (put your own values here)
    ; The following M557 commands are not needed if you are using a bed.g file to perform bed compensation
    ;*** Adjust the XY coordinates in the following M557 commands to suit your build and the position of the Z probe
    M557 P0 X60 Y0 ; Four...
    M557 P1 X60 Y165 ; ...probe points...
    M557 P2 X222 Y165 ; ...for bed...
    M557 P3 X222 Y0 ; ...levelling
    ;M557 P4 X141 Y82.5 ; 5th probe point for levelling

    ; Thermistors and heaters
    ;*** If you have a Duet board with 1K thermistor series resistors, change R4700 to R1000 to the following M305 commands
    ; You can also use S and B parameters to define the parameters of the thermistors you are using
    M305 P0 T100000 B3950 R4700 H0 L0 ; Put your own H and/or L values here to set the bed thermistor ADC correction
    M305 P1 R4700 H0 L0 ; Put your own H and/or L values here to set the first nozzle thermistor ADC correction
    M305 P2 R4700 H0 L0 ; Put your own H and/or L values here to set the second nozzle thermistor ADC correction
    M301 H1 P10 I0.10 D100 T0.50 S1.0 ; PID settings for extruder 0
    M301 H2 P10 I0.10 D100 T0.50 S1.0 ; PID settings for extruder 1
    M570 S120 ; Increase to allow extra heating time if needed

    ; Tool definition
    M563 P0 D0 H1 ; tool 0 uses extruder drive 0 and heater 1
    G10 P0 S0 R0 X-12 Y0 ; set tool 0 temperatures and offsets
    M563 P1 D1 H2 ; tool 1 uses extruder drive 1 and heater 2
    G10 P1 S0 R0 X12 Y0 ; set tool 1 temperatures and offsets

    ; Old Tool definition
    ;M563 P0 D0 H1 ; Define tool 0
    ;G10 P0 S0 R0 ; Set tool 0 operating and standby temperatures
    ;*** If you have a dual-nozzle build, un-comment the following 3 lines
    ;M563 P1 D1 H2 ; Define tool 1
    ;G10 P1 S0 R0 ; Set tool 1 operating and standby temperatures

    ;*** If you are using axis compensation, put the figures in the following command
    M556 S78 X0 Y0 Z0 ; Axis compensation here
    T0 ; select first hot end[/c]

    And homeall.g:

    [c]; homeall file for use with dc42 Duet firmware on CoreXY printers
    ; This file assumes the endstop switches are at the low end of each axis.
    ; Reverse the X and Y movement for high-end switches.
    ; Adjust the bed upper and lower limits in config.g (M208 commands) to get the correct homing positions

    G91 ; relative mode
    G1 S1 X-360 Y-380 F3000 ; course home X or Y
    G1 S1 X-360 ; course home X
    G1 S1 Y-380 ; course home Y
    G1 X4 Y4 F600 ; move away from the endstops
    G1 S1 X-10 ; fine home X
    G1 S1 Y-10 ; fine home Y

    ; If you are using a microswitch for Z homing, insert similar code for the Z axis here,
    ; but use lower feed rates suitable for your Z axis.

    G90 ; back to absolute mode

    ; If you homed the Z axis using an endstop switch, you can insert a G92 command here to correct the height.

    ; The following code assumes you are using a Z probe to do Z homing. Remove it if you are using a microswitch.
    ; Adjust the XY coordinates in the following to place the Z probe over a suitable spot,
    ; preferably near the centre of the bed if your Z probe supports that

    G1 X180 Y190 F2000
    ; This file leaves the head at the zprobe trigger height so that you can slip a piece of paper under it and then do G0 Z0 to check the height.
    ; If you prefer to send the printer to X0Y0Z0, un-comment the following lines
    ;G1 X0 Y0 F5000
    ;G1 Z0[/c]

    And homez.g:

    G1 Z5 F1600
    G1 X180 Y190
    G1 Z0 F200[/c]

    I dont think it should lowering the bed all the way down after the single homing of the z axis.
    And I cant understand why it goes all the way down when trying to just nudge it down a little bit after "Home all".
    Wonder what I am doing wrong?
    Best regards

  • And one more thing, sorry…
    I dont seem to be able to change the setting by typing and sending it from the Duet Web Control. I always have to take out the sd-card and change setting in Notepad++ instead..
    No fun..
    Regards once again

  • What web browser are you using? I found things don't work properly in Safari in relation to saving files. I haven't tried edge/IE, but I know Firefox for sure works on OS X and Linux and Chrome works on OS X. Those two are your best bets.

  • administrators

    If it's lowering the bed all the way, then it sounds like your Z axis is reversed. The Z coordinate is the distance between the nozzle and the bed. So movement in the +Z direction should move the bed down.

  • @Nyl0cke I am on PC (win10) and using Firefox…
    @David, Ahh ok maybe that's why I had to change the direction to negative for the value that the x and y axis should lower before homing those axis. Will try it tomorrow.
    By the Z coordinate you mean the value "G31 Z1.20 P500 ; Set the probe height and threshold (put your own values here) , or?
    But should it lower it all the way down to +380, when after "Home all" I e.g click on move Z axis +10 in DWC?

  • administrators

    When the G30 command is executed, it should raise the bed until the Z probe triggers. I think you have the Z axis reversed, which is why it is lowering the bed instead, waiting for the probe to trigger - but of course it never does.

  • It worked!! Thanks a lot David!
    Now I probably will find other things to ask about 😉
    Still cant send g-codes from DWC though but its not a biggie…

  • administrators

    I've been unable to send gcodes from the DWC console when the DWC and firmware versions were incompatible. The current versions are firmware 1.15c and DWC 1.12. Look on the Settings page of DWC to check which versions you have.

  • Firmware is 1.15c, dont know how to check dwc version but since its a new installation for me so I assume it is 1.12 (the latest?!)

  • administrators

    The General tab of the Settings page of DWC gives all the firmware and DWC versions.

  • Ahh, blind as a bat..
    Firmware 1.15c, webinterface HTML: 1.11, JS: 1.11
    Ok updating to 1.12 then…


Looks like your connection to Duet3D was lost, please wait while we try to reconnect.