MechMate CNC Router Forum

Go Back   MechMate CNC Router Forum > Miscellaneous hardware and software > Golden Resources
Register Options Profile Last 1 | 3 | 7 Days Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old Mon 08 December 2014, 06:45
Duds
Just call me: Dale
 
Canberra
Australia
Surfacing GCode

Hi folks, the first cut I ever made was using the surfacing wizard in Mach3. Once I had my axes calibrated and tuned and had tested limits and e'stops and other functionality I fired up the wizard set my parameters, loaded the Gcode and hit GO. I then watched my spindle bit dive 25mm into the corner of my baseboard and carve a big chunk out, It was quite happily chewing up MDF at 200IPM before I could reach the e'stop. Why? mainly because I didn't understand the X and Y coordinates, or a whole pile of other stuff about Gcode.

So, to help me learn all those things that I need to know I have been hand writing my own Spoilboard Surfacing code. It's attached. It's also late and I haven't tested it so use at your own risk. Or, better yet, mark up some edits to improve it and post it back to the thread.

Thanks.

GP001 Surfacing.txt
Reply With Quote
  #2  
Old Mon 08 December 2014, 08:57
sailfl
Just call me: Nils #12
 
Winter Park, FL
United States of America
What CAM software are you using? It is easy to create a file using your CAM software.

Then try some thing small before you take on the task of resurfacing. There is a lot to learn and it is easy to take small steps first. We all have made some cutting error when we first start out, don't feel bad.
Reply With Quote
  #3  
Old Mon 08 December 2014, 12:23
Duds
Just call me: Dale
 
Canberra
Australia
Hi Nils, I'm not sad. I love breaking stuff. Then I get to pull it apart and put it back together again
I'm not using CAM yet. I wrote this in notepad. I wanted to learn how to code my own tools. I'm pretty sure I'm going to need a lot of little utility snippets of code. I don't even know what yet. I have been using the MDI screen a lot too, to recover from crashes as I test and practice.
Reply With Quote
  #4  
Old Mon 08 December 2014, 15:15
Fox
Just call me: Fox
 
Amsterdam
Netherlands
Use notepad ++ and a g-code language highlighter, makes coding easier.
Reply With Quote
  #5  
Old Mon 08 December 2014, 16:11
racedirector
Just call me: Bruce #122
 
New South Wales
Australia
Dale

Download Cambam, you'll have 40 free uses to try out before you have to buy. Create a pocket the size of your table and set the depth to of cut to zero. When you load that into Mach, zero your Z, then change the Z value in mach to the depth you want to cut. After that away you go.

This way you can change the depth to anything you want and still use the same gcode to surface your table anytime.
Reply With Quote
  #6  
Old Mon 08 December 2014, 17:19
Duds
Just call me: Dale
 
Canberra
Australia
Bruce that's no fun! I won't learn how to use iterative subroutines like that.

And I just wrote in 20 something lines what CAM wizards use 300 lines for.

Fox, thanks good tip. Does anyone use TextExpander, or similar, to create their own gcode shorthand?
Reply With Quote
  #7  
Old Mon 08 December 2014, 17:23
racedirector
Just call me: Bruce #122
 
New South Wales
Australia
I hope you don't intend on doing any vcarving and writing your own gcode, if you do you may get one or 2 done in a year

IMO you would be better off using cam software to get you going and THEN learning the ins and outs of the gcode. Why reinvent the wheel?
Reply With Quote
  #8  
Old Mon 08 December 2014, 21:13
KenC
Just call me: Ken
 
Klang
Malaysia
I'm with Bruce's "get-you-going-ASAP" school of thought.
Reply With Quote
  #9  
Old Tue 09 December 2014, 13:55
smreish
Just call me: Sean - #5, 28, 58 and others
 
Orlando, Florida
United States of America
My personal favorite - cheap and awesome is Cut2d by vectric.
Reply With Quote
  #10  
Old Tue 09 December 2014, 14:58
servant74
Just call me: Jack
 
Nashville (Tennessee)
United States of America
If interested in a low end but good package, check out www.cambam.info - cheap ($100 USD if I remember right, but I got it a long time ago), but really a low end cad package. Quite a few tutorials on their site, and if you get it, join their forums. I have it on a Windows machine, but also use it under Linux (linux install is not as easy as windows, but it does work).
Reply With Quote
  #11  
Old Tue 09 December 2014, 17:30
Fox
Just call me: Fox
 
Amsterdam
Netherlands
Vote for cut2d, love that. But I like your learn first act later approach. Wish I had the patience and time.
Reply With Quote
  #12  
Old Thu 11 December 2014, 14:29
smreish
Just call me: Sean - #5, 28, 58 and others
 
Orlando, Florida
United States of America
...I used the Lazy cam license on Mach for 2 years before I bought a fully functioning CAM program and was truly happy with almost all the results all of the time.
Reply With Quote
  #13  
Old Fri 12 December 2014, 16:45
pblackburn
Just call me: Pete #98
 
South-Central Pennsylvania
United States of America
Software is great but for something so little, write it by hand, then you will understand it better. IMHO. For those who need help http://www.cnccookbook.com/CCCNCGCodeCourse.htm
Reply With Quote
  #14  
Old Sat 13 December 2014, 10:06
servant74
Just call me: Jack
 
Nashville (Tennessee)
United States of America
Basics for Understanding

Quote:
Originally Posted by pblackburn View Post
Software is great but for something so little, write it by hand, then you will understand it better. IMHO. For those who need help http://www.cnccookbook.com/CCCNCGCodeCourse.htm
I was a computer programmer for years, and understanding the basics everything is built on gives a perspective and a way to think that GUI and CAD users don't see.

Nothing against GUI and CAD users, but it helps folks understand the WHY things work rather just THAT they work.

It would be interesting to see a small hand-coded CNC smoothing routine that is parametrically driven. (driven by dimensions entered once and not needed to be coded in again and again). Anyone have a good small example?
Reply With Quote
  #15  
Old Sat 13 December 2014, 15:23
Duds
Just call me: Dale
 
Canberra
Australia
I've been playing with an excel sheet that does what your after and I would be surprised if there's not more excel sheets out there that are very extensive. I'll post it up after I cleanup and get it working properly without some of the fudges I'm using.

Btw I agree that hand coding provides contextual knowledge that can't be understood from using wizards and gui interfaces. This is especially useful when you have a job fail and need to recover. It's always when something goes wrong that you need to know what's going on under the hood.

Aside from the benefit of understanding what's going on under the hood. Every single wizard code I have used so far has needed some tweaking.
Reply With Quote
  #16  
Old Sat 13 December 2014, 15:48
servant74
Just call me: Jack
 
Nashville (Tennessee)
United States of America
CNCzone has a small program in VB to generate code to flatten a surface.

I was really looking for a short looping piece of G-Code to loop through.

on CNCzone a user Geof said something like:
This is the style of program I use for facing various size one offs on a vertical cnc. I have omitted all the stuff about tool selection, rpm, etc., this is just the tool path for a 3/4" dia. tool facing 18 inches by 14 inches.

N100 G54 X0. Y0.
N101 Z0.
N102 G91 G01 Y-0.74 F100. M97 P1000 L10
N103 G28 M30
N1000 G90 X-19.5
N1001 G91 Y-0.74
N1002 G90 X0. M99

Comments:

Line N100; Put the work zero slightly more than one tool diameter positive from the corner of the workpiece nearest machine zero.
N101 Set tool offset at the finished surface.
N102 This increments the Y slightly less than one tool diameter and calls the subroutine starting at N1000 ten times.
N1000 The uses absolute positioning to face across the X distance.
N1001 This increments the Y again.
N1002 This returns in absolute back to X 0. and returns from the subroutine.

The Y travel for each call of the subroutine is 1.48" and the total Y travel is 14.8". For different size cutters and different size parts it is only necessary to change the Y increment, the X travel and the L count.

...
Yes, some adjustments are needed for your configuration and setup, but this is the basics. Under a dozen lines of code can do a lot of simple things!
Reply With Quote
  #17  
Old Sun 14 December 2014, 11:11
pblackburn
Just call me: Pete #98
 
South-Central Pennsylvania
United States of America
Good find Jack. It should also be noted that there are a lot of things that can be done with custom macros and calling them from G-code
Reply With Quote
  #18  
Old Sun 14 December 2014, 13:34
Duds
Just call me: Dale
 
Canberra
Australia
Thanks for adding providing that code its a great example to learn from.
Reply With Quote
  #19  
Old Mon 15 December 2014, 21:50
KenC
Just call me: Ken
 
Klang
Malaysia
I use pocketing function available in Aspire to do surfacing. Actually, all CAM software will have this function.
Reply With Quote
  #20  
Old Tue 16 December 2014, 00:23
Quadro
Just call me: Anthony #77
 
South Australia
Australia
Attached is what you might be looking for.
I wrote it for Linux CNC so i don't know how it ports over to Mach.
I do use this on a regular basis.


P.S. Use at own risk.
Attached Files
File Type: txt PocketX.txt (948 Bytes, 22 views)
Reply With Quote
  #21  
Old Tue 16 December 2014, 00:27
Duds
Just call me: Dale
 
Canberra
Australia
Thanks Anthony!
Reply With Quote
Reply

Register Options Profile Last 1 | 3 | 7 Days Search Today's Posts Mark Forums Read

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a Gcode X amount of times Helsingtwelve Construction started, but not cutting yet 6 Thu 15 May 2014 10:27
Gcode for spiral circles. rocky2889 CNC motion control software 6 Sun 10 October 2010 18:43
surfacing a table in EMC lumberjack_jeff CNC motion control software 4 Tue 01 September 2009 03:46
Surfacing the table gixi 10. Base Table 1 Mon 10 August 2009 05:17
Gcode for surfacing table DMS CNC motion control software 2 Sun 12 October 2008 09:09


All times are GMT -6. The time now is 10:49.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.