1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

G code G2 and G3 questions

Discussion in 'General Talk Forum' started by Beejay, Nov 20, 2013.

  1. Beejay

    Beejay New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    North Shields, England
    Hi,
    I'm new to this forum and to CNC and am currently building a CNC machine (still got a long way to go!).
    I am writing my own software to read the Gcode produced by Phlatboyz addon in Sketchup.
    My question concerns the G2 and G3 codes for cutting radii and circles. When I read up on examples from other parts of the net I got the impression that I would have to calculate all the X and Y movements in the radius being cut. When I tried the script in Sketchup there were multiple X, Y positions generated in the G-code. Is this normal or is this specific to Phlatzboyz add on. An example of the code is given below:-
    G17 G2 X12.8660 Y10.7094 Z-0.3500 R3.5677
    X12.7444 Y11.6326 Z-0.3500 R3.5677
    X12.8660 Y12.5559 Z-0.3500 R3.5677
    X13.2223 Y13.4162 Z-0.3500 R3.5677
    X13.7892 Y14.1550 Z-0.3500 R3.5677
    X14.5280 Y14.7219 Z-0.3500 R3.5677
    X15.3883 Y15.0783 Z-0.3500 R3.5677
    X16.3116 Y15.1998 Z-0.3500 R3.5677
    X17.2349 Y15.0783 Z-0.3500 R3.5677
    X18.0952 Y14.7219 Z-0.3500 R3.5677
    X18.8340 Y14.1550 Z-0.3500 R3.5677
    X19.4009 Y13.4162 Z-0.3500 R3.5677
    X19.7572 Y12.5559 Z-0.3500 R3.5677
    etc etc.
    The script makes it easier from my point of view but if I get the G-code from other sources will it be the same?
    I hope that is clear
    regards
    Brian
     
  2. swarfer

    swarfer Moderator Staff Member

    Offline
    Messages:
    808
    Trophy Points:
    28
    Location:
    Grahamstown, South Africa
    Gcode is standardized and the above lines are standard 'segment of circle of radius R3.5677' statements.

    However, I must ask why you are writing your own software? Gcode interpretation is difficult to do well, and has been done well already.
    Mach3 if you want Windows based (some cost)
    LinuxCNC for linux, free.
    GRBL for Arduino (free)
    planet-cnc.com and similar hardware projects (smoothie, tinyg) take the processing out of the PC via USB cable, so the PC can be very basic or a netbook etc.

    Note that you can force SketchUcam to generate only straight line segments by exploding all curves in the drawing before adding cut lines.
     
  3. Beejay

    Beejay New Member

    Offline
    Messages:
    9
    Trophy Points:
    1
    Location:
    North Shields, England
    Thanks for your reply and advice Swarfer. I have looked at the other systems you mentioned and still may use one of them. I am a retired software engineer and saw the writing of the code as a challenge and a chance to hone some of my old skills combined with my other interest of DIY.
    Brian
     

Share This Page