Hi I am very new to actual G code prograning but how do you repeat a circle the same radius in different locations?
Hi I am very new to actual G code prograning but how do you repeat a circle the same radius in different locations?
Write a program for the circle using the center of the ciorcle as your work zero location.
Make this a sub program.
Write a program to call this program after using a G52 command to place a local work coordinate at the circle center.
For instance if your main work zero is G54 and your circles are at X4. Y0., X2 Y0., X0. Y0., X-2. Y0., X-4. Y0. your program structure would be something like this.
O00001 (circle main program)
stuff
G52 X4. Y0.
M98 O00002
G52 X2. Y0.
M98 O00002
G52 X0. Y0.
M98 O00002
G52 X-2. Y0.
M98 O00002
G52 X-4. Y0.
M98 O00002
stuff
M30
O00002 (Circle cutting program)
All the commands to cut the circle using X0. Y0. as the center of the circle
M99
An open mind is a virtue...so long as all the common sense has not leaked out.
Appreciate the help Geoff unfortunately I couldn't get it to work. Here's what I have for the first circle:-
N10 G71 LX=1980 LY+760 LZ=37 HC1 Z=PRK
N12 BOT=280 LFT=280 RAD=150
N20 X=BOT Y=LFT+(RAD-8) Z=PRK PRF=LPZ/2 F3 TP2 L=PON
N30 G2 X=BOT Y=LFT+(RAD-8) J+LFT I=PON
N40 L=PSU
N50 X=BOT Y=LFT+(RAD-8) Z=PRK PRF=LPZ F3 TP2 L=PON
N60 G2 X=BOT Y=LFT+(RAD-8) J+LFT I=PON
N70 L=PSU
N80 X=BOT Y=LFT+(RAD+4) Z=PRK PRF=-14 F3 TP2 L=PON
N90 G2 X=BOT Y=LFT+(RAD+4) J+LFT I=PON
N100 L=POFF
N110 X=PRK Y=PRK
%
I am using a Biesse Rover 321 R ATC with a CNI NC 481 controller.
Those Italian machines that have their own version of G-code. I owned one briefly in partnership with a friend who is a cabinet maker; after six months I sold my share to him because programming the Biesse was so different to metal working machines it drove me up the wall.
An open mind is a virtue...so long as all the common sense has not leaked out.
What did you use to get that first program? Did you hand code it? Does Biesse have a G or M code to offset the origin?
Gerry
Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
The code was modified from a program already in the machine. The previous operator who left before I started working for the company 4 weeks ago used to hand code it. At the moment I couldn't tell you how to offset the origin. I have learnt so far that you cant create an arc by simply altering the I and J.
damn thats a lot of code for a circle!!!!
i have a 321r atc with 481 controller. in uk
the best circles are using circle centre at zero, zero
if cutting from inside circle make a segment from centre to circumference, arc to end point centres known eg i0 j0 then lead back out to centre.
depending on cutter used you may wish to ramp the cutter down on lead in
use xo=50 yo=50 (letter ow not zero) to place centre of circle at 50, 50
depending if your cutting on line g40, left of line or right of line etc you must add a lead in and lead out.
see my pool table video on you tube biessebod. i can send you the code for it if you like.
order yourself an expensive manual and fault code book from biesse uk approx £125 BUT TOTALLY INVALUABLE.
your code is written to offset the tool radius... presumably for 16mm cutter?
the best way to do this is set tool table up correctly with exact tool diameter ie 15.95mm etc which can be easily changed at each resharpening then use g41 or g42 to offset the tool.
ring me if you wish and il explain it. 07866631400
where are you based?
this is a sample program calling a external sub routine for a hole at different positions. i will paste one of a program with internal sub routine if i can find one!
N19 L=G7 QX=1715 QY=-2 PRF=LPZ+6 YF=930 F=5 QQN=2
N20 L=GC1 UT=1
N30 X20 Y-10 Z=PRK PRF=LPZ+4 F6 G41 TP1 L=PON
N39 G1 X79
N40 G1 Y16
N50 G1 X16 BR10
N60 G1 Y79
N70 G1 X0
N90 G1 Y=LPY-79
N99 G1 X16
N99 G1 Y=LPY-16 BR10
N99 G1 X79
N99 G1 Y=LPY
N99 G1 X=LPX-79
N99 G1 Y=LPY-16
N99 G1 X=LPX-16 BR10
N99 G1 Y=LPY-79
N99 G1 X=LPX
N99 G1 Y79
N99 G1 X=LPX-16
N99 G1 Y16 BR10
N99 G1 X=LPX-79
N99 G1 Y0
N99 G1 X20
N99 G1 X-20 Y-10 G40
N100 L=PSU
N110 XO=LPX/2-750 YO125 L=H112
N120 XO=LPX/2-275 YO85 L=H112
N130 XO=LPX/2+275 YO85 L=H112
N140 XO=LPX/2+750 YO125 L=H112
N210 X=LPX/2+620 Y109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N219 G1 Y115
N220 L=PSU
N230 X=LPX/2+410 Y109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N239 G1 Y115
N240 L=PSU
N210 X=LPX/2-410 Y109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N219 G1 Y115
N220 L=PSU
N230 X=LPX/2-620 Y109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N239 G1 Y115
N240 L=PSU
N277 X=LPX/2-300 Y=LPY/2-219 Z=PRK PRF=3 F10 G41 TP1 L=PON
N277 G1 X=LPX/2-300 Y=LPY/2-209.5
N277 G1 X=LPX/2-500
N277 G1 Y=LPY/2-229.5
N277 G1 X=LPX/2-300
N277 G1 X=LPX/2-350 Y=LPY/2-219 G40
N277 L=PSU
N277 X=LPX/2+300 Y=LPY/2-219 Z=PRK PRF=3 F10 G42 TP1 L=PON
N277 G1 X=LPX/2+300 Y=LPY/2-209.5
N277 G1 X=LPX/2+500
N277 G1 Y=LPY/2-229.5
N277 G1 X=LPX/2+300
N277 G1 X=LPX/2+350 Y=LPY/2-219 G40
N277 L=PSU
N210 X=LPX/2+620 Y=LPY-109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N219 G1 Y=LPY-115
N220 L=PSU
N230 X=LPX/2+410 Y=LPY-109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N239 G1 Y=LPY-115
N240 L=PSU
N210 X=LPX/2-410 Y=LPY-109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N219 G1 Y=LPY-115
N220 L=PSU
N230 X=LPX/2-620 Y=LPY-109 Z=PRK PRF=LPZ+4 G40 TP1 L=PON
N239 G1 Y=LPY-115
N240 L=PSU
N277 X=LPX/2-300 Y=LPY/2+219 Z=PRK PRF=3 F10 G42 TP1 L=PON
N277 G1 X=LPX/2-300 Y=LPY/2+209.5
N277 G1 X=LPX/2-500
N277 G1 Y=LPY/2+229.5
N277 G1 X=LPX/2-300
N277 G1 X=LPX/2-350 Y=LPY/2+219 G40
N277 L=PSU
N277 X=LPX/2+300 Y=LPY/2+219 Z=PRK PRF=3 F10 G41 TP1 L=PON
N277 G1 X=LPX/2+300 Y=LPY/2+209.5
N277 G1 X=LPX/2+500
N277 G1 Y=LPY/2+229.5
N277 G1 X=LPX/2+300
N277 G1 X=LPX/2+350 Y=LPY/2+219 G40
N277 L=PSU
N278 XO=LPX/2+750 YO=LPY-125 L=H112
N278 XO=LPX/2+275 YO=LPY-85 L=H112
N278 XO=LPX/2-275 YO=LPY-85 L=H112
N278 XO=LPX/2-750 YO=LPY-125 L=H112
N278 L=POFF
N278 L=GC1 UT=5
N279 XO=LPX/2-750 YO125 L=H112C
N279 XO=LPX/2-275 YO85 L=H112C
N279 XO=LPX/2+275 YO85 L=H112C
N279 XO=LPX/2+750 YO125 L=H112C
N279 XO=LPX/2+750 YO=LPY-125 L=H112C
N279 XO=LPX/2+275 YO=LPY-85 L=H112C
N279 XO=LPX/2-275 YO=LPY-85 L=H112C
N279 XO=LPX/2-750 YO=LPY-125 L=H112C
N279 L=POFF
N280 X=PRK Y=PRK
%
this one calls internal sub routines. a very clever program i wrote if i say it myself. it cuts internal circles out around a radius calculated from parameters input at n30 . took me a night to think how to do it and a day to code it! but its cut hundreds of parts since and is simple to change
it is set to centre the entire piece at x350 y650. after the tool change to ut5 it does an outer circle with lead in and out. basically it cuts a large circle with a "bolt hole circle"of 23mm diameter holes inside the radius of the outer circle
hope these are of use to you!
N20 L=GC1 UT=1
N30 MC=380 CD=290 HD=23 NH=10 DA=360/NH HP=5
;MC=OUTER D CD=HOLE CIRCLE D HD=HOLE D NH=NUM HOLES HP=HOLE DEPTH
N40 DD=0 AN=0
;N50 XO=MC/2+5+350 YO=MC/2+5+700
N50 XO=350 YO=650 ZO=-7
:1
N60 JM(DD=NH):2
N70 X0 Y0 Z=PRK PRF=-10 F10 G40 TP1 L=PON
N80 G1 BL=CD/2 BA=AN
N85 G1 Z=-LPZ+HP
N90 G1 BL=HD/2 BA90 F2
N100 XI.01 R=HD/2 G5 RP=4 ZI=LPZ/4+0.6
N110 G1 BL=HD/2 BA270 Z=-LPZ-10 F10
N120 G1 X0 Y0 G40
N130 L=PSU
N140 DD=DD+1 AN=DA+AN
N150 JM:1
:2
N160 X0 Y=-MC/2-20 Z=PRK PRF=3 F5 G42 TP1 L=PON
N170 G1 Y=-MC/2
N180 G2 X0 Y=-MC/2 I0 J0 RP=4 ZI=LPZ/4+1
N210 G1 Y=-MC/2-20 G40
;N220 L=PSU
;N230 X0 Y0 Z=PRK PRF=2 F1 G40 TP1 L=PON
N240 L=POFF
N160 L=GC1 UT=5
N160 X0 Y=-MC/2-20 Z=PRK PRF=LPZ/2+1 F5 G41 TP1 L=PON
N170 G1 Y=-MC/2+.5
N180 X0 Y=-MC/2+.5 I0 J0 G2
N210 G1 Y=-MC/2-20 G40
N240 L=POFF
N250 Y=PRK
%
Thanks for the reply Battwell. I have just emigrated to NZ from the UK. At present I am only getting 1/2 hr per week on the WWW at the local library. I will try your code next week when my stuff arrives. Yes I aggree the G41 G42 codes would be better for the offsets but I just quicky stuck the program together using a program already in their called 'any hole'.
Couple of questions is it possible to type the code on PC to floppy an I get a persistant X59 error even though a tool is in? The machine is somewhat lacking in maintenace but I hope to cure that.
Can I also connect a PC to the CNI unit for more specialist tasks like sign making. Using MACH and Vectric on my own machine.