Welcome! Log In Create A New Profile

Advanced

Z_MAX always triggered

Posted by KangaGorillaPig 
Z_MAX always triggered
November 30, 2014 09:49PM
I am just begining the 3D printer journey, and am new to every aspect. Have bought a mini Kossel, finished assembly, uploaded marlin to arduino, connected laptop via Pronterface and can issue M119 to see end stop status. However the z_max is always triggered regardless of the manual state of the switch, i.e. if I manually depress the switch and issue M119 the result do not change. I think these switches are configured as NC because I have measured the ohms across the two wires and they are near zero and when I depress the switch manually it measures infinite (open circuit). So I think the switch, wiring, and terminal block are ok. I have also swapped the z and y axis on the arduino and manually toggled the switch and have received the expected status via M119, so I am reasonably confident the switch is correctly connected to the arduino.

I suspect that this means the merlin is not configured properly, I have not touched this configuration, simply accepted the default which seems to be configured for a delta printer. Having visited many pages and I have simply confused myself about the many options.

So my question can anyone suggest a testing approach that I can use to determine if it is marlin and perhaps a path to a solution.

My machine has an optical switch for z_min and I have not tested that yet, one road block at a time for me. Obviously I need to resolve these very first steps prior to attempting move the motors.

Thank you in advance.
Re: Z_MAX always triggered
November 30, 2014 10:40PM
in configuration h file, change the logic of you endstops from true to false or vice-versa. it takes few minutes to do and it's quite simple.

Disable any non-use endstop in marlin.

Edited 1 time(s). Last edit at 11/30/2014 10:41PM by ggherbaz.
Re: Z_MAX always triggered
December 01, 2014 07:35PM
Thanks for the attention, but...

I know I am a beginner however given that the z_max is always triggered regardless of the z switch position simply reversing (inverting) the switch logic will now show the z_max as never triggered regardless of switch position, is this not the case?
Re: Z_MAX always triggered
December 01, 2014 11:53PM
I had same issue before, which turned out I made mistake in connecting crimp pin to cable terminal.
Check out connectors with tester if you have one.
Re: Z_MAX always triggered
December 02, 2014 01:13AM
Unfortunately not true for me. I tested the resistance by probing the end of the crimp pins in the terminal block. When I swapped the z switch wires into the X pins the switch is registered correctly. Which is why I suspect it is in the marlin firmware. Although I would be happy to be wrong.
Re: Z_MAX always triggered
December 02, 2014 01:22PM
I would be sure you are turning off all power to the system after uploading new code. but also, what gherbas was saying was not to invert the motor axis direction but to invert the logic of the end stops. The two are separate in the config.h.
Re: Z_MAX always triggered
December 02, 2014 04:40PM
On a more fundamental level, check the "motherboard" setting in marlin, it controls a whole slew of IO pin definitions and will need to be set correctly for your electronics.
There is one more possibility, you might have a blown IO pin on your electronics. if you know your way around them then you might be able to reassign an unused pin to the Z max endstop (X min or Y min, if present, for instance )

Cheers,
Robin.
Re: Z_MAX always triggered
December 03, 2014 11:57AM
If your ZMAX endstop is not used, enable the endstop pullup and set the ZMAX inverting to "true". This configuration insures that the unused endstops will always show open.

The way the endstop circuit is designed, if there is no endstop and the pullup resistor is disabled, the "S" signal input to the Mega2560 chip is floating. This can result in random triggering or in your case the endstop triggered all the time.
Re: Z_MAX always triggered
December 06, 2014 07:30PM
Thank you all for the various hints. After a number of frustrating days wrestling with 2560, RAMPS, switches, and Arduino IDE I have finally been able to track down the issue.

1) the declaration of each endstop pin needed INPUT_PULLUP so that it would correctly register the opening and closing of the switch otherwise the registration was almost random (thanks to normw for that)

2) Having swapped the x and z switches terminal blocks on the RAMPS board I saw the behaviour move to the x_max switch. So I replaced x_max to the correct position and reallocated the z_max pin to be the x_min pin and placed the z_max terminal block on the x_min pins. Loh all worked as expected.

Conclusion: That particular arduino pin (19 for those interested) seems to be dead, so I must have done something wrong during the initial wiring, or perhaps the gremlins were at work.

Happy to find the cause and a work around.
Re: Z_MAX always triggered
August 02, 2016 10:34PM
had the same issue with zmin using a optoendstop, my case is marlin i tested the port with 2 optos with this code and pins are working good

//what pin are we using?
#define ENDSTOP_PIN 2
#define ENDSTOPa_PIN 3
//which opto enstop are we using?
//this is for the H21LOB
#define INVERTED 1
//this is for the H21LOI
//#define INVERTED 0

void setup()
{
pinMode(ENDSTOP_PIN, INPUT);
pinMode(ENDSTOPa_PIN, INPUT);
Serial.begin(9600);
Serial.println("Starting opto endstop exerciser.");
}

void loop()
{
if (digitalRead(ENDSTOP_PIN))
{
if (INVERTED)
Serial.println("open.");
else
Serial.println("blocked.");
}
else
{
if (INVERTED)
Serial.println("blocked.");
else
Serial.println("open.");
}


if (digitalRead(ENDSTOPa_PIN))
{
if (INVERTED)
Serial.println("opena.");
else
Serial.println("blockeda.");
}
else
{
if (INVERTED)
Serial.println("blockeda.");
else
Serial.println("opena.");
}





delay(500);
}



i dont know what could be wrong,
Re: Z_MAX always triggered
August 03, 2016 01:06PM
Jorgeneo,

Looks like your H21LOB should work the same as my inductive probe in the Marlin firmware.

Here are my end stop settings:
#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN
#endif


const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. - The inductive probe output is low when triggered.


Comment out the ENDSTOPPULLUP_ZMIN, and set Z_MIN_ENDSTOP_INVERTING =false, if the output is high when triggered. Set Z_MIN_ENDSTOP_INVERTING =true, if the output is low when triggered.

Edited 1 time(s). Last edit at 08/04/2016 01:19PM by normw.
Re: Z_MAX always triggered
October 06, 2019 04:56AM
I know this is old but what was the solution? Im gaving pretty much the same problem but with the Y end switch after upgrading my board to a SKR 1.3 on an Cr10s.
My Post:
[reprap.org]

Edited 1 time(s). Last edit at 10/06/2019 04:56AM by Dennis2089.
Sorry, only registered users may post in this forum.

Click here to login