O103 repeat ... O103 endrepeat question

More
21 Jan 2013 07:12 #28894 by FRD
Please hellp me to understand what is going on and how to fix it.

I am running EMC2/AXIS 2.4.6. When I try to use O103 repeat ... O103 endrepeat more than once in the same program I get the following error:

Near line 21 of /home/fred/projects/test.txt:
Radius to end of arc differs from radius to start:
start=(X0.0000,Y-10.0000)
center=(X0.0000,Y20.0000)
end=(X0.0000,Y-30.0000) r1=30.0000 r2=50.0000

The line is question is "G3 X0.0000 Y-30.0000 I0.0000 J30.0000" below.

The purpose of the program is to mill two circles into a piece of wood a little bit at a time.

The program is:

%

(test.txt)

(tool 1, 12.7 dia. 1/2 end mill)

G17 G21 G40 G49 G54 G80 G90 G94

F400

G1 x0.0000 y-50.0000 z10.0000

G42 D1

G1 X0.0000 Y-30.0000

#<zval> = 0.0000
O103 repeat [10]
#<zval> = [#<zval> - 0.01000]
G1 z#<zval>
G3 X0.0000 Y-30.0000 I0.0000 J30.0000
O103 endrepeat

G1 Z2.0000

G1 X0.0000 Y-10.0000

#<zval> = 0.0000
O103 repeat [10]
#<zval> = [#<zval> - 0.01000]
G1 z#<zval>
G3 X0.0000 Y-10.0000 I0.0000 J10.0000
O103 endrepeat

G1 Z10.0000

G40

G1 x0.0000 y-50.0000 z10.0000

G1 Y50.0000

%

Thanks.

Fred

Please Log in or Create an account to join the conversation.

More
21 Jan 2013 20:18 #28916 by BigJohnT
The error is an arc error. Also you need to use unique numbers for each o loop.

If you want to make 10 circles just us the P word with the arc along with the final Z depth.

linuxcnc.org/docs/html/gcode/gcode.html#...a_id_sec_g2_g3_arc_a

John

Please Log in or Create an account to join the conversation.

More
23 Jan 2013 07:53 #28995 by FRD
Thanks very much for your help.

I thought that "O103" was the command for "repeat ... end repeat" like the g-codes which are made up of a "G" and a number. Now I realize that the "103" part of the command is a subroutine identifier. I changed the identifier for the other "repeat ... end repeat" loop and the program works.

The arc error must have been related to the conflict caused by using the same subroutine identifier for both loops.

Thanks again.

Fred

Please Log in or Create an account to join the conversation.

Time to create page: 0.164 seconds
Powered by Kunena Forum