Use A-axis to mill a radial feature.
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
Please Log in or Create an account to join the conversation.
Start by writing it in pseudo code. You have most of it written that way now. LT is Less Than.
#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
Please Log in or Create an account to join the conversation.
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.
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
Please Log in or Create an account to join the conversation.
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.
If you use the % you must start and end the program with it.Regarding the "%" symbols, it is best to erase both of them?
M2 does a lot more than just end the program, and in some cases this may be beneficial, but not all.
linuxcnc.org/docs/html/gcode/m-code.html#mcode:m2-m30Change 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).
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
Please Log in or Create an account to join the conversation.
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
Sorry, I managed to paste the link twice in a row...
As Rick said you use either or but not both. Understand what % does not do so you don't get a surprise.
linuxcnc.org/docs/2.7/html/gcode/overvie...de:file-requirements
JT
Please Log in or Create an account to join the conversation.
Cent 1
I have been using a preamble subroutine file for a while now, so If I decide to change something I only need to do it in one place.
It is called from G-code with o<preamble> call
Cent 2
I LOVE using white space and # boxes 80 characters wide in G-code, it makes it so much easier to read for my old eyes!
comes from being a DOS dinosaur from the days of PCM and green-screen monitors... Sigh!
Please Log in or Create an account to join the conversation.
With NGCGUI you can have the preamble automatically added to your subroutines.
NGCGUI_PREAMBLE = in_std.ngc - the preamble file to be added in front of the subroutines. When concatenating several common subroutine invocations, this preamble is only added once. For mm-based machines, use mm_std.ngc
Rick G
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19204
- Thank you received: 6437
My 2 cents worth..
Cent 1
I have been using a preamble subroutine file for a while now, so If I decide to change something I only need to do it in one place.
It is called from G-code with o<preamble> call
Cent 2
I LOVE using white space and # boxes 80 characters wide in G-code, it makes it so much easier to read for my old eyes!
comes from being a DOS dinosaur from the days of PCM and green-screen monitors... Sigh!
That is neat !!! Man, i do miss those days, especially programming in asembler.
Tom
Please Log in or Create an account to join the conversation.