Dual Z bed Levelling and strange behavior



  • Hi everybody,

    I have set up Dual Z bed leveling with Duet IR-Probe on my CoreXY. But anyways I have some strange behavior while leveling Z.

    So for testing I repeated the leveling process several times and everytime i get the message "Leadscrew adjustments made". For my understanding after leveling Z once it should stay leveled as long as I don't turn off the motors. Here are the Results of my testing from the G-Code console:

    19:41:46G28 Z
    Leadscrew adjustments made: 0.438 0.441, points used 2, deviation before 0.439 after 0.000
    19:41:24G28 Z
    Leadscrew adjustments made: 0.438 0.438, points used 2, deviation before 0.438 after 0.000
    19:40:59G28 Z
    Leadscrew adjustments made: 0.432 0.441, points used 2, deviation before 0.437 after 0.000
    19:40:37G28 Z
    Leadscrew adjustments made: 0.409 0.475, points used 2, deviation before 0.443 after 0.000
    19:40:10G28
    Error: Some computed corrections exceed configured limit of 4.00mm: -5.092 -5.020
    19:39:32Connection established!

    Also the computed deviations don't seem to be right?

    My configis as follows:

    Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
    Firmware Electronics: Duet WiFi 1.02 or later
    Firmware Version: 2.02(RTOS) (2018-12-24b1)
    WiFi Server Version: 1.22
    Web Interface Version: 1.22.6

    Also find attached my Setup files from the duet. Any Help is welcome and let me know if you need more information.

    3_1565027946196_config.g 2_1565027946196_homeall.g 1_1565027946194_homez.g 0_1565027946194_bed.g



  • your M671 is commented out in the config.g. why did you do that?

    your bed does not contain any G30 statements.



  • Helo Veti,

    thanks for your reply. M671 has moved to home.g and homeall.g. Can I put it in bed.g if I also want to define mesh for compensation?

    I thought bed.g only is called with G32?

    Also I don't understand why the deviation before is 0.438 when the probe is triggered on both sites at 0.438???



  • You need the G30 command to do the actual compensation.
    Since you commented them out the compensation will not actually happen.



  • The G30 command is also stored in home.g and homeall.g. When one of those is called the compensation is called. Anyway the problem also is there. Why it compensates every time also when I run the command several times in a row?

    At one point there should be nothing to compensate?

    Also, if you look at my tests in all cases the deviation seems to be miscalculated?



  • https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors

    The value of the S parameter on the final G30 command in bed.g must equal the number of Z motors.

    Please read the Section "How it works"

    At the moment you are complaining about your method now working, but are refusing to follow the manual.



  • I have the same question but have followed the instructions (as far as i'm aware).
    Here is my config.g:

    ; Stepper Drives
    M569 P0 S1 ; Drive 0 runs forwards, active low enable, (X)
    M569 P1 S1 ; Drive 1 runs forwards, active low enable, (Y)
    M569 P2 S0 ; Drive 2 runs backwards, active low enable, (Z1)
    M569 P3 S1 ; Drive 3 runs forwards, active low enable, (E0)
    M569 P4 S0 ; Drive 4 runs backwards, active low enable, (Z2 in the E1)

    ; Dual Z
    M584 X0 Y1 Z2:4 E3 ; Dual Z motors Z and E3 (extruder1 drive). Make sure Z drive is L/H stepper and E3 is R/H stepper
    ; Leadscrew positions: The measurement is taken from X=0, Y=0. Therefore X will be negative, Y positive and middle of bed = 160
    M671 X-100:415 Y160:160 S2.0 ; Leadscrews at middle left and middle right (S0 is correction value)

    ;Drive settings
    M350 X16 Y16 Z16 E16 I1 ; Configure microstepping with interpolation
    M92 X80 Y80 Z400 E96 ; Set steps per mm for 16 microsteps
    ;M350 X32 Y32 Z32 E128 ; Use to setup new microstepping (dont delete default 16 microstepping)
    M566 X600.00 Y600.00 Z60.00 E300.00 ; Set maximum instantaneous speed changes (mm/min) - Jerk
    M203 X9000.00 Y9000.00 Z600.00 E6000.00 ; Set maximum speeds (mm/min)
    M201 X500.00 Y500.00 Z120.00 E5000.00 ; Set accelerations (mm/s^2) - print moves
    M906 X1100 Y1100 Z1100 E1300 I30 ; Motor currents - mine are 1.68amp, 85% = 1.42
    M84 S30 ; Set idle timeout

    ; Axis Limits
    M208 X-15 Y-12 Z0 S1 ; Set axis minima (adjust to make X=0 and Y=0 the edges of the bed)
    M208 X310 Y310 Z380 S0 ; Set axis maxima (adjust to suit your machine)

    ; Endstops
    M574 X1 Y1 S0 ; Set active low endstops for X and Y
    M581 Z1 S1 T0 C0 ; Set Z1 endstop as an e-stop for Z protection if Z probe fails when probing the bed.

    ; Filament Run Out Sensor
    M591 D0 P1 C4 S1 ; Filament runout Sensor for Extruder E0 on E1 Endstop input P1 = signal HIGH.

    ; Z-Probe and mesh grid
    M574 Z1 S2 ; Set endstops controlled by probe
    ; M558: the P is probe type, H is dive height-the height before probing, A is max number of probing each point, S is tollerance when multi-probing.
    ;M558 P1 H3 F120 A10 S0.03 I0
    M558 P1 H5 F120 T6000 ; Set Z probe type to unmodulated and the dive height + speeds
    ; G31: the P is the reported Z value when triggered. X,Y are offset coordinates. Z is trigger height, you can decrease value if nozzle is too close
    ; or increase if too far away.
    G31 P500 X-30 Y-5 Z1.9

    ; Mesh Grid
    ; 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 X10:280 Y20:280 S50 ; Define small mesh grid
    ;M557 X10:280 Y10:280 S20 ; Define large mesh grid

    ; Heaters
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0 (bed)
    M143 H0 S90 ; Set temperature limit for heater 0 to 90C
    M305 P1 T92000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1 (nozzle)
    M143 H1 S280 ; Set temperature limit for heater 1 to 250C
    M307 H1 A270.4 C96.4 D7.6 S1.00 V12.4 B0 ; Autotune result for hotend
    M307 H0 A227.6 C756.1 D3.3 S1.00 V12.6 B0 ; Autotune result for bed

    ;Expansion pins
    M307 H2 A-1 C-1 D-1 ; Make heater2 on extruder2 available and use it for pwm led lighting

    ; Fans
    M106 P0 S0 H-1 C"Part Cooling" ; Set fan 0 value (Part Cooling)
    ;M106 P1 S1 I0 F500 H1 T45 ; Set fan 1 (hotend), PWM signal inversion and frequency. Thermostatic control is turned on
    M106 P1 S255 I0 F259 L125 H1 T60:140.
    ; Below 60 deg C the fan is off. At 60 deg C the fan will come on at 50% then will ramp up to full full speed between 60 and 140 deg C and remain at 100% for any ; temperature above 140

    ; Set fan 2 value (Duet mcu), PWM signal inversion and frequency. Thermostatic control is turned on, fan comes on at 40 deg and reaches full speed at 65 deg
    M106 P2 F500 T40:65 H100:101:102

    ;CPU Temperature Calibration
    M912 P0 S-9.5

    ; Tools
    M563 P0 D0 H1 S"Extruder" ; Define tool 0
    G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
    G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C

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

    ; Custom settings

    Here is my bed.g :

    G28 ; home
    G30 P0 X10 Y160 Z-99999 ; probe near first leadscrew
    G30 P1 X260 Y160 Z-99999 S2 ; probe near last leadscrew and calibrate
    G1 Z5 ; Lift Z
    G1 X160 Y160 ; Go to centre of bed
    G30 ; Do a single probe to re-establish Z=0

    Here is the console output from 3 consecutive levelling attempts :

    10:35:53: M292: Leadscrew adjustments made: 0.038 0.035, points used 2, deviation before 0.037 after 0.000
    10:34:29: M292: Leadscrew adjustments made: 0.022 0.032, points used 2, deviation before 0.026 after 0.000
    10:33:02: M292: Leadscrew adjustments made: 0.034 0.021, points used 2, deviation before 0.028 after 0.000
    10:31:51: Connection established!
    10:31:51: Page Load complete!

    So, my bed is never completely level?

    I did a probe repeatability test in the probed area used in bed.g and here are the results for 5 probes on the left and 5 probes on the right :

    10:57:59: : Stopped at height 1.587 mm
    10:57:55: : Stopped at height 1.587 mm
    10:57:52: : Stopped at height 1.587 mm
    10:57:48: : Stopped at height 1.585 mm
    10:57:45: : Stopped at height 1.585 mm
    10:57:36: : Stopped at height 1.580 mm
    10:57:33: : Stopped at height 1.580 mm
    10:57:29: : Stopped at height 1.585 mm
    10:57:26: : Stopped at height 1.585 mm
    10:57:22: M98 P""0:/macros/Bed Levelling/probe_repeatability_test"": Stopped at height 1.580 mm
    10:56:41: G28
    10:55:53: Message Log cleared!

    I wonder if this is causing random bed adhesion issues when printing?



  • Hello Chas and welcome to this topic.
    Also your deviations make no sense for me.

    For example:

    10:35:53: M292: Leadscrew adjustments made: 0.038 0.035, points used 2, deviation before 0.037 after 0.000

    For my understanding the first point triggers at 0.038 and the second at 0.035 so in my opinion the deviation is 0.038 - 0.035 = 0.003 and not 0.037. Or do i get something wrong?



  • Hi RYNR,

    Yes, I agree and I would expect at some point for the trigger points to be the same and therefore indicate a level bed.



  • Right, so what is curios should we be the only two with this problem or is there e better headline for this topic?



  • @chas2706 said in Dual Z bed Levelling and strange behavior:

    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0 (bed)
    M305 P1 T92000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1 (nozzle)

    this will most likely be incorrect. you need to replace the beta value with the value for your thermistor



  • @Veti how this relates to the levelling problem?



  • it is not but its something you should look into



  • Thanks for pointing that one out Veti.
    I will look into it at a later date.

    My main reason to include the config.g though was to point out that my M671 command comes after my M584 command and any M667 or M669 command as stated in the "Bed levelling using multiple Z motors" guide and everything else regarding the set up is correct.



  • @rynr The first two figures are the adjustments which were made, not the height of the two probe points, so you can't view them as A - B should equal the third number.

    The code which drives the bed adjustment is kind of complicated. I can understand what it does, but how it does it is complicated enough to make my brain hurt. 🙂



  • @grizewald Thanks for that but it still does not explain why adjustments are always made no matter how many consecutive times you carry out a levelling procedure.



  • @chas2706 I can't answer that I'm afraid.

    Out of curiosity, I created a macro to see how repeatable my lead screw levelling is. The macro looks like this:

    M929 P"tiltlog.txt" S1
    G28
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Phomez.g
    M98 Pjogy10.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Phomez.g
    M98 Pjogy50.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Phomez.g
    M98 Pjogx10.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Phomez.g
    M98 Pjogx50.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Pfixtilt.g
    M98 Phomez.g
    M929 S0
    

    The macros it calls are four simple macros to jog the head either 10 or 50mm in X or Y directions then return to where it was before. The fixtilt.g and homez.g macros are used in my homing routines.

    So, the test starts by homing all axes. My homeall.h includes a call to fixtilt.g. Then, it does three calls to fixtilt.g and finally re-homes Z. I repeat this four times, using one of the jog macros between each set of three tilt corrections. Everything gets logged to a file.

    The fixtilt.g macro is just two lines:

    G30 P0 X0 Y233 Z-99999          	; probe near left lead screw
    G30 P1 X290 Y233 Z-99999 S2 F1.1  	; probe near right lead screw and correct with two motors and fudge factor of 1.1
    

    And homez.g looks like this:

    ; homez.g
    ; called to home the Z axis
    ;
    
    G91                 ; relative positioning
    G1 Z5 F360 S2       ; lift Z relative to current position
    G90                 ; absolute positioning
    G1 X145 Y233 F6000  ; go to homing probe point
    G30                 ; home Z by probing the bed
    
    ; Lift Z again after probing
    
    G91                 ; relative positioning
    G1 S2 Z5 F360       ; lift Z relative to current position
    G90                 ; absolute positioning 
    

    For the sake of completeness, my config.g is below:

    ; Configuration file for Duet WiFi (firmware version 1.21)
    ; executed by the firmware on start-up
    ;
    ; 
    
    ; General preferences
    G90                                        ; Send absolute coordinates...
    M83                                        ; ...but relative extruder moves
    
    M667 S1                                    ; Select CoreXY mode
    
    ; Network
    M550 PV-Core                               ; Set machine name
    M551 Preprap                               ; Set password
    M552 S1                                    ; Enable network
    M587 S"****" P"****"                       ; Configure access point. 
    M586 P0 S1                                 ; Enable HTTP
    M586 P1 S0                                 ; Enable FTP
    M586 P2 S0                                 ; Enable Telnet
    
    ; Drives
    M584 X0 Y1 Z2:4 E3 P3                       ; Z on drivers 2 and 4 (Z and E1)
    M671 X-46:346 Y233:233 S2                   ; Set lead screw positions and set max correction to 2mm
    M569 P0 S0                                  ; X Drive goes backwards (1 = forwards, 0 = backwards)
    M569 P1 S0                                  ; Y Drive goes backwards
    M569 P2 S0                                  ; Z Drive goes backwards
    M569 P3 S0                                  ; E0 Drive goes backwards
    M569 P4 S0                                  ; E1 (Z2) Drive goes backwards
    M350 X16 Y16 Z16 E16 I1                     ; Configure microstepping with interpolation
    M92 X80.00 Y80.00 Z400.00 E411.00           ; Set steps per mm
    M566 X1200.00 Y1200.00 Z100.00 E3600.00     ; Set maximum instantaneous speed changes (mm/min)
    M203 X18000.00 Y18000.00 Z600.00 E3600.00   ; Set maximum speeds (mm/min)
    M201 X1000.00 Y1000.00 Z180.00 E3600.00     ; Set accelerations (mm/s^2)
    M906 X1800.00 Y1800.00 Z1800.00 E595.00 I30 ; Set motor currents (mA) and motor idle factor in per cent
    M84 S180                                    ; Set idle timeout to 180 seconds to stop the bed relaxing while waiting for the final
                                                ; phase of heating the bed and print head.
    
    ; Axis Limits
    M208 X0 Y0 Z0 S1                           ; Set axis minima
    M208 X290 Y280 Z285 S0                     ; Set axis maxima
    
    ; Endstops
    M574 Y1 X1 S0                              ; Set active LOW endstops for X and Y at minimum
    
    ; Z-Probe
    M574 Z1 S2                                 ; Z end stop is probe at low value
    M558 P8 R0.4 I1 H5 F360 T6000              ; Set Z probe type to inverted, unfiltered piezo and the dive height + speeds
    G31 P500 X0 Y0 Z-0.02                      ; Set Z probe trigger value, offset and trigger height
    M557 X5:285 Y5:275 P14                     ; Define mesh grid
    
    ; Heaters
    M307 H0 B0 S1.00                           ; Disable bang-bang mode for the bed heater and set PWM limit
    M305 P0 T100000 B3950 R4700                ; Set thermistor + ADC parameters for heater 0
    M143 H0 S120                               ; Set temperature limit for heater 0 to 120C
    M305 P1 T100000 B4725 C7.060000e-8 R4700   ; Set thermistor + ADC parameters for heater 1
    M143 H1 S290                               ; Set temperature limit for heater 1 to 290C
    
    ; Fans
    M106 P0 S0 I0 F500 H-1                     ; Fan 0 is the part cooling fan. Start at zero speed and let the slicer decide
    M106 P1 S1 I0 F500 H1 T45                  ; Fan 1 is the hot end heatsink. Keep it running while hot end temp is > 45C
    M106 P2 S0.3 I0 F100 H-1                   ; Fan 2 is cooling the Duet3D board. I originally had it full speed on an
                                               ;       always on connection but it was so loud!
    ; Tools
    M563 P0 D0 H1                              ; Define tool 0
    G10 P0 X0 Y0 Z0                            ; Set tool 0 axis offsets
    G10 P0 R0 S0                               ; Set initial tool 0 active and standby temperatures to 0C
    
    T0                                         ; Select the one and only tool
    
    ; Set Pressure Advance parameters
    
    M572 D0 S0.11                              ; Seems OK from test pattern
    
    ; Run any overrides
    
    M501
    

    So, after all that preparatory information, what did my macro show? Here's the log: (I added some blank lines so that the adjustment messages are easier to match up to each stage of the test.)

    2019-08-09 16:08:54 Event logging started
    2019-08-09 16:09:26 Leadscrew adjustments made: 0.102 0.088, points used 2, deviation before 0.095 after 0.000
    
    2019-08-09 16:09:41 Leadscrew adjustments made: 0.101 0.111, points used 2, deviation before 0.106 after 0.000
    2019-08-09 16:09:51 Leadscrew adjustments made: 0.006 -0.004, points used 2, deviation before 0.004 after 0.000
    2019-08-09 16:10:01 Leadscrew adjustments made: -0.000 0.003, points used 2, deviation before 0.002 after 0.000
    
    2019-08-09 16:10:16 Leadscrew adjustments made: 0.102 0.105, points used 2, deviation before 0.104 after 0.000
    2019-08-09 16:10:26 Leadscrew adjustments made: 0.003 -0.000, points used 2, deviation before 0.002 after 0.000
    2019-08-09 16:10:36 Leadscrew adjustments made: 0.000 -0.003, points used 2, deviation before 0.002 after 0.000
    
    2019-08-09 16:10:52 Leadscrew adjustments made: 0.095 0.098, points used 2, deviation before 0.096 after 0.000
    2019-08-09 16:11:02 Leadscrew adjustments made: 0.002 0.002, points used 2, deviation before 0.002 after 0.000
    2019-08-09 16:11:12 Leadscrew adjustments made: -0.006 0.004, points used 2, deviation before 0.004 after 0.000
    
    2019-08-09 16:11:27 Leadscrew adjustments made: 0.098 0.092, points used 2, deviation before 0.095 after 0.000
    2019-08-09 16:11:37 Leadscrew adjustments made: 0.003 -0.000, points used 2, deviation before 0.002 after 0.000
    2019-08-09 16:11:47 Leadscrew adjustments made: 0.003 -0.000, points used 2, deviation before 0.002 after 0.000
    
    2019-08-09 16:12:03 Leadscrew adjustments made: 0.098 0.092, points used 2, deviation before 0.095 after 0.000
    2019-08-09 16:12:13 Leadscrew adjustments made: -0.009 0.001, points used 2, deviation before 0.005 after 0.000
    2019-08-09 16:12:22 Leadscrew adjustments made: 0.012 -0.002, points used 2, deviation before 0.007 after 0.000
    2019-08-09 16:12:28 Event logging stopped
    

    Oddly, re-homing Z between each test seems to introduce a 0.1mm deviation. However, performing the lead screw adjustment (with a fudge factor of 1.1) fixes the misalignment on the first attempt. Subsequent adjustments after that show a deviation which is within the variation caused by the repeatability of my piezo probe.

    Hopefully, this post is more helpful!



  • That should be homeall.g not homeall.h, but the system won't let me edit my post claiming "It was detected as spam"!

    🤣


Log in to reply