![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi, I am writing some new software for my CNC router and am adding a G-code command interpreter. Previously I have mainly worked in 2D or 2.5D using mainly flat cuts of 2D shapes and layers etc. I also have a 2D to 2D morphing system for doing tapered shapes etc. Now my goal is to be able to run 3D G-code and cut more complex shapes and to reduce my time as it will be more automated, so I won't have to keep loading new layers etc to do an entire complex job. A lot of my work will remain 2D routing, but it will be nice to add tapered pocket features and some variable height profiling etc all in the one job file. Currently I have implemented a couple of setup commands, then just G0 for 3D traverses and G1 for 3D cutting, but no arc commands or tool offset commands. And hopefully these will not be needed anyway. Can anyone please suggest the minimum G-code commands that will allow me to use G-code from other people, and to also allow my software to export G-code that should be usable by others? Also, I am after some simple G-code examples for testing purposes, preferably with no arc or tool offsets or anything complex and not too large (say under 1000 lines?). Thank you very much for any help you can provide. |
|
#2
| ||||
| ||||
| I built a gCode interpreter based on RepRap (et al) that implements just this subset: G0 rapid moveyou'll probably also need: M0 stopIf it's half as good as your PID controller - there'll be a queue before you even pick up your coding pencil ![]() (can I take a number please?) I have some sample PCB mill gcode if you'd like? |
|
#3
| ||||
| ||||
| 1000 lines isn't much for 3D. Objects that are about 75mm x 75mm can require over 100,000 lines. Here's ±5000, just cut out what you don't need. Edit. There's an A axis move at the start that you probably need to remove. remnant from the 4 axis post.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#4
| |||
| |||
| Thanks mmcp42, that's a nice concise list. I wasn't really thinking of releasing it, it's just a windows software to allow me to import and export files and of course do g-code tweaking and processing to make my life easier.Currently it imports and exports basic HPGL PLT and g-code, and displays the move paths in top down and a few 3D views, and it has some editiing features so I can move the coords or scale the coords, either all coords or just ones in a user defined range etc. I was going to put some 2D-2D morphing in it as I already have that written in my other software. A make-duplicate feature is next on my list so it can import one g-code and then lay out a few of them in an array. I thought there was plenty of windows software that have these features already released? Basically I was just coding my own because it's handy (being a programmer) having a tool I can change and adapt, and because I can make it optimised for my machine and my exact needs. Or do you think there is a need for a program like this? Can you confirm that G0 and G1 (ok G28) are the only actual "moving" commands needed to make useful g-code? And I would love to see the PCB g-code too if you don't mind. ![]() Ger21- Thanks for the sample, I will have a play with it. I just said a limit of 1000 lines thinking it would be easier for people. |
|
#5
| ||||
| ||||
| indeed G0 for "positioning" and G1 for "doing" would be fine you can just ignore anything else that you get here's a couple of PCBs "wot i rote" limit switch Arduino CameraAxe both made using Eagle and pcb-gcode enjoy |
| Sponsored Links |
|
#6
| |||
| |||
| Thanks for the help Mmcp42 and Ger21. ![]() I have basic g-code import, translation and display working ok, and thought you might like to see the results. First photo is a "sphere in cube" example I found on the forum, second is your g-code Ger21, it looks like a sculpted 1/4 round object (part of a plaque?). Last item is your massive PCB gcode Mmcp42, it works fine and I also downloaded pcb-gcode ULP (same program as you used) and might have a play with some Eagle outputs later. Mmcp42- May I ask what you meant by "If it's half as good as your PID controller - there'll be a queue...", did you think I was making a hardware device to interpret g-code? Isn't there already one of those? |
|
#7
| ||||
| ||||
| Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
|
#8
| ||||
| ||||
| That's the reasoning behind why I went down the "smart controller" route (apart from I like playing )a) uses USB to talk PC-controller b) offloads the generation of timing to hardware close to the drivers I have implemented the subset I mentioned in an earlier post I did wonder if you may be heading the same way ![]() If you are thinking of building a hardware controller (like your PID controller) especially if you implemented acceleration, I am sure there would be a market. RomanCNC -> USB -> RomanController -> Drivers -> Steppers If you want more bits and bytes about where I've got to - very happy to share. cheers! Mike |
|
#11
| |||
| |||
| Al_the_man- Thanks for the tip, so let me see if I understand you right; regarding G0 it should move at the max rapid speed for the longest moving axis and not an exact hypotenuse speed as used for G1 cutting? Mmcp42- Thanks for the link, I had not seen that product. It looks to have a PC software and USB controlled step generator in hardware. I think is a bit like the Smoothstepper product but from what I know about Smoothstepper it communicates directly with Mach3. There must be a few more products like that as well.
Do you have a build log for your machine and electronics? I'd love to see it! As for a commercial hardware CNC driver I really wouldn't want to enter a "PC->USB controller" market that has great products like the Smoothstepper etc, it's much more preferable for me to create a product where there is a complete gap in the market (like the SuperPID for example). Anyway this windows software I'm working on is mainly just to create a useful tool for me, at this point anyway. Nian_id- Thanks for the suggestion to include arcs. I did consider arc importing, then converting to small linear moves as my machine hardware can only do linear moves. Do people really use arcs much in their g-code? The impression I got from the CNC router crowd was that they normally export DXF to linear g-code and just use that on their machines. I thought arcs were more for the metalworking guys that cut round bearing recesses etc? Last edited by RomanLini; 01-26-2011 at 04:55 AM. |
|
#12
| ||||
| ||||
![]() here's a link my build log a bit higgledly piggledy but ... I have been watching several of your threads had seen the plastics router one (excellent btw!), but managed to not see the bit where you mention the controller ![]() and as for arcs the Eagle - gcode route seems to code up circular pads as lots of short x and y movements sounds like a tinkly piano when it's drawing them! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NC-Corrector, New Free G-code Editor for testing | CyberPunk | Coding | 14 | 03-17-2012 12:26 PM |
| Need (hopefully simple)G code Help | inventor30 | General CNC (Mill and Lathe) Control Software (NC) | 2 | 11-12-2010 05:32 AM |
| G-code testing on a SCM tech Z25 plus | PuresoundGuitar | WoodWorking | 5 | 02-23-2009 07:47 PM |
| Need help with simple G code | Step by Step | Coding | 2 | 10-24-2008 08:49 PM |
| Tutorials , exercices, samples , mold samples | engrsc | Solidworks | 4 | 02-22-2007 09:24 AM |