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 05-10-2007, 06:44 PM
 
Join Date: Sep 2006
Location: USA
Posts: 51
WITOMCIO is on a distinguished road
Changing Work offset from the program

I' making parts from tube stock.Simple set up , tube is sitting vertically in 3 jaw chuck. I machine inside diameter, outside profile , top of the part and then it's being cut off with carbide saw to approx. 0.160 thick.
Then manually change offset Z- .225 in G54.
Run again and so on.
Because set up is quite rigid, I can make 10 parts without pulling this tube up.
So I was thinking

Simple program like
%
O100
M98 P110 L10
M30
O110
{MAIN PROGRAM}
LINE TO CHANGE G54 -.225
M99
%
Does anybody know how to do it .
Any help would be greatly appreciated.

thanks
Tom
Reply With Quote

  #2   Ban this user!
Old 05-10-2007, 07:44 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

G10 L2 G91 P1 Z-.225

And instead of having two programs using M98 make it a subroutine using M97.

You start with the Z value in G54 at 0.0.

BLAH is all the stuff I am too lazy to type

BLAH
BLAH
BLAH
G10 L2 G91 P1 Z.225 <<<<<<<<<<<<<<<<<<WRONG, READ POST FURTHER DOWN
G10 L2 G91 P1 Z-.225 M97 P1000 L10
G10 L2 G90 P1 Z.0
BLAH BLAH
M30
N1000
All your program stuff
M99

The line that says G10 L2 G91 P1 Z.225 is to move the G54 Z up .225 so that at the subroutine call immediately below with an L count it just goes back to 0.0 for the first run through the sub, then increments down 10 times calling the sub each time.
The final G10 L2 G90 P1 Z.0 puts the G54 Z value back to zero before the program ends.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.

Last edited by Geof; 05-10-2007 at 08:47 PM.
Reply With Quote

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

070510-1938

WITOMCIO:

Use G52 and a loop.

Before the loop initialize G52 to 0.

#150 = 0.
G52 Z #150 (the content of G52 is added (maybe subtracted) from the currently active G5x.)
(where x = 4,....,9)

Start your loop with an initialized count limit.

Your progam
#150 = #150 - 0.225
Test for done count
End loop

Stop

.
Reply With Quote

  #4   Ban this user!
Old 05-10-2007, 08:15 PM
 
Join Date: Sep 2006
Location: USA
Posts: 51
WITOMCIO is on a distinguished road

Gar and Geof thank you so much.
That is exactly what i was looking for.
I will try it tomorrow.
If it comes from you, I'm sure it works

Thanks again

Tom
Reply With Quote

  #5   Ban this user!
Old 05-10-2007, 08:46 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Originally Posted by WITOMCIO View Post
Gar and Geof thank you so much.
That is exactly what i was looking for.
I will try it tomorrow.
If it comes from you, I'm sure it works

Thanks again

Tom
Don't try mine as it is written. I have a potential crash situation

Change the G10 L2 G91 P1 Z.225 to this:

G10 L2 G90 P1 Z.225

The reason for this is that if you had a program the same as my first post and you stopped part way through the L count your G54 Z value would have been incremented down so many steps.

Then, if you repositioned the workpiece and started again you would not be at Z0.0 so you would try to start working part way down the material amidst much crunching and puzzlement.

Putting the absolute value of (+)Z0.225 into the G54 Z coordinate at the start of the loop means no matter what the value is when you start the program the first entry into the subroutine has the correct value of Z0.0.

You may never have stopped the program part way through the loop count but it is always better to be safe than sorry.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 05-11-2007, 10:40 AM
 
Join Date: Apr 2005
Location: Paradise, Ca, USA
Age: 35
Posts: 533
Matt@RFR is on a distinguished road

CNC newbie warning: Why couldn't you use G55, G56, etc. for this?
Reply With Quote

  #7   Ban this user!
Old 05-11-2007, 10:54 AM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Originally Posted by Matt@RFR View Post
CNC newbie warning: Why couldn't you use G55, G56, etc. for this?
You could, it just means entering more information at setup; G54 Z.0, G55 Z-.225, G56 z-.45, etc, and writing 10 lines with the Gnn M97 P1000 lines in the program.

You could also do it with G52 by putting in the actual values insteading incrementing like gar explained. In this case the 10 lines would be G52 Z.0 M97 P1000, G52 Z-.225 M07 P1000, G52 Z-.450 M97 P1000, etc.

The disadvantage to doing it this way is not much but if for some reason you want to change the Z shift value you have to remember to change all the lines whereas using the incremental command you only change the one value.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #8   Ban this user!
Old 05-11-2007, 11:01 AM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

70511-1043 EST USA

Matt@RFR:

If you have 10 different G5x values needed, then you have to load these values. If you want to change the spacing, then there are ten values to change instead of one.

.
Reply With Quote

  #9   Ban this user!
Old 05-11-2007, 01:32 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

More specific:

The working program in the subroutine can be in absolute coordinates.

G54 (center and top of part at the start of new stock)
G52 X 0. Y 0. Z 0. (initialize G52 to zeroes)
#150 = 0. (initialize Z offset accumulator)
#151 = 10 (initialize count limit)

N100
#151 = #151 + 1 (doing the increment here means that #151 IDs the current part)
G52 Z #150 (the content of G52 is added to the currently active G5x.)
(G54 is the current active G5x based on the above assertion of G54)
(whether there is a sign inversion when G52 is combined with G5x you will have to verify)

G65 N2000 (to call your program for one part)

#150 = #150 - 0.225 (your incremental move)
IF [#151 GT 9] GOTO 120
GOTO 100

M00


O2000 your part program. You can work with internal subroutines if you want.


You could use WHILE also.

.
Reply With Quote

  #10   Ban this user!
Old 05-11-2007, 02:47 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

But you have to pay for Macro to be enabled I think.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-11-2007, 03:21 PM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road

This is the way I would probably do it if I didn't have Macros to set up counters. Since we always leave our G54 Z at zero I would set or reset G54 to zero in line N100. Then if I have to reset and start over I have my original G54 Z0 to start at the top of the part. For short blanks you can set G54 in N100 to whatever level you need to start, and change the L word in N120 to the number of parts left to do. We make multiple parts on our lathes using Macros to count and saving the original start Z in #5222.
Multiple part blanks are no fun!! Any time you mess with part Zero's you have to be very careful.

Edit--- I added line N125 to reset G54 to zero after the last part off each blank

%
O7654 (TEST G54 Z SHIFT )
N30 (WRITTEN 05-11-2007 13:35:38)
N40 (RETURNED 05-11-2007 15:01:26)
N50 G17 G54 G90
N60 G40 G49 G80
N70 G53 G00 Z0.
N80 G53 G00 X-20. Y0.
( SET OR RESET G54 Z TO ZERO )
N100 G10 L2 P1 Z0.
( CALL LOCAL SUB 10 TIMES )
N120 M97 P170 L10
( RESET G54 Z TO ZERO AFTER LAST PART )
N125 G10 L2 P1 Z0.
N130 G53 G00 Z0.
N140 G53 G00 X-20. Y0.
N160 M30 (END OF MAIN PROGRAM)
N170 (START OF MACHINING SUBROUTINE)
(TOOL #01 IS A TOOL )
N190 G53 G00 Z0.
N200 G53 G00 X-20. Y0.
N210 T1 M06
N230 G54 G00 G90 X0. Y0.
N240 G43 Z0.2 H01 D01 M08
( DO SOMETHING HERE )
N260 G53 G00 Z0. M09
N270 G53 G00 X-20. Y0.
N280 M01
(TOOL #02 IS A TOOL )
N300 G53 G00 Z0.
N310 G53 G00 X-20. Y0.
N320 T2 M06
N330 G54 G00 G90 X0. Y0.
N340 G43 Z0.5 H02 D02 M08
( DO SOMETHING HERE )
N360 G53 G00 Z0. M09
N370 G53 G00 X-20. Y0.
N380 M00 (PROGRAM STOP)
( SHIFT G54 Z -.250 )
N400 G10 L2 P1 G91 Z-0.25
N410 M99
%

Last edited by JWK42; 05-12-2007 at 07:57 AM.
Reply With Quote

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

070511-1513 EST USA

Correct Geof.

I am of the opinion that everyone should activate MACROS and learn to take advantage of all the neat capabilities provided.

As you know Geof, I am not talking to you but to all the other readers here.

Just G65 with parameter passing probably makes MACROS worth while. However, I would like a G65 equivalent for local subroutines. Your own counters, DPRNT, and math operations are so useful.

.
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
Mach 3 work offset retention. Geoff86 Machines running Mach Software 9 01-30-2010 02:03 PM
How to set part program offset wayneman Bridgeport and Hardinge Mills 0 01-25-2007 12:22 PM
Changing tool height ofsets and re-runing program Fudd Fadal 4 11-03-2006 08:01 AM
work offset in fanuc 6m b- help rags Fanuc 14 08-03-2006 09:39 PM
change offset in program jianjianca G-Code Programing 11 12-22-2005 10:48 AM




All times are GMT -5. The time now is 02:26 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