CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > MetalWorking Machines > Haas Mills


Haas Mills Discuss Haas machinery here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-21-2007, 12:14 PM
CJH CJH is offline
 
Join Date: May 2007
Location: United Staes
Posts: 101
CJH is on a distinguished road
Question Macros on the Haas

I just got done answering another post about the TM-1, and had seen macros mentioned. I know we have the macros on our mill, and others I have run in the past. I've never used them to my knowledge, but now wonder if they could be useful. So I know there is probably somebody who may fall out out of their chair laughing when they read my question below, but I thought I would ask anyway. I figure it never hurts to learn more.

Here goes...

If we program at a PC, then how are macros useful in what we do?

Most of the time of we have complex things or multiple parts we just set them up on the PC screen and then do all of the work there. Clarification on macros could help us in the future. I've read parts of the manual, never really understood the macro part.
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 07-21-2007, 03:05 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

070721-1336 EST USA

CJH:

The MACROS option on CNC machines is merely an extension to the basic G & M code language. This is not to be confused with a computer program macro.

Many things you can do when you have the MACROS option.

From a prior post of mine on CNCZONE

"You can do logic, math, and trig functions. You can easily pass parameters to subroutines. DPRNT is available which allows you to output data to the COM 1 serial port. You can create counters for special functions. You can easily do step and repeat functions, even with varying increments. You can write a program that will step and repeat for a variable number of steps, and do it efficiently without a lot of tool changes. You can access timers and operate on the values."

You can call an external subroutine, G65, and pass parameters to the routine. Unfortunately this capability does not exist for internal subroutines.

Another prior post

"Following is a thread I started on a Tool Change Macro:

A sample tool change macro.


And at some time you might want to study this thread:

Hass VF-1 work coordinate problems
"

The way you make a counter is:

Select a suitable non-volatile memory address such as #500 for your counter register, then whenever you want to increment the counter execute this instruction:
#500 = #500 + 1
or maybe
#500 = #500 + 1.0

The counter can be initialized to any value you want with:
#500 = desired initial counter value, usually 0.

To make a down counter use:
#500 = #500 - 1

Or you can count by someting other than 1:
#500 = #500 + 1.75

To convert from polar to rectangular coordinates within the first quadrant
#100 = numeric value of radius
#101 = angle of point
#500 = #100 cos [#101] (....... the X-axis coordinate)
#501 = #100 sin [#101] (........ the Y-axis coordinate)

Study the MACROS section of the HAAS manual.

If in Google you insert the following search string you will find much discussion on MACROS
site:cnczone.com "gar" G65

.

Last edited by gar; 07-21-2007 at 04:20 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 07-23-2007, 10:38 PM
CJH CJH is offline
 
Join Date: May 2007
Location: United Staes
Posts: 101
CJH is on a distinguished road

Thanks for the info...
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 07-23-2007, 11:41 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,419
Geof will become famous soon enough

Originally Posted by CJH View Post
.....So I know there is probably somebody who may fall out out of their chair laughing when they read my question below, but I thought I would ask anyway. I figure it never hurts to learn more.

Here goes...

If we program at a PC, then how are macros useful in what we do?..
You're right it never hurts to learn more. Let me give my answer to your question, along with other comments, and see if it generates further posts to enhance the learning for both of us, I am interested to see what response my comments can garner.

I think the direct answer to your question which I took the liberty of making bold is...macros are mostly superfluous. I put mostly because gar has some examples that I think cannot be replicated by doing things on the PC.

My take on macros is that by and large they are a hangover from the days when memory was in short supply in CNC machines. When you read the manual explanation for macros one thing that is mentioned is their use in "simplifying" programming for 'families of parts', parts which are in many ways similar but have one or a few dimensions different.

If you have two parts that only differ in one or a few dimensions and you program them separately the programs are practically identical except for one or a few lines. So if you can write a program which allows you to easily insert these values that differ into any easy to find location in the program before running it you can save memory; you don't have to store both versions you store one with just a few extra lines. The location that you enter the differing dimensions is the macro variables.

These days available memory is rarely a limiting factor in CNC machines; particularly when hand coding. In addition Haas machines have such an easy to use editor it is dead simple to copy a program, find the dimension that differs in a different part in the family and change it; it is a simple find-and-replace operation. My company makes numerous parts that are in families; in some case differing only in that one has metric threads and another imperial threads; we could do things with macros but we simply have two programs one for each thread type. This is in fact easier than using macros because the operator simply brings up the appropriate program and does not even need to worry about the variables.

I also think macros are a hangover from the days when compound curves that were not constant radii were difficult to do partly because large programs could not be stored and partly because there was no way to easily convert coordinates describing the curve into G code. Performing calculations in real time within a macro made it possible to generate complex curves on the machine while it was actually doing the curve; a prerequisite of course is that it must be possible to describe the curve with a mathematical function. When this is possible it is not difficult to generate the curve as a series of very short straight line moves by sequential calculations from any arbitrary starting point; only the next point exists at any one time and in the machine memory the current point overwrites the immediately preceding point. Not much memory is needed.

CAD/CAM does precisely the same thing but in this case the multitudinous points making up the curve in the CAD depiction are converted into multi-thousands of lines of G code by the CAM requiring huge amounts of storage not previously available.

As a 'not-so-side-comment' in the early days when the macro was running in the machine controller it would bog down the processor with the calculation load so the processor could not run the machine at a good speed. Early CNCs where in some ways limited more by their processor speed than by their mechanical capabilities; this as far I have have been able to discern turned around in the mid to late 1980's when they became limited more by the maximum servo power and speed. Now I think with modern brushless servos, and on some machines linear motors, once more the mechanical side is pushing the processor side.

I have read articles in the past describing how complex shapes where generated 'off-machine' in (at that time big and fast) computers such as the PDP-11 and dripped into the machine processor line by line to speed up the running of the machine.

These days CAM programs sometimes generate such huge amounts of G code that it overwhelms even the expanded machine memory and has to be dripped in. And when the data transfer speed is rate limiting the machine stutters and stalls which is entirely analogous to the early day processors bogging down with macro calculations. Which I think shows how things stay the same when they change.

And that is my explanation for my 'macros are mostly superfluous' answer.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 07-26-2007, 12:22 PM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road

This is a program we use to end mill holes in round flanges. We use this for small lot jobs. G54 X/Y is always the center of the part.
It uses WHILE/DO - END logic. I prefer this to the IF/THEN logic.
I am posting this as an example of what you can do with Macro Programming



%
O3544 (MILL HOLES ON A B.C.)
N30 (WRITTEN 07-24-2007 14:57:49)
N40 (RETURNED 07-26-2007 11:03:07)
N50 #602= 1.125 ( DIAMETER OF HOLES )
N60 #603= 18.0 ( BOLT CIRCLE OF HOLES )
N70 #604= 0.2 ( DEPTH OF EACH CUTTING PASS )
N80 #605= 3.0 ( NUMBER OF CUTTING PASSES )
N90 #601= 7.0 ( FEED RATE )
N100 #620= 3000.0 ( SPINDLE SPEED )
N110 #606= 0.5 ( DIAMETER OF END MILL )
N120 #621= 83.0 ( PERCENT OF END MILL DIA STEPOVER )
N130 #607= 16.0 ( NUMBER OF HOLES )
N140 #608= 11.25 ( STARTING ANGLE 3 O:CLOCK = ZERO )
N150 #609= 22.5 ( DEGREES BETWEEN HOLES )
N160 #610= 0.0 ( TOP OF PART IN 'Z' AXIS )
N170 #611= 2.0 ( CLAMP/FIXTURE 'Z' AXIS CLEARANCE PLANE )
( END OF INPUTS )
N190 #604= [ #604 * -1 ]
N200 #612= [ #602 / 2 ]
N210 #613= [ #603 / 2 ]
N220 #616= [ #606 / 2 ]
N230 #617= [ #606 * [ #621 / 100.0 ] ]
N240 G17 G54 G90
N250 G40 G49 G80
( TOOL #01 IS AN END MILL )
N270 G53 G00 Z0. ( RESTART TOOL #01 HERE )
N280 G53 G00 X-20. Y0.
N290 T1 M06
N300 S#620 M03
N310 #618= #608
N320 #627= #607
N330 #624= [ COS[ #608 ] * #613 ]
N340 #625= [ SIN[ #608 ] * #613 ]
N350 G54 G00 G90 X#624 Y#625
N360 G43 Z#611 H01 D01 M08
N370 WH [ #627 GT 0 ] DO1
N380 G00 X#624 Y#625
N390 Z [ #610 + 0.1 ]
N400 M97 P500
N410 #627= [ #627 - 1 ]
N420 #618= [ #618 + #609 ]
N430 #624= [ COS[ #618 ] * #613 ]
N440 #625= [ SIN[ #618 ] * #613 ]
N450 END1
N460 G53 G00 Z0. M09
N470 G53 G00 X-20. Y0.
( UNLOAD HERE )
N490 M30
N500 ( START OF HOLE MILLING CYCLE )
N510 G01 Z#610 F#601
N520 G13 G91 Z#604 I#616 K#612 Q#617 L#605
N530 G90
N540 G00 Z#611
N550 M99
%
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-18-2007, 02:31 AM
 
Join Date: Aug 2007
Location: usa
Posts: 2
rikosintie is on a distinguished road

Probing is an something that can't be done without macros. If you want to add proximity switches to fixtures to verify that a part is loade correctly you will need a macro. If you want a fully automated tool setting system with a CNC Presetter and baluff tool tags you will need macros.

If you have need to make a parabola on a lathe use a macro. There are some expamples on www.programmingunlimited.com. Also look at the tips and tricks page.

There are a lot of uses for macros, they are not just a through back to the old days.

Michael
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 08-19-2007, 01:19 PM
 
Join Date: Apr 2006
Location: USA
Posts: 200
JohnJW is on a distinguished road

CJH,

I'm just starting out in CNC adventure on a Haas with macro. . . . so if your question made people fall out of their chairs laughing my answer will probably do the same for them as well. . . .

Anyway, so I am just starting out and man, there so many variables involved in machining. . . . surface speed, chip load, and the rest. The end mills come with recommended value but I'm told that I should start with more conservative values. I have one RPM setting per tool but has a variety of feed depending on plunge, profiling and slotting, sprinkled all over the program.

Using the simplest variable definition available with macro, I group my feed rates and define them in the beginning of the program so I can easily change them as I experiment with the feed speed.

Probe package simplifies tools length and parts offset for a newbie like me, and like rikosintie mentioned, probing is done through macro.
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 08-26-2007, 09:53 PM
Chi-town CNC's Avatar  
Join Date: Dec 2006
Location: USA
Age: 34
Posts: 8
Chi-town CNC is on a distinguished road
Buy me a Beer?

Wether or not many of us use macros in actual part programs, they are the power behind Visual Quick Code. I've really been digging into my Lathe VQC and tailoring it to my shop's needs. I'll never have to calculate thread depth or convert metric to inches again. (keeps work interesting.) In my opinion, they surely aren't neccessary for day to day machining, but when understood and used in the right circumstance, they save lots brainwork and data entry and prevent mistakes.
__________________
Jet engine is next!
http://www.floridaame.org/GalleryPages/g1m0186.htm
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 08-27-2007, 12:09 AM
 
Join Date: Aug 2007
Location: usa
Posts: 2
rikosintie is on a distinguished road

Chi-Town CNC;
If you want to share some of those I will put them up on the Tips page at

www.programmingunlimited.com

Michael
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with macros afterburn25 Haas Mills 4 04-09-2007 09:19 AM
Macros in Autocad2006 LT gatorman Visual Basic 6 06-30-2005 03:58 PM
Macros cncfreak General CAM Discussion 24 05-06-2005 06:04 PM
macros toyoda General CAM Discussion 0 05-30-2004 05:56 AM
Macros MachineSMM General CAM Discussion 2 06-20-2003 01:41 PM




All times are GMT -5. The time now is 01:18 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353