Hello Guest it is March 29, 2024, 04:35:59 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bandtank

Pages: 1
1
I'm new to CNC, GCode, etc. I've been working with my machine for a few months in my spare time and I've finally been able to dedicate more time to this, so I'm trying my first program (I've written tons of small snippets of code, so I'm at least somewhat familiar with the language).

I am trying to drill pockets in a grid for fixture bolts. The pockets need to be every 4.5688" in the Y direction and 4.3654" in the X direction. I've incrementally written the following code to move to each location, call a subroutine to cut the pockets, and then move to the next location. Everything works except for the code to cut the pockets.

I do not know how to use G2/G3 yet, so I used one of the wizards to generate the code to cut the pocket. I know the problem is that the code was generated to run in absolute coordinates and I am trying to use incremental coordinates as it makes more sense for this program.

The first picture is the toolpath for the pocket code only when it is generated correctly.
The second picture is the toolpath for the pocket when it is in my program and obviously incorrect.
The third picture is the overall toolpath of the program. It is correct except for the slight drift to the right because of the misshapen pocket.

Below is my Gcode. I do a lot of programming in C and C++, but I've never written Gcode programs. If my code looks odd that is probably why. The idea is to call multiple routines from "main" to use the power of the language (I know you are all aware of this already). The first subroutine to be called will call the second subroutine to drill 5 holes and then move to a new row of holes. The second subroutine calls the third and fourth subroutines to drill the 2 different pockets I need in the table for the shaft and head of the bolt.

Code: [Select]
G0 G49 G40  G17 G80 G50 G64 G20
G90
G0 Z.25
G0 X0 Y0
M98 P1 L10
G90
G0 Z.25
M30

O1
M98 P2
G90
G0 Z.25
G91
G0 X-4.3654 Y-18.2752
M99

O2
M98 P3
M98 P4
G91
G0 Y4.5688
M98 P3
M98 P4
G91
G0 Y4.5688
M98 P3
M98 P4
G91
G0 Y4.5688
M98 P3
M98 P4
G91
G0 Y4.5688
M98 P3
M98 P4
M99

O3
G90
G0 G43 H0  Z0.25
G01 Z-0.1693 F15
G91
G2 Y0 X0.0375 R0.0187 F10
Y0 X-0.0375 R0.0375
Y0 X0.075 R0.0562
Y0 X-0.075 R0.075
Y0 X0.0915 R0.0832
Y0 X-0.0915 R0.0915
X0.0915 Y0 R0.0915
G90
G0 Z0.25
M99

O4
G90
G0 Z.25
G91
G0 Z-.2
M99

Finally, my question. Is it possible to use the code from the wizard to cut the pockets or am I going to have to write my own?

Thanks,
Tony

2
Forum suggestions and report forum problems. / How do you license Mach3?
« on: January 05, 2010, 04:39:34 PM »
I searched through the website, included files, and the forum for an answer to this. I bought Mach3 through a distributor and he emailed me a license file, but what do I do with it?

Pages: 1