End stops and home position

6,331 views
Skip to first unread message

Qianqian Fang

unread,
Jul 31, 2012, 11:45:12 AM7/31/12
to mend...@googlegroups.com
Yesterday I was struggling with setting home position and installing the end stops.

I set up the wiring based on RAMPS1.4 diagram:

http://reprap.org/mediawiki/images/6/6d/Rampswire14.svg

but I found the end stops did not work: print head can only move one way; when moving the other way, pronterface always complains "endstops hit: X/Y/Z:????"

I connected the middle pin instead, sometime it worked, but not always.

I know Mike did not use end stops, so there was no end stop mounts in the package. However, I found it is still necessary to use those because I was not able to set up the home position on pronterface, unless I put end stops at xmin/ymin/zmin.

Does anyone know the correct way to connect the end stops? other than use end stops, any other ways to set up home position?

thanks

Qianqian

Gert van den Berg

unread,
Jul 31, 2012, 2:05:29 PM7/31/12
to mend...@googlegroups.com
M119 shows the endstop status... (In Marlin at least)

Marlin seem to like them being high when hit... (Connected to center pin and pin nearest to hinge) There are some settings to invert the endstop logic, but then it assumes that the max endstop is hit, unless you jumper it out...

Marlin has some settings that allow you to go to negative positions...

My RAMPS board had the endstop header soldered on on position out. I connected to the I2C pins, and there was no header on the x-min connector. A solding iron and some spare headers fixed it up

Gert

Qianqian Fang

unread,
Jul 31, 2012, 3:38:21 PM7/31/12
to mend...@googlegroups.com
On Tuesday, July 31, 2012 2:05:29 PM UTC-4, Gert van den Berg wrote:
M119 shows the endstop status... (In Marlin at least)

hi Gert

thanks! I looked into Marlin Configuration.h, I found the following lines:

const bool X_ENDSTOPS_INVERTING = true;
const bool Y_ENDSTOPS_INVERTING = true;
const bool Z_ENDSTOPS_INVERTING = true;
...
#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

when I send M119 to the board, I got

 x_min:L x_max:L y_min:L y_max:L z_min:H z_max:L

I found x-axis can only move along x+, y can move both ways, and z is similar to x, only move along + direction.

If I change all [XYZ]_ENDSTOPS_INVERTING to false, the output of M119 became

x_min:L x_max:H y_min:H y_max:H z_min:L z_max:H

the x-axis can only move -x direction; y can not move either way (endstops hit error), z can only move towards -z.

do you know what exactly should I use in the Configurations.h?


Marlin seem to like them being high when hit... (Connected to center pin and pin nearest to hinge) There are some settings to invert the endstop logic, but then it assumes that the max endstop is hit, unless you jumper it out...


now my wires connects to the 1st and 3rd pins (skip the middle one) of the 
end stop. Are you suggesting I should use the middle pin?


 
Marlin has some settings that allow you to go to negative positions...

My RAMPS board had the endstop header soldered on on position out. I connected to the I2C pins, and there was no header on the x-min connector. A solding iron and some spare headers fixed it up


it would also be nice if you can comment on how you set your
home position. 

thanks

Qianqian
 

Gert

Cecil

unread,
Jul 31, 2012, 4:04:39 PM7/31/12
to mend...@googlegroups.com
My first 'fun' with Marlin started last week with endstops.   For mechanical endstop switches, you need the pullup resistors enabled.  In configuration.h   look for

 

// coarse Endstop Settings

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


Your code probably has    //#define ENDSTOPPULLUPS    and the // opens the resistors.
 
On the switch, the pivot end of the switch is often the common arm.  I used the pivot end contact and the center contact, which gave Normal Open operation and the Marlin default (of July 14th, any way)

Gert van den Berg

unread,
Jul 31, 2012, 4:12:53 PM7/31/12
to mend...@googlegroups.com


On Tuesday, July 31, 2012 9:38:21 PM UTC+2, Qianqian Fang wrote:
On Tuesday, July 31, 2012 2:05:29 PM UTC-4, Gert van den Berg wrote:
M119 shows the endstop status... (In Marlin at least)

hi Gert

thanks! I looked into Marlin Configuration.h, I found the following lines:

const bool X_ENDSTOPS_INVERTING = true;
const bool Y_ENDSTOPS_INVERTING = true;
const bool Z_ENDSTOPS_INVERTING = true;
...
#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

when I send M119 to the board, I got

 x_min:L x_max:L y_min:L y_max:L z_min:H z_max:L

I found x-axis can only move along x+, y can move both ways, and z is similar to x, only move along + direction.

If I change all [XYZ]_ENDSTOPS_INVERTING to false, the output of M119 became

x_min:L x_max:H y_min:H y_max:H z_min:L z_max:H


It thinks it hit the max endstops... shorting them out will work, or leave invert on defaults, and change the wiring...
 
the x-axis can only move -x direction; y can not move either way (endstops hit error), z can only move towards -z.

do you know what exactly should I use in the Configurations.h?

I use the defaults for the endstops, with the wires on the pins as mentioned below.

Advantage of using invert: If the switch gets disconnected, it triggers useful if the cable breaks, etc...

Disadvantage: The MAX endstop also need to be present / shorted out... 
 
Marlin seem to like them being high when hit... (Connected to center pin and pin nearest to hinge) There are some settings to invert the endstop logic, but then it assumes that the max endstop is hit, unless you jumper it out...


now my wires connects to the 1st and 3rd pins (skip the middle one) of the 
end stop. Are you suggesting I should use the middle pin?

If you use the middle pin, you don't need to play with the invert settings... I found this to be easier....

it would also be nice if you can comment on how you set your
home position. 

That is still a work in progress.... I'm still waiting for my extruder and getting the Z-axis smooth have been taking up most of my time...

Gert

Qianqian Fang

unread,
Jul 31, 2012, 5:09:51 PM7/31/12
to mend...@googlegroups.com
On Tuesday, July 31, 2012 4:12:53 PM UTC-4, Gert van den Berg wrote:

I use the defaults for the endstops, with the wires on the pins as mentioned below.
 

After using the invert connection (hinge+middle pin), x and z both worked fine. 
y-axis is the only one that is not working. Pressing the switch while y-axis 
moving towards did not do any thing :( I don't fully understand ...

all switches are located at the min end.

Gert van den Berg

unread,
Jul 31, 2012, 5:17:03 PM7/31/12
to mend...@googlegroups.com

On Tuesday, July 31, 2012 11:09:51 PM UTC+2, Qianqian Fang wrote:
On Tuesday, July 31, 2012 4:12:53 PM UTC-4, Gert van den Berg wrote:

I use the defaults for the endstops, with the wires on the pins as mentioned below.
 

After using the invert connection (hinge+middle pin), x and z both worked fine. 
y-axis is the only one that is not working. Pressing the switch while y-axis 
moving towards did not do any thing :( I don't fully understand ...

all switches are located at the min end.

Try to press it manually and check what M119 says? It should say H for Y_min when pressed and L when not pressed... A multimeter should find continuity when pressed (between the connected pings) and it should stop showing continuity when it is released...

How have you mounted the switches? For Z a cable tie around the smooth rod works... My X and Y mounts still need improvement... (It basically involve sticking them in the way of the carriages... Only keeps axis from hitting limits, doesn't currently ensure that extruder stays above print head...)

(I need to get some sleep now...)

Gert

Larry Knopp

unread,
Jul 31, 2012, 7:00:05 PM7/31/12
to mend...@googlegroups.com
Leaving your wiring as is, set Y to inverted in Marlin...

The physical location of your endstop switches should be :
X = left (the "front" of your machine being the side where your Y motor is mounted)
Y = back
Z = bottom (either left or right, doesn't matter)

So, this places 0,0,0 (Home) at the front, bottom left corner of your print envelope...


Gert

--
You received this message because you are subscribed to the Google Groups "MendelMax Support" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mendelmax/-/3O3VFf8oCv8J.

To post to this group, send email to mend...@googlegroups.com.
To unsubscribe from this group, send email to mendelmax+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mendelmax?hl=en.

Qianqian Fang

unread,
Aug 1, 2012, 12:45:48 PM8/1/12
to mend...@googlegroups.com, Gert van den Berg
On 07/31/2012 05:17 PM, Gert van den Berg wrote:
> Try to press it manually and check what M119 says? It should say H for
> Y_min when pressed and L when not pressed... A multimeter should find
> continuity when pressed (between the connected pings) and it should
> stop showing continuity when it is released...

using a multi-meter, I found out that the y-stop was
a broken switch. No pins are connected after pressing
down the button :(

does anyone know where to get a replacement? I
need a new one to start testing the printer.

Qianqian

>
> How have you mounted the switches? For Z a cable tie around the smooth
> rod works... My X and Y mounts still need improvement... (It basically
> involve sticking them in the way of the carriages... Only keeps axis
> from hitting limits, doesn't currently ensure that extruder stays
> above print head...)
>
> (I need to get some sleep now...)
>
> Gert

Tim A. King, Jr

unread,
Aug 1, 2012, 12:51:58 PM8/1/12
to mend...@googlegroups.com
You could raid a computer mouse, or depending on where you are located in the world, there is bound to be an electronics supply house close...


Tim 


To unsubscribe from this group, send email to mendelmax+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/mendelmax?hl=en.
--
You received this message because you are subscribed to the Google Groups "MendelMax Support" group.
To post to this group, send email to mend...@googlegroups.com.
To unsubscribe from this group, send email to mendelmax+unsubscribe@googlegroups.com.

Gert van den Berg

unread,
Aug 1, 2012, 3:26:29 PM8/1/12
to mend...@googlegroups.com, Gert van den Berg


On Wednesday, August 1, 2012 6:45:48 PM UTC+2, Qianqian Fang wrote:
using a multi-meter, I found out that the y-stop was
a broken switch. No pins are connected after pressing
down the button :(

does anyone know where to get a replacement? I
need a new one to start testing the printer.

You should be able to print without homing Y? If it insists on homing it, manually shorting wires connected to the RAMPS board instead of the endstop when it approaches a reasonable start positions should allow you to print while figuring out where to get a replacement...

It seems like optical endstops might make sense for the Z axis... They are probably tricker to get than simple switches... (For X and Y, a millimeter or two inconsistency shouldn't be a problem, as long as nothing decides to home during a print...)

Gert

Qianqian Fang

unread,
Aug 1, 2012, 5:32:53 PM8/1/12
to mend...@googlegroups.com, Gert van den Berg
On Wed, Aug 1, 2012 at 3:26 PM, Gert van den Berg <ger...@gmail.com> wrote:
You should be able to print without homing Y? If it insists on homing it, manually shorting wires connected to the RAMPS board instead of the endstop when it approaches a reasonable start positions should allow you to print while figuring out where to get a replacement...


I did exactly what you suggested: short the pins when I want it to stop along y. 
I did it once, the controller seemed to remember it. The only issue was that I occasionally
need to turn off motors, and move the y-axis by hand to fix things. I found this could 
shift the home positions, and sometime it could cause trouble. But in any case, I think 
it is ready for some simple prints.


It seems like optical endstops might make sense for the Z axis... They are probably tricker to get than simple switches... (For X and Y, a millimeter or two inconsistency shouldn't be a problem, as long as nothing decides to home during a print...)


I think the origin of the trouble came from pronterface. It appears
to me that pronterface relies on these end stops to set home position.
If there is a command I can manually set the home position (say, to 
the current position), I think I can get away from using end stops.

Qianqian

 

Gert

--
You received this message because you are subscribed to the Google Groups "MendelMax Support" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mendelmax/-/3y1-CY7PQ7sJ.

MoHaG

unread,
Aug 1, 2012, 5:50:42 PM8/1/12
to mend...@googlegroups.com, Gert van den Berg


On Wednesday, August 1, 2012 11:32:53 PM UTC+2, Qianqian Fang wrote:
I think the origin of the trouble came from pronterface. It appears
to me that pronterface relies on these end stops to set home position.
If there is a command I can manually set the home position (say, to 
the current position), I think I can get away from using end stops.
The firmware uses the position of the printer as 0.0,0.0,0.0 when it starts up (or resets)... As far as I figured out, the homing allows it to find a consistent position, irrespective of where they were when it was switched on...

Marlin has some settings the allow it to move to negative co-ordinates.... There is a g-code command as well that sets the current position to be 0.0, 0.0, 0.0 (According to http://reprap.org/wiki/G_code it is G92)

I haven't actually sliced anything, so I'm not sure how the slicer's output tries to set up the printer....

Repetier-Host looks really nice as well... See http://reprap.org/wiki/Repetier-Host

Gert

Ross Shannon

unread,
Aug 1, 2012, 7:37:29 PM8/1/12
to mend...@googlegroups.com

Slic3r will add some code to shut the extruder heat off and home the axis - make sure you REM or erase this before slicing.

--
You received this message because you are subscribed to the Google Groups "MendelMax Support" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mendelmax/-/Sy6ctDacsGYJ.

Eric Sorensen

unread,
Aug 2, 2012, 1:17:52 AM8/2/12
to mend...@googlegroups.com

Endstops are definitely nice to have, but in the last few weeks I've gotten really used to printing without them. Here are some tips:

1. I disable software min/max in firmware so I can tell the printer to move to negative positions in case it is ever homed in the wrong position.

2. Get the printer to where you think home is. Then send "G92" to set the home position. (I create a button for this in pronterface)

3. Start a print, if the z height is wrong, adjust it "on the fly" by manually turning the aluminum couplers by hand until the filament is squished a bit, but not so much that you are causing extruder problems. Once you've done this once, you shouldn't have to do it again unless you are skipping steps on z. Next time you go to x0 y0 z0 it will be the correct home position.

4. At the end of a print, goto home using g0. Ie: "g0 x0 f1200" "g0 y0 f1200", etc. (I make buttons for these too).

5. If you want to turn off your printer, make sure it is in the home position first. That way when you turn it back on it will already be home and ready to go.

It is also useful to have your start gcode set home (G92) so you will never accidentally crash the hot end if your home position is off.

I've used both optical and mechanical end stops and they have both worked equally well for me. I highly recommend finding an endstop mount that is easily adjustable for the z-axis.

Again, its really nice having end stops (so you can have that "home, print" experience) but hopefully this will help some of you as you pick out some end stop holders and print them. :)

Eric (ravix)

vlad

unread,
Aug 24, 2012, 3:54:44 AM8/24/12
to mend...@googlegroups.com
I have only ever printed using RepG and a cupcake, so I never had endstops, and its a pain to always manually zero it, but it works fine like you said.   I simply removed the "set positino to zero" g92? code from my G-code manually after skienforge made it, and would manually using the controll buttons or belts bring the system to 0,0,0.  Then send the make current posstion home command manually (there is a button in RepG) and hit print.

list form cause it's easier to read:
1) get the printer exaclty where you want 0,0,0 to be manually
2) send "G92" to the printer, which makes current position 0,0,0
3) open the .gcode, find any instances of G92 or G28, remove with extreme prejudice
4) Profit!... er hit print!

vlad

unread,
Aug 29, 2012, 9:11:17 PM8/29/12
to mend...@googlegroups.com
I have solved this issue, maybe, I don't have not printed yet, BUT you need to clarify for me your setup.  you have the X end stop in the max location, and no min? 

On Wednesday, August 29, 2012 8:53:53 PM UTC-4, Tom11 wrote:
I've got a similar problem- My X opto is on the right side of my printer, which means I need to home to the max, rather than the min.  It seems to home properly, but when I o print, or use G codes to move to a location, it won't move- or it goes past the endstop and causes all sorts of nasty problems.

After homing the X axis the printer thinks it's at X0 when really it should be at X200.  I've tried several variations on inverting the axis or home direction in marlin firmware, but none seem to work, other than to set it up so max X is to the right- but then my prints all come out inverted.

Is there another way to do this in firmware, or do I need to move my x opto to the left, or min side of the printer?
Y and Z work fine, and are in the normal places.

-Tom

vlad

unread,
Aug 29, 2012, 9:17:09 PM8/29/12
to mend...@googlegroups.com
I keep thinking I am talking to a Thing-o-Matic.  anyways I re-read ur msg with my eyes open and think I got everything I need.  in configuration.h near line 184 change:

#define X_HOME_DIR -1
to
#define X_HOME_DIR 1
and
#define X_HOME_POS 0
to
#define X_HOME_POS 200

now if you are using RAMPS wire the endstop to the X+ location, which I belive is unlabled and above the X- location, which is labled
change pins.h near line 255
#define X_MIN_PIN           3
#define X_MAX_PIN          -1
to
#define X_MIN_PIN           -1
#define X_MAX_PIN          2

that is all for mechanical endstops, so if you have changed things to make opto work, make sure you did that as well, I can't help you there.


On Wednesday, August 29, 2012 8:53:53 PM UTC-4, Tom11 wrote:
I've got a similar problem- My X opto is on the right side of my printer, which means I need to home to the max, rather than the min.  It seems to home properly, but when I o print, or use G codes to move to a location, it won't move- or it goes past the endstop and causes all sorts of nasty problems.

After homing the X axis the printer thinks it's at X0 when really it should be at X200.  I've tried several variations on inverting the axis or home direction in marlin firmware, but none seem to work, other than to set it up so max X is to the right- but then my prints all come out inverted.

Is there another way to do this in firmware, or do I need to move my x opto to the left, or min side of the printer?
Y and Z work fine, and are in the normal places.

-Tom

On Friday, August 24, 2012 12:54:44 AM UTC-7, vlad wrote:

Ross Shannon

unread,
May 28, 2013, 9:56:59 PM5/28/13
to MendelMax Support

I tried and failed - surrendering to just put it like Larry says and everything will be ok

On May 28, 2013 7:02 PM, "Alex Guenov" <alexg...@gmail.com> wrote:
I understand what you are saying for the physical location of the endstop switches and it works correctly that way on marlin. But what if I want to move my Y endstop to the front of the printer? So home is at the top, left corner of print envelope. I've tried messing with configuration.h but nothing seems to want to make the Y axis home towards the front of the printer. It only homes correctly when the y wants to go to the back. The only thing that works for making the y home to the front is inverting the Y direction but this has a negative consequence. The prints are mirrored to what they actually should be.
To unsubscribe from this group and stop receiving emails from it, send an email to mendelmax+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages