Separate names with a comma.
Some features disabled for guests. Register Today.
Discussion in 'CAM' started by jace2016, Aug 30, 2020.
How do you all generate your code from Solidworks? This has been stumping me for a month...
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.
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++?
Yes I have actually, the commands are not recognized by the Duet control board for the Workbee I have.
GRBL Postprocessor for Solidworks – Restricted Ayerspace might help
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.
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.
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
Try the Grbl post above first
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
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.
Do you have to add this to the Solidworks installation folder?
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.
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.
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
N5 S6829 M03
N8 X-15. Y27.25
N10 G82 G98 R.1 Z-.12758 P1000 F34.14828
When I try to upload and run this code it says that G1/G0 are out of bounds and it fails immediately.
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)
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)
I use solidworks for my CAD and CAM program, but the workbee has all axis homed when I start the carving.
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)
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.
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?
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.
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)
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.
How To Use WorkBee Control
Do you know if there's a list of 'approved' commands for this version of the duet gcode controller?
Yes - the Duet uses Rep-Rap variety of g-code - the wiki listing them all is below.
Ok cool, nothing specific to the workbee package?
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.