10 ms·
I Revived 3-Axis CNC Mill G-Code Simulator
- chiffre01 2y agoVery cool project. what kind of post processors do you test with?
- harvie 2y agoTry GRBL post processor.
- WillAdams 2y agoThat's an excellent question. Also, how are tool definitions to be handled? Each program seems to have their own approach, though some will place the tool description in comments. CutViewer is notable for doing this, and is the example I have been following in: https://github.com/WillAdams/gcodepreview https://github.com/WillAdams/gcodepreview (which is quite a different project) EDIT: Note that the comment system which Cutviewer uses seems to be something of a de facto standard --- Carbide Create uses this same scheme.
- harvie 2y agoI was thinking about implementing some tool management in that simulator... What system would you reccomend? I can't really find example of what cutviewer uses... Can you please send me link to sample definition?
- notpublic 2y agoNice and Thanks! Was looking for something like this with minimal dependency. By the way, changing options updates browser history every time. You may want a debounce. Also, you could remove jQuery and make it even more leaner.
- harvie 2y agoPRs welcome :-)
- roamerz 2y agoVery nice thank you!!
- leetrout 2y agoThis is awesome. I learned CNC & manual G-Code on a Rockwell 3 axis in ~2000 and I am taken back tinkering with this.
- WillAdams 2y agoThe big problem for contemporary hobby CNC is that the G-code interpreters for small single board computers such as Grbl running on an Arduino are extremely memory-constrained: https://bengler.no/grbl https://bengler.no/grbl which means: - no loops - no branching - no variables One work-around for that is: https://github.com/NRSoft/GSharp https://github.com/NRSoft/GSharp (I took a very different approach in my project linked elsethread)
- harvie 2y agoYeah, i think hobby CNCs should be going in similar direction the 3D printing does with klipper...
- abakker 2y agoDo you not consider Mach4/UCCNC/Masso/Centroid Acorn to be hobby? I’ve never encountered a hobby grade controller without loops.
- WillAdams 2y agoThey are the high-end/legacy-end of hobby CNC. The Grbl/Arduino stuff seems most prevalent/commonly sold. That said, I was remiss in not mentioning LinuxCNC, &c., and as you note, they do have a more traditional G-code implementation w/ loops and variables and branches. But, I don't think that this simulator supports all of that --- could someone post a sample program which does that sort of thing and test it?
- abakker 2y agoYeah - I guess as a someone who considers my machining "non professional", I've never even really consider GRBL for a machine because "running G code" and "running a mill/router/lathe" feel like different categories. the lack of a reasonable GUI and access to the configurations and macros to handle things like tool changes etc. has never made me interested in GRBL. (I've only ever played with GRBL in the context of a router that needed to be run by UGS) and that felt so limited as to be useless. That said, I'm on the brink of converting both my mill and router from UCCNC to Centroid just to be into some software that is more "machine operator aware" meaning that it offers more features targeting making my life easier as an operator, rather than simply running gcode in a machine-agnostic way.
- buserror 2y agoMore importantly, what do you use for toolpath generation? I haven't found anything open source that really works...
- harvie 2y agoI've been long-term contributor to bCNC https://github.com/vlachoudis/bCNC/ https://github.com/vlachoudis/bCNC/ But FreeCAD seems to be interresting choice lately as well...
- WillAdams 2y agoOpensource options include: - Solvespace --- limited to 2D last I checked - FreeCAD has a workbench for CAM/toolpath generation - BlenderCAM is a plug-in for Blender which is well-regarded, and together w/ CADsketcher/BlenderCAD works well for some folks - Kiri:Moto - pyCAM --- a venerable option, it worked well ages ago when I used my son's gaming computer to make toolpaths. Rather rough (possibly outdated) list at: https://old.reddit.com/r/shapeoko/wiki/cam https://old.reddit.com/r/shapeoko/wiki/cam
- deleted 2y ago[deleted]
- phkahler 2y agoAnother might be gcad3d https://www.gcad3d.org/ https://www.gcad3d.org/
- Joel_Mckay 2y agoIn general, FreedCAD has 3-axis tool path support, and I've met the kind local guy who started the original Path toolbox. For 2.5D there are several engraver options with the inkscape mightyscape plugins (scorchworks etc.) YMMV with the island-routing and surface probing routines: https://github.com/pcb2gcode/pcb2gcode.git https://github.com/pcb2gcode/pcb2gcode.git https://github.com/pcb2gcode/pcb2gcodeGUI.git https://github.com/pcb2gcode/pcb2gcodeGUI.git Also, we are currently evaluating: viaconstructor, inkcut, GCAM ( https://github.com/blinkenlight/GCAM.git https://github.com/blinkenlight/GCAM.git ) If you want 3D contouring operations, than you could also try: git://pycam.git.sourceforge.net/gitroot/pycam/pycam And note, if you patch CAMotics to compile on ubuntu 24.04.x it still has a number of Qt5 GUI problems (not entirely unexpected with Qt impact on LTS programs.) There are also direct gcode generator macros that support the LinuxCNC/emc language extensions. This is the most accurate methodology for turning and milling ops. Best of luck, =3
- tekno45 2y agohas anyone tried making a mastercam/solidworks replacement? Mostly interested in looking at some code, not taking on the challenge lol
- WillAdams 2y agoFreeCAD and its CAM Workbench? For the light version maybe Solvespace? I'm still amazed by Dune 3D: https://dune3d.org/ https://dune3d.org/ where the Github page has the footnote: >I ended up directly using solvespace's solver instead of the suggested wrapper code since it didn't expose all of the features I needed. I also had to patch the solver to make it sufficiently fast for the kinds of equations I was generating by symbolically solving equations where applicable.
- mitthrowaway2 2y agoDune 3D is made by the same guy who did Horizon EDA (https://horizon-eda.org/ https://horizon-eda.org/). A really talented and productive person.
- nraynaud 2y agohttps://nraynaud.github.io/webgcode/ https://nraynaud.github.io/webgcode/ I made one too, a long time ago. https://nraynaud.github.io/webgcode/webapp/visucamTest.html https://nraynaud.github.io/webgcode/webapp/visucamTest.html I did some code generation too, but it's bit rotting.
- slt2021 2y agowhat if I want to learn CNC programming as a hobby, where one can go and learn and practice, without purchasing CNC equipment? (in NorCal/bay area) lets say I want to emboss hello world on a piece of foam
- WillAdams 2y agoSearch term for that is "makerspace" Perhaps: https://www.humanmade.org/ https://www.humanmade.org/
- Animats 2y ago3x the price of Techshop. I miss TechShop.
- luma 2y agoOne thing I'll suggest - if you ever want to cut anything metal, you'd probably do well to learn how machining works in general and by that I mean on a manual lathe and mill. The coding part is going to be easy for you (and probably anyone else reading this), but knowing what you want the thing to do is a MUCH different task than being able to tell the machine what to do. Everything about how you move that tool through the work matters. Materials, workholding, spindle speeds, tooling, tooling coatings, feed rates, plunge speeds, all of these things need to be worked out and they all change when you swap a tool or a part etc. Speeds and feeds are dynamic, you need to learn about conventional-vs-climb milling, you'll need to know about cutter geometries and the materials the cutters are made of, when and how to deploy coolant, the list just never ends. GCODE is, by far, the easy part for a programmer. It's a very simple language that hasn't changed much in the past several decades. "Knowing machining" is that tougher hill to climb. My recommendation? Check your local community colleges/trade schools! I took a couple semesters of machining classes as a 40-something grown-ass dude and I learned a huge amount of stuff that would have been expensive or dangerous to learn by trying. You'll get hands-on access to big machines with someone over your shoulder helping to make sure you keep your limbs attached to your body.
- xupybd 2y ago
- robszumski 2y agoI have a post-processed NC file from Fusion 360...which I think is just gcode. How can I transform that into something this can simulate? My hacky attempts have failed.
- harvie 2y agoDoes Fusion 360 have postprocessor for GRBL? I've tried to make the simulator GRBL compatible. At least to some extent... If that does not help, please share the g-code...
- xupybd 2y agoVery cool. It seemed to struggle a bit with a more complex example. N30 PAN=1 ST1="16MMRH" L=PCUA N40 Z=PRK N50 X1846.942 Y1157.433 G42 F=1.0 S20000 VF=1.0 AX=X,Y,Z PRF=-12.7 TP=1 L=PON M55 N60 G1 X1832.8 Y1171.575 Z=-LPZ+-12.7 F=1.0 N70 G1 X1832.8 Y1187.575 Z=-LPZ+12.2 F=1.0 N80 G2 X1807.8 Y1218.8 I=1839.8 J=1218.8 F=1.0 N90 G1 X1.2 Y1218.8 Z=-LPZ+12.2 F=5.0 N100 G1 X1.2 Y757.2 Z=-LPZ+12.2 F=5.0 N110 G1 X1807.8 Y757.2 Z=-LPZ+12.2 F=5.0 N120 G1 X1807.8 Y1218.8 Z=-LPZ+12.2 F=5.0 N130 G1 X1799.0 Y1218.8 Z=-LPZ+12.2 F=5.0 N140 G2 X1767.775 Y1243.8 I=1799.0 J=1250.8 F=5.0 N150 G1 X1767.775 Y1243.8 Z=-LPZ+-12.7 F=5.0 N160 G1 G40 X1778.481 Y1260.693 Z=-LPZ+-12.7 F=5.0 N170 G0 L=PSU N180 X1846.142 Y1156.633 G42 F=1.0 S20000 VF=1.0 PRF=-12.7 TP=1 L=PON M55 N190 G1 X1832.0 Y1170.775 Z=-LPZ+-12.7 F=1.0 N200 G1 X1832.0 Y1186.775 Z=-LPZ+12.2 F=1.0 N210 G2 X1807.0 Y1218.0 I=1839.0 J=1218.0 F=1.0 N220 G1 X2.0 Y1218.0 Z=-LPZ+12.2 F=5.0 N230 G1 X2.0 Y758.0 Z=-LPZ+12.2 F=5.0 N240 G1 X1807.0 Y758.0 Z=-LPZ+12.2 F=5.0 N250 G1 X1807.0 Y1218.0 Z=-LPZ+12.2 F=5.0 N260 G1 X1798.2 Y1218.0 Z=-LPZ+12.2 F=5.0 N270 G2 X1766.975 Y1243.0 I=1798.2 J=1250.0 F=5.0 N280 G1 X1766.975 Y1243.0 Z=-LPZ+-12.7 F=5.0 N290 G1 G40 X1777.681 Y1259.893 Z=-LPZ+-12.7 F=5.0 N300 G0 L=PSU N310 G0 L=POFF N320 PAN=1 ST1="FINTOOL" L=PCUA N330 X1817.607 Y747.3934 G42 F=3.0 S18000 VF=1.0 PRF=-12.7 TP=1 L=PON M55 N340 G1 X1807.0 Y758.0 Z=-LPZ+-12.7 F=1.0 N350 G1 X1807.0 Y758.0 Z=-LPZ+12.2 F=1.0 N360 G1 X1807.0 Y1216.5 Z=-LPZ+12.2 F=3.0 N370 G3 X1805.5 Y1218.0 I=1805.5 J=1216.5 F=3.0 N380 G1 X3.5 Y1218.0 Z=-LPZ+12.2 F=3.0 N390 G3 X2.0 Y1216.5 I=3.5 J=1216.5 F=3.0 N400 G1 X2.0 Y758.0 Z=-LPZ+12.2 F=3.0 N410 G1 X2.0 Y758.0 Z=-LPZ+-12.7 F=3.0 N420 G1 G40 X-8.6066 Y747.3934 Z=-LPZ+-12.7 F=3.0 N430 G0 L=PSU N440 G0 L=POFF N450 G0 Z=PRK