Mesh Bed Compensation Confusion



  • Hey All!

    I recently updated to 1.19 (I was on 1.11) and updated my configs to match the changes since 1.11.

    I'm in the process of reprovisioning my machine as I changed the print head and had to move the optical probe.

    I calculated the trigger offset between probe and nozzle as per https://duet3d.com/wiki/Using_mesh_bed_compensation (I followed all the steps).

    I ran the following:

    [[gcode]]
    M557 X58:318 Y57:218 S20.5
    G29
    
    

    And it yielded this:

    I hit emergency stop before it crashed hard (just barely).

    I'm not sure why this occured, so here is my config.g and probe_config.g (which I have in a macro for easier calling).

    ; TazStiffBlack Configuration G-Codes
    
    ; General Preferences
    M111 S0                  ; Debug off
    G21                      ; Work in millimetres
    G90                      ; Send absolute coordinates...
    M83                      ; ...but relative extruder moves
    M555 P2                  ; Set firmware compatibility to look like Marlin
    M208 X0 Y0 Z0 S1         ; Set axis minima
    M208 X365 Y240 Z147.5 S0 ; Set axis maxima
    ;M575 P1 B57600 S1		 ;Force internal serial port baud rate.
    
    ; Endstops
    M574 X2 Y1 Z2 S1                ; Define active low and unused microswitches
    M666 X0.00 Y0.00 Z0.00          ; Endstop Adjustments
    M558 P1 X0 Y0 Z1 H3 F200 T5000  ; Set Z probe type to modulated, the axes for which it is used and the probe + travel speeds
    G31 C0 P500 X39.5 Y-56.5 Z1.42  ; Set Z probe trigger value, offset and trigger height
    M557 X15:350 Y15:225 S20        ; Define mesh grid
    
    ; Drives
    ; Axis stepper direction
    M569 P0 S0                       ; X Normal
    M569 P1 S1                       ; Y Reverse
    M569 P2 S0                       ; Z Normal
    M569 P3 S0                       ; Extruder
    M92 X114.29 Y114.29 Z400 E750    ; Set steps per mm
    M566 X900 Y900 Z12 E120          ; Set maximum instantaneous speed changes (mm/min)
    M203 X36000 Y36000 Z900 E1200    ; Set maximum speeds (mm/min)
    M201 X2750 Y2750 Z25 E2000       ; Set accelerations (mm/s^2)
    M906 X1350 Y1350 Z2000 E1500 I95 ; Set motor currents (mA) and motor idle factor in per cent
    M84 S0                           ; Set idle timeout
    M85 S0                           ; NEVER timeout stepper motors
    
    ; Heaters
    M143 S260                             ; Set maximum heater temperature to 260C
    M305 P0 T100000 B3794 C0 R4700 H30 L0 ; Set thermistor + ADC parameters for heater 0 - Heared Bed
    M305 P1 T100000 B4267 C0 R4700 H30 L0 ; Set thermistor + ADC parameters for heater 1 - Hotend
    
    ; 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
    
    ; Network
    M550 PTazStiffBlack     ; Machine name (can be anything you like)
    M540 PBE:EF:DE:AD:FE:ED ; Set MAC address
    M552 P192.168.7.30 S1   ; IP address (0 = use DHCP)
    M554 P192.168.1.1       ; Gateway
    M553 P255.255.255.0     ; Netmask
    M586 P0 S1              ; Enable HTTP
    M586 P1 S0              ; Disable FTP
    M586 P2 S0              ; Disable Telnet
    
    ; Fans
    M106 P0 S0.3 I0 F500 H-1  ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off - Hotend
    M106 P1 S0 I0 F500 H1 T45 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on - Part Cooling
    
    ; Additional Options
    M570 S180             ; hotend warmup wait time
    301 H1 P45 I0.35 D100 ; Hexagon hotend PID settings. Periodic pulses from the Duex board necessitates extra resistance to disturbance.
    
    ; Load probe config from a macro
    M98 P/macros/probe_config.g
    
    

    probe_config.g:

    G31 C0 P500 X39.5 Y-56.5 Z1.42
    
    

    I'm sure this is something really stupid, but I am stuck.

    Also, here is a sketch of the nozzle, probe, the measured offset and the X/Y axes scale:

    Thanks in advance!


  • administrators

    Your sketch appears to show a left handed axis system. But I expect your printer has a bed that moves in the Y direction, and you have shown where high and low Y are on the bed.

    Did you remove any unused deployprobe.g and retractprobe.g files as described in the upgrade notes?



  • To clarify, you are correct. This is a Cartesian, with the Y axis being the bed moving.

    I do not have any deployprobe.g or retractprobe.g files currently.

    If it helps, when doing a G30, I get similar behavior. With G30, instead of the bed (Y) moving forward to put the probe where the head used to be, it moves it backwards. The X move works as expected (it is always on the correct X plane with G30).


  • administrators

    Your Y offset in the G31 command has the wrong sign, because your probe is offset from the nozzle 56.5mm in the +Y direction. What's confusing you is that the bed moves in the opposite direction, so you thought it was offset 56.5mm in the -Y direction.



  • Alright, I adjusted the Probe config line to the following:

    [[gcode]]
    G31 C0 P500 X39.5 Y56.5 Z0.2
    
    

    Upon doing the above M557 command followed by the G31, it rammed the probe into the bed again. It seems the problem is that it is not stopping when the probe triggers. It looked to be in above the right spot, but no probe trigger.



  • It may be hard to tell from the photo, but the probe is at the correct place after fixing the offset:

    The only issue now is the probe activating isn't stopping the head from dropping.

    Thanks!



  • Have you checked with M119 if the Z stop changes when holding a piece of paper under it? Does the light on the probe come on and flash when first powered up as well as when you put a piece of paper under it?

    Looks like the printer is still powered on in both pictures you posted (hot end fan still spinning), but I don't see the trigger light on the IR in either of them.



  • I did an emergency stop. It went past the point of triggering, which on the optical probe makes the light goes back out.

    If I bring a piece of paper towards it, it turns red to trigger. If I physically touch the bottom of the PCB with the paper it turns off again. It should have stopped the moment it triggered, regardless of this behavior.

    If I do a G30, it triggers with a piece of paper as expected and stops.


  • administrators

    @natewalck:

    The only issue now is the probe activating isn't stopping the head from dropping.

    Under what conditions? You've told us that when you send G30, the probe does stop the head dropping when it triggers.



  • @dc42:

    @natewalck:

    The only issue now is the probe activating isn't stopping the head from dropping.

    Under what conditions? You've told us that when you send G30, the probe does stop the head dropping when it triggers.

    Gotcha. When running the G29 command, the probe does not stop the head movement. When running a G30, it does.

    To summarize:

    • Boot Duet

    • Home all axes

    • Run G30

    Probe stops head. Doing the same thing, but with the M557 + G29, it does not stop.



  • Alright, I confirmed that bed.g is working as expected with 4 point leveling. For some reason, the probe doesn't activate using G29, not entirely sure why. Let me know if there is anything else I should try out.

    [[gcode]]
    ; bed.g
    ; called to perform automatic bed compensation via G32
    ;
    
    ;T99    ;Non-existant tool, no offset.
    ; Clear any bed transform
    M561
    
    ; Home all axes
    G28
    
    ;Goto Center. Unlike other points, this should include compensation for probe X/Y coordinates.
    G0 Z35
    G0 X143 Y63.5
    G30
    
    G0 Z35
    M98 P/macros/cd_topRight
    G30 P0 Z-10000
    
    G0 Z35
    M98 P/macros/ce_bottomRight
    G30 P1 Z-10000
    
    G0 Z35
    M98 P/macros/cf_bottomLeft
    G30 P2 Z-10000
    
    G0 Z35
    M98 P/macros/cc_topLeft
    ;G30 P3 S0 Z-10000  ;Calibrate with same number of factors as points probed.
    ;G30 P3 S4 Z-10000  ;Four factor calibration.
    G30 P3 S4 Z-10000  ;Three factor calibration.
    ;G30 P3 S-1 Z-10000 ;Simply report coordinates.
    
    ;Pause for UI.
    G4 P1500
    
    ;Return to safe position.
    G0 Z35
    M98 P/macros/cb_center
    
    

  • administrators

    The difference is that a plain G30 starts probing from wherever it already is; whereas G29 moves the head to one dive height above the bed and starts probing from there. So before you can run G29, you need to home the printer, and homing must establish the Z=0 position to within an accuracy of one dive height.



  • @dc42:

    The difference is that a plain G30 starts probing from wherever it already is; whereas G29 moves the head to one dive height above the bed and starts probing from there. So before you can run G29, you need to home the printer, and homing must establish the Z=0 position to within an accuracy of one dive height.

    I assume using G31 to set Z offset is not the same as homing the printer?

    In the directions here: https://duet3d.com/wiki/Using_mesh_bed_compensation

    It shows to do steps 4-10 at all the places you want to probe. I don't see that measured Z height being specified anywhere prior to running the M557/G29. Does the machine remember all the Z heights for the points you probe in that process?

    If that is the case, I should make a macro that handles this for me to make the process more hands off.

    I'll try this manually and report back, but I want to make sure I fully understand what is going on during that homing process (and how that information is used by G29).


  • administrators

    The directions don't say you need to measure the trigger height at all the points you want to probe, they suggest you measure it at various places to check that it is consistent. Mesh bed compensation assumes the same trigger height at all probe points, so it won't give accurate results if the trigger height varies a !ot.



  • @dc42:

    The directions don't say you need to measure the trigger height at all the points you want to probe, they suggest you measure it at various places to check that it is consistent. Mesh bed compensation assumes the same trigger height at all probe points, so it won't give accurate results if the trigger height varies a !ot.

    Ok, I'm still confused then. If I have G31 set and the Z probe height homed as per the directions, why is the G29 not responding to the probe firing off? Am I missing some other setting/config?

    Thanks!


Locked
 

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