MechMate CNC Router Forum

MechMate CNC Router Forum (http://www.mechmate.com/forums/index.php)
-   Golden Resources (http://www.mechmate.com/forums/forumdisplay.php?f=18)
-   -   Surfacing GCode (http://www.mechmate.com/forums/showthread.php?t=4842)

Duds Mon 08 December 2014 06:45

Surfacing GCode
 
1 Attachment(s)
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.

Attachment 15220

sailfl Mon 08 December 2014 08:57

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.

Duds Mon 08 December 2014 12:23

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.

Fox Mon 08 December 2014 15:15

Use notepad ++ and a g-code language highlighter, makes coding easier.

racedirector Mon 08 December 2014 16:11

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.

Duds Mon 08 December 2014 17:19

;) 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?

racedirector Mon 08 December 2014 17:23

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? :)

KenC Mon 08 December 2014 21:13

I'm with Bruce's "get-you-going-ASAP" school of thought.

smreish Tue 09 December 2014 13:55

My personal favorite - cheap and awesome is Cut2d by vectric.

servant74 Tue 09 December 2014 14:58

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).

Fox Tue 09 December 2014 17:30

Vote for cut2d, love that. But I like your learn first act later approach. Wish I had the patience and time.

smreish Thu 11 December 2014 14:29

...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.

pblackburn Fri 12 December 2014 16:45

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

servant74 Sat 13 December 2014 10:06

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?

Duds Sat 13 December 2014 15:23

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.

servant74 Sat 13 December 2014 15:48

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!

pblackburn Sun 14 December 2014 11:11

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

Duds Sun 14 December 2014 13:34

Thanks for adding providing that code its a great example to learn from.

KenC Mon 15 December 2014 21:50

I use pocketing function available in Aspire to do surfacing. Actually, all CAM software will have this function.

Quadro Tue 16 December 2014 00:23

1 Attachment(s)
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.

Duds Tue 16 December 2014 00:27

Thanks Anthony!


All times are GMT -6. The time now is 07:20.

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