Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Riley on September 08, 2011, 10:21:24 AM

Title: Work offsets
Post by: Riley on September 08, 2011, 10:21:24 AM
I'm having trouble with changing work offsets in g code. Seems to work fine if I remove cutter comp. With cutter comp it does fine with the squares but when going to G56 and doing the circle it freaks out and comes up with some crazy toolpath. This was only coded for testing....any input would be great!
Title: Re: Work offsets
Post by: BR549 on September 08, 2011, 11:44:35 AM
You cannot switch offsets WHILE in COMP.   Does it work ok IF you turn off comp then switch then reapply comp?

(;-) TP
Title: Re: Work offsets
Post by: BR549 on September 08, 2011, 12:10:17 PM
OK I see you are working with Comp in SUBS.

First add the G54 to the startup safety line this sets the display position correctly in reference to the rest of the program.

After add it here the Program looks and runs ok. NOW be aware that Mach3 will draw the profiles as offsets BUT when it runs it doews NOT move to the profiles displayed position on the screen . IT WILL cut it correctly just not display the moves corretly.

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 08, 2011, 02:57:29 PM
Hmmm.....seems to work on the PC in the house. It does however keep going over the first toolpath like you stated. On my laptop it makes some crazy crop circles when running the circle toolpath on G56. config pages look exactly the same. I have to run three operations on the mill and wanted a test code. I will move on to the real thing with this outline and see what happens. Thanks for the reply!
Title: Re: Work offsets
Post by: BR549 on September 08, 2011, 03:11:18 PM
It is acutally drawing it correct when cutting as the Zero gets reset each time the Fixture changes. It should cut just fine.

On your laptop look at the IJ settings. Crop circles sound like it is set to abs instead of inc. You can change it with Gcode to make sure it is set correctly on program load.

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 14, 2011, 10:04:53 PM
I reinstalled mach on laptop and set config just like the pc in the house and the one on the mill, and it works fine. But the pc running the milling machine still wont run it correctly. All settings have been tripled checked and it just won't run it. If I call sub o1 for all three work offsets it is ok. If I change it to call sub o2 for all three offsets it still is ok. If I change it to any combination of o1 and o2......fail. It come up with some crazy toolpath for the third work offset. I even tried calling the offsets in the reverse order. If I take out cutter comp all is good, however that really does not help me much.

Title: Re: Work offsets
Post by: BR549 on September 14, 2011, 10:46:29 PM
HIYA Riley, You were close(;-) Change the G41 to a G42. Also set your tool# 12 to about 0.050"diam to make SURE it clears that tight radius.

After changing those points it runs fine here.

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 15, 2011, 08:46:23 PM
Well here is where I'm at....both subs are totally identical and as long as I only call one of them the program works fine. If I get really crazy and want to call a different sub then things get sticky. I have included a photo of a program and its matching toolpath, one with all sub calls the same and the second program I asked it nicely to run sub 2 and it makes crop circles. Have tried many many different combinations and the results are the same.  ???
Title: Re: Work offsets
Post by: BR549 on September 15, 2011, 10:31:35 PM
AH I see you found the known BUG in TComp and  SUBS. It has always been there.  AND there is NO KNOWN way to overcome the error that I know of . Last time I worked on it for 3 weeks straight trying to creat a workaround. NO LUCK

Sometimes you get LUCKY and do not disturb it and everything runs OK but certain combinations of  multi subs AND TC sets it off.

Best to stay away from TC and subs. Subs by themselves run OK. The problem is Mach does NOT carry over some of the positional data from SUB TO SUB and it gets lost trying to apply the new TC. It will eventually find it ways BACK to the proper stop place givin enough room to roam.

(;-) TP

Title: Re: Work offsets
Post by: Riley on September 15, 2011, 10:47:13 PM
so how does one run cutter comp on different work coordinates? This has to be an everyday occurrence for some people.
Title: Re: Work offsets
Post by: BR549 on September 15, 2011, 11:09:11 PM
You just don't use toolComp with Fixture offsets OR deep subs.

I feel your pain BUT it is what it is. (;-(

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 16, 2011, 09:17:13 PM
I'm not sure why but on a windows7 box the toolpath is fine. Every combination of tcomp and subs in any work offset I have tried works normal. Is it possible something on that xp box is corrupt?
Title: Re: Work offsets
Post by: BR549 on September 16, 2011, 09:35:34 PM
I have found it broken on W2k XP and Vista so far. Have not tried it on Win7 yet.

Please list the code you were using.  Also include what the modal calls were in the mode list.

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 16, 2011, 10:05:21 PM
G15 G0 G53 G17 G40 G20 G90 G94 G55 G49 G98 G64 G97

Hi, not even sure what a G97 is but its in there....thanks for the help with this one! Most of the programs I have needed in the past the wizards worked just fine for but now I need to run a lot of parts and want to handle them as little as possible. This is only a sample program to make sure I can get everything working right before I start coding the actual parts. Wish I had another xp box to test it on.
Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 12:29:15 AM
NOPE it does not work here, same thing.

I can do what you wanted but it is not a pretty thing to do. Instead of using a Fixture offset, G92 or G52 You can use a G53 move in machine coords then use a macro to reset machine Zero. That process works EVERY time correctly. Trouble is YOU Have to keep track of where you are instead of MACH doing the hard work(;-)
G54
M98 P1 L1
G53 X6.000
M80  ( SetMachZero(0), SetMachZero(1)  )
M98 P2 L1
G53 X12.000
M80
M98 P3 L1
G53 X-18.000
M80
M30
Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 12:57:57 AM
There IS one other way that is not as messy. It keeps the Mach coord base intact so you at least know where you are(maybe). It also works EVERY time. IF you set the Work 0,0 as refhome(machine 0,0) then it it is fairly simple.

G54
M98 P1 L1
G0 X6.000
M80  ( zeroX, zeroY  )
M98 P2 L1
G0 X6.000
M80
M98 P3 L1
G53 X0.000
M80
M30

HOPE it helps,(;-) TP
Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 11:59:08 AM
RIley I have developed a WORKAROUND for you that makes sense. We have to get creative and shift the Fixture offset BEFORE you leave the sub. Then it will work every time. The only limit IS you have to make sure all the fixture calls are in the same order of progression as the #var formula to index up the number. NOte that it starts with G54 then each loop indexes the G54 UP 1 number G54,G55,G56,etc. IT will not allow you to randomly switch Fixtures but at least it does give you an Option with TC and fixtures.

I have narrowed this problem down to a very specific area in MACH3 that should not be hard to find(;-).

N0000 (Filename: TCtest.tap)
N0010 (Post processor: Mach3.scpost)
N0020 (Date:09/16/11 Time:11:36:09 PM)
N0030 G20 (Units: Inches)
N0040 G40 G90  G54
N0050 F1
N0060 (Part: TCtest)
N0070 (Operation: Outside Offset, 0, T1: Mill/router, 0.5 in diameter, 0.02 in Deep)
N0080 (Intake)
N0090 S1000 G00 Z0.5000
#100 = 54
N0110 (Mill/router, 0.5 in diameter)
N0120 T1 M06
N0140 S1000 M03 F30
%
G0 X0Y0
M98 P1 L4
M30
%
o1
G0 X6 Y1.799
M8
N0100 X6.000 Y1.799
N0001 G41 D1
N0150 G00 X4.8900 Y2.4278
N0160 Z0.0197
N0170 G01 Z-0.020 F10
N0180 G01 X4.2500 Y1.7878 Z-0.0200  F30.0
N0190 G01 Y0.0000 Z-0.020
N0200 G02 X4.0000 Y-0.2500 Z-0.0200 I-0.2500 J0.0000
N0210 G01 X0.0000 Z-0.020
N0220 G02 X-0.2500 Y0.0000 Z-0.0200 I0.0000 J0.2500
N0230 G01 Y4.0000 Z-0.020
N0240 G02 X0.0000 Y4.2500 Z-0.0200 I0.2500 J0.0000
N0250 G01 X4.0000 Z-0.020
N0260 G02 X4.2500 Y4.0000 Z-0.0200 I0.0000 J-0.2500
N0270 G01 Y1.7878 Z-0.020
N0280 G01 X4.8900 Y1.1478 Z-0.0200
N0290 G00 Z0.5000
N0300 G40
N0310 G00 X6.000 Y1.799
N0320 M09 (Coolant off)
#100=[#100+1]
G#100
N0330 M99
%

Hope that helps, (;-) TP


Title: Re: Work offsets
Post by: Riley on September 17, 2011, 12:42:06 PM
You ARE the man! I can't thank you enough! I really was not even close to that after days of attempts. I guess it's like they say about skinning that old cat. That gives me a great platform for a mutiple vise setup. I'm thinking the next best thing to mach is this site!
Title: Re: Work offsets
Post by: Riley on September 17, 2011, 03:21:06 PM
I am set to run this job, thanks again. I am cutting three holes for switches in the left side vice, a hole for a cord in middle vise, and right side vise runs the same part as the first. I have to keep pretty close numbers on stations 1 and 3. The hole cutout is not too critical so I removed the g41 in that sub. Try the attached code out and it should run fine. Then enable tcomp in the second sub and see what happens. I am good to go and I thank you for the help just wanted some feedback on why one sub can be run as often as I like with comp but a second sub with comp will crash out.
Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 08:50:21 PM
HIYA Riley, I think I can save you some more time (;-). I came up with a workaround that will allow you to do as you wish roam in the Workoffsets as you please.

DO NOT USE G54 as your base offset.      Use G55 and above as your base offset X0Y0 THEN you can program as you wish it will work 24/7. JUST DO NOT USE G54 anywhere(;-)

I think I have the BUG narrowed down to just a small window of possiblities now.

Give it a try, Let me know IF it works for you. (;-) TP

Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 09:16:20 PM
Riley BELAY THAT ORDER mate, It solved part of the problem but not all.  Multi subs are stilll a quirk. The old method will work there.

(;-) TP
Title: Re: Work offsets
Post by: BR549 on September 17, 2011, 09:48:29 PM
OK I think I have it solved for you.  

Rule 1 do NOT use G54. Set your init string in config to add G55 as the base mode.

Rule 2 do NOT use the subcall M98 P1 L1 with the sub code INSIDE the Gcode program . Move your subs to the SUBprogram dir and call them with the Redirect call

M98 (Test.txt) L1

SO FAR that has solved all the TC, multiSUB, Multi offsets problems here.

Give it a whirl,(;-) TP
Title: Re: Work offsets
Post by: Riley on September 17, 2011, 10:08:16 PM
fantastic!! I will be back at the shop in the morning and will give it a try. Thanks soooo much for all the help. I will have to add you to my Christmas card mailing list!
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 07:32:06 PM
BR549, I ran the program on the windows7 box with no trouble. Dumped it into the mill which is using xp and the circle cutouts failed. After playing around for awhile I reversed the toolpath to conventional milling instead of climbing and all is good. Is there a way to always have mach start on the g55 offset on start up? Thanks again for all your input!
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 07:53:25 PM
Here is the code for that project....op1 and 3 are the same but need different retract heights so I just made two different subs. operations 2 and 4 are the circles again just with different retracts. Have to post the last .txt in next reply, will only let me attach 4 files. This is the code that didn't work on my xp box. All switchboxop*.txt go in the sub folder.
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 07:54:02 PM
Here is the last one.
Title: Re: Work offsets
Post by: BR549 on September 18, 2011, 08:15:12 PM
SURE go to Config / genconfig look in the middle of the page for the initialization string and add G55 to it. IF there is a G54 remove it.

You know you can set the retract height with a #var and change it on demand. Saves having to do 2 circle programs

I am Glad you got it all working , GOOD JOB
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 08:37:04 PM
I was thinking that the initialization string on the config page is where that would go except there is only a G80 in that box now. I will give it a shot. I will play around with retract variables a little bit, good call. I cant stand cutting air almost as much as I hate driving an end mill into the side of a fixture! There is always room for improvement.
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 08:55:15 PM
Ok....just tried the same code on another windows7 pc and I can program climb or conventional milling with no issues. Just don't have any other xp machines to try it on. I have not tried to actually run a mill on a windows7 pc. I am only using the simulation and assuming it is all good. Could I put 7 on the milling machine? Maybe a fresh install would not be a bad idea.....or maybe I should leave well enough alone and make some chips!  ;)
Title: Re: Work offsets
Post by: BR549 on September 18, 2011, 09:27:23 PM
I would just make chips(;-) Mach3 was designed around XP.  IN CNC there is NO leading edge of technology ONLY the bleeding edge. (;-) ONCE you loaded the Driver in WIN7 it may react differently.

We can work out any other quirks as you run across them.

(;-) TP
Title: Re: Work offsets
Post by: Riley on September 18, 2011, 09:46:35 PM
That's what I'm thinking! I'm totally amazed at the the amount of support that one is able to receive from this site. It makes a huge difference, thanks to everyone!
Title: Re: Work offsets
Post by: BR549 on September 18, 2011, 09:50:09 PM
Heck you did all the work I just nudged you back on the road a time or two.

(;-) TP
Title: Re: Work offsets
Post by: Riley on May 22, 2012, 01:23:26 PM
Some time has gone by now and I'm still calling subs to get the results I need. Things work well that way but I stumbled into something yesterday. The attached code runs on my laptop using R3.043.022. The computer running my mill is version R3.042.040 and will not run the code. Maybe the cutter comp with work offsets has been repaired....not sure. Can someone else give it a try and confirm this for me before I go running updates on the mill computer. Thanks, Riley.
Title: Re: Work offsets
Post by: ger21 on May 22, 2012, 05:23:43 PM
3.43.022 was released more than 6 months before you started this thread. If anything was fixed, it would have been more than a year ago.
Title: Re: Work offsets
Post by: Riley on May 23, 2012, 01:32:19 PM
I guess I have had the software installed much longer than I thought! I will have to get around to bringing that machine up to date....my oversight. I just can't figure out why one computer runs the sample code and one won't. The computer that will run it is a windows 7 system. I am just curious if anybody else has the same results.
Title: Re: Work offsets
Post by: Hood on May 23, 2012, 02:24:45 PM
I tried the code and it seemed to run fine with a late version of Mach, never studied what it was actually doing but it did run through and complete.
Hood
Title: Re: Work offsets
Post by: Riley on May 23, 2012, 02:33:42 PM
Thanks for the feedback!...I will try an update on the machine in question in a few days. Have some parts to run and I don't dare fool with it yet! I'm just glad to know an update my fix it.
Title: Re: Work offsets
Post by: Riley on May 23, 2012, 03:10:48 PM
Hood, did it draw one or two circles?
Title: Re: Work offsets
Post by: Hood on May 23, 2012, 03:55:31 PM
The toolpath view showed 2 I think, never actually watched it, just let it run through.
Hood
Title: Re: Work offsets
Post by: Hood on May 23, 2012, 04:00:06 PM
Just loaded it here at home and one circle here. I have the Dev version loaded here but an older one at the workshop.
Hood