505,963 active members
3,275 visitors online
Register for free
Login
Page 1 of 3 123
Results 1 to 12 of 27
  1. #1
    Registered
    Join Date
    Oct 2017
    Posts
    15

    G-code editor

    Newbie question. If you write a quick routine in G-code, what software do you use? I wrote a simple routine to spot drill, G81 drill corner holes, and G1 move a 1/4" end mill to route finger joints in boards for some bee hives. I put in the actual dimensions and added 0.002" on each cut to make a little clearance so they'd easily slip together. Turned out I needed a little more clearance, so had to go in and retype all of the coordinates to make the cuts a little deeper. I used Notepad for the editing.

    I'm thinking there must be something out there that lets you assign a variable, then call the variable throughout the routine. In my case, the Y-axis dims were the same on every finger joint, so would be nice to name a variable something like "finger joint depth" and have another variable like "depth clearance" assigned with 0.002". When the routine runs, it's add/subtract the clearance from the dim for the actual target. If the joint was sloppy, make the clearance smaller or bigger if it's too tight.

    I'm probably going to use Excel as I could set up a header area with cells to do the math and have the routine reference those cells. Then do a Save As *.txt file for dumping onto my 1100.

    Thanks, Bruce

    p.s. Learning Fusion 360 will be a winter project. My wife is a Unigraphics/ Solidworks designer so have an in-house tutor.

  2. #2
    Registered
    Join Date
    Nov 2012
    Posts
    317

    Re: G-code editor

    I use gedit on the Linux box that runs PathPilot.

    Note that PathPilot supports the full LinuxCNC language, which lets you declare and use variables right in the code.

    See for example: G Code Overview

    Code:
    #<Xstart> = 1.0
    #<Ystart> = 2.0
    #<Zend> = -0.5
    #<Xdelta> = 0.5
    #<Ydelta> = 0.3
    
    M03 S3000
    
    G0 X[#<Xstart>] Y[#<Ystart>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>+#<Xdelta>] Y[#<Ystart>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>+#<Xdelta>] Y[#<Ystart>+#<Ydelta>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>] Y[#<Ystart>+#<Ydelta>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    
    M30
    G30
    (This is untested, but should illustrate the principle I think.)

  3. #3
    Registered
    Join Date
    Oct 2017
    Posts
    15
    Quote Originally Posted by jwatte View Post
    I use gedit on the Linux box that runs PathPilot.

    Note that PathPilot supports the full LinuxCNC language, which lets you declare and use variables right in the code.

    See for example: G Code Overview

    Code:
    #<Xstart> = 1.0
    #<Ystart> = 2.0
    #<Zend> = -0.5
    #<Xdelta> = 0.5
    #<Ydelta> = 0.3
    
    M03 S3000
    
    G0 X[#<Xstart>] Y[#<Ystart>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>+#<Xdelta>] Y[#<Ystart>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>+#<Xdelta>] Y[#<Ystart>+#<Ydelta>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    G0 X[#<Xstart>] Y[#<Ystart>+#<Ydelta>] Z1.0
    G0 Z0.1
    G1 [#<Zend>] F150
    G0 Z1.0
    
    M30
    G30
    (This is untested, but should illustrate the principle I think.)
    Thanks! I have lots of learning to do. Will start reading the G code reference link you included in your post during lunch breaks.

    Bruce

  4. #4

    Re: G-code editor

    Bruce, it's time to learn Fusion 360. https://academy.titansofcnc.com This is the simplest course I have seen and it's free. Took me from zero to semi-competent in a couple of days.

    I use Notepad for quick editing and really quick stuff, but for anything that requires tool offsets and the like I use CAM to generate the G code. Prior to using Fusion 360 I was using AutoCAD and CamBam, don't use that much anymore.
    Jim Dawson
    Sandy, Oregon, USA

  5. #5
    Junior Member
    Join Date
    Apr 2018
    Posts
    11

    Re: G-code editor

    Have you looked at CNCCookbook's G-Wizzard Editor here is the link
    https://www.cnccookbook.com/g-code-s...rator-gwizard/

  6. #6

    Join Date
    Jun 2018
    Posts
    315

    Re: G-code editor

    Have a look at SimplyCam, not free but not expensive either. You can draw your part outline, generate and view tool paths including ISO views for a wide variety of controls.

    WebSite: MR-Soft Nc Software Tools

    To allow for the tolerances you mention you can just change the tool diameter a little bit and regenerate the G-code file, it will apply the offsets in the tool path.

  7. #7
    Registered
    Join Date
    Sep 2009
    Posts
    608

    Re: G-code editor

    Any text editor. Gedit, etc. Just not Word or equivalent, which hides all kinds of invisible stuff in the document as well (sometimes, in some cases, saving as plain text files works).

    The one thing I would NOT do is use Excel. Excel is not a document processor; that's why Microsoft sells it with Word. Excel can be made to handle text, and there are some g-code generators that use Excel, but eventually you'll wind up twisting into unlikely contortions in order to do something that would be straightforward in a text editor. Use a tool designed for the job.

  8. #8
    Junior Member
    Join Date
    Apr 2013
    Posts
    1432

    Re: G-code editor

    Certainly Excel is not a great text editor. However, Excel is actually very useful to produce gcode if your data is generated in Excel (or can be read by Excel). For example, I've used Excel to mill 3D surfaces that are defined by an equation or mesh data that has been smoothed in Excel.

  9. #9
    Junior Member
    Join Date
    Apr 2013
    Posts
    1432

    Re: G-code editor

    I paid for Gwizard Editor but it doesn't have any special handling for LinuxCNC specific constructs.

    I often use the free Notepad++ (https://notepad-plus-plus.org/download/v7.7.1.html)

  10. #10
    Registered
    Join Date
    Oct 2017
    Posts
    15

    Re: G-code editor

    Hi Jim,

    Yeah, I often wonder why I keep beating my head against the wall . . . . I plan to learn Fusion 360 this winter. Always like to have multiple options for doing the same thing. Kind of like edge finding on the mill. I have a Haimer taster, Wildhorse probe, mechanical edge finder, electronic edge finder, centering scope, etc. Almost like a collector in some regards.

    Thanks all for the suggestions here. Always something new to learn.

    Bruce

  11. #11
    Registered
    Join Date
    Oct 2017
    Posts
    15

    Re: G-code editor

    One of my projects is a 75-tooth gear that has an OD of about 1.5" (yes, really small teeth). I'm still learning the nuances of G-codes, know there's a looping function which would make the indexing pretty simple. I used program in Z-80 code on a TRS-80 computer back in the day (Google Bruce Hansen TRS-80). If I was writing a routine in BASIC, it'd go something like:

    G0 X0 Y0 Z0 (set up for first pass, move in X to cut the tooth, Y 0 is on the edge of the blank, Z 0 is at the center of the blank, X 0 is to the left of the blank)
    G1 Y -0.050 (assuming a 0.050" depth of cut)
    FOR I= 0 to 360 STEP (75/360)
    G1 A I (rotate the 4th axis to the "I" angle)
    G1 X 1.5 (move X to make the pass, Y/Z are already set to depth)
    G1 X 0 (return to start)
    NEXT I (loops back up and indexes I by 75/360)

    Same type of thing I'm sure can be done in G-code, just gotta read up on it and make the conversions.

    Thanks again, Bruce

  12. #12
    Junior Member
    Join Date
    Apr 2013
    Posts
    1432

    Re: G-code editor

    Following is some hand produced code that I've used to cut gears using a gear cutter. Hopefully it will provide a few hints regarding one approach.

    (program to cut a gear)
    g90 (ensure not in incremental)

    #<GearTeeth> = 52
    #<GearWidth> = .18
    #<GearDiameter> = 1.102
    #<ToothDepth> = 0.047



    (Setup)
    ( Gear left face is at x=0)
    ( Gear axis is at y=0 / z=0)

    #<GearRadius> = [#<GearDiameter>/2]

    (parameters for 20T gear cutter)
    #<ToolNum> = 203
    (Aluminum: DoC 0.015, Feed 6, RPM 1000)
    (Delrin: DoC 0.025, Feed 3, RPM 1700)
    (Brass: DoC 0.010, Feed 3, RPM 565)
    #<DoC> = 0.015
    #<FinalDoC> = 0.005
    #<cutFeed> = 6
    #<cutRPM> = 1000

    (Choose gear tooth cutter -- tool 203)
    T#<ToolNum>M6G43
    #<CutterRadius> = [#5410 / 2]
    #<YcutterTouch> = [#<gearRadius> + #<CutterRadius>]
    #<strokes> = [FUP[[#<ToothDepth> - #<finalDoC>] / #<DoC>]] (calc minimum # strokes)
    #<DoC> = [[#<ToothDepth> - #<finalDoC>] / #<strokes>]
    #<x_home> = [#<GearWidth> + 0.5] (offset to ensure cutter clears spindle)
    #<y_home> = [#<YcutterTouch> + 0.5]
    #<Z_home> = 0
    #<A_home> = 0
    #<angle_inc> = [360 / #<GearTeeth>]
    #<curr_angle> = 0
    #<A_backup> = -3 (amount to reverse 4th axis to ensure that backlash is removed)
    #<Y_backoff> = .25 (retract after cutting)
    (DEBUG,#<GearTeeth> teeth, #<GearWidth> wide, #<GearDiameter> diameter, depth #<ToothDepth>)
    (DEBUG,#<strokes> strokes with adjusted DoC of #<DoC>)
    (DEBUG,At Y=#<YcutterTouch>, #<CutterRadius> radius cutter touches gear blank)
    M01 (pause to display values)

    #<XleadOut> = 0.05 (amount past face of gear to cut)
    (XleadIn must be greater than 1/2 of the chord with a sagitta of #<Doc>)
    #<XleadIn> = 0.25 (amount before face of gear to begin cut)
    #<CutWidth> = [#<GearWidth> + #<XleadOut> + #<XleadIn> ]

    G92A#<A_home> (quickly reset 4th axis position)
    G00 Y#<y_home> A#<A_backup> (take up any backlash)
    G00 X#<x_home> A#<A_home> Z#<Z_home>

    S #<cutRPM>
    M03 (spindle ON)
    M08 (coolant ON)

    o101 repeat [#<GearTeeth>]
    G00 A#<curr_angle> X[#<XleadIn> + #<GearWidth>]
    g00 y[#<YcutterTouch>] (move to just touching outside of gear blank)
    F #<cutFeed>
    G91 (begin incremental mode)
    o110 repeat [#<strokes>]
    G00 Y[-#<DoC>]
    G01 X[-#<CutWidth>]
    G00 Y#<Y_backoff>
    G00 X[#<CutWidth>]
    g00 Y[-#<Y_backoff>]
    o110 endrepeat

    G0 Y[-#<FinalDoC>] (make one final cut)
    G01 X[-#<CutWidth>]
    G00 Y#<Y_backoff>

    G90 (begin absolute mode)

    #<curr_angle> = [#<curr_angle> + #<angle_inc>]
    G00 A#<curr_angle> F1250

    o101 endrepeat

    g00 X#<X_home>
    g00 Y#<Y_home>

    M09 (coolant OFF)
    M5 (spindle off)

Page 1 of 3 123

Similar Threads

  1. Code editor
    By Fortdick in forum Benchtop Machines
    Replies: 6
    Last Post: 11-21-2015, 11:12 PM
  2. G-code editor?
    By gearsoup in forum G-Code Programing
    Replies: 17
    Last Post: 11-28-2011, 03:06 PM
  3. G code editor for MAC
    By DIFF OVER in forum Uncategorised CAM Discussion
    Replies: 3
    Last Post: 10-28-2010, 01:21 AM
  4. G Code Editor
    By TravisR100 in forum General CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 09-30-2009, 02:18 AM
  5. G Code Editor
    By Ryan P in forum News Announcements
    Replies: 1
    Last Post: 07-24-2009, 09:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •