Welcome to Our Community

Some features disabled for guests. Register Today.

Generating gcode from Solidworks CAM?

Discussion in 'CAM' started by jace2016, Aug 30, 2020.

  1. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    How do you all generate your code from Solidworks? This has been stumping me for a month...
     
  2. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    This has been stumping me for a month now, the Solidworks CAM doesn't have the option to output as gcode but has .cnc and a couple other available formats.
     
  3. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    749
    G-code files that I use are usually .nc or .ngc, sometimes .gcode. I doubt the specific "format" really matters, since the actual file encoding is just a txt file full of gcode, much like an HTML file is just a txt file. The controller knows how to parse the gcode by line.

    Did you output a file and open it in say, Notepad++?
     
  4. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Yes I have actually, the commands are not recognized by the Duet control board for the Workbee I have.
     
  5. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
  6. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    If @Peter Van Der Walt 's suggestion doesn't solve the problem post the first few lines of a g-code file and I'll be able to point out the code that causes a problem with the Duet. As @Rob Taylor said the file extension is not critical - the Duet will accept files with lots of different extensions.
    Alex.
     
  7. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Thank you very much for the help I really appreciate it, I just went ahead and attached the whole output. I'm just trying to make a simple spoilboard.


    O0001
    N1 G20
    N2 (1/2 X 90DEG CBT SPOT DRILL)
    N3 G91 G28 X0 Y0 Z0
    N4 T18 M06
    N5 S6829 M03

    N6 ( Center Drill1 )
    N7 G90 G54 G00 X-15. Y27.25
    N8 G43 Z1. H18 M08
    N9 G82 G98 R.1 Z-.1417 P1000 F34.1483
    N10 Y24.25
    N11 Y21.25
    N12 Y18.25
    N13 Y15.25
    N14 Y12.25
    N15 Y9.25
    N16 Y6.25
    N17 Y3.25
    N18 Y.25

    N436 M30
     
    #7 jace2016, Aug 31, 2020
    Last edited: Sep 1, 2020
  8. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
    Try the Grbl post above first

    Then...

    Then we look closer at the output of the Grbl post to make it work with Duet.

    The default post you were using is much farther off... So use the Grbl one and then address editing it to fix whatever small changes are needed. This edited post then becomes the Duet post
     
    Alex Chambers likes this.
  9. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    As @Peter Van Der Walt said, please try with a grbl post processor first. It might need a bit of tweaking to work with the Duet, but most grbl post processors work OK.
    I have just posted another grbl post processor for Solidworks in the resources section (Solidworks grbl post processor) which was developed for the Carbide folk and may be a bit better developed than the one Peter found.
    Make a simple file with a square and a circle - just one pass deep to keep it short - and post it here and we'll be able to tell you if it needs any modification.
    Alex.
     
  10. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Do you have to add this to the Solidworks installation folder?
     
  11. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    No idea @jace2016 - I don't have Solidworks. I was hoping that I (or someone else here) could help if the output (g-code) didn't work well (I am familiar with the Duet). Have a look to see where Solidworks saves it's post processor files and put it there. You might have to re-start Solidworks for the programme to find it.
    Alex
     
    #11 Alex Chambers, Sep 1, 2020
    Last edited: Sep 1, 2020
  12. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    I just received this from the folks at Hawkridge systems - hope it helps.

    If you find yourself modifying the G-code before sending it to your CNC, we can customize your post for a one time charge. Call or email me for details.


    SOLIDWORKS CAM / CAMWorks Training - CLICK HERE


    If you have questions, please don't hesitate to reply to this email. Looking forward to hearing from you.


    ~ Instructions for Post Installation ~

    - Default post location - ~ SolidWorksCAM ~ Unzip, then place all the extracted files in C:\ProgramData\SOLIDWORKS\SOLIDWORKS CAM 20xx\Posts\ sub folder Mill or Lathe depending on machine. The XX denotes the year of SolidWorksCAM you are running. ~ CAMWorks ~ Unzip, then place all the extracted files in C:\camworksData\CAMWorks20XX(x64)\posts. The XX denotes the year of CAMWorks you are running and the x64 may or may not be there depending on your system. - User defined post location - Unzip, then place all the extracted files in the location where you keep your post files. *** This step is a must *** Once the post is in the location 1.Edit the definition of your machine. 2.Go to the post processor tab. 3.Highlight your post.

    4. Press the 'select' button.

    5. "ok" to close the dialogue window. 6.Right click on the NC Manager and 'Generate tool-path'.

    7. Post your code with your new post.

    Alex.
     
  13. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Here's what I get with the post processor now:


    N1 G90 G54 G00 Z-.12758 M00
    *N2 (1/2 X 90DEG CBT SPOT DRILL)
    N3 T18 M06
    N4 T19
    N5 S6829 M03
    N6 G54
    N7 M08
    N8 X-15. Y27.25
    N9 Z1.
    N10 G82 G98 R.1 Z-.12758 P1000 F34.14828
    N11 Y24.25
    N12 Y21.25
    N13 Y18.25
    N14 Y15.25
    N15 Y12.25
    N16 Y9.25

    When I try to upload and run this code it says that G1/G0 are out of bounds and it fails immediately.
     
  14. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
    Did you set your machines Max Travel in Grbl Settings? See github.com/gnea/grbl/wiki
    Zeroed out workpiece?
    (Related to the exceeding travel error)

    even then..
    Can you export the model to Fusion360 then CAM there? Already has working posts, very good CAM, etc
    Theres still a lot of commands there in your sample that Grbl will also not support (M06, G98, G82)
     
    #14 Peter Van Der Walt, Sep 5, 2020
    Last edited: Sep 5, 2020
  15. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Hi,

    I use solidworks for my CAD and CAM program, but the workbee has all axis homed when I start the carving.
     
  16. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
    Yes but in the absense of a actual grbl post for SW (as a possible option, but actually you still have to edit or hunt down the Duet specifics too) Won't you consider throwing an extra step into your workflow?

    Also, homing sets Machine zero. You still have to set Work Zero on the origin relative to the piece of stock to be machined. But before that you need Duet compatible Gcode, and as you are out of depth on how to edit a post to get that working in SW, throwing an extra step through some other, easier, more compatible CAM is a option to consider. Fusion, vectric, openbuilds cam etc. Export CAD from Solidworks, open the CAD drawing (DXF R14 for example) in a different CAM.

    Have you got your feet wet with some basic jobs yet? (as i see you may not yet grasp the Setzero part of the workflow it may be a good starting point from something more familiar)
     
    #16 Peter Van Der Walt, Sep 5, 2020
    Last edited: Sep 5, 2020
  17. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    I mean the whole intent of the forum is to learn things based on shared knowledge which is what I'm trying to do here, not just switch CAM software because it's easier to explain. I've set the coordinate system to 0,0 on one of the corners of the stock piece in Solidworks CAM.
     
  18. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
    Well, if supplementing your workflow is not an option, then refer to my link higher up in this thread of the person who explained how to edit/compile posts.
    - start with his base
    - remove and substitute any unsupported commands
    - fix all formatting, headers and footers to suit what duet needs
    - compile, test, revisit any remaining errors


    As there is no ready to use Post, it will be up to you to help create one (as you have a copy of SW to work/test it on)

    Alternatively you could pay the guys Alex mentioned

    Good, but did you jog the machine to the same corner, and then zeroed out the DROs?
     
  19. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    So I can make sure I'm understanding the terms right, for jogging, you're talking about lining up the spindle/router bit with the corner of a workpiece correct? If so, I've tried that, and for zeroing out the DRO's, is that zeroing out the coordinates once the bit is jogged to the workpiece? If so, I'm not sure I know how to do that in the web interface.
     
  20. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,190
    Likes Received:
    4,346
    Yes, unless zeroed the next commanded move will be from where zero was last set which may be the cause of the error related to exceeding travel.
    I am going to step aside for the Duet based part of that question and tag in @Alex Chambers
    (we use Grbl and the beginner friendly OpenBuilds CONTROL with a Blackbox motion controller)
     
    Alex Chambers likes this.
  21. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    Hi @jace2016, the Ooznest learning portal is a good place to find out about the workbee with Duet. I'll post a link to the section on using the Duet Web Control software. To set the Work Coordinates System (wcs) zero you should have the CENTRE of the bit lined up with the point on the workpiece that you set the origin to in your cam software and the tip of the bit just touching the the surface if you set the origin in cam to be the top of the workpiece. Then click on "Set work xyz" on the right hand side of the screen.
    Alex.


    How To Use WorkBee Control
     
  22. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Thanks!

    Do you know if there's a list of 'approved' commands for this version of the duet gcode controller?
     
  23. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    Yes - the Duet uses Rep-Rap variety of g-code - the wiki listing them all is below.
    Alex.


    Duet Gcode
     
  24. jace2016

    jace2016 New
    Builder

    Joined:
    May 7, 2020
    Messages:
    14
    Likes Received:
    0
    Ok cool, nothing specific to the workbee package?
     
  25. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,797
    Likes Received:
    1,375
    The only real differences are the user interface plus, of course, the Duet was designed primarily for 3d printers, so some of the available commands are only appropriate to 3d printing. For example the tool change commands in Rep-rap g-code refer to changing print heads - not changing a tool in a cnc router.
    Alex.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice