Welcome! Log In Create A New Profile

Advanced

G28 Z; ignores endstop

Posted by rbtwas 
G28 Z; ignores endstop
May 01, 2020 04:41PM
And before chorus of groans begins:

Z endstop:
-Z-min end stop function *verified* via M119 and manual actuation (*triggered*/*open* on manual actuation)
-Z-min axis end stop switch *verified* functional by testing against X axis (homing works on X, Y)

Behavior:
issued (via serial port) and z axis promptly crashes into table despite limit switch being actuated.

Things tried:
-different switches
-verification of switch operation using meter/oscilloscope
-Z-min, Z-max switches (manually actuated during G28 evolution)
-switch in question used on X axis (temporarily wired, manual actuation of Z switch for X axis, does trigger complete homing behavior)
-M119 verification

I've also poured over the documentation regarding endstops, probing, and config settings, I'm not seeing what might cause it
( #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) is enabled but that's the default.

My configuration file has only been minimally changed to select for ramps 1.4.


Marlin version: 1.1.9
hardware: ramps 1.4/mega2560 controller
printer: custom
Re: G28 Z; ignores endstop
May 01, 2020 06:18PM
I would guess that depends on how you have Marlin configured. And which direction it thinks the end-stops are located.
If Marlin believes the are on MAX instead of MIN then it will never stop

My Configuration For an example
// Mechanical end-stop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false

#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true

#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1


Post these lines of code with where your end-stops are located and how they are wired, this will make troubleshooting easier.


Computer Programmer / Electronics Technician
Re: G28 Z; ignores endstop
May 01, 2020 09:36PM
>
Quote
Roberts_Clif
>I would guess that depends on how you have Marlin configured. And which direction it thinks the end-stops are located.
>If Marlin believes the are on MAX instead of MIN then it will never stop

As I mentioned in my first post, I installed Z-min and Z-max switches and manually actuated them while "G28 Z" was in
progress.

Z travel, at least for G0/G1 has been verified, I can print normally with machine and issue manual G0/G1 commands
and see Z moves down for small position, and up for larger ones (relative mode).

I have also verified the polarity of the switch behavior with "M119".



>My Configuration For an example
// Mechanical end-stop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false

#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true

#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1


Post these lines of code with where your end-stops are located and how they are wired, this will make troubleshooting easier.


#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the
#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the
#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the

#define INVERT_X_DIR false
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false

#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

Config file attached.


Thanks.

Edited 1 time(s). Last edit at 05/01/2020 09:42PM by rbtwas.
Attachments:
open | download - Configuration.h (71.5 KB)
open | download - Configuration_adv.h (69.8 KB)
Re: G28 Z; ignores endstop
May 02, 2020 07:59AM
#define DEFAULT_AXIS_STEPS_PER_UNIT   { 10.616, 10.616, 5.308, 500 }

#define X_BED_SIZE 100
#define Y_BED_SIZE 100
#define Z_MAX_POS 100


If appears that you are working on something like a M3D Micro 3D Printer/Clone.
Could you post the location of the Z-Axis End-Stop switch and how it is wired NO/NC.


Computer Programmer / Electronics Technician
Re: G28 Z; ignores endstop
May 03, 2020 07:44AM
Quote
Roberts_Clif
It appears that you are working on something like a M3D Micro 3D Printer/Clone.
Could you post the location of the Z-Axis End-Stop switch and how it is wired NO/NC.

The printer is custom made. The intended switch is incorporated as a limit screw that also serves as
an electrical contact attached to a passive sub-slide which the hotend is mounted on. When the nozzle
contacts the bed, the sub-slide is lifted, opening the limit screw contact. There is a debounce circuit
made with monostable multivibrator to stretch the initial pulse *or'd* with the switch input signal which
provides a constant *triggered* value after the monstable multivibrator ends it's pulse.

This is all irrelevant as I have said that I have tried external switches (optical interrupters) on both
Z-min and Z-max connections on the ramps board. The switches were actuated *manually* while
the G28 Z command was in progress. Marlin did not respond to *any* switch actuation combination.

Again, Z-min circuits have been verified with the M119 command (triggered/open seen
on Z-min).

I have replicated these tests on a known good axis (X axis). Manual actuation of switches works on the X axis during
a G28 X cycle. The experimental switch *works* on the X axis (actuated manually) as well.

Edited 2 time(s). Last edit at 05/03/2020 07:47AM by rbtwas.
Re: G28 Z; ignores endstop
May 03, 2020 08:14AM
I think I found it!

To deal with an inverted motor I do:

M92 X169.856 Y168.856 Z-84.928 E101.92; # set steps per unit (with invert..)

Note the "-" on the Z.

If I do:
M92 X169.856 Y168.856 Z84.928 E101.92; (no invert on Z)

G28 Z *does* respond to the Z-min switch (manual actuation). Although it moves
in the wrong direction.

This looks like a bug or something.

I wonder if by inverting Z it's looking for Z-max instead. I'm see a "USE_ZMAX_PLUG" being *undefined* and required
to enable Z-max in Configuration.h.

Edited 1 time(s). Last edit at 05/03/2020 08:25AM by rbtwas.
Re: G28 Z; ignores endstop
May 19, 2020 04:52PM
there is a setting to deal with inverted motors. Your fix it trying to tell it to go to Z= -84

// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR true

That is mine and are not default.
Sorry, only registered users may post in this forum.

Click here to login