Mini Differential IR Sensor Triggering Too Soon



  • I've tried everything I can think of to get this thing to work properly, but have been unable to get the sensor to trigger when the hotend touches the bed. In every case, the sensor triggers with the hotend a few mm above the bed when homing Z, which then sets the Z=0 about 2mm above the board. I can manually home the probe to the bed, but then it Triggers early again the next time you start a print or level the bed because I home all axes before each print.

    What I've tried:

    • Adjusting the Z-Offset in the Marlin Firmware from -2.85 all the way up to 2.75mm in 0.1mm increments

    • Adjusting the physical height of the sensor board from damn near flush with the hotend tip (e3d V6 Titan) to 3mm above the hotend tip

    • Adjusting the Z-Offset in software through the Marlin UI

    • Manually zeroing the Z-Axis through Pronterface

    • Change the print surface - Black Paper under 3mm glass, 6mm glass over Red heated bed with white lettering, back side of mirror tile (flat black) under 3mm glass, 3mm glass over red heated bed with white lettering, black paper under 6mm of glass, black paper on top of glass just for shits and giggles.

    I have a report of Triggered with M119 when the red light is on, and Untriggered when the red light is off.
    After Homing the Z-Axis, my firmware is programmed to raise the nozzle 5mm, which reports as Z=5, even though the nozzle is actually 7+mm above the board.
    After manually setting Z=0 while the nozzle is touching the glass with any of the above bed types, Autoleveling triggers 2mm above the bed, which prevents the nozzle from ever touching the glass enough to get a proper extrusion.
    If I manually set the offset -2.75 in Marlin after homing, I can lower the nozzle to -2.75mm to touch the bed, but Autoleveling again triggers before touching the bed, causing the same problem as above.
    Regardless of the value I have for Z_PROBE_OFFSET_FROM_EXTRUDER, whether positive or negative, the sensor triggers at the same height. Example:

      #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.6  // Z probe to nozzle Z offset: -below (always!)
    
    ```and
    

    #define Z_PROBE_OFFSET_FROM_EXTRUDER 1.6 // Z probe to nozzle Z offset: -below (always!)

    Both trigger the sensor at the same height above the board.
    
    I don't expect anyone on this forum to have a Pegasus 12" machine, but anyone with a PRUSA, CoreXY, or basically any non-delta printer with RAMPS 1.4 and Marlin with working code for the Differential IR Sensor would be able to help me. I can compare your code to mine and see where I messed up. I've also only toyed with Configuration.h, and do save and flash new firmware every time I change the values. I'm at my wit's end, and have nothing else to try.
    
    [https://imgur.com/a/EwYRT](https://imgur.com/a/EwYRT)
    
    The above link shows Z=5 from multiple angles so you can see how I have the board aligned with the hotend.


  • Its been a long time since I did anything in Marlin, but I always used M212 to set the Z-offset, and M500 to save to EEPROM, and M501 to read back from EEPROM to see what was set there.

    I'm not sure if Marlin overrides configuration.h values with EEPROM values but if it does, that would explain your issues.

    Could you try doing a M212 to see what the current setting for the z-probe offset is according to firmware?



  • M212 doesn't do anything in Marlin… however, your suggestion prompted me to look up the gcode for that command and it is M851.... It worked. Now I'm just configuring a few last details, like my jacked up PID tuning since updating my firmware. I have set M851 Z-1.21 and it registers as properly changed now. I guess setting it in the firmware doesn't do a damn thing... at least I figured it out, thank you.



  • Ah, M212 is for Printrbots (what I last set a z-offset on). Sorry about that. Wish everyone could stick to a standard!



  • I just checked out the RepRap gcode database and found it… thank you very much for your push in the right direction. I'm printing a Seirpinski's Fractal Pyramid now, and it's looking quite nice so far...


Locked
 

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