Hello Guest it is April 18, 2024, 02:50:22 PM

Author Topic: Subroutine confusion.  (Read 7466 times)

0 Members and 1 Guest are viewing this topic.

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Subroutine confusion.
« Reply #10 on: October 03, 2010, 05:53:22 PM »
If you want to use the same sub program in many different gcode files then is must be stored in the subroutines folder inside the Mach3 folder and called with a M98 (filename.tap) command.
   That is exactly what I wanted to know regarding the sub and its storage, thanks.
   The feed rate and depth of cut are taken from your original gcode.
G1 A0 F360
G1 Z0 X0 Y0 F8
G1 Z-.0214
I did just notice that what I thought I had put in there isnt what I did. I was using the feedrate of F360 in the code for the rotary table and that was in degrees. I had determined that was too slow and sped it up to 1080 in all following lines interpreting it as being able to do 3 revolutions in 1 minute. Then looking closer at my original code wouldnt the Z feed be at F8? due to the line above and no specific feed rate being on this line? My original intent was for a FR of 1 in the Z. I was messing with that file on the fly while cutting and editing it. I apparently didnt go back thru all of it as I was just on the verge of understanding the relationships.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: Subroutine confusion.
« Reply #11 on: October 03, 2010, 06:04:14 PM »
Its not a problem, change the feed rates to what you need.

Graham
Without engineers the world stops

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Subroutine confusion.
« Reply #12 on: October 03, 2010, 09:34:27 PM »
Cool, I took the code you made ran it, edited it a bit to see the differences and ran it again and repeat. That should give me a day or 2 to manipulate it to see what is going on. Id di get a few different results than I expected in a case or 2 but I will really just have to examine the piece and the code to make sense of it all. Your help has made my week and weekend. I had read quite a bit just to get the basics of a sub. Nice to get a bone occasionally. Thanks again many more questions to follow.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Subroutine confusion.
« Reply #13 on: October 04, 2010, 03:15:29 PM »
Graham
   On this code you wrote for me. I pictured the opposite being done. Is there a way that the steps down in Z would be the sub and the X & Y movement be the main program? The 1 you wrote worked fine but I was just curious as my vision was different. 
%
G20 G40
T1 M6
G92 A0
G00 G90 X0 Y0 Z.1 A0
G01 Z-.0214 F360.
M98 P0002 L6
G01 Z-.022 F360.
M98 P0002 L6
G01 Z-.03 F360.
M98 P0002 L6
G01 Z-.0375 F360.
M98 P0002 L6
G00 Z.1
M30

O0002(SUB)
G91
G01 X3. A1080. F1080.
G00 Z.1
X-3. A60.
Z-.1
G90
M99
%

Edit : Revised code to remove excess rapids.

Graham

[/quote]
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)