![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi everyone, I've got my small router working under Mach3 and now I need to write a program to create g-code for a specific engraving job which I will perform regularly (this isn't a one-off). I need to engrave a scale on anodized alum bar stock. Determining my x y and z coordinates is easy enough. At this point I'm trying to determine what the fastest way to put a value on various increments of the scale is - (For example a scale which has increments between 200 and 900 by 100 - so the bottom of the scale is 200 next increment is 300, etc. ) because I'll need these numbers at various times throughout each engraving job. Because, I'll need an array of different numbers, maybe being able to call a "2" and a "0" twice is my best choice so I can mix and match values? If a macro is the best way - where would I get the g-code to engrave "200" to fill the macro? and then how would I call it in my program in order to start the "200" at any given coordinate? (I haven't yet but can purchase the add-ons so I can use the write wizard.) Am I making sense? I guess it's like a canned cycle, but those are specifically for drilling and tapping as far as I could tell from the manual. I can certainly explain further, but I want to see if I'm even barking up the right tree. Many Thanks- |
|
#2
| ||||
| ||||
| First, you don't need to purchase anything to use the Write wizard. It's free, as are most of the Wizards. Only the Newfangled Solutions addons require a license. I'd say that your best bet would be to write a VB macro to do what you want. You'll need the macro to create the g-code for the numbers, or possibly call them from other macros. If you don't have any VB experience, you may be in for a steep learning curve. Or maybe not. ![]() Depending on how many different numbers you'll need, then yes, it may be easier to do individual digits, rather than complete numbers. You probably have more questions now?
__________________ 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) |
|
#3
| |||
| |||
| thanks Gerry, I do have more questions and unfortunately my web searches aren't revealing much - to me at least. I am fairly familiar with VB so that part should be ok. I'm using a form in Access to take custom coordinates for various scales and then programatically create gcode files for me based on coordinates I enter. (The horizontal lines on the scale are simple moves and quick to assemble in a text file.) As far as how many numbers I need to engrave - one scale goes in inches 0-60 with numbers at each inch - then another is 0-31 - another is 0-11 - another type of scale has numbers from about 50 up to 5000 in various increments...so probably it's best to set up each individual digit and just combine digits. I still don't understand how I position the digits where I want them. Is this the time to use G52? Or is there another G code which will *add* the values of the following group of Gcodes to the DRO positions - instead of returning the spindle back to 0,0 and working from there? Has anyone else done something like this - and documented it on the web somewhere? I'm trying to understand what the likely workflow is. Do I need to create an individual gcode file for each digit or can I create a single file with subroutines for each digit or number which can be called while the program is running? Also, is there more documentation on Macros online? I read about them in the manual and came away with an overview of what they are - not so much what can be done with them. I'm definitely going to read about them again, but extra info isn't going to hurt me here. |
|
#4
| ||||
| ||||
| Not real familiar with G52, but it looks like you could do it. Maybe also use incremental code to do the numbers? You know where you want them, so positioning them should be fairly straightforward, once you have the g-code for them and you know what size they are. And know how you're going to do them. Basically, you keep track of where you are, move to the numbers start position, and either create the code and run it, or call it from an external file. Then move to the next position and repeat. The Mach2 customization guide should have some examples, but are probably a bit outdated. The Wiki has most of the functions listed. http://www.machsupport.com/MachCusto...itle=Main_Page You can also find a lot of example code on the Mach forum, if you poke around.
__________________ 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) |
|
#6
| |||
| |||
| I'm not sure I understand what you want to learn from a drawing. |
|
#7
| |||
| |||
|
Font size and style. Layout, are the numbers side by side or one under the other. Do they lineup, left side, right side. |
|
#8
| |||
| |||
| oh, sure, of course. I don't know why I didn't quite understand. I'll make a sketch a little later this evening. I've been reading about sub-routines at the mach support site and it seems that might be the way I should go - combine that with g52 (iirc) and locate the numbers I want where I want them. Advantageously, the numbers for the various items I'll be engraving will be the same size height wise - so I can re-use the same code for them where necessary. Because I know what all the different number combinations will be, it seems wisest to create subroutine files with each number I'll need to engrave and then just call them as needed while creating the g-code. I'll get a sketch of the scale up later on and thanks for bearing with me as I delve into stuff I've never thought seriously about how to implement - though I know it's possible to implement. |
|
#9
| |||
| |||
| I haven't had the opportunity to draw a sketch, but here's a representative picture. The anodized bar is 1" wide. The numbers will be located just above their respective line because two scales will be engraved on a single bar for some orders. Making the whole line .375", the half line .25" and the tenth line .125" and still leaving a clear separation down the middle. I haven't measured the text in height but it's probably .375" or so. As for font style - something stick or simple - no serifs or fancy stuff. Clear and readable is all we're looking for. I do know that I don't want the number touching it's line, I'd like a small bit of empty space above the line, below the number. How much space will really depend on how fine a line my engraving cutters will give me. As for depth - I was thinking .030" but I haven't been able to take any test cuts with the engraving bits yet. Does that help give an overview of what I'm working toward? |
|
#11
| |||
| |||
| I'm planning a simple fixture which will allow the bar to be held lengthwise along the X. But back to my original question - is G52 the code which is appropriate for locating/offsetting the spindle when I go to engrave the text? As in - I'll have a series of .tap files with g-code for a sequence of digits or text. I've already determined where each horizontal line goes and plan to either intersperse the number subroutines with M98 as I work along the X axis (likely a better use of time) or go back and call the subroutines after engraving all the horizontal lines and engrave the numbers. The thing I want to confirm though is that G52 will allow my subroutine file to have origins at x0 y0 and will, based on my calculated offset, put the text in the desired location. |
|
#12
| |||
| |||
| I had a play and wrote a VB program. I'm sure there is room for improvements. |
![]() |
| 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 |
| "difference between Custom Macro A and Custom Macro B" | arulthambi | Parametric Programing | 4 | 10-05-2009 03:34 PM |
| Need help with macro?????? | lokey | Mach Mill | 1 | 04-27-2009 10:04 PM |
| Testing program for Macro (Fanuc Macro B) | NickDP | Fanuc | 2 | 03-27-2009 03:15 PM |
| Convert Fanuc Macro to Fadal Macro | bfoster59 | Fadal | 1 | 11-08-2007 11:41 PM |
| Macro | gm3211 | Mazak, Mitsubishi, Mazatrol | 2 | 09-06-2007 07:02 AM |