Hello Guest it is August 08, 2022, 10:26:23 PM

### Author Topic: Limit switch location on axis?  (Read 7110 times)

0 Members and 1 Guest are viewing this topic.

#### bigandy

• 17
##### Limit switch location on axis?
« on: January 12, 2009, 09:29:26 AM »
Afternoon all.

Please forgive the rather obvious question (it's not for me though, otherwise I wouldn't be asking!).  I am nearly ready to run my 3 axis router, and I just need to mount the axis limit switches to the machine now.  However, I am not sure of the best place to locate them, in terms of the axis total movement.

For example, my X axis can move a total of 12".  If it travels any more than that limit, the carriage will hit the machine frame, and something has to give (either the leadscrew nut, the motor coupling or the machine frame!).  Although that is my ultimate machine limit, is it good practice to mount the limit switches at (say) 90" of the axis total travel?

I'm thinking that perhaps it is, that way there will be time for Mach3 to detect the limit switch trigger, and stop the axis moving (allowing a bit for deceleration too).  The only thing I am wondering, is the amount of room required for this, which will determin where to mount the limit switches.  Are there any guidelines for this sort of thing anywhere?

Any opinions would be much appreciated!

Cheers
Andy

#### HimyKabibble

• 1,687
##### Re: Limit switch location on axis?
« Reply #1 on: January 12, 2009, 10:53:49 AM »
Andy,

Ideally, the limit switches should directly cut power to the drives, WITHOUT depending on Mach3 to do anything at all.  This means having the switches directly controlling a relay.  The limit switches should be placed far enough from the physical limit of travel that once the limits are triggered, even if the axis is moving at it's maximum speed, the axis will coast to a stop JUST before hitting the physical end of travel.

Regards,
Ray L.
Regards,
Ray L.

#### simpson36

• 1,369
##### Re: Limit switch location on axis?
« Reply #2 on: January 13, 2009, 09:58:16 AM »
Mach has a feature called "soft limits" which slows and then stops the travel (based on your settings) before the limit is reached. That should serve to protect your machine, provided it is turned on of course.

A really nice aspect of this feature is that Mach will warn you if you are about to run a program that will exceed the limits . . . handy for a newbee like myself!

This raises an interesting question. If I have this right, Mach uses only one value for both accel and decel. If soft limits are turned off and the limit switch is tripped, does Mach still honor that value, or does it do an 'emergency' maximum decel?

As to cutting the power to the motors independent of Mach, wouldn't you then loose the ability to brake the motors? Certainly I would at least put a braking resistor on any normal PM DC motor, and cut that in when the power was disconnected by a relay. I don't know if steppers can be dynamically slowed. Anyone?
« Last Edit: January 13, 2009, 10:06:29 AM by simpson36 »

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Limit switch location on axis?
« Reply #3 on: January 13, 2009, 10:37:42 AM »
Hitting a limit will be just like an e-stop so no decel used just total and instant  stopping of the step pulses.

Hood

#### HimyKabibble

• 1,687
##### Re: Limit switch location on axis?
« Reply #4 on: January 13, 2009, 11:44:20 AM »
Mach has a feature called "soft limits" which slows and then stops the travel (based on your settings) before the limit is reached. That should serve to protect your machine, provided it is turned on of course.

A really nice aspect of this feature is that Mach will warn you if you are about to run a program that will exceed the limits . . . handy for a newbee like myself!

This raises an interesting question. If I have this right, Mach uses only one value for both accel and decel. If soft limits are turned off and the limit switch is tripped, does Mach still honor that value, or does it do an 'emergency' maximum decel?

As to cutting the power to the motors independent of Mach, wouldn't you then loose the ability to brake the motors? Certainly I would at least put a braking resistor on any normal PM DC motor, and cut that in when the power was disconnected by a relay. I don't know if steppers can be dynamically slowed. Anyone?

Yes, for DC servos a braking resistor would be a good idea as well.  For steppers, the best thing to do is just interrupt the step signal, and leave the motor powered, which should stop it pretty much as quickly as possible.

Regards,
Ray L.
Regards,
Ray L.

#### bigandy

• 17
##### Re: Limit switch location on axis?
« Reply #5 on: January 14, 2009, 06:17:41 PM »
Cheers for the input guys, much appreciated!  I'm going to redesign my breakout board to feed a disable signal (5v) into the stepper drives on either an E stop or a Limit switch event, and this should stop the drives/motors in the quickest fashion.  I just need to do some more testing to determine the best position for the switches to ensure I don't get any crashes.  Hopefully it won't eat into my available travel though (Only got 9"x9"x4"!).

I've just spent a couple of hours wondering why my sums for the "Steps per" in Mach 3 were miles out, only to find I had got a dip switchin the wrong position, resulting in 64 Microsteps, instead of only 10!  Doh!

I like the sound of these Soft limits too.  I hope they work with the Smoothstepper driver I am using

Cheers
Andy

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Limit switch location on axis?
« Reply #6 on: January 14, 2009, 06:20:33 PM »
Yep, softlimits have been working with the SS for quite a while now.
Hood

#### HimyKabibble

• 1,687
##### Re: Limit switch location on axis?
« Reply #7 on: January 14, 2009, 06:49:44 PM »
Cheers for the input guys, much appreciated!  I'm going to redesign my breakout board to feed a disable signal (5v) into the stepper drives on either an E stop or a Limit switch event, and this should stop the drives/motors in the quickest fashion.  I just need to do some more testing to determine the best position for the switches to ensure I don't get any crashes.  Hopefully it won't eat into my available travel though (Only got 9"x9"x4"!).

I've just spent a couple of hours wondering why my sums for the "Steps per" in Mach 3 were miles out, only to find I had got a dip switchin the wrong position, resulting in 64 Microsteps, instead of only 10!  Doh!

I like the sound of these Soft limits too.  I hope they work with the Smoothstepper driver I am using

Cheers
Andy

64 microsteps?  What kind of stepper drivers are you using?  64 is kinda ridiculous.  Anything over 10 is kinda pointless....

Regards,
Ray L.
Regards,
Ray L.

#### bigandy

• 17
##### Re: Limit switch location on axis?
« Reply #8 on: January 15, 2009, 06:30:54 AM »
Good stuff re the softlimits.  I've got an afternoon/evening of testing and work scheduled for Sunday so, fingers crossed, I'll be able to get the limit switches and limits nailed

Regarding the drives I am using, they are MDS542 stepper drivers from Motion Control Products Ltd.  (see here: http://www.motioncontrolproducts.co.uk/product_info.php?cPath=26&products_id=3 ).  They actually support up to 128 microstepping, but as you say, anything over ten is pretty pointless in this application.  Being pointless didn't stop me from making a c*ck up though!

Cheers
Andy