Use A-axis to mill a radial feature.

More
30 Jun 2016 21:57 - 30 Jun 2016 21:59 #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: 30 Jun 2016 21:59 by fc60. Reason: typo

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

More
02 Jul 2016 10:47 #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.
#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
07 Jul 2016 15:20 #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 Jul 2016 22:18 - 11 Jul 2016 22:48 #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: 11 Jul 2016 22:48 by BigJohnT.

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

More
10 Jul 2016 23:12 #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
11 Jul 2016 06:14 - 11 Jul 2016 06:19 #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: 11 Jul 2016 06:19 by Rick G.
The following user(s) said Thank You: fc60

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

More
11 Jul 2016 22:51 #77322 by BigJohnT

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.

More
05 Aug 2016 01:36 - 05 Aug 2016 01:39 #78376 by cncnoel
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!
Attachments:
Last edit: 05 Aug 2016 01:39 by cncnoel.

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

More
05 Aug 2016 10:54 #78382 by Rick G
Yep you can see the DOS influence there!

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.

More
05 Aug 2016 11:36 #78385 by tommylight

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.

Time to create page: 0.304 seconds
Powered by Kunena Forum