Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: majorstrain on April 04, 2011, 12:29:26 AM

Title: Possible to keep limits enabled during home?
Post by: majorstrain on April 04, 2011, 12:29:26 AM
Hi Guys and Gals,
I have a 3 axis mill with all limits and home switches wired to separate inputs on my BOB. Yep nine inputs.
I Set up the mill b4 I had Mach running and wired the limits this way because it lets you safely jog off a limit without disabling the limit, and it's normal practice here at work for motion control systems. ( would be great if I could replicate this in Mach as well)

Is it possible to edit the homing routine (DoButton24 etc) to leave the limit inputs enabled during the home all sequence.

My home positions are 20mm inside the closest limit and if I inadvertently home from within that space the limits are of no use at all, the mill will drive to the end stops and stall the steppers.
I understand why Mach is set up this way, I just want to keep the fail safe features that I have implemented enabled during home.

Cheers,
Phil

Title: Re: Possible to keep limits enabled during home?
Post by: Hood on April 04, 2011, 02:58:39 AM
It is something I have asked for and hopefully will be included in Rev4 but dont think there is a way at the moment.
One thing you can possibly do which may help you. If you have the home switches trigger set up so that once the table reaches and passes the home switch it is always triggered then there is an option on General Config page  called Home Switch Safety, if you have that chosen you get a message saying a home switch is active and the axis wont home, if however you dont have that chosen then the axis with the active home switch will home the opposite way from normal thus moving off the switch.
Hood
Title: Re: Possible to keep limits enabled during home?
Post by: majorstrain on April 04, 2011, 04:08:16 AM
Thanks Hood,
I run separate hall effects and one magnet for the limits and home, I think maintaining the home active mechanically will be a bit of a challenge.

While I wait for Rev4, I might install some electronics to sort the issue out.
I think if I wire the limit signal and home signal through a logic OR gate (74LS32) to the home switch input it will solve the issue.
If the home is missed then the limit will trigger a home and when the home sequence finishes and the limits are re-enabled, the still active limit will trigger an E-stop. That way I'll know that the home was missed. (if I remember the set up)

Thanks again,
Phil

Title: Re: Possible to keep limits enabled during home?
Post by: Hood on April 04, 2011, 04:26:08 AM
Sounds like it would work.
I am in the fortunate position that my homing is done in my drives so Mach knows nothing about me homing until my drives signal its complete, so the Limits are always active.
Hood
Title: Re: Possible to keep limits enabled during home?
Post by: Overloaded on April 04, 2011, 07:59:17 AM
Phil, Hood,
  Could you just use OEM Triggers for the limits that are near the home pos. ?
Assign OEM Trigger 1003 (STOP) to those three inputs. Tried 1021 (RESET) but it never goes into EStop.
Seems to work OK here in sim. and allows all jogging afterwards.
Just a thought,
Russ
Title: Re: Possible to keep limits enabled during home?
Post by: Hood on April 04, 2011, 08:02:18 AM
Possible I suppose Russ. Not sure if they would be as quick as actual limits but probably not far behind if they were  slower.
Hood
Title: Re: Possible to keep limits enabled during home?
Post by: Overloaded on April 04, 2011, 08:14:05 AM
Appears to be instantaneous here in sim., surely would be quick enough unless homing at near 100%.
I'd try it with caution though, start slow.
Russ
Title: Re: Possible to keep limits enabled during home?
Post by: Hood on April 04, 2011, 08:24:31 AM
Yes should be fine, not sure if limits are via the driver or not, if they are then they will be faster but its likely they are not, and even if they were  the difference likely be so minimal that it probably wouldnt matter.
Hood
Title: Re: Possible to keep limits enabled during home?
Post by: majorstrain on April 04, 2011, 10:10:38 AM
Quote
Phil, Hood,
  Could you just use OEM Triggers for the limits that are near the home pos. ?
Assign OEM Trigger 1003 (STOP) to those three inputs. Tried 1021 (RESET) but it never goes into EStop.
Seems to work OK here in sim. and allows all jogging afterwards.
Just a thought,
Russ

Thanks for the Idea Russ,
I'll give it a try when I get back to the mill tomorrow night and let you know how it went.

I home at 20% and the limit stays active for about 3mm before the magnet travels too far past.

Cheers,
Phil
Title: Re: Possible to keep limits enabled during home?
Post by: Overloaded on April 04, 2011, 12:05:10 PM
I'll check back for the update, thanks Phil.
Oh, and don't forget to disable the chosen limits in Ports and Pins / Input Signals.
Good luck,
Russ
Title: Re: Possible to keep limits enabled during home?
Post by: majorstrain on April 06, 2011, 10:09:02 AM
Russ,
You'll be pleased to know that your suggestion worked like a charm, and with a bit more playing around I got it working better than I had hoped.

When I set up the OEM trigger input and disabled the limit input on the X axis, it stopped as expected during a home or jog. But because I have safe Z enabled the Z axis moved to safe Z height as soon as the X axis stopped. No big deal, but scarred the crap out of me the fist time it happened.

I then had the Idea to re-enable the limit input.
Now when the X axis is homing and starts on the wrong side of the home location, the axis gets the stop command from the OEM trigger when it hits the limit switch. The home routine then terminates and the still triggered limit is detected. The system does an E-stop like normal

Way cool, Now I don't have to do any hardware mods.


I'll run through the whole process just in case someone want's to do the same.
You will need to repeat this for each limit that you want active during HOME using a different OEM trigger input.

I went to Config / Ports & Pins / Input Signals and took note of the appropriate limit Port # and Pin number as well as if it was active low or not. I made no changes to this line and left this limit enabled
I duplicated the set up for that limit in the OEM trig #1 line which you will find if you scroll down a bit.
I then clicked OK.
From there I went to Config / System Hotkeys and entered the OEM code of 1003 in the External Buttons - OEM codes section in box 1. This replaced the -1
I clicked OK and that was it.


Thanks Again Russ and Hood for all your help.
Cheers,
Phil
Title: Re: Possible to keep limits enabled during home?
Post by: Overloaded on April 06, 2011, 12:36:27 PM
That's great news Phil, thanks for posting your results.
I'll put this in my saved forum topics folder for future reference.
Regards,
Russ
Title: Re: Possible to keep limits enabled during home?
Post by: kf2qd on April 06, 2011, 05:27:22 PM
It sounds like you are trying for a work-around for poor home switch design.

You should not be able to drive past your home switch. (shouldn't be able to drive past your limit switches either...) What you then need is a workaround in your limits so that if you hit a limit then you know you went past your home switch, you then have to reverse and make sure you go past your home switch and then start the homing sequence all over again. The homing sequence is then needlessly complicated.

Homing sequence begins - Move in the homing direction and check for the homing switch. When the switch is found reverse direction and then stop once the homing switch changes state.  Clean simple and reliable. If you start out on the switch the machine will sense that teh first condition is true and then back off the switch and call that home.

Title: Re: Possible to keep limits enabled during home?
Post by: ger21 on April 06, 2011, 06:20:55 PM
Quote
You should not be able to drive past your home switch. (shouldn't be able to drive past your limit switches either...)

Are you saying separate home and limit switches is a bad design? Because if they are separate, you'll have to go past one of them, unless you set them to the exact same spot.  :)
Title: Re: Possible to keep limits enabled during home?
Post by: majorstrain on April 06, 2011, 06:53:19 PM
Hi kf2qd,
Your right, you should not be able to drive past a limit but the issue arises because during Mach's home sequence the limit signals are disregarded as limits even though I have them on different input pins from the home switches.
This whole issue only arises in a Home routine. Any other time the limits are detected as limits.

For the people that use a limit switch input for homing this is not a problem, their limit is being detected as a home location.
I have separate inputs for all my home and limits switches. I use hall effect sensors for the switches and run an active low system.
My home location on the X axis is 20mm inside my limit location. The X axis is the only axis I have ever had trouble with. Even with mechanical switches you would still have a dead space between the two locations.

LIMIT----HOME-------------------------------------------------------------------------------------------LIMIT

If in the unlikely event I start a home sequence inside that 20mm space, then the home location is on the wrong side of the movement direction. Because of the Mach Home sequence the limits are disabled as limits and the machine will drive past the physical limit location looking for a home input.

Hope this clears it up.
Cheers,
Phil

The reason for the OEM trigger set up is to effectively keep the limits enabled through a Home sequence so you cant drive passed them.
Title: Re: Possible to keep limits enabled during home?
Post by: kf2qd on April 06, 2011, 10:20:33 PM
Quote
You should not be able to drive past your home switch. (shouldn't be able to drive past your limit switches either...)

Are you saying separate home and limit switches is a bad design? Because if they are separate, you'll have to go past one of them, unless you set them to the exact same spot.  :)

NO - Homing switches should have some sort of mechanusm that keeps them tripped after you pass teh leading edge of the home switch, UNLESS you trust the operator to ALWAYS make sure they position the machine properly BEFORE starting the homing sequence.

You could have a home position that is mid travel, you would just need a very long cam to keep the switch tripped as long as you are on the "wrong" side of the switch. A proper homing switch should stay tripped as long as the machine is physically past the home switch in the homing direction. Either that, or you must create a homing sequence that will ALWAYS place the machine physically on the proper side of the switch BEFORE doing the actual homing sequence.

The only other homing sequence I have seen hits the switch 2 times in the homing direction - it goes toward the homing switch at high speed, when it hits the homing switch the axis reverses travel and moves off the homing switch and then  moves toward the homing switch at low speed.(machine had 100 foot travel) It then sets home when it trips the switch. In this case a home switch that you could go past has the potential to be a real problem.

Sorry - I think you should design your homing switches/cams so they function in a more standard way, not require a software change for a sub-optimal design.
Title: Re: Possible to keep limits enabled during home?
Post by: majorstrain on April 06, 2011, 11:02:19 PM
There is a deeper issue than just how the home switch is set up.
The underlying issue is that the limit switches are not active (disregarded) during a home operation.
Just having the home on a cam setup will not sort out issues like a damaged home cable or inoperative switch. If this happens and your setup is active high your axis will sail on past your home position and your limits
I run an active low setup, if the cable is cut then it will be as if the home or limit switch is active. Even with this set up and I get a cut cable then following the logic or the home sequence reversing direction to look for the change of the Home switch from active to idle the axis will just travel full length and sail on past the other end limit because it is disregarded.

Like I said, the issue is not the home switch set up but the fact that the limits are disregarded during a home operation.
This OEM Trigger set up gets around that limitation for those that run separate limit switches from their home switches.

I have no issue with those that run limits and homes on the same input or that Mach is set up to enable that type of system.

That's enough from me now. The OEM setup has been outlined for those who wish to do it, and the reasons behind the requirement to do so are (I think) clear.
Regards,
Phil
Title: Re: Possible to keep limits enabled during home?
Post by: Overloaded on April 07, 2011, 08:29:33 AM
Hi Phil,
  Looks like this would work as well ... provided you were not too close to the opposite end of the travel from your home sensor, then it would just hit the limit and then go into EStop. Then just jog off 30mm or so and re-reference.

Where ever the table is, it will move +25mm, then run the HOMING sequence as normal.

Just another possible option.
Having fun learning,
Russ