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! > Machine Controllers Software and Solutions > Fanuc


Fanuc Discuss Fanuc controllers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 09-01-2009, 09:19 AM
 
Join Date: Aug 2009
Location: usa
Posts: 4
MOtorPARts is on a distinguished road
fanuc o-m, subprogram repeat w/ z axis shift?

hello all- newbie here, i've done some searching, but couldn't find any info. i run a late '80's kiwa 510 colt VMC with series o-m controller. i am trying to repeat sub program o3450 12 times (m98p123450), but each time it repeats i want the z value in the work offset to change by an additional .015" . is this possible? if so how?
thanks for any help-jeff
Reply With Quote

  #2   Ban this user!
Old 09-01-2009, 12:57 PM
 
Join Date: Nov 2006
Location: USA Texas
Posts: 310
John_B is on a distinguished road

You can use incremental positioning, G91, in the sub-program.

Just move the table to the location you need to start in G90 mode before jumping to the sub, then begin using incremental mode. You can make all moves in incremental, or just the Z, you just have to be careful to change back and forth.
Reply With Quote

  #3   Ban this user!
Old 09-01-2009, 01:07 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

Well, here's a couple of ideas.

If your control has the G10 option, you can use G10 G91 L2 Pn Z-0.015 (Pn is P1 for G54, P2 for G55, etc to P6 for G59).

O1001 (SUB PROGRAM)
(INCREMENT G54 Z-0.015)
G10 G91 L2 P1 Z-0.015
G01 G90 Z... F20.
X...
...
M99

When you're all done don't forget to increment it back up 12 * 0.015:

G10 G91 L2 P1 Z0.18

- or -

If you have User Macros you could write a macro to do it.
Reply With Quote

  #4   Ban this user!
Old 09-02-2009, 07:39 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by dcoupar View Post
If you have User Macros you could write a macro to do it.
For example, insert #5223 = #5223 - 0.015 in the beginning of the subprogram, on 0i control.
After the M98 block, insert #5223 = #5223 + 0.18
Reply With Quote

  #5   Ban this user!
Old 09-02-2009, 10:52 AM
 
Join Date: Feb 2009
Location: USA
Posts: 64
James L is on a distinguished road
Do while loop

some variation of this might also work
program -
.........
#33=12;
#32=#5223;
while [#33 gt 0] do1;
m98 p#;
#5223 = #5223 -.015;
#33 = #33-1;
end1;
#5223=#32;
.........
program -

this way you can keep the macro in your main program
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 09-02-2009, 01:08 PM
 
Join Date: Feb 2009
Location: USA
Posts: 64
James L is on a distinguished road

Just out of curiosity.. why do you want to change the offset to do this? It will work, but I do try to avoid altering offsets as much as possible. If you are repeating a pattern over and over with a simple z step with each pass, I believe using an incremental step at the start of your sub-program should be effective.
Reply With Quote

  #7   Ban this user!
Old 09-02-2009, 09:18 PM
 
Join Date: Aug 2009
Location: usa
Posts: 4
MOtorPARts is on a distinguished road

it dosent have to be in the offset, it was just my way of saying everything pertaining to the z axis, sorry for the confusion, so would you recommend somthing like dcoupar posted? i won't be able to fart around with these ideas till i return to work on the 14th(laid off till then)
Reply With Quote

  #8   Ban this user!
Old 09-02-2009, 09:45 PM
 
Join Date: Feb 2009
Location: USA
Posts: 64
James L is on a distinguished road

Dcoupar or john b's suggestion earlier are both methods that would do what you need. I would personally do as much as I could without altering work offsets.
Reply With Quote

  #9   Ban this user!
Old 09-03-2009, 06:52 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Altering the work offsets if you are changing the total part height say surfacing then I don’t see an issue with changing the work offsets because you are adjusting them to match what you physically have.

I also agree with James that if you are doing a feature that is not changing the physical height of the part then I would go about using a loop and a variable to move the Z down. You will need macroB programming on the control. You can do a WHILE statement as James suggested but use a variable instead of the work offset.

O0001(main program)
M98P3450
M30

O3450(subprogram)
#1=0-----------incremental Z (set to .015 if you want to start off being .015 deep in the part otherwise leave at 0)
N1
G0X()Y()Z-#1---start position at a Z of the value of #1 which is 0
…-------------your code here
#1=#1+.015---once first pass is complete it will add .015 to variable #1
IF[#1GT.18]GOTO500---if you reached .18 deep then it willgo to N500 and end subprogram if not it continues to next block
GOTO1---will jump to N1 with the new #1 value which will be .015 more.
N500M99

Stevo
Reply With Quote

  #10   Ban this user!
Old 09-03-2009, 07:50 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Incidently, the manual recommends the use of WHILE_DO_END loop over IF_GOTO_ statement, as the WHILE loop is faster. In fact, I have tested this. I wrote two macros for clearing permanent common variables #500 - #999, using the two methods. The WHILE loop method takes nearly half the time (about 5 seconds, which was 10 seconds with GOTO method, on 0i Mate TC).

There can be one more issue, though not in this case.
The macro calculations are not extremely accurate. So, if a lot of complex calculations are involved, there is a possibility that the expected 0.18 may actually appear as 0.1800001 or 0.1799999. This may affect the logic in comparison statements. Someone of you might have faced this problem in the past. In such cases, instead of #1, one may use
[ROUND[#1 * 100] / 100]
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 09-03-2009, 09:10 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Sinha,
I agree with you the WHILE statements are faster. I prefer to do it that way as well. The other reason that it is recommended to use the WHILE over the GOTO is because you can lose track in an extensive program with too many GOTO statements were it will jump to the wrong sequence. Downside is you can only nest 3 WHILE statements and they can get confusing if you have 3 nested and are running multiple subprograms. I usually end up using both actions, the WHILE for the continuous machining and the IFstatments for calculation and variable changing.

Yes the rounding function can burn you. I have been burned by it before. Motors application would be a good time to use the "round" function given the pick size is .015 (good catch). Sinha we had discussed this in a previous thread, if anyone is interested here is a thread that I started posing the question of the “floating point math”.

http://www.cnczone.com/forums/showth...ighlight=round

Stevo
Reply With Quote

  #12   Ban this user!
Old 09-04-2009, 12:01 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Stevo,
Rounding is the only way to handle this situation, as suggested by you.

Just for the sake of having some fun, the control also does "implicit" rounding, in some cases. For example, if you command #0.5 = 10, it will assign the value 10 to #1 (I have verified this on 0i Mate).
On the other hand, #.49999999 = 10 would be an illegal command, because #0 is a read-only variable!
There are several other interesting cases.
All I can say is, one has to understand the internal logic of the control. And such things are not discussed in manuals. One learns only after facing some peculier problem.
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
Enable shift key for Fanuc 6M. ckirchen Fanuc 3 02-04-2012 04:13 AM
Need Help!- Axis shift during machining zeeshan.insight LinuxCNC (formerly EMC2) 7 03-19-2009 02:26 PM
Shift option on Fanuc 6M system, very OLD controller shape Mazak, Mitsubishi, Mazatrol 0 03-13-2009 02:59 PM
Problem- c axis work shift Atlas_Too Fanuc 3 10-13-2008 12:14 PM
Fanuc 16T subprogram example?? stex Fanuc 11 03-27-2006 02:15 PM




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