Hello Guest it is March 19, 2024, 06:46:46 AM

Author Topic: Gcode questions pt2  (Read 11402 times)

0 Members and 1 Guest are viewing this topic.

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Gcode questions pt2
« Reply #10 on: October 16, 2009, 10:57:30 PM »
I thought I had seen that m code before. Btw thanks for being awake!
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: Gcode questions pt2
« Reply #11 on: October 16, 2009, 11:04:39 PM »
That looks alot better, thank you. How could I implement the same cut being done along Y during each pass the same cut amount of .005 ?
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: Gcode questions pt2
« Reply #12 on: October 16, 2009, 11:05:54 PM »
Even though I am just cutting air as of the moment it sure is easier than MDI!
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Re: Gcode questions pt2
« Reply #13 on: October 16, 2009, 11:47:07 PM »
You ask about Y cuts, I was settling for repetition on any axis. If I could cut both From X0 to X7 say .005 a pass and then Y0 to Y2.5 at the same rate .005 that would be great but as you can see I dont really have an idea how to implement it. I would think there has to be a final destination though 50 passes @.005 indicates 1/4".  
 

You're going about this in a rather unconventional way.  The more "normal" way to do it is to step down in Z, cutting the entire profile in each pass, then do one final, full-depth pass to put the final finish on.  So, for example, to cut a 2" square, 1/4" deep, centered on X0, Y0, using a 1/4" endmill, with a 0.010" finishing pass:

M3 (Spindle On CW)
M7 (Coolant On)
#100 = 0.000 (Register for current Z depth)
G0 Z1 (Move to safe height)
G0 X-1.135 Y1.135 (Move to start position)
M98 P0001 L25 (Do roughing passes down to full depth)
(Do finish pass, taking off 0.010")
G1 X-1.125 Y1.125 F5  (Move to start position for finish pass)
G1 X1.125 F5  (Cut top edge of square)
G1 Y-1.125 F5  (Cut right edge of square)
G1 X-1.125 F5  (Cut bottom edge of square)
G1 Y1.125 F5  (Cut left edge of square)
G0 Z1 (Retract to safe height)
M9 (Coolant Off)
M5 (Spindle Off)
M30 (Program End)
(Roughing Subprogram)
O0001 (Do one pass of roughing cut)
G0 Z#100 (Rapid to depth of last cut)
#100 = #100 + 0.010 (Step down in Z)
G1 Z#100 F5 (Feed move to new depth)
G1 X1.135 F10  (Cut top edge of square)
G1 Y-1.135 F10  (Cut right edge of square)
G1 X-1.135 F10  (Cut bottom edge of square)
G1 Y1.135 F10  (Cut left edge of square)
M99 (Return)
M30

The above code *should* work, but for some reason stalls on the #100 = #100 + 0.010, but should give you the idea of how it's more typically done.  Really, though, except for very simple parts, writing G-code by hand is pretty painful.  You should look into some CAM software.  I can highly recommend SheetCAM.

Regards,
Ray L.
Regards,
Ray L.

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Gcode questions pt2
« Reply #14 on: October 17, 2009, 02:18:21 AM »
Wiow what you showed me helped immensely. I could see some form of pattern that I could maniplate the figures enough to tinker. Too bad I didnt read your post as I was playing. I was just going to come back and ask about linking x and y moves as I see you did in your last post. Btw I just thought I should side mill cause I dont now any better. The way for the best results is to step down and then finish pass? Anyway I took your suggestion and changed it based on what I thought. It worked fair. At least directionally it was accurate.
G90
G0 X0 Y0
G0 Z0.000
G0 Z-4.85
M98 P0001 L25
M30
O0001
G91 (Set incremental mode)
G1 X0.005 F7 (Step over +0.005)
G90 (Set absolute mode)
G1 Y0 F5  (Cut from Y0 to Y-3)
G1 Y-3 (Return to Y0)
M99 (Return)
M30
It was getting closer to what I wanted at this point however what decides when the tool advances ideeper into the part? I am going to look at your last code and vary it some tonight. It should be much easier since I am the coolant and spindle! LOL Again THANK YOU. It made my night just to do what you taught me. Of course now I have to figure why there is a little bit of chatter in the corner when it meets at X&Y  though that might go away stepping down and or cutting a fluid 2 sides each pass. Also on the above Gcode if I followed the G1 Y-3 with an F3 would the tool advance in another .005? So many questions now.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Re: Gcode questions pt2
« Reply #15 on: October 17, 2009, 06:29:29 PM »
put the revised # value in square brackets -

#100 =[#100+0.010]

this should work now ;)
Re: Gcode questions pt2
« Reply #16 on: October 17, 2009, 06:39:23 PM »
put the revised # value in square brackets -

#100 =[#100+0.010]

this should work now ;)

Now you know why I use CAM, rather than writing my G-code by hand....  :-)

Regards,
Ray L.
Regards,
Ray L.

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Re: Gcode questions pt2
« Reply #17 on: October 18, 2009, 12:08:31 AM »
 
put the revised # value in square brackets -

#100 =[#100+0.010]

this should work now ;)

Blue, Thank You also ! It took me a while to figure out what brackets and where they were. I figured out something and it worked pretty well. Could be better and will be but I was very satisfied. It took over a month to see motion in my machine after building the driver board (Btw with no experience there either, just ask the Hobby CNC forum LOL)I ended up using 2 different codes that all i can see different are the feedrates but the results seemed different. I do want to cut the other direction on a finish pass if I run this code again but otherwise it was fine.

M3
G0 Z1
G0 X0 Y0
M98 P0001 L86
G1 X0 Y-1.4480 F5
G1 Z0 F5
G1 X7.4155 F5
G1 Y-4.537 F5
M30
O0001
G0 Z#100 F5
#100=[#100+.005]
G1 Z#100 F5
G1 X0 Y-1.453 F5
G1 X7.4405 F5
G1 Y-4.537 F5
M99
M30
%
&
%
M3
G0 Z1
G0 X0 Y0
M98 P0001 L86
G1 X0 Y-1.4480 F16
G1 Z0 F16
G1 X7.4155 F16
G1 Y-4.537 F16
M30
O0001
G0 Z#100 F16
#100=[#100-.005]
G1 Z#100 F16
G1 X0 Y-1.453 F16
G1 X7.4405 F16
G1 Y-4.537 F16
M99
M30
%

I was constantly seeing ways of improving it in flight.
« Last Edit: October 18, 2009, 12:15:30 AM by Fastest1 »
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: Gcode questions pt2
« Reply #18 on: October 18, 2009, 12:11:39 AM »
On another note Ray recommended stepping down in Z instead of the side milling approach I was using. Much better and faster and I am sure cutter wear is minimized to a degree. I never really thought about it but I guess pushing down on the end mill is much more rigid if the proper feedrate is used or a conservative 1 anyway.
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: Gcode questions pt2
« Reply #19 on: October 18, 2009, 12:26:52 AM »
 I just measured the part We all just made at my house, and I had intended it to be 1.20" wide on both x & y axis' it is 1.2065! on both planes. Looks like there is room for a finish pass or 2 maybe presenting the work to the tool from the other direction.
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)