Autolevel with NPN NO Inductive sensor problems



  • So i have installed an NPN NO inductive sensor. Since then i have been trying to get successful results with bed mesh compensation but i do not.
    0_1546104762672_Screenshot_2018-12-29 GP CR20(3).png
    Originally i tried operating the procedure as my setup was. My z end stop limit switch was below the bed surface by 2mm.

    As i thought that is the problem i moved the sensor to be close to the bed surface. Then got this result.
    0_1546104861655_Screenshot_2018-12-29 GP CR20(7).png

    Then as i could not understand why it is high again i changed the G31 value on my config.g to be positive and got this.
    0_1546104930357_Screenshot_2018-12-29 GP CR20(6).png

    Then i noticed this difference is close to the z height trigger i put on G31. My value is (0.7mm)
    So i thought i should run it with zero z height to see what happens. And i got a bette looking mesh. 0_1546105509471_Screenshot_2018-12-29 GP CR20(8).png
    This though does not solve any problem.
    When i try to print with this i get my nozzle to be a lot higher than the bed surface again. What is happening?
    Is the z height trigger not working maybe?
    I tried a test print with the mesh that showed below xy plane and the latest that shows it is close to the xy plane.
    Still the nozzle seems to be the same distance aways from the bed at both cases.

    Please be advised i have followed the procedure step by step several times today and i post this long post as i can find no solution to this problem. I have been troubleshooting more than 12 hours and still nothing.
    The posts i followed are
    1)https://duet3d.dozuki.com/Wiki/Using_mesh_bed_compensation#main
    2)https://duet3d.dozuki.com/Wiki/Test_and_calibrate_the_Z_probe
    Main difference between those is that one states that the trigger height value should be negative.

    Thank you in advance!



  • Adding my config text to be easier to use.

    ; Configuration file for Duet WiFi (firmware version 1.21)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v2 on Thu Dec 13 2018 23:04:14 GMT+0200 (Eastern European Standard Time)

    ; General preferences
    G90 ; Send absolute coordinates...
    M83 ; ...but relative extruder moves

    ; Network
    M550 P"pass" ; Set machine name
    M552 S1 ; Enable network
    M587 S"pass" ; Configure access point. You can delete this line once connected
    M586 P0 S1 ; Enable HTTP
    M586 P1 S0 ; Disable FTP
    M586 P2 S0 ; Disable Telnet

    ; Drives
    M569 P0 S0 ; Drive 0 goes backwards
    M569 P1 S1 ; Drive 1 goes forwards
    M569 P2 S1 ; Drive 2 goes forwards
    M569 P3 S1 ; Drive 3 goes forwards
    M350 X16 Y16 Z16 E16 I1 ; Configure microstepping with interpolation
    M92 X200.00 Y200.00 Z400.00 E415.00 ; Set steps per mm
    M566 X1200.00 Y1200.00 Z24.00 E300.00 ; Set maximum instantaneous speed changes (mm/min)
    M203 X45000.00 Y45000.00 Z600.00 E1500.00 ; Set maximum speeds (mm/min)
    M201 X2000.00 Y2000.00 Z100.00 E1000.00 ; Set accelerations (mm/s^2)
    M906 X1200.00 Y1200.00 Z560.00 E560.00 I30 ; Set motor currents (mA) and motor idle factor in per cent
    M84 S30 ; Set idle timeout

    ; Axis Limits
    M208 X0 Y0 Z0 S1 ; Set axis minima
    M208 X235 Y200 Z250 S0 ; Set axis maxima

    ; Endstops
    M574 X1 Y1 Z1 S1 ; Set active high endstops

    ; Z-Probe
    M558 P5 I1 F0 T6000 ; Set Z probe type to switch and the dive height + speeds
    G31 P1000 X-55 Y0 Z0.4 ; Set Z probe trigger value, offset and trigger height
    M557 X20:180 Y20:200 S30 ; Define mesh grid

    ; Heaters
    M305 P0 T100000 B4138 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S110 ; Set temperature limit for heater 0 to 110C
    M305 P1 T100000 B4138 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S280 ; Set temperature limit for heater 1 to 280C

    ; Fans
    M106 P0 S0 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
    M106 P1 S1 I0 F500 H1 T45 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on

    ; 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

    ; Automatic power saving
    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 are not configured
    M501



  • why do you need a z endstop if you have a probe?



  • @veti Safety i guess. It was installed initially so i did not bother removing it. And i did not see anywhere the need to remove the end stop. It can work along with the probe if i am not mistaken. The homing happens with endstop. Only mesh levelling happens with probe.


  • Moderator

    @gpetropoulos Yes you can use multiple means of homing since it depends on how your homing files are configured which gets used. As long as the trigger heights are accurate and repeatable between them the Z0 point should be equivalent.

    I'm not sure what would explain your extreme looking heightmaps though.

    Can you post your homing files?

    M558 P5 I1 F0 T6000

    I notice your probing feedrate is set to 0. I'm not sure if that will cause a problem or if it will just fall back to using the Z axis max feed rate. I'd try setting it to something like F100 just incase it's an issue caused by probing too fast.



  • i would assume that to be the different trigger height from probe and endstop.



  • As i understand now i have been using G32 from the web interface. Still trying to understand what the difference with G29 is.

    This is my homeall.g

    ; homeall.g
    ; called to home all axes
    ;
    ; generated by RepRapFirmware Configuration Tool v2 on Thu Dec 13 2018 23:04:14 GMT+0200 (Eastern European Standard Time)
    G91 ; relative positioning
    G1 Z5 F6000 S2 ; lift Z relative to current position
    G1 S1 X-225 Y-220 F6000 ; move quickly to X and Y axis endstops and stop there (first pass)
    G1 X5 Y5 F6000 ; go back a few mm
    G1 S1 X-225 Y-220 F360 ; move slowly to X and Y axis endstops once more (second pass)
    G1 S1 Z-255 F1800 ; move Z down stopping at the endstop
    G90 ; absolute positioning
    G92 Z0 ; set Z to axis minimum (you may want to adjust this)

    ; Uncomment the following lines to lift Z after probing
    ;G91 ; relative positioning
    ;G1 S2 Z5 F100 ; lift Z relative to current position
    ;G90 ; absolute positioning


  • Moderator

    @veti said in Autolevel with NPN NO Inductive sensor problems:

    i would assume that to be the different trigger height from probe and endstop.

    Yes, but the probe trigger height would only come into play using G30 and anywhere else that probes. The endstop "trigger height" would be set in the homing files.

    @gpetropoulos said in Autolevel with NPN NO Inductive sensor problems:

    G92 Z0 ; set Z to axis minimum (you may want to adjust this)

    Is the nozzle actually touching the bed at the point the endstop switch is triggered?

    Also we should confirm what firmware version you're using.

    I also notice you're loading config-override.g at the end of your config.g, can you post the contents of that as well?

    @gpetropoulos said in Autolevel with NPN NO Inductive sensor problems:

    G1 S1 Z-255 F1800 ; move Z down stopping at the endstop
    G90 ; absolute positioning
    G92 Z0 ; set Z to axis minimum (you may want to adjust this)

    As a test, you could replace this section of your homeall with a G1 move to position the probe at center, and then a G30 to probe the bed. Then run a G29. This would eliminate the endstop switch from the equation entirely.

    The main difference between G29 and G32 is that G29 uses a mesh of points to compensate for the geometry of the bed, whereas G32 uses bed.g to create a simple plane of a few points. It can also be used to do mechanical bed leveling depending on how you have bed.g setup. If you're just trying to correct for the shape of the bed, G29 is superior.



  • Should i really eliminate my z endstop though? Not even keep it as a backup? What will then give my z=0 value? The probe?

    Here is the config override:

    ; config-override.g file generated in response to M500 at 2018-12-29 18:07
    ; This is a system-generated file - do not edit
    ; Heater model parameters
    M307 H0 A90.0 C700.0 D10.0 S1.00 V0.0 B1
    M307 H1 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H2 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H3 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H4 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H5 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H6 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    M307 H7 A340.0 C140.0 D5.5 S1.00 V0.0 B0
    G10 L2 P1 X0.00 Y0.00 Z0.00
    G10 L2 P2 X0.00 Y0.00 Z0.00
    G10 L2 P3 X0.00 Y0.00 Z0.00
    G10 L2 P4 X0.00 Y0.00 Z0.00
    G10 L2 P5 X0.00 Y0.00 Z0.00
    G10 L2 P6 X0.00 Y0.00 Z0.00
    G10 L2 P7 X0.00 Y0.00 Z0.00
    G10 L2 P8 X0.00 Y0.00 Z0.00
    G10 L2 P9 X0.00 Y0.00 Z0.00


  • Moderator

    It's not really a backup. The endstop would only trigger and stop movement while doing a G1 move with an S1 switch as done in the homing files to seek the endstop. Hitting the endstop at any other time would have no effect.

    So yes, for testing at least, I would suggest trying to use your probe in the homing file to set Z0

    So it would change from this

    G1 S1 Z-255 F1800       ; move Z down stopping at the endstop
     G90                     ; absolute positioning
    G92 Z0                  ; set Z to axis minimum (you may want to adjust this)
    

    To this

    G90   ; absolute positioning
    G1 X150 Y150 ; move probe to bed center
    G30 ; probe the bed
    G1 X0 Y0  ; return to home position
    


  • @phaedrux said in Autolevel with NPN NO Inductive sensor problems:

    @veti said in Autolevel with NPN NO Inductive sensor problems:

    i would assume that to be the different trigger height from probe and endstop.

    Yes, but the probe trigger height would only come into play using G30 and anywhere else that probes. The endstop "trigger height" would be set in the homing files.

    @gpetropoulos said in Autolevel with NPN NO Inductive sensor problems:

    G92 Z0 ; set Z to axis minimum (you may want to adjust this)

    Is the nozzle actually touching the bed at the point the endstop switch is triggered?

    Yes

    Also we should confirm what firmware version you're using.

    Firmware version: 2.02RC6(RTOS) (2018-12-15b2)

    I also notice you're loading config-override.g at the end of your config.g, can you post the contents of that as well?

    @gpetropoulos said in Autolevel with NPN NO Inductive sensor problems:

    G1 S1 Z-255 F1800 ; move Z down stopping at the endstop
    G90 ; absolute positioning
    G92 Z0 ; set Z to axis minimum (you may want to adjust this)

    As a test, you could replace this section of your homeall with a G1 move to position the probe at center, and then a G30 to probe the bed. Then run a G29. This would eliminate the endstop switch from the equation entirely.

    The main difference between G29 and G32 is that G29 uses a mesh of points to compensate for the geometry of the bed, whereas G32 uses bed.g to create a simple plane of a few points. It can also be used to do mechanical bed leveling depending on how you have bed.g setup. If you're just trying to correct for the shape of the bed, G29 is superior.



  • @phaedrux said in Autolevel with NPN NO Inductive sensor problems:

    It's not really a backup. The endstop would only trigger and stop movement while doing a G1 move with an S1 switch as done in the homing files to seek the endstop. Hitting the endstop at any other time would have no effect.

    So yes, for testing at least, I would suggest trying to use your probe in the homing file to set Z0

    So it would change from this

    G1 S1 Z-255 F1800       ; move Z down stopping at the endstop
     G90                     ; absolute positioning
    G92 Z0                  ; set Z to axis minimum (you may want to adjust this)
    

    To this

    G90   ; absolute positioning
    G1 X150 Y150 ; move probe to bed center
    G30 ; probe the bed
    G1 X0 Y0  ; return to home position
    

    When i probe the bed does it do a g92 as well? How will i tell it where zero is? There is a trigger height value to be used to direct this one but how do i do that?
    My trigger value is 0.7mm.
    So do i give a G92 Z0.7 after it probes?


  • Moderator

    G92 is not necessary when using G30. It will use the configuration provided in M558 and G31 to set the Z height.

    The trigger height in G31 Z tells the firmware how far away from the bed the nozzle is when the probe triggers. So when it triggers during G30, it knows it's that high above the bed, and therefore, Z0 is established. The X and Y portion of G31 tells the firmware where the probe is in relation to the nozzle. G29 also uses the information from M558 and G31.

    Makes sense?



  • @phaedrux Yes certainly.

    Let me try this. I think i understand the problem now. So my homing hits the endstop and gets a zero value from there. So the z trigger height is not used. That is why depending on the z end stop distance we see different heights in the above pictures. So the 0.7 (my z trigger) reflected on the distance from the z end stop 0..

    One more thing. When typing the z trigger in G31 should it be negative?
    eg G31 P1000 X-55 Y0 Z0.7
    OR
    G31 P1000 X-55 Y0 Z-0.7


  • Moderator

    It should be the value you get from doing the G30 S-1 procedure you linked above.

    It will only be a negative value in cases where the nozzle ends up pressing down into the surface of the bed, like when using a nozzle contact probe like a piezoelectric.



  • @phaedrux I mean it is not really negative but is it written like that? Writing it as a positive in the G31 gave the blue mesh result above which is below the xy plane.


  • Moderator

    @gpetropoulos No you shouldn't flip the sign on it. The probe triggers before the nozzle touches the bed, correct? No after? That would be a positive value.

    I'm hoping that after we change your homing file to use G30, and re run G29, we will get a better result.



  • @phaedrux Certainly that solves the mesh problem at least. This looks much more consistent.
    I used a negative value on G31. I am pretty sure that is it. I will run a test print and see for sure now.

    0_1546111884213_Screenshot_2018-12-29 GP CR20(9).png


  • Moderator



  • Updating my new Homeall using the z probe as z endstop.

    ; homeall.g
    ; called to home all axes
    ;
    ; generated by RepRapFirmware Configuration Tool v2 on Thu Dec 13 2018 23:04:14 GMT+0200 (Eastern European Standard Time)
    G91 ; relative positioning
    G1 Z5 F6000 S2 ; lift Z relative to current position
    G1 S1 X-235 Y-220 F6000 ; move quickly to X and Y axis endstops and stop there (first pass)
    G1 X5 Y5 F6000 ; go back a few mm
    G1 S1 X-235 Y-220 F360 ; move slowly to X and Y axis endstops once more (second pass)
    G90 ; absolute positioning
    G1 X160 Y100 F6000 ; move probe to bed center
    G30 F1000 ; probe the bed
    G1 X0 Y0 Z2 F6000 ; return to home position and 2mm higher than the surface

    ; Uncomment the following lines to lift Z after probing
    ;G91 ; relative positioning
    ;G1 S2 Z5 F100 ; lift Z relative to current position
    ;G90 ; absolute positioning



  • @phaedrux Not clear to me yet. I will try with positive then first and report back.


  • Moderator

    @gpetropoulos Yes that looks good, except that G30 won't take an F parameter. It will use the F value given in M558 in config.g. I suggested a value of 100 earlier.



  • @phaedrux Yeah probably. I tried the 100 and was too slow. 😄 I have F1000 in my M558 and probably that is being used. I started the test print and seems to be working like a charm. 🙂

    Thank you very much. I would not manage to get it done this fast without your help. Cheers!
    Wish you the best and a Happy New Year mate.

    So for anyone confused set positive value for trigger height in G31 command!!


  • Moderator

    Glad it's working properly now. I think the issue was a result of Z0 being set differently than what the G31 trigger height would have given, and the difference was resulting in the huge offset from the Z plane in the heightmap.


Log in to reply