Use A-axis to mill a radial feature.

More
10 years 4 months ago - 10 years 4 months ago #76870 by fc60
Greetings,

I would like someone to create and send me a program that does the following.

(Cutter positions) G0 X0 Y-1.0 Z.25 A90.
(Cutter moves to) G1 X-1. F3.0

Repeat the above rotating A in increments of A-2.0 until A = 25.0

I can visualize what I want to do in my head; but, lack the looping code skills.

Most sincerely,

Dave
Last edit: 10 years 4 months ago by fc60. Reason: typo

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

More
10 years 4 months ago #76918 by BigJohnT
Looping linuxcnc.org/docs/2.7/html/gcode/o-code.html#ocode:looping

Start by writing it in pseudo code. You have most of it written that way now. LT is Less Than.
Code:
#1 = 0 (assign parameter #1 the value of 0) o101 while [#1 LT 10] G1 X0 G1 Y[#1/10] X1 #1 = [#1+1] (increment the test counter) o101 endwhile

Take a shot at writing what you want and if you don't get what you expect post your G code.
JT
The following user(s) said Thank You: fc60

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

More
10 years 3 months ago #77145 by fc60
Greetings John,

Took me a while; but, I managed to accomplish my task.

%
( T237 | 3/8 FLAT ENDMILL | H237 )
N100 G20
N102 G0 G17 G40 G49 G80 G90
( GENERATE RADIUS BLEND )
N768 T237 M6
N770 G0 G90 G54 X.7092 Y-.3617 A0. S3000 M3
N772 G43 H237 Z2.
N774 Z.9
N776 (G1 Z.2136 F10.)
N778 (X.5217 F12.)
N780 (X-.015)
N782 (G3 X-.1433 Y-.3843 I0. J-.375)
#1=0 (A AXIS FIRST CUT)
O101 WHILE [#1 GE -90.]
G0 X.7092 Y-.3617 Z1. A[#1]
G1 Z.2136 F10.
X.5217 F12.
X-.015
G3 X-.1433 Y-.3843 I0. J-.375
#1=[#1-[90./180]]
G0 Z1.
O101 ENDWHILE
N784 G0 Z2.
N786 M5
N788 G91 G28 Z0.
N790 G28 Y0. A0.
N792 M30
%


Many thanks for the starting point.

Cheers,

Dave

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

More
10 years 3 months ago - 10 years 3 months ago #77270 by BigJohnT
Looking good, a couple of thing to note is I would not us the % to wrap the code unless you understand what it does not do. Much better to use M2. Also line numbers are ignored by LinuxCNC so they only clutter up your G code. A good preamble on line one prevents much headaches later on.
gnipsel.com/linuxcnc/g-code/gen01.html

The best thing now is you understand your G code or at least understand it much better than before.

Edit: double pasted link...

JT
Last edit: 10 years 3 months ago by BigJohnT.

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

More
10 years 3 months ago #77272 by fc60
Greetings John,

I will see if I can modify my Post to output the M02 at the end of the file.

Regarding the "%" symbols, it is best to erase both of them?

Also, the link you posted is dead. I get the Error 404, page not found.

With kind regards,

David

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

More
10 years 3 months ago - 10 years 3 months ago #77278 by Rick G
Nothing wrong with using the % to start and stop the program. It is what I use on all my programs.

Regarding the "%" symbols, it is best to erase both of them?

If you use the % you must start and end the program with it.

M2 does a lot more than just end the program, and in some cases this may be beneficial, but not all.

Change from Auto mode to MDI mode.
Origin offsets are set to the default (like G54).
Selected plane is set to XY plane (like G17).
Distance mode is set to absolute mode (like G90).
Feed rate mode is set to units per minute (like G94).
Feed and speed overrides are set to ON (like M48).
Cutter compensation is turned off (like G40).
The spindle is stopped (like M5).
The current motion mode is set to feed (like G1).
Coolant is turned off (like M9).

linuxcnc.org/docs/html/gcode/m-code.html#mcode:m2-m30

Suppose you have 2 vises on your mill, the first is using the G54 coordinate system the second using the G55 coordinate system.

You run a program on the second vise using th G55 coordinate system. After the program ends you want to return X to 0.00 from the MDI window so you issue G0 X0. If you used the % to stop and end the program all is well, the machine will go to X0.00 on the vise you are using. However if you ended the program with M2 the M2 command will switch the machine to the G54 coordinate system and now is a different coordinate system than you were working and will go to X0.00 on the first vice. This can lead to an unwanted and in my opinion potentially dangerous move. To avoid this problem with using M2 you would have to remember to switch the coordinate system at the MDI window before entering any movement commands.

As John said it is important to understand the difference and select the method that works best for you.

Rick G
Last edit: 10 years 3 months ago by Rick G.
The following user(s) said Thank You: fc60

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

Time to create page: 0.263 seconds
Powered by Kunena Forum