Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jevs on March 14, 2015, 05:22:23 PM

Title: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 05:22:23 PM
Mach3 broke my machine last night while I was trying to repeat another issue I was having.

I was having issue where an axis would not stop running randomly when I let go of the enable button on the pendant. Pressing it again would stop it, but more than once the limit switch was the saving grace.
While testing the possible fix on that, the limit switch in Z got ignored by mach. This is not the first time for that except this time it broke.
 
I think a pokeys update MAY have fixed the first problem. I could not replicate it after the update and correcting the direction of the encoder (was set to move the wrong way). So after a long time trying everything to duplicate the runaway axis, I could not. Everything was working perfect. I decided to do a Reference home. Bad move....
Bam, Z never stops, it goes up, rotates the turret, but then keeps driving even though the limit switch is tripped and lit on mach.

Well, I had an update document that came with my machine on a part that needs to be replaced for safety from who knows when...1980s maybe. They never put the part on and I don't have it. Well sure enough, this last crash snapped a bolt and two bent and then it proceeded to rip my ratchet rod ball link apart (pulled the lock ring out), then the giant linear bearing hit the rubber pads and that was the end. I did not notice any of this happened until it got to the end and made motor noise still. I hit the E-stop.

 So, I took the Z motor belt off so it could spin free. Sure enough you hit the ref button and it spins forever, even when your hitting the limit switch manually and Mach shows it activating.

I was told this could be normal??? This is super dangerous on my machine. This is not a $600 Chinese mill. The AC servos are strong and will break things. It has crashed before like this and broke my link rod, but the other part was able to stop it.

So, how can you reference home and zero everything out without breaking the machine??

Something must be up with Z that it loses its location or I am doing something to make it lose its location since it never stopped.

This machine has a weird Z, where the upper portion of Z is used for the tool change. I wrote the macro and got it working a long time ago, but this is not going to be safe. I have to figure something out.....

Here is the old thread on that.
http://www.machsupport.com/forum/index.php/topic,18069.0.html

So far I do not recall X or Y crashing since I have been done. When they kept going using the pendant, the switch made an E-stop like I would expect. Then I am able to just override limits and back it up.

If you cannot use the switches at some point to set home, how will it ever know where it is if it loses position?
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 05:36:15 PM
As I said on the BobCAD forum, Mach ignores limit switches whilst homing and also I mentioned the reason.
Nowadays with the external controllers and plenty of I/O really it should be an option to have them adhered to if you use separate home switches.


Now on to your problem, few questions.
Are you using an external controller? If so which one.

Do you have separate home and limit switches for each axis or are you sharing limits and homes?

If you attach your xml it may help me asking lots of other questions about your config as I will be able to see it myself.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 06:02:54 PM
Here is the XML. Here is also a schematic of my machine I did years ago when I built it.

This should help while I finish cleaning up my mess and get the machine back together.

I have to research it all over again to remember what I did way back then....

I did change to an Ethernet SmoothStepper when my computer died and I built a new one. I wanted to run windows 7 and quit fighting with parallel ports...
So, the schematic is the same except the smoothstepper feed into the Machmotion I/O boards parallel port connectors.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 06:03:40 PM
By the way, that stupid "there is already a file with this name" thing is super duper annoying and made me try like 5 times to post this grrr...
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 06:34:29 PM
Ok I see you have shared the limits and homes for the X and Y but the Z has separate.
That should not be a problem as long as your Z Home switch is working.
You mentioned during the testing on the bench that when you did a ref all and pressed the Z Limit the motor kept turning, that is normal as I explained earlier. If however you press the Z Home switch it should stop, reverse and then stop when you again release the switch, does it do that?


Regarding limits and Mach, as I mentioned I had asked for an option of having Home switches adhered to if using seperate homes and limits but that never got done, should be fine in Mach4 I think but no chance in Mach3 now.

Personally I do not rely on software for limits, powerful machines should really have hardware limits, I do mine via safety relays, that then kills the drives, so even if for some reason Mach ignores my home switches when homing then the limits will kill things for me.

Below is a pic of a section of the E-Stop wiring on one of the machines.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 07:54:41 PM
I moved that xml on accident and then started mach. It started going through the start up stuff. I exited and put the xml back. Now it lost everything.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 07:56:29 PM
NM fixed it. Had to run a restore to an old save.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 08:06:59 PM
Ok, now that everything is back in one piece. The home of Z is at the top of the cutting area. The tells it where home is for its actual cutting area use.
It has to go up past this to do a tool change.
The Limit switches are actually at the very top of z and at the very bottom of Z. This encompasses all of the tool change area as well as the cutting area.

Z does stop running if I trip the home switch.

It does not stop when I hit the limit switch.

What I suspect happened is that Z got above the home switch into the tool change area by me jogging around.
Then I hit Reference All Home.
Then I guess it did like you say and ran out of control past the limits and never saw the home switch because it was already past it.

X and Y do stop at the switches during a reference home. They are tied as limits and homes.

So, this is making more sense now.

So, now I have to figure out what to do to fix this so it does not happen again.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 08:14:15 PM
Not sure how the ESS handles Home switches that are active when you ask for a home move. Reason is on the machines I have the ESS and SS the homing is done in the servo drives and Mach/ESS/SS know nothing about it until they are homed. On these machines and also on my Chiron with the CSMIO/IP-A and the wee lathe with the CSMIO/IP-S, if the limit is active when a homing request is made it will back off first. My home switches have the trigger such that the axis can not travel past the home switch as the trigger is long and goes right to the end of travel.

There is an option in General Config called Home Switch Safety or something like that, you could try using that and trigger your home switch manually and then press RefAll and see what happens, it may pop up a message telling you the Z switch is active. If it does then you could extend the trigger like I have done so that the switch once triggered does not become inactive again as you move further in that direction..



Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 08:18:03 PM
My home switch is not active once Z moves up past it. It is just a dog hitting a roller. Once it goes past, it is off and not being seen as an issue.
So if you hit Reference Home, I guess it just runs forever even when the limit trips.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 08:22:22 PM
I know and what I am saying is on my machines I have extended the trigger so that it goes active and stays active if I travel further in that direction.

My controllers/drives can handle that situation and back off if I request a home and the switch is active. I do not think the ESS supports that feature but it may but also as mentioned there is an option in General Config which may work by telling you its active and not homing.

Other option is to alter the VB in the RefAll button and have it look at the LED for the Z Home, if it is active have it pop a message telling you and then have it stop any homing happening before it starts.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 08:25:54 PM
I do have single unused home switches on X and Y. I suppose I could use those to make it safer for those axis. Then wire the limits to the E stop or something.

See attached. There are several unused switches in the Z. Maybe I can tie one of those in with the cutting area Z home. Then it would stop before hitting the limit. Then just wire the limits to the E stop also or something.

Not sure how you will move off the switches if it is tripping E stop. I guess you would need a manual toggle switch for override on the control panel.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 08:29:16 PM
I know and what I am saying is on my machines I have extended the trigger so that it goes active and stays active if I travel further in that direction.

My controllers/drives can handle that situation and back off if I request a home and the switch is active. I do not think the ESS supports that feature but it may but also as mentioned there is an option in General Config which may work by telling you its active and not homing.

Other option is to alter the VB in the RefAll button and have it look at the LED for the Z Home, if it is active have it pop a message telling you and then have it stop any homing happening before it starts.

Hood

I got you. However I cannot do this. My mechanics would not allow Z to go all the way down if I had a rod keeping that switch active. I will have to think about this.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 08:31:10 PM
Not a good idea to have a toggle for physical limit overrides, use a momentary push button, that way you can never accidentally leave it on. Thats what I use, you will see it in the pic I attached, near the top, just to the right.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 08:32:59 PM
Ok so the switch is fixed on your machine and the trigger travels?

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 08:38:22 PM
Yeah, there is a plate with a bunch of dogs that hit all the switches so originally it would know the start and stop of the tool change, home and limits.

I will have to think about this more tomorrow. At least I got all the welding and grinding and repair done today.

What stinks is that this is completely not what I needed to be getting done this weekend :(

Now, I have to make this thing 100% bullet proof safe though.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 08:42:58 PM
Could you possibly set things up so the switch is always triggered when in normal  operation and only goes off the trigger when it reaches the Home position?
That way you would just have to change the active Hi/lo setting for your Home.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 09:08:02 PM
First off. Do you agree I should take all the limits and tie them to the E-stop (enable relay)?
I can make this my first priority tommorow. At least then I can't crash it figuring out the rest
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 14, 2015, 09:11:26 PM
It is definitely wise to have the limits working via hardware rather than software only, especially on bigger machines and is something I always do.

Hood
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 14, 2015, 09:15:06 PM
I am not sure of I can wire them to disable the drives and also still report as limits to Mach. I will have to look into it.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 12:09:14 PM
Alright. I am ready to fix this thing now.
Any ideas how I can wire the limits so that it either still reports to Mach in the diagnostics screen or lights an LED on my panel?
I can put them in series with the e-stop, but that won't specifically tell me a limit is tripped for diagnostics of what has gone wrong.
I suppose I could use a relay, but that will add a tiny more delay.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: BR549 on March 15, 2015, 01:30:18 PM
You don't have to report to MACh3 as a limit hit even though you can. Just output a signal from the estop circuit to mach3 and from there activate a BIG FLASHY led to signal the OP that a LIMIT hit has occured.  No need to worry about what Mach3 is doing as the axis's are dead at that point . To resume you will have to totally reset mach3 and Refhome the machine again.

(;-) TP
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 01:59:57 PM
The problem is that there is no way to "output a signal from the e-stop circuit" from what I have.
If I wire the limits in series with the e-stop, then it Is just a string of NC switches.

On another note, using the machines original home switches is going to put my home in the opposite corner to what I had it set. Basically the spindle will be in the back right corner of the table. Is this normal?
I had it set so the head is in the front left corner when home. This seems more logical to think the head is moving from 0 to positive x and y values.
I think this may be why I did not use them in the first place.....
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: BR549 on March 15, 2015, 03:48:57 PM
Most relays HAVE 2 channels NO NC just use the one you are not using to control the Estop and map it to Mach3.

HOME can be anywhere you want it to be independant from the Home switch position. JUST set the offset. then when it refhome it sets HOME to wherever you want it to be on the table.

Just a thought, (;-) TP
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 04:32:59 PM
Have to think about that. The bad thing about that is that it will indicate a limit hit if you hit the E-stop. When in fact it has not been.
I had something that I thought was going to work. It seems that adding them with the E stop and trying to indicate a limit issue only when the limits are tripped and not the E-stop is the challenge (without adding more parts).

Just checked and my enable relay that kicks on the main relay is switching AC...so using that won't work.

One thing I might be able to do is run the 24 volts for the enable relay through all my limits, but I kind of hate to have the coil current on them all the time. I have no idea what their rating is. They are big and heavy duty looking with sealed connections etc, but I have no idea their rating.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: BR549 on March 15, 2015, 04:58:37 PM
(;-) When you have to hit ESTOP you have lost all use of MACH3 anyway until you reset and re reference the machine so  I am not sure why you are worried about a LED flashing a warning. It will be very obvious that a problem has occured and IF you simply LOOK at the table it will be obvious where the problem is.

Just a thought, (;-)TP
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 05:30:19 PM
My mach is still reporting switch conditions etc even when E-stop is hit. E-stop kills the drives and stuff in my machine, but the IO board and computer are still on. Hitting the E-stop kills the enable output from the IO board that goes to the enable relay which kills the drives and anything that moves like the coolant, cabinet fans, way oiler. Mach is still active, just in E-stop mode, it just gets a signal on pin 10 that the E-stop was hit.

So, my thought was that it would be much easier to just look at the diagnostics screen and see the limits tripped and know instantly where the issue is. Sure I can figure it out, but it would be nice if Mach just said the limit was hit.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 07:14:29 PM
EstopInput - Z Limit - Y Limit - Z Limit - E-Stop - E-stop output(+24 when circuit is open)
                                                       ^
                                                    Pin 1-15

This works.
Pin 1-15 will see 24V coming through the E-stop if any limit opens and the E-stop has not been pressed. This will light up the limit switch inputs in mach.
EstopInput will see an e-stop if anything opens and kill the drives.

The only thing is you will not see the limit active in mach if you hit the E-stop. This will open up 1-15 no matter what.

This could be a little tricky to diagnose, but in real life, if you hit the limit while moving it will show in diagnostics. At this point E-stop has been activated for you and your probably not going to hit the real E-stop since it already stopped.

Worst case scenario is that you do hit the E-stop and then the limit lights are not on in mach. You  might not figure it out until you undo e-stop and then they show lit again and nothing happens.

This does require a momentary enable switch across the limits if you ever want to move off the switch. You will have to hold the enable and reset mach and the E-stop if you pressed it. Then you can make a move.

The good thing is that Mach cannot ignore limits during a home sequence. If I have an axis past the home switch for some reason and reference home, the worst that will happen is an emergency stop.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 09:23:13 PM
So it is all done now. Working like a charm. No more limit crashing ever! My override button works perfect and everything. I must have been thinking ahead, because I had 3 extra terminal blocks open to do everything and I had already labeled all the home switch wires I was not using :)

So, now when you turn off soft limits and jog z above home, then hit a reference all, Z will travel up and hit the limit. Mach ignores it (which is dumb), but it overrides everything and kills the drives anyway.

The only thing is, mach never thinks it went into an E-stop or anything happened and the Z numbers just climb forever unless you hit the E stop. It still thinks it is moving Z. Not a big deal, but if anyone knows a way to force it to acknowledge it has stopped, I am open to making it so it does know it was stopped.

Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 09:36:08 PM
I do have a problem now that I am not sure how to fix. For some reason the natural home for this machine is at what would normally be it's positive extremes. The spindle is over the back right corner of the table.
Unless I change something, all machining will be negative.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: BR549 on March 15, 2015, 09:47:26 PM
THe machine coords have nothing to do with your work coords. You can set the work coords 0,0 to be anywhere you like. Just like the machine coords.

You can have HOME anywhere and Work 0,0 anywhere.
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: jevs on March 15, 2015, 10:06:00 PM
Never mind on the homing. They were nice enough to make it so you can move the dogs that trip the switch to the other side of the axis. Problem Solved..
Title: Re: Mach ignoring limit switch broke my machine :(
Post by: Hood on March 16, 2015, 10:48:06 AM
As TP said earlier you can have it home to any position you like and still have the machine coords be zero at the lower left of your table. All you need to do is enter a Home Off(set ) value in the Homing and Limits page, that is equal to the distance the axis is away from the normal Machine Coords Zero. If you do that then when you home the machine coords will be set to the value you entered in Home Off and thus Mach will know the "true" machine coords zero is lower left.
Often it is good to have the machine home to a position upper right as it means the table is closer to you for loading parts etc.

Hood