MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.26k stars 19.23k forks source link

Inductive Probe bug report #9020

Closed rjcuomo1 closed 6 years ago

rjcuomo1 commented 6 years ago

configuration and adv.zip

So, if I home through the smart controller display in the "prepare" menu, everything works normally and correctly. Everything homes then I can bed run the "bed leveling" and that works normally as well. The problem comes in when I try to print. X and Y home fine (they use optical end stops), then Z does it's first bump, the sensor triggers then the plate moves downwards. The LED on the probe stays turned on and plate doesn't return for the second homing bump. Then the printer just continues on with the printing. The probe LED indicates triggered even though it's 10 mm from the bed though the z-axis says it's 0 on the display. This happens when I try to print by SD or USB. Once the probe gets locked up like that, it won't even home through the prepare menu anymore. I have to reset the printer or power cycle to get it to home correctly again through the menu. Has anyone else had this issue?

Version: Marlin 1.1.7 Printer: Homemade Corexy printer Probe: 61mm-M12-DC-5V-NPN-NO-LJ12A3-4-Z-BX-5V-300mA-Inductive-Proximity-Sensor-Switch Code: //=========================================================================== //============================== 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_XMAX_PLUG //#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG

// coarse Endstop Settings //#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

if DISABLED(ENDSTOPPULLUPS)

// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined //#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_YMAX //#define ENDSTOPPULLUP_ZMAX //#define ENDSTOPPULLUP_XMIN //#define ENDSTOPPULLUP_YMIN //#define ENDSTOPPULLUP_ZMIN //#define ENDSTOPPULLUP_ZMIN_PROBE

endif

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).

define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.

define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.

define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.

define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.

define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.

define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.

define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe.

// Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE

rjcuomo1 commented 6 years ago

Anyone have any thoughts?

Bob-the-Kuhn commented 6 years ago

The probe stays in the triggered state.

My first reaction is that it's a hardware issue.

How repeatable is this? Does it ever happen when homing manually? Does it happen when leveling the bed? Does it happen if you just mannually home and then start the print?

If its just when mannually homing and starting the print then I'd like to see the beginning of the print file to see if its turning something on before doing the homing.

rjcuomo1 commented 6 years ago

Repeatable like clockwork. Manual leveling and homing works perfectly through the firmware and through commands via USB. It only has this problem when I start a print (through SD, usb directly from Cura, and through Octoprint) and it doesn't home correctly, it just locks up.

The only issue at this point is the sensor, all the other inputs and outputs work flawlessly manually or printing. I'll test the power going to the sensor and paste in the gcode when I get a chance.

revilor commented 6 years ago

If I'm not mistaken inverse endstop logic requires a pull-up resistor:

define ENDSTOPPULLUP_ZMIN

define ENDSTOPPULLUP_ZMIN_PROBE

rjcuomo1 commented 6 years ago

So the voltage is 4.87v at the connector to the board.

and here is the beginning GCODE ;FLAVOR:Marlin ;TIME:1217 ;Filament used: 1.36219m ;Layer height: 0.2 ;Generated with Cura_SteamEngine 3.1.0 M190 S60 M104 S200 M109 S200 M82 ; absolute extrusion mode G28 ;Home G1 Z15.0 F6000 ;Move the platform down 15mm ;Prime the extruder G92 E0 G1 F200 E3 G92 E0 ;LAYER_COUNT:101 ;LAYER:0 M106 S255 M204 S3000 M205 X20 Y20 G0 F4500 X165.157 Y165.478 Z0.2 ;TYPE:SKIRT G1 F1800 X165.552 Y165.094 E0.01832 G1 X165.998 Y164.77 E0.03666

rjcuomo1 commented 6 years ago

The probe has a 10k resistor built-in between VCC and signal and it tested out as such

revilor commented 6 years ago

Sometimes the heated bed interferes with inductive probes. You could try

define PROBING_HEATERS_OFF

to see if this helps.

rjcuomo1 commented 6 years ago

That didn't have any effect :/

This is getting frustrating! But thank you guys for your help

revilor commented 6 years ago

I can give you one last list of things you could try (if you haven't already) before I'm out of options:

rjcuomo1 commented 6 years ago

Here's the bed leveling information, perhaps I may have missed something:

//=========================================================================== //=============================== Bed Leveling ============================== //=========================================================================== // @section calibrate

/**

/**

if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL)

// Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z

define ENABLE_LEVELING_FADE_HEIGHT

// For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves.

define SEGMENT_LEVELED_MOVES

define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)

/**

endif

if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)

// Set the number of grid points per dimension.

define GRID_MAX_POINTS_X 3

define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

// Set the boundaries for probing (where the probe can reach).

define LEFT_PROBE_BED_POSITION 20

define RIGHT_PROBE_BED_POSITION 315

define FRONT_PROBE_BED_POSITION 20

define BACK_PROBE_BED_POSITION 315

// The Z probe minimum outer margin (to validate G29 parameters).

define MIN_PROBE_EDGE 10

// Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST

if ENABLED(AUTO_BED_LEVELING_BILINEAR)

// Beyond the probed grid, continue the implied tilt?
// Default is to maintain the height of the nearest edge.
//#define EXTRAPOLATE_BEYOND_GRID

//
// Experimental Subdivision of the grid by Catmull-Rom method.
// Synthesizes intermediate points to produce a more detailed mesh.
//
#define ABL_BILINEAR_SUBDIVISION
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
  // Number of subdivisions between probe points
  #define BILINEAR_SUBDIVISIONS 3
#endif

endif

elif ENABLED(AUTO_BED_LEVELING_3POINT)

// 3 arbitrary points to probe. // A simple cross-product is used to estimate the plane of the bed.

define ABL_PROBE_PT_1_X 15

define ABL_PROBE_PT_1_Y 180

define ABL_PROBE_PT_2_X 15

define ABL_PROBE_PT_2_Y 20

define ABL_PROBE_PT_3_X 170

define ABL_PROBE_PT_3_Y 20

elif ENABLED(AUTO_BED_LEVELING_UBL)

//=========================================================================== //========================= Unified Bed Leveling ============================ //===========================================================================

//#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh

define MESH_INSET 1 // Mesh inset margin on print area

define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.

define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

define UBL_PROBE_PT_1_X 39 // Probing points for 3-Point leveling of the mesh

define UBL_PROBE_PT_1_Y 180

define UBL_PROBE_PT_2_X 39

define UBL_PROBE_PT_2_Y 20

define UBL_PROBE_PT_3_X 180

define UBL_PROBE_PT_3_Y 20

define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle

define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500

elif ENABLED(MESH_BED_LEVELING)

//=========================================================================== //=================================== Mesh ================================== //===========================================================================

define MESH_INSET 10 // Mesh inset margin on print area

define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.

define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

endif // BED_LEVELING

/**

if ENABLED(LCD_BED_LEVELING)

define MBL_Z_STEP 0.025 // Step size while manually probing Z axis.

define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment

endif

// Add a menu item to move between bed corners for manual bed adjustment //#define LEVEL_BED_CORNERS

/**

// @section homing

// The center of the bed is at (X=0, Y=0) //#define BED_CENTER_AT_0_0

// Manually set the home position. Leave these undefined for automatic settings. // For DELTA this is the top-center of the Cartesian print volume. //#define MANUAL_X_HOME_POS 0 //#define MANUAL_Y_HOME_POS 0 //#define MANUAL_Z_HOME_POS 0

// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // // With this feature enabled: // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. // - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //

define Z_SAFE_HOMING

if ENABLED(Z_SAFE_HOMING)

define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28).

define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28).

endif

// Homing speeds (mm/m)

define HOMING_FEEDRATE_XY (50*60)

define HOMING_FEEDRATE_Z (4*60)

// @section calibrate

/**

if ENABLED(SKEW_CORRECTION)

// Input all length measurements here:

define XY_DIAG_AC 282.8427124746

define XY_DIAG_BD 282.8427124746

define XY_SIDE_AD 200

// Or, set the default skew factors directly here // to override the above measurements:

define XY_SKEW_FACTOR 0.0

//#define SKEW_CORRECTION_FOR_Z

if ENABLED(SKEW_CORRECTION_FOR_Z)

#define XZ_DIAG_AC 282.8427124746
#define XZ_DIAG_BD 282.8427124746
#define YZ_DIAG_AC 282.8427124746
#define YZ_DIAG_BD 282.8427124746
#define YZ_SIDE_AD 200
#define XZ_SKEW_FACTOR 0.0
#define YZ_SKEW_FACTOR 0.0

endif

// Enable this option for M852 to set skew at runtime //#define SKEW_CORRECTION_GCODE

endif

myoung008 commented 6 years ago

I suggest wiring. Inductive probes don't tend to work well on 5v, so use 12v for power. There are lots of suggestions about how to wire them with resistor bridges on the signal line, but those gave me inconsistent results.

The wiring method that works for me is a simple diode on the signal pin, cathode toward the board, anode toward the sensor. The odd part is that the sensor LED appears triggered at all times, maybe 80% brightness, then goes to full brightness when actually triggered. Marlin can see the correct trigger state regardless of the LED however.

M48 repeatablilty is essentially perfect with this wiring method.

rjcuomo1 commented 6 years ago

My next step was probe replacement since it seems like I'm running out of steps, lol.

benlye commented 6 years ago

If you're thinking about replacing the probe anyway, you could get one which is designed for 5V, and avoid the wiring complications of a 6-36V probe altogether.

I have this one and it works very well. https://m.aliexpress.com/s/item/32719316657.html?trace=wwwdetail2mobilesitedetail&productId=32719316657&productSubject=M18-8mm-sensing-DC-5V-NPN-NO-LJ18A3-8-Z-BX-5V-cylinder-inductive-proximity-sensor

Bob-the-Kuhn commented 6 years ago

Here's the NC version. It was just added tonight.

https://www.aliexpress.com/store/product/M18-8mm-sensing-DC-5V-NPN-NC-LJ18A3-8-Z-AX-5V-cylinder-inductive-proximity-sensor/1162433_32851947449.html

rjcuomo1 commented 6 years ago

I have the one that works on 5v currently. It's a NPN and NO

rjcuomo1 commented 6 years ago

Thank you all again for your help! The problem was the 5v inductive probe. I went with a 12v with a voltage divider and it works.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.