Machsupport Forum

Mach Discussion => Feature Requests => Topic started by: rrc1962 on December 01, 2010, 01:18:57 PM

Title: Rotational offset on Z plane
Post by: rrc1962 on December 01, 2010, 01:18:57 PM
I've always thought that it would be handy to have a button on screen that would rotate the part in Mach.  That way if it doesn't fit in the space intended on the sheet it could be rotated on the shop floor to match the material without generating a new g-code file.  Is this possible?  I know you can do work offsets, but I'm not sure about setting offsets that would effectively rotate the part on the Z plane.  A quick test shows that simply swapping x of y and y for x in the code effectively rotates the part 90 degrees, so one not so elegant solution would be to go through the loaded g-code file, swap it's contents over to a teach file swapping x or y and y for x, then loading the teach file.

Offsets would be so much cooler.
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 01, 2010, 01:20:46 PM
Now that I think of it, I'm not sure there is even a way to read a file line by line in VB Script.  Is there a way?

EDIT:  Looks like you can use regular VB Script in Mach.  Don;t know why, but I was thinking mach used it's own limited subset of the language. 
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 01, 2010, 01:45:22 PM
How about just using the G68 Corrd rotation(;-) to rotate the part.

Just a thought, (;-) TP
Title: Re: Rotational offset on Z plane
Post by: Ya-Nvr-No on December 01, 2010, 03:07:17 PM
I created a DRO box, I just type in the angle I want, or
I also have a probing routine that finds the angle by touching off two sides and computes it for me, then moves to the new 0,0 point

So it is possible, though it can get confusing watching the numbers on the screen, ;)
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 01, 2010, 03:11:09 PM
Exactly what I was looking for.  Thank very much.

Is there a way to get the X an Y bounds of a part file so you could rotate on the center of the part?
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 01, 2010, 04:23:50 PM
You can use the program extents.  X min/max Ymin/max But that does not always give you the geometric center of the part just the center of the program.

(;-) TP
Title: Re: Rotational offset on Z plane
Post by: Ya-Nvr-No on December 01, 2010, 06:20:39 PM
Once I have the 0,0 (lower left corner) point,  I have a routine that finds the center of a block/rectangle  based on its rough size, and then makes a new 0,0 point to the center coordinates. There is always a way to get what you want. That's why we love this program, even with the minor issues. It just keeps getting better with everyone's input.
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 01, 2010, 09:07:17 PM
I've got it working great.  The only problem is that Mach doesn't play well with IJ arcs and circles after a G68.  I found a post that said that R mode arcs work fine.  Just don't know if it's worth all that just to rotate the part.  Most, if not all of my part files have IJ arcs.
Title: Re: Rotational offset on Z plane
Post by: Mike_F on December 02, 2010, 06:06:22 AM
Hi, Can you not tweak your post processor to only use the R word for arcs. That is just what I have had to do for my -1 scaling problem. I was able to find the place in the pp that determined the type of code to use for arcs and changed it accordingly.

Mike
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 02, 2010, 09:38:00 AM
Yes, I can, but I'm told that R has some accuracy issues at certain angles.
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 02, 2010, 10:26:13 AM
You need to let Brian know that Ij is broken with Coord Rotation.I t used to work fine.

Just a thought, (;-) TP
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 02, 2010, 11:26:13 AM
I've seen a couple of past posts discussing it, so he probably already knows.
Title: Re: Rotational offset on Z plane
Post by: Mike_F on December 02, 2010, 11:31:19 AM
Brian just posted that he has fixed this in the next rev. http://www.machsupport.com/forum/index.php/topic,16603.msg113151.html#msg113151

Mike
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 02, 2010, 12:28:49 PM
I just tested with arcs and circles with G68. What was it that was not working right?? Everything looked ok here.

(;-) TP
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 07, 2010, 09:56:03 AM
This is what I'm seeing in the tool path display.  The first is a shot of the original and the second is after executing a G68.  This is on version R3.042.036.
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 07, 2010, 11:42:31 AM
Could you post your code for me to test here? That looks like an IJ setting problem.

Thanks (;-) TP
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 07, 2010, 04:03:53 PM
I agree.  It looks as if it's in absolute IJ mode when it should be incremental.  That's not it though.  The G58 causes what you see in the second image and a G59 returns it back to normal.  Here's the code.  On line 40 I'm not sure what the G53 and G90 are doing, but that line is the same in every program I've run for the last year.  The M7 turns on an output (downdraft blower) and the M1100 toggles the THC on.

N0000 (Filename: rounded rectangle NO CW LL.tap)
N0010 (Post processor: THC300.scpost)
N0020 (Date: 02/10/2010)
N0030 G20 (Units: Inches)
N0040 G53 G90 G40 M7 M1100
N0050 F1
N0060 (Part: rounded rectangle NO)
N0070 (Operation: No Offset, DEFAULT, T1: Plasma, 0.05 in kerf, 120IPM)
N0080 M06 T1  (Plasma, 0.05 in kerf, 120IPM)
N0090 G00 Z0.3750
N0100 G00 X0.2500 Y0.0000
N0110 (Operation: Reference Torch)
N0120 F15
N0130 G31 Z-1
N0140 G92 Z-0.1452
N0150 G00 Z0.2000
N0160 M03
N0170 G04 P0.5
N0180 G01 Z0.1000 F30
N0190 G02 X0.0000 Y0.2500 I0.0000 J0.2500 F120.0
N0200 G01 Y1.7500 F120
N0210 G02 X0.2500 Y2.0000 I0.2500 J0.0000 F120.0
N0220 G01 X2.7500 F120
N0230 G02 X3.0000 Y1.7500 I0.0000 J-0.2500 F120.0
N0240 G01 Y0.2500 F120
N0250 G02 X2.7500 Y0.0000 I-0.2500 J-0.0000 F120.0
N0260 G01 X0.2500 F120
N0270 M05
N0280 G00 Z0.3750
N0290 G00 X0 Y0
N0300 M30
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 07, 2010, 05:21:26 PM
I just ran the code and it runs fine I rotated 45 deg at a time all the way around.

Just a thought, (;-) TP
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 07, 2010, 08:52:13 PM
What version of mach are you running?
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 07, 2010, 09:32:16 PM
Ver .022. I dought it has anything to do with the G68 itself.
Just a thought, (;-) TP
Title: Re: Rotational offset on Z plane
Post by: rrc1962 on December 07, 2010, 10:45:19 PM
Hmmm...If I rotate the part with X0Y0 it works fine.  If I rotate using a X or Y value to keep the origin at the lower left of the part, I get errors.

If I rotate 90 degrees around X0Y0 the part origin shifts to the lower right.  Is there another offset command I could use after the G58 to correct that?
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 08, 2010, 12:37:41 AM
Have you tried rotating the prgram from the MDI page LH side coord rotation box to see if there is any difference in the error ?

When you rotate the part the 0,0  goes with the rotation so it will rotate the angle as the rotation angle

Just a thought, (;-) TP
Title: Re: Rotational offset on Z plane
Post by: BR549 on December 08, 2010, 01:05:55 AM
OK I rotated serveal other test files and finally got one to error on an arc when rotated with a G68 call with an OFF 0,0 rotation point.

SO there IS a problem here with arcs and G68 call .  Not all arcs fail and never from a 0,0 rotation point. The arc that failed was a G3.It also never failed from teh Rotation window on the MDI screen.

THanks for the extra testing, (;-) TP