Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: fast89 on November 21, 2013, 05:27:47 PM

Title: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 21, 2013, 05:27:47 PM
I've had a tool changer workign for a few months now. Also been fine tunning the macro to better protect things and have safetys. Had alot of issues lately with the spindle starting out at the proper rpm for orient and then speeding up and the orientation fails. Just a mild problem, wasn't breaking anything. Well yesterday i'm setting up to recut some parts. Rolled off, set the first tool, mdi'd t2m6. The z goes home as it should but it starts the spindle at 6k and tries to orient.....What the......Blew up the bearing that orients....great....now i gotta fix that. So i get it fixed tonight, type in m19 and don't you know it did it again. Wiped out more than just a bearing this time. Well after some investigation, the line in the macro that resets spindle over ride to 100% is now somehow setting the spindle to 6000 and maxing out the over ride. If i take that line out it is fine. Anyone got any ideas? Stuxnet virus?lol
 Here is the macro for orientation

SetOEMDRO(74,100)
SetOEMDRO(821,100)
         
Message ("Spindle Orient")
Code "S23"
Sleep 100
ActivateSignal(OUTPUT19)
Sleep 100
DoSpinCW()
Sleep 100
Sleep 2200
DoSpinStop()
Sleep 100
If Not IsActive(INPUT3) then
CodE "M30"
SetCurrentTool(toolold)
MsgBox ("ORIENTATION FAILED")
STOP
Message (" ")
End If
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 21, 2013, 05:46:19 PM
I have tried here and it resets to 100 as it should.
If you zip your xml and your macro folder I will test with your setup and see if I can replicate.
Also let me know the Revision of Mach you are using.
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 21, 2013, 07:53:42 PM
It would only do it when mach was first fired up on the first orient. After the first orient it was fine (after blowing itself up of course). Mach version is 3.043.022.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 22, 2013, 04:33:42 AM
You also seem to have a macropump and a Brain, can you attach them please.
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 22, 2013, 03:25:34 PM
Hood,
I don't know anything about a macro pump. I can't find it in mach3 either??? I attached the brain though.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 22, 2013, 04:45:44 PM
Ok your macropump should be in your macro folder.

You have the toolchange set to stop spindle and wait for start in that xml.  what is in the M6End?
Should you not have the tool change option set to Auto?
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 22, 2013, 08:04:53 PM
Sorry,
It was set for auto but after the crash i had to set it to stop spindle so i could run parts hand loading tools. While i stared at my non functioning tool changer. lol
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 23, 2013, 03:42:19 AM
Well I cant seem to find an issue or replicate it here unless your macropump is the problem. I do see you are calling a M3 before the Spindle speed, shouldnt really matter but I suppose it may depend on how your VFD works and what the spindle speed was previously. For example if your previous spindle speed was high and you set the override DRO to 100% and then called a M3 it may momentarily shoot off to 6000rpm and maybe your VFD will go there before going to the set speed, where if you called the S word before the M3 it shouldnt happen.
The only other thing I can think of is you are not meant to use macros under 100 for custom use, under 100 are reserved for Mach so maybe there is sme sort of interaction with the M19 you have.
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 23, 2013, 08:14:55 AM
I had tried stating the spindle speed at the beginning of the macro and then turn the spindle on later in the orientation. I rarely use the m19. Generally the m6start has the orientation in it. The only time i use m19 is for testing. My vfd is pretty fast on the speed change, I've got a large braking resistor so i made it pretty aggressive on the acceleration and deceleration. What boggles me is i've used both of these macros for months and then out of the blue this happened. I had not changed anything. (that i remember)
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 23, 2013, 10:00:31 AM
I tried in the macro SetOemDro(202,100) instead of SetOemDro(74,100) and it does the same thing on the first orient. Sets spindle override to max which is 6k rpm. I also unchecked run macro pump and it still does this on the first orient.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 23, 2013, 12:26:32 PM
I removed the spindle over ride reset and now it doesn't do it. But now i have another problem, it will fire the orient cylinder but not hold the output I just blips it and turns it back off. I had this happen before if a port/ pin was used twice but that is not the case here.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 23, 2013, 01:03:45 PM
Ok,Figured that one out. Not enough dwell after turning on the spindle before the solenoid activates.  I forgot i changed that.   ;D   Now, how can  i reset spindle over ride with out using SetOemDro (74, 100)
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 23, 2013, 01:42:56 PM
Did you restart after setting macropump to off?
Is there anything in your initialisation string that is setting spindle speed? (deleted your xml so cant look without downloading again)
DoOemButton(183) will reset to 100% but it will likely do the same as something seems to be setting the spindle speed to max.
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 25, 2013, 06:30:51 PM
I did restart. There is nothing in the initialize string pertaining to the spindle. I tried DoOemButton(183) with the same results. It appears that this is related to the requested spindle speed of 0 when mach3 starts. After a spindle speed has been instated, it will work fine. If put, 
Code "S25"
SetOemDro (74,100)
it will max out the spindle.

If i put this, it does what it is supposed to.
Code "S25"
Sleep 200
SetOemDro (74,100)

Very strange. Even stranger that this happened after months of running this macro just fine.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 25, 2013, 06:33:31 PM
What is in your spindlespeed macro?
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 30, 2013, 03:07:54 PM
Ok, finally had a few minutes to get back to this. My spindle speed macro is :
rpm=GetRPM( )
SetSpinSpeed ( rpm )

Now I've narrowed this problem down some more. I only use pulley 1. If it is set to 0 as minimum rpm, no problem happens. If it is set to 23 as minimum rpm, and  if the requested spindle speed is 0 and then you reset the spindle override to 100% it maxes out the rpm's. I repeated this several times.
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: Hood on November 30, 2013, 04:19:11 PM
OK the macro is fine, occasionally I have seen them get corrupted.

Regarding the Zero RPM, I have seen the DRO get set to Zero when pressing the Reset button, in fact it screwed up a Brain I had and I had to resort to the macropump to set it.
Suppose your answer is to set the pulleys to 0 for min unless that would cause other issues?
Hood
Title: Re: Tool change macro issues....I'm about ready to go to linux
Post by: fast89 on November 30, 2013, 06:54:17 PM
That's what i did. I don't think it will cause an issue. Just a pain to get all this figured out and fixed. Clearly there is a bug in there.