05 Firmware Configuration

Locating Probe Offsets

You need to establish the probe position relative to the nozzle in all firmware variants. The following image showing the probe location is used in the examples below.

Another good resource for determining the probe offsets is discussed on this Duet dozuki page.

Duet 2 / RepRap Firmware 2.x

Probe is configured as P5 (from RepRapFirmware 1.14) as a normally closed switch for bed probing between the IN and GND pins of the Z-probe connector (Duet 0.8.5 and Duet 2 WiFi).

https://duet3d.dozuki.com/Wiki/Gcode#Section_M558_Set_Z_probe_type

; Euclid Probe Settings  
M558 P5 H8 F300 T9000 A1 S.01     ; set Z probe type to P5 for NC switch
                                  ; H dive height of 8mm, F300 probing speed 6mm/sec, 
                                  ;T9000 travel speed 150mm/sec,   
                                  ; A number of probes 1, S0.01 max tolerance of 0.01 
;
G31 K0 P500 X-16.4 Y-29.4 Z0.90   ; CHECK for LOOSE things first! set Z probe trigger value, offset and trigger
                                  ; height.  Higher numbers makes nozzle closer to bed  
                                  ; switch plunger is 16.4mm to the LEFT and 29.27 in FRONT of the nozzle
                                  ; switch triggers 0.90mm BELOW nozzle
                                  ; https://duet3d.dozuki.com/Wiki/Test_and_calibrate_the_Z_probe#Section_Fine_tuning_the_trigger_height
                                  ; baby stepping - if you have to move the nozzle closer to the bed, 
                                  ; increase the G31 Z
                                  ; if you have to move the nozzle away from the bed, decrease the G31 Z 
                                  ; value by the amount of baby stepping used.
;

Narrative is written in general terms, using gcode commands. The process is basically starting with a known Z probe offset and then adding/subtracting the difference of the true and relative positions. Figure on doing it twice- once cold and then hot if you want more accurate height.

  1. Assign an initial Z probe offset SMALLER than you will actually use to stop the probe HIGHER off the bed.
    • In RRF G31 … Z2.5 as example
  2. Home Z as you normally do.
  3. Move the carriage to a point on the bed where its going to be easy to access with a strip of paper / feeler gauge.
    • G1 X100 Y100
      • 20# bond paper is about 0.1mm, or 0.004 inches
      • 0.2mm is ideal, 0.008in is close (0.207mm)
      • Stainless steel feeler gauges are recommened even though they cost a little more because the stainless steel is non-magnetic. Examples-
      • measure any long and thin object you can manupulate. bare PCB boards are reliably 1.6mm thick. Paper matchbook covers are 0.013 inch. or 0.35mm thick. Credit cards are around 0.03 inches, or 0.762mm thick. Anything will work as long as you can measure and verify the thickness.
  4. Creep the nozzle down to touch it off on the feeler gauge, then use G92 to set the height. If you have a display or machine console, use that to save yourself some work. Otherwise, issue terminal commands to jog down-
    G91 ; set the machine into relative coordinates mode
    G1 Z-0.05 ; move the bed UP 0.05mm
    • repeat the small Z motion until you just touch your feeler, adjust the move distance to suit.
    • You will feel a slight drag on the feller when the nozzle is touching it.
    • Once you touch off the nozzle to the feeler gauge, set the machine’d Z position to that height.
      G92 Z0.2 ; set the Z axis to be the value of the feeler gauge
      ; 0.2 in this example
  5. Manually execute your deployprobe.g macro to pick up the probe. Move the carriage back to the spot you were at before.
    M401 P0 G12 X100 Y100
  6. Use a single probe commant to report the probe position when it triggers. Pay attention to the G-code options so at to no reset the Z or probe height.
    G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered ; do not adjust the Z coordinate, just report the machine height at which the probe was triggered.
    That reported value is the best starting point to set your Z-probe offset for your system! You wil have to fine tune this a bit either by redoing the procedure hot, or using baby-stepping when you print. I find its easier to print a single 0.45mm wide perimeter, 0.3mm high around the bed and measure it to finally adjust the Z probe height.
  7. You can reprobe the SAME spot a few times and average the values: G30 S-1 for example in RRF to probe and report the trigger height. The result is the Z probe offset value to use in your config. In this next example line, 2.956
    G31 ...Z2.956
  • If you really want to get fancy, you can use a g-code macro like this to have the system do it for you probing say 10 points and doing the math.

findZprobeoffset.g

    ; ***
    ; findZprobeoffset.g
    ; ***
    M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
    G28 X Y
    M401
    G28 Z
    G1 X100 Y100 Z12   ; travel to X,Y of probe point 12mm above bed
    G30 P0 Z-9999
    G30 P1 Z-9999
    G30 P2 Z-9999
    G30 P3 Z-9999
    G30 P4 Z-9999
    G30 P5 Z-9999
    G30 P6 Z-9999
    G30 P7 Z-9999
    G30 P8 Z-9999
    G30 P9 Z-9999 S-1
    M402

RepRap Firmware 3.x

P5 selects normally closed switch for bed probing between the IN and GND pins of the Z-probe connector.
The pull-up resistor on the Z probe input is disabled by default. If using Duet 2 hardware, running RRF3, enable it by prefixing the input pin (C parameter) with the ^ character.

We have not tested the Euclid Probe on Duet3 hardware in-house yet. Users have reported that the use of a pull-up resistor is not is not needed when configuring Euclid Probe with Duet3 hardware.

; Euclid Probe Settings RRF 3.x on Duet2
; 
; Endstop type S0 (active low switch) is no longer supported in M574 commands. 
; Instead, use type S1 and invert the input by prefixing the pin name with '!'.
; example to have multiple endstops on leadscrews
; M574 Z1 S1 P"zstop+e1stop" ; configure active-high endstops for low end on Z via pins zstop and e1stop
; Make sure that the two endstops are defined in the same order in the M574 command 
; as the corresponding Z motors in your M584 command. 

M574 Z1 S2                                       ; configure Z-probe endstop for low end on Z

;
M558 K0 P5 C"^zprobe.in" H8 F300 60 T9000 A3 S0.01      
                                              ; K0 for probe 0, P5 for NC switch, C for input pin, 
                                              ; ^ for enabling the native pullup resistor on Duet 2 
                                              ; hardware running RRF3  
                                              ; H dive height of 8mm, F300 probing speed 6mm/sec, 
                                              ; T9000 travel speed 150mm/sec,   
                                              ; A3 number of probes 1, S0.01 max tolerance of 0.01 

;
G31 K0 P500 X-16.4 Y-29.4 Z0.90               ; CHECK for LOOSE things first! set Z probe trigger 
                                              ; value, offset and trigger height.  Higher numbers
                                              ; makes nozzle closer to bed
                                              ; switch plunger is 16.4mm to the LEFT and 29.27mm in
                                              ; FRONT of the nozzle. Switch triggers 0.9mm BELOW nozzle
                                              ; https://duet3d.dozuki.com/Wiki/Test_and_calibrate_the_Z_probe#Section_Fine_tuning_the_trigger_height
                                              ; if you have to move the nozzle away from the bed, 
                                              ; decrease the G31 Z value by the amount of baby stepping used.

Narrative is written in general terms, using gcode commands. The process is basically starting with a known Z probe offset and then adding/subtracting the difference of the true and relative positions. Figure on doing it twice- once cold and then hot if you want more accurate height.

Narrative is written in general terms, using gcode commands. The process is basically starting with a known Z probe offset and then adding/subtracting the difference of the true and relative positions. Figure on doing it twice- once cold and then hot if you want more accurate height.

  1. Assign an initial Z probe offset SMALLER than you will actually use to stop the probe HIGHER off the bed.
    • In RRF G31 … Z2.5 as example
  2. Home Z as you normally do.
  3. Move the carriage to a point on the bed where its going to be easy to access with a strip of paper / feeler gauge.
    • G1 X100 Y100
      • 20# bond paper is about 0.1mm, or 0.004 inches
      • 0.2mm is ideal, 0.008in is close (0.207mm)
      • Stainless steel feeler gauges are recommened even though they cost a little more because the stainless steel is non-magnetic. Examples-
      • measure any long and thin object you can manupulate. bare PCB boards are reliably 1.6mm thick. Paper matchbook covers are 0.013 inch. or 0.35mm thick. Credit cards are around 0.03 inches, or 0.762mm thick. Anything will work as long as you can measure and verify the thickness.
  4. Creep the nozzle down to touch it off on the feeler gauge, then use G92 to set the height. If you have a display or machine console, use that to save yourself some work. Otherwise, issue terminal commands to jog down-
    G91 ; set the machine into relative coordinates mode
    G1 Z-0.05 ; move the bed UP 0.05mm
    • repeat the small Z motion until you just touch your feeler, adjust the move distance to suit.
    • You will feel a slight drag on the feller when the nozzle is touching it.
    • Once you touch off the nozzle to the feeler gauge, set the machine’d Z position to that height.
      G92 Z0.2 ; set the Z axis to be the value of the feeler gauge
      ; 0.2 in this example
  5. Manually execute your deployprobe.g macro to pick up the probe. Move the carriage back to the spot you were at before.
    M401 P0 G12 X100 Y100
  6. Use a single probe commant to report the probe position when it triggers. Pay attention to the G-code options so at to no reset the Z or probe height.
    G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered ; do not adjust the Z coordinate, just report the machine height at which the probe was triggered.
    That reported value is the best starting point to set your Z-probe offset for your system! You wil have to fine tune this a bit either by redoing the procedure hot, or using baby-stepping when you print. I find its easier to print a single 0.45mm wide perimeter, 0.3mm high around the bed and measure it to finally adjust the Z probe height.
  7. You can reprobe the SAME spot a few times and average the values: G30 S-1 for example in RRF to probe and report the trigger height. The result is the Z probe offset value to use in your config. In this next example line, 2.956
    G31 ...Z2.956
  • If you really want to get fancy, you can use a g-code macro like this to have the system do it for you probing say 10 points and doing the math.

findZprobeoffset.g

    ; ***
    ; findZprobeoffset.g
    ; ***
    M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
    G28 X Y
    M401
    G28 Z
    G1 X100 Y100 Z12   ; travel to X,Y of probe point 12mm above bed
    G30 P0 Z-9999
    G30 P1 Z-9999
    G30 P2 Z-9999
    G30 P3 Z-9999
    G30 P4 Z-9999
    G30 P5 Z-9999
    G30 P6 Z-9999
    G30 P7 Z-9999
    G30 P8 Z-9999
    G30 P9 Z-9999 S-1
    M402

Configuring Euclid Probe is similar to defining and endstop switch. The following is an example of the probe section in the configuration file.

[probe]
##    Euclid Probe
pin: ^PA0
x_offset: 0
y_offset: 25.0
z_offset: 9.5
speed: 5
samples: 2
samples_result: average
sample_retract_dist: 3.0
samples_tolerance: 0.0075
samples_tolerance_retries: 3

Marlin

Marlin configuration is highly dependent on the controller board used. the following is a general outline of the hardware definition only. The probe deployment and retraction, also part of the Configuration.h file is addressed in the next page.

//===========================================================================
//============================== Endstop Settings ===========================
//===========================================================================
// @section homing

// Specify here all the endstop connectors that are connected to any endstop or probe.
// Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
...
#define USE_ZMAX_PLUG // ENABLE IF USING Z_MAX FOR PROBE
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
...
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
// @section probes

//
// See https://marlinfw.org/docs/configuration/probes.html
//

/**
 * Enable this option for a probe connected to the Z-MIN pin.
 * The probe replaces the Z-MIN endstop and is used for Z homing.
 * (Automatically enables USE_PROBE_FOR_Z_HOMING.)
 */
// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // 

...

/**
 * Z_MIN_PROBE_PIN
 *
 * Define this pin if the probe is not connected to Z_MIN_PIN.
 * If not defined the default pin for the selected MOTHERBOARD
 * will be used. Most of the time the default is what you want.
 *
 *  - The simplest option is to use a free endstop connector.
 *
 *  - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin:
 *    - For simple switches connect...
 *      - normally-closed switches to GND and D32.
 *      - normally-open switches to 5V and D32.
 */
#define Z_MIN_PROBE_PIN PA4 // Pin 32 is the RAMPS default
                            // Our Ender-3 test printer with Creality 4.2.2 controller
                            // uses the filament runout sensor connector 

The best way we have found to deploy Euclid Probe under Marlin is with the Allen Probe scheme. The predefined sequence of points and movements to deploy and retract work well natively without any additions. Marlin has a built in probe detect function- if the probe does not properly couple upon deploy, the system will halt.
Following is an example configuration for the step-wise Allen key movements. Images illustrating the movements at the end.

//
// For Z_PROBE_ALLEN_KEY see the Delta example configurations.
//
// DJP EDIT ADD 
/**
 * Allen key retractable z-probe as seen on many Kossel delta printers - https://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
 * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
 */
#define Z_PROBE_ALLEN_KEY

#if ENABLED(Z_PROBE_ALLEN_KEY)
  // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
  // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.

//DEPLOY PROBE
  #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 55, 30, 10 }    // ENDER3 MOVE TO DOCK SIDE ADJACENT 
//  #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 50, 0, 10 }  // ENDER5 MOVE TO DOCK SIDE ADJACENT 
  #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE (XY_PROBE_FEEDRATE)*1

  #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 55, 0, 2 }    //  ENDER3 MOVE DOWN TO COUPLE PROBE 
//  #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 10, 0, 10 }  // ENDER5 MOVE TO DOCK SIDE ADJACENT LEFT SIDE DOCK
  #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_FEEDRATE)*1

  #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 20, 0, 2 }    //  ENDER3 MOVE PROBE OUT OF DOC 
//  #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0, 0, 10 }  // ENDER5 MOVE OVER DOCK TO COUPLE PROBE 
  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_PROBE_FEEDRATE)/4

  #define Z_PROBE_ALLEN_KEY_DEPLOY_4 { 20, 0, 15.0 }  // ENDER3 RAISE PROBE ABOVE DOCK SLOWLY
//  #define Z_PROBE_ALLEN_KEY_DEPLOY_4 { 0, 50, 10 }  // ENDER5 MOVE +Y TO CLEAER 
  #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE (XY_PROBE_FEEDRATE)/4

// RETRACT PROBE
  #define Z_PROBE_ALLEN_KEY_STOW_1 { 25, 0, 15.0 }    // ENDER3 MOVE THE PROBE TO THE XY READY POSITION
//  #define Z_PROBE_ALLEN_KEY_STOW_1 { 0, 50, 10 }    // ENDER5 MOVE TO PROBE IN FRONT OF DOCK ENTRY LOCATION
  #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE (XY_PROBE_FEEDRATE)*1

  #define Z_PROBE_ALLEN_KEY_STOW_2 { 25, 0, 2.0 }     // ENDER3 LOWER PROBE TO DOCK ENTRY ELEVATION
//  #define Z_PROBE_ALLEN_KEY_STOW_2 { 0, 0, 10 }     // ENDER5 MOVE PROBE INTO TO DOCK
  #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_FEEDRATE)/2

  #define Z_PROBE_ALLEN_KEY_STOW_3 { 55, 0, 2.0 }     // ENDER3 STOW PROBE AND SWIPE OFF
//  #define Z_PROBE_ALLEN_KEY_STOW_3 { 0, 0, 10 }     // ENDER5 STOW PROBE AND SWIPE OFF
  #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_FEEDRATE)/4

  #define Z_PROBE_ALLEN_KEY_STOW_4 { 75, 0, 2.0 }     // ENDER3 STOW PROBE AND SWIPE OFF
//  #define Z_PROBE_ALLEN_KEY_STOW_4 { 50, 0, 10 }    // ENDER5 STOW PROBE AND SWIPE OFF
  #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_FEEDRATE)*2
Example Ender5 Deploy Movements
Example Ender5 Stow Movements
Ender3 Deploy Movements

Smoothie ware does a pretty good writeup on setting up an NC switch in its docs- smoothiware.org/zprobe

Add the following to the smoothie config file :

gamma_min_endstop            nc                 # normally 1.28. Change to nc to prevent conflict, not needed on Azteeg X5

zprobe.enable                true               # set to true to enable a zprobe
zprobe.probe_pin             1.28^             # pin probe is attached to if NO add !
zprobe.slow_feedrate         5                  # mm/sec probe feed rate
#zprobe.debounce_ms          1                  # set if noisy
zprobe.fast_feedrate         100                # move feedrate
zprobe.probe_height          5                  # how much above bed to start probe NB only needed for G32 on delta
zprobe.return_feedrate       0                  # feedrate after a probe, default 0 is double of slow_feedrate (mm/s)
zprobe.max_z                 200                # maximum default travel for the probe command, will use gamma_max if not defined

Next Step: Probe Deploy & Retract Macros

⇦ Previous Step: Locating & Installing the Probe Dock