Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: stirling on May 23, 2007, 04:25:05 AM

Title: home and limits question
Post by: stirling on May 23, 2007, 04:25:05 AM
Hi all

When axis go home they hit the switch, decelerate then back off (as of course they should).
When an axis hits limit it stops instantly (which I think is normal) but... can Mach3 be configured so that they decelerate? (like home but obviously with no back off).

It just seems that if there's room for a decelerate after home switch hit, then why not after limit switch hit? I'm thinking it would be kinder to the machine.

Cheers
Title: Re: home and limits question
Post by: Chaoticone on May 23, 2007, 07:42:43 AM
I think what you want is softlimits which Mach has. :) In config, homing and limits. With these settings it will ramp down to a crawl until it hits a limit.

Brett
Title: Re: home and limits question
Post by: stirling on May 23, 2007, 09:07:42 AM
hi Chaoticone

got it - thanks very much
Title: Re: home and limits question
Post by: Chaoticone on May 23, 2007, 09:18:24 AM
Your welcome, let us know if you need anything else.

Brett
Title: Re: home and limits question
Post by: lemo on May 23, 2007, 09:46:42 AM
Think about it, the limit switch is not, compared to the home switch, at a fixed location.
At least not necessarily by definition.
The limit switch is simply signaling the event that a set limit has been hit. I move my limit switches when I have my 4th axis mounted, so the machine head stock does not collide, or better said, cannot collide. So the machine can know where home is and then certainly slow down while approaching it, but in the case of a limit, it has to stop dead and does not really know when to encounter that position.
In theory it would be nice to have the machine figure out where the limit is, equal to the home exploration. And then work as it does with the soft limits.
But in practice, the limits should NEVER be hit as per definition something is at fault.
And considering that, things are not going to improve from there.
I changed my workflow to tell the machine that I have home switches, then run it very close to the limit switches, note the locations, enter them as soft limits, then unleash heck on the workpiece. I have to do that as the limit switches are often triggered by the induced stepper noise on their lines. And I am to lazy to rewire right now. That method works very well, and I cannot destroy my little mill.
Cheers
Lemo
Title: Re: home and limits question
Post by: stirling on May 23, 2007, 06:02:57 PM
Hi lemo - understood.

My question was based around the fact that suddenly stopping an axis is generally best avoided except when you're about to lose a body part.
I'd thought that there would be a way in Mach3 to avoid this happening and indeed as Chaoticone stated, there is.
I'd expected the algorythm to be "if you hit a limit then brake hard as you can to a stop" and the op would position the limit switches appropriately. Wheras it's actually "on entering the soft limit zone, slow down to a velocity slow enough that IF you hit a limit, a sudden stop will not be too hard".

Which is the better approach? I don't know - I can see advantages/disadvantages to both approaches.

Title: Re: home and limits question
Post by: lemo on May 23, 2007, 08:16:30 PM
The soft stop is always the better one. But the software has to know where that is located to be able to slow down to a crawl.
The limit switch option controlled by the port and the pin ID is a mystery for the machine till it hits.
When I use the hard limit switch, then I even modify their X position during the run if I see that some obstruction is closer than I thought.
I don't think that both methods can really be compared. When you know you do not loose steps, and the code worked on is known, then I see little risk that the software would loose sync with the real world and require the hard limit switches. Soft would be fine. I just finished building my little pet, so I rely on the hard limits while adjusting and trying things. Once all looks cool, I use the soft limits for the apparent benefits.

Btw... I just connected an old USB joystick. Haha, very cool!
Lemo

Title: Re: home and limits question
Post by: stirling on May 24, 2007, 03:04:17 AM
Hi again lemo - this could run :D

It doesn't matter that the machine doesn't know where a limit switch is. It's how it can respond, if and when it hits one that I'm discussing. The software writer (Art in Mach3's case) has basically two options.

if limit switch hit then
stop dead
end if

or

if limit switch hit then
stop in a controlled manner
end if

it's like when you're driving your car, you don't know when a child is going to run out in front of you but you have the same options if one does

if child runs out then
break so hard you're head comes off
end if

or

if child runs out then
break as hard as you can without causing your neck to snap.
end if

Another approach is to play the caution card i.e. when there's a likelyhood of children being around, drive slowly enough that if you have to do a dead stop, you can do so without your eyes flying out of your head and splatting on the windscreen. This is the Mach3 approach. It's a perfectly good approach but not the only one possible is all I'm saying.
Title: Re: home and limits question
Post by: Chaoticone on May 24, 2007, 08:02:38 AM
Stirling, If a limit is hit, it stops dead still right then no matter if soft limits are on or not. The soft limits simply put are set so that you never get to the limits. If they are not set up right, they won't work as they should. In any case, make a limit and, dead stop.

Brett
Title: Re: home and limits question
Post by: Hood on May 24, 2007, 01:14:03 PM
Stirling, it is not really practical to  stop in a controlled manner after a limit has been hit.  You would have to position your limit a certain distance away from where your actual physical table limits were as a controlled stop would take some distance. You would find this distance very hard to judge as the speed the axis was moving would vary the stopping time and also the weight of the axis (with a vice, with a heavy workpiece etc) so in the end you would have to move it back far enough for the maximium expected "controlled stop" distance which would eat up valuable travel. A possibility would be to have a second limit before the hard stop limits so that when it was tripped the axis could slow down, but why do this when that is exactly what the softlimits do?

Hood
Title: Re: home and limits question
Post by: stirling on May 24, 2007, 01:40:43 PM
Thanks Hood

Maybe I havn't been explaining myself very well, but you've obviously understood what I was trying (obviously badly) to say. Also you've given a good reason why the soft limit approach in conjunction with the hard limit switches are the better approach. I now understand why Mach3 opts for this method, which was all I was trying to discuss.

Thanks all for your input. Much appreciated. :)
Title: Re: home and limits question
Post by: Hood on May 24, 2007, 01:45:44 PM
No problem stirling and please dont let this put you off bringing ideas to the fore as you may see something that no one else has seen or thought of before.

Hood
Title: Re: home and limits question
Post by: lemo on May 24, 2007, 08:26:59 PM
Sharing and discussing concepts always reveals thoughts and points of view one might have overlooked before. I like discussions like this as I always learn from them. Always cool!

Considering the car example, I think about the limit switches as if they are a transparent concrete wall. Not like a child, which you cann see and react upon.

I have not tried it but, are the limit switches active when soft limits are activated? In case, the limit switches could be what they should be, emergency switches, and the soft limits, defined to trigger before the limits are hit...

Maybe I just understood how Mach should be configured hahaha

Happy weekend all!
Lemo
Title: Re: home and limits question
Post by: stirling on May 25, 2007, 06:51:27 AM
All's good - I have reasonably broad shoulders :) This whole question came to me after using a machine for a couple of years without any switches at all. I decided to add them really cos I wanted a home function and thought I'd do limits while I was at it. I'd had very few crashing problems before but thought it might be a good idea as I've (more or less) gained the confidence to leave the machine doing it's thing unattended.

That said I'm still thinking about it cos far from crashing into fixtures etc. the problem I've had more often than anything else is with "shifting islands", and no limits (soft or hard) can help with that one.

Maybe I'll look at spindle and stepper current overload monitoring!!!! - that should sort it ;D

On a completely different tack - has anyone noticed that if you preview a post, when you try to actually post it the board thinks you've already sent it and hacks you off for maybe double clicking the post button? Never happens if I don't preview first.
Title: Re: home and limits question
Post by: lemo on May 25, 2007, 07:06:23 AM
Right now I am the biggest danger for my machine. And the fact that I have a fourth axis on the little system congests everything a tad. Limit switches during the setup have prevented a few times that the dimwit at the controls ran the tool into the turntable... Sometimes I also try out G-Code deliverd by someone else, and that's not always 100% cool.
Lemo
Title: Re: home and limits question
Post by: Hood on May 25, 2007, 11:17:44 AM
On a completely different tack - has anyone noticed that if you preview a post, when you try to actually post it the board thinks you've already sent it and hacks you off for maybe double clicking the post button? Never happens if I don't preview first.

 I dont get this, I have just posted a reply to another  thread and did a preview first with no problems. What browser are you using?

Hood
Title: Re: home and limits question
Post by: stirling on May 27, 2007, 05:02:22 AM
IE 6 on XP pro
Title: Re: home and limits question
Post by: Hood on May 27, 2007, 06:23:32 AM
Just typing this in IE6 and will do a preview to see what happens.
Hood
Title: Re: home and limits question
Post by: Hood on May 27, 2007, 06:25:34 AM
Well it worked fine for me in IE so dont know why you are getting the problems, have you changed any of your security settings in IE?

Hood
Title: Re: home and limits question
Post by: stirling on May 27, 2007, 07:34:41 AM
Nope. Just a thought but it didn't happen on my last post and I'd just cleaned out the cache etc. so I'm wondering if I had a double clicker or something in there. Anyway, if it's not happening for you it must be a local problem - I'll sort it.

Thanks
Title: Re: home and limits question
Post by: Hood on May 27, 2007, 08:38:50 AM
NP but let me know if you still get this and I will see if Benny or anyone else can figure out why.
Hood