Welcome, Guest. Please login or register.
Did you miss your activation email?
October 24, 2014, 04:18:54 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  G-Code, CAD, and CAM
| |-+  G-Code, CAD, and CAM discussions
| | |-+  Subtest again...
Pages: 1   Go Down
Print
Author Topic: Subtest again...  (Read 1692 times)
0 Members and 1 Guest are viewing this topic.
Bodini
Active Member

Offline Offline

Posts: 217



View Profile
« on: May 29, 2007, 04:49:45 PM »

Noob alert. Roll Eyes

I had a look here.http://www.artsoftcontrols.com/forum/index.php?topic=2540.0

OK, i got it, that works.

Now what if you want to run that sub in different locations in the coordinate system?

So take this one... <stolen from that link above>


G20 G40

G00 g90 g43 X-1. Y-1.
z1.
M98 (SUBTEST.TAP)
M30

%


and then add another position, so it looks like this:


G20 G40

G00 g90 g43 X-1. Y-1.
z1.
M98 (SUBTEST.TAP)
X5 Y5
M98 (SUBTEST.TAP)
M30

%


You see that I'm trying to run the sub again at x5 y5... but it doesnt turn out like i'd expect (another box at x5,y5).

What remedies this?

Thanks much.

-Nick
Logged
Bodini
Active Member

Offline Offline

Posts: 217



View Profile
« Reply #1 on: May 29, 2007, 05:23:20 PM »

In other words, it's like the coordinate system needs to be temporarily reset (or something along those lines) at the insertion point of the sub.  I dont know enough about g-code yet to know what path to take.

thanks,

Nick
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,774


West Yorkshire, England



View Profile WWW
« Reply #2 on: May 29, 2007, 10:47:38 PM »

Hi Nick,

You need to offset the datum using G52, like this :-

G20 G40

G00 g90 g43 X-1. Y-1.
z1.
M98 (SUBTEST.TAP)
G52 x5. y5. (datum shift)
M98 (SUBTEST.TAP)
G52 x0 y0 (datum shift cancel)
M30

%

If you run this in Mach it will not show the 2 paths offset, it will draw them on top of each other. The machine will do it right though.

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Bodini
Active Member

Offline Offline

Posts: 217



View Profile
« Reply #3 on: May 30, 2007, 07:35:04 AM »

Thanks Graham.

One more quiestion... and i only ask instead of doing it because Mach wont display it and I cant get to a machine to see it go right now...

What about adding another random position in the code like:

X13 Y2

would it look like this?


G20 G40

G00 g90 g43 X-1. Y-1.
z1.
M98 (SUBTEST.TAP)
G52 x5. y5. (datum shift)
M98 (SUBTEST.TAP)
G52 x0 y0 (datum shift cancel)

G52 x13. y2. (second datum shift)
M98 (SUBTEST.TAP)
G52 x0 y0 (second datum shift cancel)

M30

%

Thanks,

Nick
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,774


West Yorkshire, England



View Profile WWW
« Reply #4 on: May 30, 2007, 02:09:17 PM »

Yes, you can do it as many times as you want.

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Bodini
Active Member

Offline Offline

Posts: 217



View Profile
« Reply #5 on: May 30, 2007, 02:29:06 PM »

Thanks Graham, just 1 more detail needed (until the next one Cheesy)

What I meant to ask in that last one, but forgot to...

If you go to many locations, does the g52 need to be cancelled between each one?


-Nick
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,774


West Yorkshire, England



View Profile WWW
« Reply #6 on: May 31, 2007, 02:21:49 AM »

It is always safer to put the G52 x0 y0 in the code and less confusing when looking for the end of a block.

There are other rules attached to G52 too.

You can not change datum e.g. G54,G55 etc.

G52 must be cancelled before a tool change.

G40,G41,G42 must be within the G52 block.

(This is very bad code)
G52 X100 Y100
G41 X25 P2
Y..
X..
G52 X0 Y0
X10. Y10.
X15.
G40

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!