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 06-04-2009, 09:33 AM
 
Join Date: Jun 2006
Location: usa
Posts: 236
kendo is on a distinguished road
probing macros

Im having a problem with variables that end up with a value like .50003
when I expect it to have just .5

Im probing a part
telling it to travel .5" until skip signal
but if the surface is too far away, The program needs to know this
the best way I've come up with so far is: take the difference between the start point and the end point, if the difference is exactly .5", then the probe didnt touch anything
but when this value ends up .50003, it ruins my process

so when I command:
G31 X-.5 F4.
and the probe touches nothing, comes to a stop, and computes the difference
why would it be anything but exactly .5" ??????

do I need to round all my start end end points to 4 decimal places before the computation?
If this is happening for some random reason, then whats to keep it from rounding up when it should round down one of these days?
Reply With Quote

  #2   Ban this user!
Old 06-04-2009, 12:31 PM
 
Join Date: Jun 2006
Location: usa
Posts: 236
kendo is on a distinguished road

OK, the Macros chapter of the HAAS manual has this to say:



Doesn't help me much, Im not too keen on exactly why storing from decimal to binary and back to decimal causes this to happen

The example uses no decimal point
But I use the decimal point when declaring all my variables
It doesn't say wether using or not using the point has any affect though
so I guess this means if you assign
#100 = 7.123456

it could later be read as
7.123457

right?
Reply With Quote

  #3   Ban this user!
Old 06-05-2009, 02:14 PM
 
Join Date: Jun 2006
Location: usa
Posts: 236
kendo is on a distinguished road

not many of you messing with this kind of stuff I guess
that or my rantings are just too elementary for you guys to bother

heres another one:
Is there some variable inside the control that reflects the status of the probe?when the probe comes to a stop, has the stylus made contact or not?
Id think there would be a variable that switched from 0 to 1 just like the little light on the probe that goes from green to red when contact is made

so far, like I said, the only way for me to know this is to compare the distance traveled to the distance commanded by the G31 line. This takes me 5lines of code to accomplish at my current level of expertise

it looks like this:

#113= #5041 (SAVE START POSITION)
G31 X - #6 F#106 (ATTEMPT PROBE TOUCH)
#114= ABS[ #113 - #5061 ] (FIND THE DIFFERENCE BETWEEN START AND END POINTS)
#115= #114 - #6 (SUBTRACT COMPUTED DIFFERENCE FROM COMMANDED TRAVEL DISTANCE)
IF [ ABS[ #115 ] GT 0.001 ] GOTO7 (ALARM IF VARIANCE BETWEEN COMMANDED DISTANCE AND ACTUAL DISTANCE IS GREATER THAN .001")
#3000= 22 (START POINT NOT WITHIN PROBE REACH)
N7
Reply With Quote

  #4   Ban this user!
Old 06-05-2009, 03:25 PM
 
Join Date: Jan 2007
Location: USA
Posts: 1,299
Delw is on a distinguished road

Keep it coming, I am reading just have no answers cause this macro probing stuff is pretty cool.

I been doing cncs from the mid 80s and just now starting on macros, Once my haas gets here next week I will be playing alot because I have an extra spindle to do it on.

I am sure once it shows up with the probe and I start using it I am going to have a million questions.
Reply With Quote

  #5   Ban this user!
Old 06-05-2009, 03:55 PM
 
Join Date: Apr 2005
Location: Paradise, Ca, USA
Age: 35
Posts: 533
Matt@RFR is on a distinguished road

Kendo, can you use the skip signal function? I have no info or knowledge about it, only that I know it exists. Maybe searching on that will get you further.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-05-2009, 04:24 PM
extanker59's Avatar  
Join Date: Mar 2008
Location: USA
Age: 53
Posts: 426
extanker59 is on a distinguished road

Kendo, like Delw, I'm just reading and trying to learn.

I don't use all the macro programming the probe and machine can use. I just use the already written macros to probe my part. Like the one below that probes the center of an rectangle with cut outs along the centerlines (so I have to move off center to probe).

N25 (PROBE)
T25 M06
G00 G90 G59 X-1.44 Y0 M05
G43 H25 Z3. T23

G65 P9832 (TURN PROBE ON)
G65 P9810 Z.25 F50. (PROTECTED MOVE)
G65 P9023 A4. Y3.45 S59. Z-.5 (PROBE Y WEB)

G65 P9832
G65 P9810 X0 Y-1.425 F50.
G65 P9023 A4. X3.5 S59. Z-.5 (PROBE X WEB)

G65 P9832
G65 P9810 X0 Y0 F50.
G65 P9023 A9. S59. (PROBE Z LEVEL)

G00 Z3.
G53 Y0 Z0
M01


Not to your level but maybe someone else can build on it.
You're going much deeper than that.
But keep it coming. Just reading and learning.
Reply With Quote

  #7   Ban this user!
Old 06-05-2009, 06:15 PM
 
Join Date: Jun 2006
Location: usa
Posts: 236
kendo is on a distinguished road

Matt, Im using the skip signal, just not as effectively as I'd like

G31 X-.5 F#107
will push .5" in negative X until the probe touches

M78 G31 X-.5 F#107
will do the same thing, but will throw up an alarm if the probe does touch
its used for when you don't expect to touch anything unless somethings gone wrong

M79 G31 X-.5 F#107
will throw up an alarm if the probe doesn't touch, to let you know somethings wrong if it didn't

the problem is, I need this check to occur without any alarms
I just need the program to make a decision based on wether it touched or not
Im getting this accomplished just fine with my 5 lines of code, it just seems too sloppy

if you look at pit202's macro in the "reproducing an irregular shape" thread
he's using variable #1029 which is a discrete input that his homemade probe puts out telling wether the stylus is deflected or not

that would be very useful to me if the Hass/Renishaw combo had something like that but I dont think it does. At least I can't find anything like it when scanning through the renishaw macros that came with the probe. Everywhere theres a G31 line in those macros, theres a bunch of math going on before and after the move a lot like my code above, which compares the commanded distance to the actual distance traveled in order to find out if the probe touched or not.
Reply With Quote

  #8   Ban this user!
Old 06-05-2009, 06:35 PM
 
Join Date: Jun 2006
Location: usa
Posts: 236
kendo is on a distinguished road

extanker,

heres my center probing macro
instead of starting at the center and then returning to the center after each touch, mine goes around the part from one side to the next and saves time.

It will always probe the front of the part first, then right, back, and left
It requires G154 P98 and P99 to be empty for use in the calculations, but that could be changed
If you dont want to probe the part at the actual center, you can offset where it touches at by as much as 1" in either direction in the Y or X
X offset is I-word
Y offset is J-word
you can increase the offset, but theres an alarm in my macro keeping me from doing it accidentally, just change the value the alarm checks for
the only offsets you can update with this are G54 through G59

you may wish to add some more protected moves in there,
like for the rapid moves between sides,
and the Z moves in the G43 lines
at least untill you get confident with it, give yourself a big retract amount
and make sure the probe is at a clearance height before calling the macro

hope this helps you guys learn some more
ask me anything, I like to help if I can

Code:
%
O09009 (NEW CENTER PROBE) 
(PROBES THE CENTER AND UPDATES SPECIFIED OFFSET) 
(SAVES X AND Y MEASUREMENTS TO #600 AND #601) 

(**MACRO CALL**)
(G65 P9009 A2. X15.38 Y33.43 J-1. Z-0.15 S56 R4.)
(A = 1 FOR BLOCK, 2 FOR POCKET)
(X = OVERALL X WIDTH)
(Y = OVERALL Y WIDTH)
(I = DISTANCE TO OFFSET FROM CENTER IN X)
(J = DISTANCE TO OFFSET FROM CENTER IN Y)
(Z = PROBE DEPTH)
(S = OFFSET TO BE UPDATED)
(R = RETRACT DISTANCE)


(INITIALISE VARIABLES)
#19= ROUND[ #19 ] 
#24= ABS[ #24 / 2 ] 
#25= ABS[ #25 / 2 ] 
IF [ #18 EQ #0 ] THEN #18= #5003 
IF [ #19 EQ #0 ] THEN #19= 54 
#18= ABS[ #18 ] 
IF [ #4 EQ #0 ] THEN #4= 0 
IF [ #5 EQ #0 ] THEN #5= 0 

(ALARM CONDITIONS)
IF [ [ ABS[ #4 ] LE 1 ] OR [ ABS[ #5 ] LE 1 ] ] GOTO5 
#3000= 1 (I OR J MUST BE BETWEEN -1 AND 1) 
N5 
IF [ #18 GE 0.25 ] GOTO10 
#3000= 2 (RETRACT MUST BE GREATER THAN .25) 
N10 
IF [ #25 NE #0 ] GOTO20 
#3000= 3 (NO Y VALUE) 
N20 
IF [ #24 NE #0 ] GOTO30 
#3000= 4 (NO X VALUE) 
N30 
IF [ #26 NE #0 ] GOTO40 
#3000= 5 (NO PROBE DEPTH) 
N40 
IF [ [ #1 EQ 1 ] OR [ #1 EQ 2 ] ] GOTO50 
#3000= 6 (INPUT "A1" FOR BLOCK "A2" FOR POCKET) 
N50 
IF [ #26 GT - 0.5 ] GOTO60 
#3000= 7 (PROBE DEPTH SHALL NOT EXCEED Z-.5) 
N60 

(IDENTIFY AND ASSIGN WORK OFFSET BETWEEN G54 AND G59)
IF [ #19 NE 54 ] GOTO100 
#101= 5221 
#102= 5222 
#103= 5223 
GOTO700 
N100 
IF [ #19 NE 55 ] GOTO200 
#101= 5241 
#102= 5242 
#103= 5243 
GOTO700 
N200 
IF [ #19 NE 56 ] GOTO300 
#101= 5261 
#102= 5262 
#103= 5263 
GOTO700 
N300 
IF [ #19 NE 57 ] GOTO400 
#101= 5281 
#102= 5282 
#103= 5283 
GOTO700 
N400 
IF [ #17 NE 58 ] GOTO500 
#101= 5301 
#102= 5302 
#103= 5303 
GOTO700 
N500 
IF [ #17 NE 59 ] GOTO600 
#101= 5321 
#102= 5322 
#103= 5323 
GOTO700 
N600 
#3000= 6 (USE OFFSETS G54 THROUGH G59) 
N700 

(CHECK BLOCK OR POCKET)
IF [ #1 NE 1 ] GOTO710 
#110= -0.5 
#111= 0.5 
GOTO810 
N710 
#110= 0.5 
#111= -0.5 
N810 

(APPROACH GAP)
#105= #24 + #4 
#106= #25 - #5 
#107= #24 - #4 
#108= #25 + #5 

(P99) 
#15961= #[ #101 ] - #24 
#15962= #[ #102 ] - #25 
#15963= #[ #103 ] 

(P98) 
#15941= #[ #101 ] + #24 
#15942= #[ #102 ] + #25 
#15943= #[ #103 ] 

(MAIN CODE)
G00 G90 G154 P99 X#105 Y#110 
G43 H18 Z [ #26 + 0.5 ] 
M78 G31 Z#26 F60. 
G65 P9811 Y0 S154.99 
G00 Z#18 

G90 G154 P98 X#111 Y - #106 
G43 H18 Z [ #26 + 0.5 ] 
M78 G31 Z#26 F60. 
G65 P9811 X0 S154.98 
G00 Z#18 

G90 G154 P98 X - #107 Y#111 
G43 H18 Z [ #26 + 0.5 ] 
M78 G31 Z#26 F60. 
G65 P9811 Y0 S154.98 
G00 Z#18 

G90 G154 P99 X#110 Y#108 
G43 H18 Z [ #26 + 0.5 ] 
M78 G31 Z#26 F60. 
G65 P9811 X0 S154.99 
G00 Z#18 

(RESET CENTER FOR SPECIFIED WORK OFFSET)
#[ #101 ]= [ [ #15961 - #15941 ] / 2 ] + #15941 
#[ #102 ]= [ [ #15962 - #15942 ] / 2 ] + #15942 

(SAVE X Y DIMENSIONS)
#600= ABS[ #15961 - #15941 ] (X MEASUREMENT) 
#601= ABS[ #15962 - #15942 ] (Y MEASUREMENT) 
M99 
%
Reply With Quote

  #9   Ban this user!
Old 06-06-2009, 06:24 AM
extanker59's Avatar  
Join Date: Mar 2008
Location: USA
Age: 53
Posts: 426
extanker59 is on a distinguished road

Very cool.
I'll try it soon.
Thanks
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
macros georgebarr Mach Mill 1 06-03-2009 08:11 AM
Need Help!- X3 CNC macros trainfred Syil Products 6 05-20-2008 07:42 PM
Need Help!- help with macros gj83 General CNC (Mill and Lathe) Control Software (NC) 2 04-11-2008 08:42 PM
Need Help!- macros bob@apc Mazak, Mitsubishi, Mazatrol 2 02-04-2008 11:42 AM
Macros cncfreak General CAM Discussion 24 05-06-2005 05:04 PM




All times are GMT -5. The time now is 12:02 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 354 355 356 357 358 359 360 361