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-29-2005, 01:12 PM
 
Join Date: Dec 2004
Location: USA
Posts: 15
MR_NC is on a distinguished road
Program-ABLE Coolant

FWIW,
Thought someone might be able to make use of this. Wrote this macro after finding out that the P-Cool is lame and required operator setting everytime. Seriously friggen weak if you ask me. IMHO, this is the way Haas should have provided it. It sure is nice to stick the friggen tool in and never think about the coolant nozzle.

Things to note:
1. Machine must have to have the P-Cool option (duh)
2. Machine must have to have the Macro option (duh)
3. ALIASING will be used. (see manual under same)
4. You will possibly need to adjust the values for the coolant positions. We can only make use of 17 locations given our shortest tool and longest tool.
5. Editing of the code may be required. (see below)
6. After putting this in use, you will no longer make any p-cool adjustments, the program will do it for you. You will need to add the aliasing M code to the program to auto adjust the p-cool. I used M88 as we don't have TSC, some folks will have to use a different M code to alias if they have TSC.
7. The [AND] statements are sorta strange. They work, however I have had "and" statements fail to produce the desired result in other usage. This is a "bitwise" deal with Haas, not logical. So the use of "and, or, and xor" must be coded with caution (see manual). This has been in service on our machine since shortly after delivery and I can say it has worked great. This is one case where the "and" statement produces the desired result.
8. Machine does not "hold" for adjustment if you alias the M code. Right after I shoot the M88 I have the Z coming down to the part. The Z will be in motion and the coolant will be adjusting. We have a VF3-SS, and no the machine can't make the part before the coolant is in position, even @ 1400IPM
9. YOU MUST HAVE A VALID POSITIVE TOOL OFFSET FOR THIS TO WORK TURNKEY! If you use some other offset method you will need to adjust the values to work for your "range" off TLO's.
10. If you have questions just post or PM me. I will try to help you get it working.

I know what your thinking, what about tools longer than 14. Well on our machine, those crashed coming out of the drum, so the P-cool ain't an issue for tools longer than 14 Possibly more settings could be added if the machine in question can make use of a P-cool position greater than 17 ours can't. In order for that you would do the following:

Say 19 coolant positions get used in your shop.
1. Your shortest tool is say 1.87
2. Your longest tool is say 18.00
3. You use 19 of the 20 positions to cover this.
4. 18.00 - 1.87 = 16.13(range)
5. 16.13 / 19 = .848 "increment" for checking. (my program = .705)

Best regards,
Sean

CODE*****************

%
O09005 (M88-COOLANT POSITIONING)
(5-24-05)
(USE WITH ALIAS FOR M88 CODE)
(#523 STORES P-COOL POSITION)
(#120 IS FOR VOLITILE USE)
G103 P1
#1= #[ 2000 + #3026 ] (GET TLO VALUE FOR TOOL IN SPDL)
IF [ [ #1 GE 2.000 ] AND [ #1 LT 2.705 ] ] THEN #523= 1
IF [ [ #1 GE 2.705 ] AND [ #1 LT 3.410 ] ] THEN #523= 2
IF [ [ #1 GE 3.410 ] AND [ #1 LT 4.115 ] ] THEN #523= 3
IF [ [ #1 GE 4.115 ] AND [ #1 LT 4.820 ] ] THEN #523= 4
IF [ [ #1 GE 4.820 ] AND [ #1 LT 5.525 ] ] THEN #523= 5
IF [ [ #1 GE 5.525 ] AND [ #1 LT 6.230 ] ] THEN #523= 6
IF [ [ #1 GE 6.230 ] AND [ #1 LT 6.935 ] ] THEN #523= 7
IF [ [ #1 GE 6.935 ] AND [ #1 LT 7.640 ] ] THEN #523= 8
IF [ [ #1 GE 7.640 ] AND [ #1 LT 8.345 ] ] THEN #523= 9
IF [ [ #1 GE 8.345 ] AND [ #1 LT 9.050 ] ] THEN #523= 10
IF [ [ #1 GE 9.050 ] AND [ #1 LT 9.755 ] ] THEN #523= 11
IF [ [ #1 GE 9.755 ] AND [ #1 LT 10.460 ] ] THEN #523= 12
IF [ [ #1 GE 10.460 ] AND [ #1 LT 11.165 ] ] THEN #523= 13
IF [ [ #1 GE 11.165 ] AND [ #1 LT 11.870 ] ] THEN #523= 14
IF [ [ #1 GE 11.870 ] AND [ #1 LT 12.575 ] ] THEN #523= 15
IF [ [ #1 GE 12.575 ] AND [ #1 LT 13.280 ] ] THEN #523= 16
IF [ [ #1 GE 13.280 ] AND [ #1 LT 14.000 ] ] THEN #523= 17
()
()
N10 (HOME P-COOL)
#120= 20.
WH [ #120 GT 0. ] DO1
M35 (MOVE P-COOL UP 1)
#120= #120 - 1.
END1
()
()
N20 (POSITION P-COOL)
#120= 1.
WH [ #120 LT #523 ] DO2
M34 (MOVE P-COOL DOWN)
#120= #120 + 1.
END2
N100
G103
M99
%

Sample code showing usage:*************

G00 X-4.115 Y4.9361 A-90. B180. S4584 M03
M88
M8
G43 H2 Z2.3839
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 07-29-2005, 05:45 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road
050729-1643 EST USA

MR_NC:

Consider the following to replace your sequence of IFs. I have used different variables because it makes testing and observing the program results easy. One might want to add high and low test limits.

#100 = #[ 2000 + #3026 ]
#101 = [ #100 - 2.0 ] * 1.4184 ( 1/0.705 = 1.4184 )
#102 = FIX [ #101 ] + 1.0
#523 = #102

Obviously this can be simplified for an actual program as follows:

#523 = FIX [ [ #[ 2000 + #3026 ] - 2.0 ] * 1.4184 + 1.0 ] ( note multiplication and divison take precedence over addition and subtraction.

When AND is used in an IF statement it is treated as a logical operator, and when AND is used with variables it is a bitwise AND function which is very useful for masking operations,

.

Last edited by gar; 07-29-2005 at 09:31 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 08-01-2005, 10:13 AM
 
Join Date: Dec 2004
Location: USA
Posts: 15
MR_NC is on a distinguished road
Originally Posted by gar
050729-1643 EST USA

MR_NC:

Consider the following to replace your sequence of IFs. I have used different variables because it makes testing and observing the program results easy. One might want to add high and low test limits.

#100 = #[ 2000 + #3026 ]
#101 = [ #100 - 2.0 ] * 1.4184 ( 1/0.705 = 1.4184 )
#102 = FIX [ #101 ] + 1.0
#523 = #102

Obviously this can be simplified for an actual program as follows:

#523 = FIX [ [ #[ 2000 + #3026 ] - 2.0 ] * 1.4184 + 1.0 ] ( note multiplication and divison take precedence over addition and subtraction.

When AND is used in an IF statement it is treated as a logical operator, and when AND is used with variables it is a bitwise AND function which is very useful for masking operations,

.

Thanks Gar,
I am more an "old school" guy myself. Programs and such that I only write once I tend to leave pretty vebrose. Sometimes after putting something away for a long time I find it easier to follow what I have done if I don't lean things out too much. The other reason I did it this way was to provide a clean option for "tweaking" only some of the ranges if required. This way I can edit each range or such if I need more overlap in an area or somesuch. Given the tools we use.

Clearly your code is much more compact. Of course this is preferred by most folks.

Indeed this makes sense about the "AND" statement. It works here, however when used against variables it does not (at least logical). This explains what the story is.

Best regards,
Sean
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 08-01-2005, 01:31 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road
050801-1229 EST USA

MR_NC:

Initially I did not look at all your increments. I just looked at the first two and then I wrote the short code for the ifs. Later I found you had used equal increments. If not I was thinking it might be necessary to add some trig function.

When I see a sequential test, such as your ifs, it is a challenge to look for a simpler procedure.

With equal increments do you get adequate positioning accuracy?

Internally in most computers at the machine language level the AND function is the bit wise AND of two registers. This is neat for making a modulo 1024 counter by ANDing the counting register with the constant 1023. No comparisons needed. In the case of UARTs you can test two or more bits at once to determine if the UART needs service.

.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 08-02-2005, 11:27 AM
 
Join Date: Dec 2004
Location: USA
Posts: 15
MR_NC is on a distinguished road
Originally Posted by gar
050801-1229 EST USA

MR_NC:

Initially I did not look at all your increments. I just looked at the first two and then I wrote the short code for the ifs. Later I found you had used equal increments. If not I was thinking it might be necessary to add some trig function.

When I see a sequential test, such as your ifs, it is a challenge to look for a simpler procedure.

With equal increments do you get adequate positioning accuracy?

A. Yea it seems to work pretty good. I have not messed with it since implemenation. Since Haas is only providing "increment feedback" and not "position feedback" I am thinking it is about as good as it gets. The idea was with all the "if checks" I could tune if required.

Internally in most computers at the machine language level the AND function is the bit wise AND of two registers. This is neat for making a modulo 1024 counter by ANDing the counting register with the constant 1023. No comparisons needed. In the case of UARTs you can test two or more bits at once to determine if the UART needs service.

I will pretend I understood that
.
Best regards,
Sean
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-02-2005, 09:49 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road
050802-2049 EST USA

MR_NC:

Arithmetic modulo X is a subject of number theory. This is sometimes referred to as "clock arithmetic". It is a form of integer arithmetic with a finite number of integers.

A MOD 4 sytem only contains the integers 0, 1, 2, 3. A MOD 1024 number system only includes the integers 0, 1, 2, .... thru 1023, base 10. This means there are only 1024 integers in this number system. If I add 1 to 1023 that equals 1024 in an infinite number system. 1 + 1023 mod 1024 = 0, and 2 +1023 = 1, etc.

Why this funny number 1024. This is because 2 to the 10th power = 1024, and 1024 converted to binary is 10000000000, and 1023 is 01111111111 .
If I counted correctly there are 10 zeros, and 10 ones.

If I make register DX a counter, then by bitwise ANDing 011 1111 1111 ( base 16 this is 3FF ) with DX I turn DX into a counter MOD 1024.

For those unfamiliar with how a counter is generated in a computer the following illustrates the function:

ADD DX, 1 ................ this adds 1 to the current content of register DX and puts the new value in DX.

To make it MOD1024

ADD DX, 1
AND DX, 01111111111b


You can increment this counter by any desired amount. If I am working in binary or integer the increment would not contain a fraction. However, for other purposes I might count by some number like 3.1416.

If I want to make a counter MOD 1000 then it is not so easy. Here I have to do a compaison and this takes longer than AND in a typical computer.

.
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





All times are GMT -5. The time now is 12:20 PM.





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