![]() | |
| 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 guys , im new to CNC ,and i have a question. Do i need special hardware to use g code in my machine ?? can i compile g code and install it on my PIC?? what do i need exactly to use G code in my machine??? Thanks for all the help in advance. |
|
#2
| |||
| |||
Don't know what kind of kind machine you are using, or what controller, but I have never seen one that you could not just stand at the console keypad and type it in. Lots of guys still do that. Personally I think they're nuts. Go sit down at your computer, open Notepad, Wordpad, or any other word processor, (if you use Word, save your program as a .txt file) and start typing. When you have what you want, you can upload it using your RS232 port, floppy disc, ethernet, etc.. You'll need cables and a communications program of some sort. There are a lot of old, simple, bulletproof ones. Ask around. Actually you can use -Hyperterminal-, the program that comes with all Windows OS's. You'll find it in the accessories folder. It's tough to use though if you don't know just how to set it up for your controller. The floppy disc is the easiest if your machine control has a floppy disc drive but it probably won't if it's older.. Otherwise get ready for the sore feet you'll get standing at the console typing with 2 fingers... G-code, Mazatrol, Caps, Maps or whatever, it all ends up as 0's, and 1's (binary) in the machine's head. After you've spent your 10,000 hours typing all that G-code, you've paid your dues. Then go buy a good Cad/Cam package and never type another line. G0 od luck Remember, close the door before an M8! |
|
#3
| ||||
| ||||
|
Haha, I've been known to put an extra M00 before an M08, with the comment (Close Doors or Take a Bath!) between the two, in setups that require the operator to swap or flip parts during a cycle. |
|
#4
| |||
| |||
| Thank you for your time to answer . Im not sure i got what i wanted from the answer. 1-What do i need to use G code in my machine? can i send G code instructions serially to the PIC on my CNC ?? how should the PIC understand the G code instructions G00 G01 ..etc ??? 2- Is there a special hardware i must get to use G code ?? or does G code can be installed on a PIC . 3- If im not using G code what can i use instead?? |
|
#6
| |||
| |||
| Guys, you might be misunderstanding the question. 1041448 I know nothing about PIC's. Are you working on a concept similar to seen here? http://cnczone.com/forums/showthread.php?t=59461 The author of that thread was offering help 6 mths ago. Maybe the offer is still open. Then again, I may also be misunderstanding the question
__________________ Anyone who says "It only goes together one way" has no imagination. |
|
#7
| |||
| |||
at the end of each block.If you mean PC when you write PIC, then yes, you can upload your G-Code files serially using the serial port on your PC and the RS232 port on your machine. As I said above, you will need the proper cables and software to upload your file. I don't know what other options you have. Unless you have some oddball contol like a Bandit or something, G-code is what you use. Even machines like Mazaks with their Mazatrol programming system allow the programmer to change settings to accept EIA (G-Code). Fadal has a simple program that will communicate with any machine with a RS232 port for about $200.00 There are plenty of others. If you have Windows, you already have one, Hyperterminal, but it's over my head.. You can probably find some generous soul to give you something easier than that. You need the cable no matter what. What configuration the cable needs to be depends on your machine control. It's usually just a matter of gender changers or null modems, with are cheap to get it right if it doesn't work the 1st time. You'll need a manual to find out what baud rate, how manystop bits, and what parity to use to communicate. Or someone out here who has the same setup as you and can help you out. It's not as bad as it sounds. We need to know what type machine and controller you have. We need more details. Show us an example of what you're trying to do. It's tough when your all alone trying to figure his out, but it can be done. |
|
#8
| |||
| |||
| Im sorry i wasnt clear in my question. I attached a flow chart of the machine i intend to build . Hardware wise , do I need another part ?? Can i use G code with design?? how would that go?? Again thx for all of ur time. |
|
#9
| ||||
| ||||
| G-code (g and m codes) make an interpreted 'language' that you really don't 'compile'. Some g-code interpreters use different 'dialects' of g-code. So if you know the set of instructions your code interpreter uses well, you can pretty quickly write g-code programs to do lots of 'normal' (standard geometric shape) processing. In the picture it appears that the PIC may be running a g-code interpreter. You would code the g-code in your 'computer' and send the g-code to the PIC via a serial cable. The PIC interprets it, sends commands to your stepper motor drivers to activate the steppers corresponding to your g-code commands. To get the 'job done' you probably need a 'board' for the PIC, to interface to the RS-232 and to the LM-289 driver boards. You will also need power supplies for the Stepper motors (that will really hook to the LM-289 driver boards) and a logic power supply for the PIC, it's board, and possibly the logic side of the LM-289 driver boards depending on their particular requirements. A box to put them in with fan for cooling, protection, etc is also a nice idea. If you want to up your personal efficiency (if your time is worth money) getting a bit more hardware than a PIC as a controller, you can use an inexpensive commercial g-code interpreter (like Mach3 or competitors) or a good free interpreter (like EMC2 from linuxcnc.org) Then you probably want to get some CAD/CAM software that allows you to do more with less of your time, like CAMBAM or any number of others. I think you may be starting out well, if you want to really learn the how's and why's of CNC and machine control using a setup like you pictured. If/when you get 'the bug' and want to be more serious you can 'move up' or build new more robust equipment as your needs and finances dictate. If this was trying to put beans on your table at this point, I would consider going to a more commercial solution sooner rather than later. If it is for hobby / education, take your time, learn, enjoy. I'm curious, what code are you programming the PIC with to be the g-code interpreter? Or are you going to write your own? It would be an interesting task, but it has been years since I did board/chip level development for fun. I hope this helps a bit. Does it answer the question you thought you asked? |
|
#10
| |||
| |||
| I can't add much to jcoats very thorough answer except a diagram. This is a drawing of how most people here approach stepper cnc. The gcode interpretor on the computer and step/direction signals sent from computer by parallel port. pport cable to breakout board and commercial drives (gecko, kelingnc, whatever) I expect you were aware of the common approach and have good reason for going the PIC route. There is a PIC design forum here. You question may draw different responses if posted there. Edit/ "Commercial drives" was a bad choice of words. Sounds industrial/expensive. Bored and nitpicking my own post.
__________________ Anyone who says "It only goes together one way" has no imagination. Last edited by cyclestart; 12-28-2008 at 08:34 PM. |
| Sponsored Links |
|
#12
| |||
| |||
| G-code is just a programming language. Just like basic or C but the instructions are designed for moving things around. Your PIC is not going to understand the instructions so you need a piece of software in between to convert the high level instructions to something you chip understands. If you program a computer in basic you need something like visual basic to convert the basic commands to the chip level instructions that your x86 cpu can process. Typically G-code is converted to machine instructions one line at a time and then processed by the motion controllers CPU. In computer jargon this type of processing is know as an interpreter. G-code is rarely (if ever) compiled. A compiler processes your entire program at once and produces a file, usually now called an .exe file, which contains the chip level instructions to be executed. Packing a full G-code interpreter into a PIC would be quite a challenge. My G-code system is over 20,000 lines of code but that includes the user interface. A subset using just G00, G01, G02, and G03 wouldn't be too hard if you've got a fair amount of programming experience. If you want features like cutter compensation and such I'd suggest you look for a packaged solution. Something like Mach or EMC will do all the heavy lifting for you and you won't need the PIC at all. Bob
__________________ You can always spot the pioneers -- They're the ones with the arrows in their backs. |
![]() |
| 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 |
| Wierd NC Code and G-Code | Tazzer | General CAM Discussion | 10 | 01-09-2012 01:07 PM |
| To hand Code? or to CAD Code? | automizer | Polls | 81 | 11-26-2011 09:30 PM |
| learning g code or cad-cam code output? | slow_rider | G-Code Programing | 3 | 02-27-2010 08:48 PM |
| G-code for beginners - want to learn G-code | FPV_GTp | G-Code Programing | 7 | 11-17-2008 11:25 PM |
| looking for g code 3d from bobcadcam or simmilar for indexer lpt v5 with g code soft | troyswood | Ability Systems - LPT Indexer and G-Code | 2 | 12-24-2006 09:21 PM |