What's new
What's new

Brother Speedio engraving macro

GiroDyno

Cast Iron
Joined
Apr 19, 2021
Location
PNW
We put a part number and revision, and batch number on everything coming out of the mill.
With our Haas there is a macro that allows the operator to quickly update the rev (ex. 1-111D, where D is the rev) and batch number (todays date ex. 011222) at the control before running a set of parts. Engraving is always the same number of characters, same font, same size, same relative position.

We have a new R650 that doesn't have that function AFAIK.

I found a video for serialized engraving in a Speedio on YouTube Serial Number CNC Engraving Macro - Easily add serializing ability to your NC programs - YouTube but it doesn't seem like it would work with letters.

Did I miss the page of the manual explaining this function, or does it for sure not exist?
Has anybody come up with a work around?

I could program the part/rev # in CAM, since any rev change would presumably require some CAM alteration anyways, but that still leaves the batch number needing to be updated every time we run parts...
 
Don't have the patience to watch the video, but if the batch number is sequential digits, you should be able to engrave the things that don't change and add the things that do change which should work with his macro

Gawd, why do I want to watch anyone type on line

seriously
 
There is no engraving capabilities in the control other than macro capability. I think for your application you will need to create the part #, rev # and batch # in CADCAM and post it. There are some nice serial # macros but they don't do letters and they will advance/update the # each time it is called. I haven't looked, but maybe there is a macro out there that can do letters and numbers and let you choose size, spacing, angle or radius.
 
I got buy-in to update the process to include part and revision engraving into CAM.

I still need to update batch number every time we run a set of parts. We switch parts about 5 times a day on average so that's 5 batch numbers updated every day. Kind of annoying to go into CAM and repost when operators are used to being able to do it all themselves at the control first thing when they load a program.

Batch number is just the 6 character date, straight, flat, standard size and font so at least I don't have to worry about rotating or bending a string of text, just centering it in the right place...
 
I got buy-in to update the process to include part and revision engraving into CAM.

I still need to update batch number every time we run a set of parts. We switch parts about 5 times a day on average so that's 5 batch numbers updated every day. Kind of annoying to go into CAM and repost when operators are used to being able to do it all themselves at the control first thing when they load a program.

Batch number is just the 6 character date, straight, flat, standard size and font so at least I don't have to worry about rotating or bending a string of text, just centering it in the right place...


So take the time to write a macro for each number, 0-9, then write a program that reads the date from the control and automatically adds the batch number to your programs. Make it a sub program that stays in the control and can be called from any of your main part programs.
 
I should add, make it incremental so you can call it from any start location, and if you're really fancy, you can make different font sizes that can be selected from within the program with a variable, either set by the operator or passed from within th emain program.
 
I wrote my own characters years ago in the Heidenhain. I would then scale and rotate them within a subprogram to do whatever needed doing

Nowadays I would just make the characters in CAM and cut up the program into the individual characters.

I haven't even begun to understand Brother macros, but they can do so much that this must be 'straightforward' which of course is not to say 'easy'
 
I have some parts that are my product that I would love to have an incremental macro to mark the parts with a part number. Right now everything gets hand stamped which is irritating even doing small batches like 30 pcs. The parts are small and intricate, and before heat treat are easily damaged. Clamping them in a bench vise, even with wooden jaws, is begging for damage to be done.

And of course, being able to mark the corresponding parts with an assembly number would be fantastic. Much easier to organize assemblies after heat treat.

One of the companies I worked at I spent a fair amount of time doing 5 axis, primarily hard milling, I worked on a number of macros for Heidenhain and Mazak's. None were entirely my brain child, and none were entirely my work, I had several seasoned guys to check both the structure and intricacies. The biggest thing was having 12hrs to 3 days of run time to be able to sit down and write everything out. Even managing 2-3 machines I still had enough free time to dedicate to writing a macro. If I am lucky once a month I have an opportunity to turn my Brother down to 50% and get an hour run time.

So while I jokingly say share it with those of us who are too stupid, I really do mean it. I see a lot of guys here and on Instagram that post, oh I whipped this up. The whole time I am thinking, jesus, that would take me a week to get up and running!
 
I've spent a fair amount of time with Hirudin's Speedio engraving macro and recently re-wrote it for Mazak SmoothG. I'll start with a brief overview of how the macro works and then make some suggestions for how you might be able to use it to get what you want.

Hirudin included a lot of configuration/options in the macro that make it flexible but a bit difficult to understand. At its core, here's how the macro works:

  • Two programs are used; I believe Hiruden uses O1080 (the macro) and O1090 (the engraving helper)
  • The serial number being engraved can be specified either directly (engrave this number) or indirectly (engrave the number that this Common Variable points to).
  • You also pass in an XYZ start position relative to the active coordinate system (this is where engraving will start), a desired number of digits to engrave (this will automatically zero-pad the serial number so that 4 becomes 00004 or whatever you want), and an XYZ stepover amount per-digit (it's possible for your engraving helper to specify a custom stepover for variable-width fonts, but let's ignore that for now).
  • The macro will then "loop" through the serial number, calling into the engraving helper (explained in a minute) to engrave each digit. How it loops through the serial number is easiest to explain with a bit of pseudocode:
    Code:
    serial = 12345
    
    serial / 10000 = 1.2345
    integer(1.2345) = 1
    
    engrave 1
    serial = serial - 1*10000
    
    # serial is now 2345
    serial / 1000 = 2.345
    integer(2.345) = 2
    
    engrave 2
    serial = serial - 2*1000
    
    ...etc.
  • Instead of doing this manually, the macro tracks the current power of 10/etc. and loops through until you get to 0 (or something of that nature).
  • For each digit, the macro shifts the local coordinate system using G52 in order to handle character spacing.
  • The engraving helper is a macro itself that takes a single argument A to determine what digit should be engraved. A10000 will run any setup that needs to happen (tool change/etc.), A80000 engraves 0, A80001 engraves 1, A80002 engraves 2, etc.
  • Each digit is called individually, so the engraving helper returns control back to the macro with M99 after engraving a single digit using the current coordinate system zero.
  • The benefit of this system is that you can have multiple engraving helper programs that are differently sized, use different fonts, different tools, etc. I generate the engraving helper in CAM and then modify the program by hand to run the right part of the program based on how its called. Hirudin goes into this in the video, I believe.

It's very possible to adapt this system to support revision characters by mapping them to a digit. A could be 1, B 2, C 3, etc. Hiruden uses N8000x in the engraving helper to refer to digits and you could just extend that such that N810xx refers to characters. Pick some unused argument to the macro, let's say M/#13, and modify the macro with something like this after it loops through the serial number:

Code:
(Original macro loop)
WHILE [ ... ] DO 1
...
END 1

(Added code)

IF [#13 EQ #0] GOTO 99991

G52 X#4 Y#5 Z#6
G65 P#1 A[81000 + #13]

GOTO 99991

To engrave the date, we can use the same power-of-10 "trick" to convert the date system variable to the format you want (#3011, the current date with format YYYYMMDD):

Code:
#1 = #3011 (Current date, 20220114)

(Get the year)
#2 = FIX[#1 / 10000]
#1 = #1 - [#2 * 10000]
#2 = #2 - [[FIX[#2 / 100] * 100] (Convert 4-digit year to last-2-digit year)

(Get the month)
#3 = FIX[#1 / 100]
#1 = #1 - [#3 * 100]

(Get the day)
#4 = #1 (all the remains)

(Convert to DDMMYY)
#5 = [#4 * 10000] + [#3 * 100] + #2

After all this, #5 now contains a number that you could pass to the engraving macro in order to engrave the date.

Okay, that was quite a lot, so I'll leave it at that for now. Please know that everything above would need to be tested extensively/etc. before running. Please don't crash your machine trying to run my bad pseudocode. :D
 
Thanks for the broad strokes explanation Mutiny!

As opposed to everything else done in the shop here all the parts I program are one-off, 3D surfaced, custom parts so I don't have a lot of (or any) experience with macros or subprogram formatting, I generally just spit out a huge program and call it good. I would have just added the engraving in CAM because I'd never need to come back and make another part!

Breaking the process down into bite size pieces really helped.

Another thing that helped me (and might help someone else) was to generate the code I knew I would need first (the individual numbers), and then filling in the blanks before and after (need to read this, assign that, move this here, repeat process, etc...). It was hard to know where to start looking at a totally blank slate.

Its probably not as elegant as it could be, but as they say "if its stupid and it works, it isn't stupid."
 








 
Back
Top