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 12-04-2010, 03:38 AM
 
Join Date: Sep 2005
Location: USA
Age: 54
Posts: 26
wevz is on a distinguished road
Fanuc 31i

Hi
I am a technician that works with many different machines/controls. We currently have a three spindle (horizontal), four pallet milling center. Recently the compant hired a contractor to program variables to help adjustment effeciencies. I have worked with and programmed variables in the past but, have never seen it accomplished this way before. We are having problems with the variables not always moving in the direction we request. I am wondering in someone might see a problem in the follow. You will notice that whenever the coordinate srarted as a Negitive numer, they used a Minus in the variable calculation. I've never seen it done that way. Thanks for any help. Wayne

%
O0223(XXX HOUSING REAR STATION #2 FIXTURE #2)
(LAST EDIT 10-4-10)
(50 PPH, ADD 90MM FINISH BORE FROM STA. 4)
(MOVE -H- MILL TO STA. 3)
(USE T12 -J- BORE ONLY DRILL)

(G54.1 P20 UPPER PART A-LOAD FIXTURE X0,Y0=CENTER OF -B- BORE Z0 = SURFACE A B0.)
(G54.1 P21 LOWER PART B-LOAD FIXTURE X0,Y0=CENTER OF -B- BORE Z0 = SURFACE A B0.)
(G54.1 P22 UPPER PART A-LOAD FIXTURE X0,Y0=CENTER OF -B- BORE Z0 = SURFACE A B180.)
(G54.1 P23 LOWER PART B-LOAD FIXTURE X0,Y0=CENTER OF -B- BORE Z0 = SURFACE A B180.)
(G54.1 P24 UPPER PART A-LOAD FIXTURE X0,Y0=CENTER OF -J- Z0 = SURFACE @-J- A B270.)
(G54.1 P25 LOWER PART B-LOAD FIXTURE X0,Y0=CENTER OF ACTUATOR BORE Z0 = ACTUATOR SURFACE B90.)

G00G17G40G49G80G90
M28

M98P9002(VARIABLE RESTRICT)

T12(T12 TOOL #2-12 ****DRILL & COUNTER BORE HL. -J- 10MM DIA. A-LOAD**** )
M6B270(TOOL CHANGE AND PALLET ROTATE TO 270)
G00G17G40G49G80G90
G54.1P24
G00G90X0.Y0.S8000M03M7M8(-J- POS)
G43H12Z5.0T2
G1G9Z[-31.718-#525]F2400.(F3000.)(-J-DP)
G0Z200.
M9M16
M19
G30G91X0.0Y0.0Z0.0

T2(T2 TOOL #2-2 ****DRILL & COUNTER BORE HL. -J- 10MM DIA.6MM SLOT,5MM HOLE A-LOAD**** )
M6(TOOL CHANGE)
G00G17G40G49G80G90
G54.1P24
G00G90X0.Y0.S8700M03M7M8(-J- POS)
G0G43H2Z5.0T4Z[-3.36-#527]S8700(6MM SLOT DP)
G1X-18.0F1000
G1Y[-.572-#526]F2000(6MM SLOT LOWER SIDE POS)
G1X0.0
G1Y[.572+#526](6MM SLOT UPPER SIDE POS)
G1X-18.0
G0G54G49G90Z0.0
B180
G54.1P23
G00G90X[39.62+#528]Y[72.15+#529]G43H2Z200.0S9705(5MM HL LOC)
Z-43.0
G1Z[-58.05-#530]F1250(5MM HL DP)
G0Z200.0S300
M16M09(OPEN TC DOOR & STOP COOLANT)
M19(SPINDLE ORIENT)
G30G91X0.0Y0.0Z0.0(MOVE TO TOOL CHANGE POS)

T4(T4 ****FINISH BORE & CHAMFER 90.0 MM B-LOAD**** )
M6(TOOL CHANGE)
G00G17G40G49G80G90
G54.1P23(WC B LOAD, -B- BORE, -A- SURFACE @ B180)
G00G90X[142.643+#531]Y[172.503+#532]G43H4Z200.0S864M03M7M8(90MM BORE POS)
Z0.0T10
G1Z-23.F880
Z-25.0F444
G9Z[-25.95-#533]F444(90MM BORE DP)
Z-8.0F5000
G0Z200.0
M16M09(OPEN TC DOOR & STOP COOLANT)
M19(SPINDLE ORIENT)
G30G91X0.0Y0.0Z0.0(MOVE TO TOOL CHANGE POS)

T10(T10 **** J BORE UNDERCUT TOOL**** )
M6B270(TOOL CHANGE AND PALLET ROTATE TO 270)
G00G17G40G49G80G90
G54.1P24(WC A LOAD, -J- BORE, -J- SURF @ B270)
G00G90X0.Y0.S7640M03M7(-J- POS)
G9G43H10Z[-15.19-#534]T8(UNDERCUT DP)
G1Y1.5F1000.0
G2J-1.5
G1X0.0Y0.0
G0G54G49G90Z0.0
M16M09(OPEN TC DOOR & STOP COOLANT)
M19(SPINDLE ORIENT)
G30G91X0.0Y0.0Z0.0(MOVE TO TOOL CHANGE POS)

T8(T8 ****SPOTFACE AND THRILL HL#20 & #21, ROUGH AND SPOTFACE -B- BORE****)
M6B0(TOOL CHANGE AND PALLET ROTATE TO ZERO)
G00G17G40G49G80G90
G90G54.1P21(WC B LOAD, -B- BORE, -A- SURFACE @ B0)
G00G90X[-196.49-#535]Y[188.307+#536]G43H8Z180.0S8700M03M7M8(HL#20 LOC)
Z58.0T12(PRE-DRILLING)
G1Z48.0F522.
G1Z[36.445+#537](HL#20 SPOTFACE DP)
G00Z39.7( CONVENTIONAL MILLING )
G01G91G42D1X+0.0000Y+3.1720F141(F141)
G02X+0.0000Y-7.1720I+0.0000J-3.5860Z-0.1875
G02X+0.0000Y+0.0000I+0.0000J+4.0000Z-1.2500F252(F252)
G02X+0.0000Y+7.1720I+0.0000J+3.5860Z-0.1875F352(F352)
G00G40X+0.0000Y-3.1720
G00G90Z100.0
X[-173.9-#538]Y[233.79+#539](HL#21 LOC)
Z58.0
G1Z48.0F522.
G1Z[36.375+#540](HL#21 SPOTFACE DP)
G00Z39.7( CONVENTIONAL MILLING )
G01G91G42D51X+0.0000Y+3.1720F141(F141)
G02X+0.0000Y-7.1720I+0.0000J-3.5860Z-0.1875
G02X+0.0000Y+0.0000I+0.0000J+4.0000Z-1.2500F252(F252)
G02X+0.0000Y+7.1720I+0.0000J+3.5860Z-0.1875F352(F352)
G00G40X+0.0000Y-3.1720S4000
G00G90Z160.0S1900
X[0.0+#541]Y[0.0+#542](-B- BORE LOC)
Z84.0
G4P500
G1Z[47.09+#543]F1100(ROUGH -B- DP)
G0Z200.0
M16M09(OPEN TC DOOR & STOP COOLANT)
M19(SPINDLE ORIENT)
G30G91X0.0Y0.0Z0.0(MOVE TO TOOL CHANGE POS)

T12(T12 TOOL #2-12 ****DRILL & COUNTER BORE HL. -J- 10MM DIA. A-LOAD**** )
(M6)(TOOL CHANGE)
M30
%[/SIZE]
Reply With Quote

  #2   Ban this user!
Old 12-04-2010, 04:07 AM
LVX LVX is offline
 
Join Date: Feb 2010
Location: Netherlands
Posts: 8
LVX is on a distinguished road

I'm not sure there is a problem in the notations of these formulas. But what I can say is that the calculus is being done could be wrong. You don't need to at a - (minus) after a negative number, or a + (plus) after a positive number to make the calculus work for you.

But say your X value is -30 and you want to add an extra 100 (mm or inch) as #1, then you can do the following:
#1=100
X[-30-#1]
resulting in X-130

This would be the same as the next example, but note the difference at the declaration of #1:
#1=-100
X[-30+#1]
resulting in X-130

So if the machine is moving in the wrong direction look at the setup of your params, it can be the you need to ad or remove a - or + there.

Good luck

greetingz,
Loek
Reply With Quote

  #3   Ban this user!
Old 12-10-2010, 04:04 AM
 
Join Date: Sep 2005
Location: USA
Age: 54
Posts: 26
wevz is on a distinguished road
Fanuc 31i

Loek
Thanks for the reply. Your calculations are the same as I have been getting. My problem is if X[-30-#1], when you use 100 or -100 how would I aquire +70?
Wayne
Reply With Quote

  #4   Ban this user!
Old 12-10-2010, 04:43 AM
LVX LVX is offline
 
Join Date: Feb 2010
Location: Netherlands
Posts: 8
LVX is on a distinguished road

That actually is really easy math, -30 + 100 = 70.
so
#1=100
X[-30+#1]

Does that help you to come to a solution?
Greetz.
Loek
Reply With Quote

  #5   Ban this user!
Old 12-11-2010, 04:33 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Execute the program in single-block mode, and try to pinpoint the problem.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-12-2010, 05:02 AM
 
Join Date: Sep 2005
Location: USA
Age: 54
Posts: 26
wevz is on a distinguished road
Fanuc 31i

This is my point. I understand -30 + 100 = 70. That is how I would have written all the macros. However someone else wrote them and you will notice in the program whenever the number starts as a negitive they used the minus sign in the calculation. I suspect that is where the problem is, but without a good explanation I cannot get anyone to understand.
Wayne
Reply With Quote

  #7   Ban this user!
Old 12-13-2010, 09:22 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by wevz View Post
This is my point. I understand -30 + 100 = 70. That is how I would have written all the macros. However someone else wrote them and you will notice in the program whenever the number starts as a negitive they used the minus sign in the calculation. I suspect that is where the problem is, but without a good explanation I cannot get anyone to understand.
Wayne

If you subtract a positive number, the result will be a number of lesser value
Ex1.
#1=100
X[30-#1]
X-70.0

Ex2
#1=100
X[-30-#1]
X-130.0

If you subtract a negative number, the result will be a number of greater value
Ex1
#1=-100
X[30-#1]
X130.0

Ex2
#1=-100
X[-30-#1]
X70.0

If you add a negative number, the result will be the same as subtracting a positive number.
Ex1
#1=-100
X[30+#1]
X-70.0

Ex2
#1=-100
X[-30+#1]
X-130.0

How the sign is applied depends greatly on the logic of the program.

Lets say that the program had to calculate a new machining level. If the top of the work was Zero, the cutting depth would be negative value of increasing magnitude. So if I were to define the variables as follows:

#1=0 (Z level to start cut in from)
#2=5.0 (depth of cut)
#3=-24.0 (full depth)

Then I would write the code as follows:
#1=0
#2=5.0
#3=-24.0
N10 #1=#1-#2
IF [#1 LT #3] TH #1=#3
G01 Z#1
XY moves------
---------------
---------------
IF [#1 GT #3] GOTO 10
Rest of program--
-----------------
-----------------

If variable #2 was a negative then the code would vary as follows
#2=-5.0
N10 #1=#1+#2
IF [#1 LT #3] TH #1=#3
G01 Z#1

As Sinha suggested, if you’re having trouble following the logic of the program, step though it in single block and view the result of the various calculations by viewing the value of the focus Macro variable in the Macro Variable registry before advancing to the next block.

Regrads,

Bill
Reply With Quote

  #8   Ban this user!
Old 12-14-2010, 12:41 PM
LVX LVX is offline
 
Join Date: Feb 2010
Location: Netherlands
Posts: 8
LVX is on a distinguished road

Wayne, I think a good example of the code suggested by Bill is in your own program.

See the code listed below (I added some numbering), this is the part for Tool number 2 of your code:
N1T2(T2 TOOL #2-2 ****DRILL & COUNTER BORE HL. -J- 10MM DIA.6MM SLOT,5MM HOLE A-LOAD**** )
N2M6(TOOL CHANGE)
N3G00G17G40G49G80G90
N4G54.1P24
N5G00G90X0.Y0.S8700M03M7M8(-J- POS)
N6G0G43H2Z5.0T4Z[-3.36-#527]S8700(6MM SLOT DP)
N7G1X-18.0F1000
N8G1Y[-.572-#526]F2000(6MM SLOT LOWER SIDE POS)
N9G1X0.0
N10G1Y[.572+#526](6MM SLOT UPPER SIDE POS)
N11G1X-18.0
N12G0G54G49G90Z0.0
N13B180
N14G54.1P23
N15G00G90X[39.62+#528]Y[72.15+#529]G43H2Z200.0S9705(5MM HL LOC)
N16Z-43.0
N17G1Z[-58.05-#530]F1250(5MM HL DP)
N18G0Z200.0S300
N19M16M09(OPEN TC DOOR & STOP COOLANT)
N20M19(SPINDLE ORIENT)
N21G30G91X0.0Y0.0Z0.0(MOVE TO TOOL CHANGE POS)

At the lines N8 and N10 you will see the variable #526, this variable is used by adding it to a value and subtracking it from a value. This will demostrate the use of a single value in two directions both + and -.

Hopefully this will clear some fog for you.
Loek
Reply With Quote

  #9   Ban this user!
Old 12-15-2010, 02:28 AM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Wayne,
Loek is stop on with his observation.

Its clear that the lines labeled N8 and N10 represent the sides of a slot with a Y center line of Zero. #526 is not being defined in the program snippet you provided. Accordingly, its either being set in another part of the program, or perhaps directly in the Macro variable registry. It may be being used like a cutter comp offset and by setting various values for #526, the size of the slot could be controlled. Because #526 is a common variable that retains its value when the power is turned off, it would still be right to go when machining was resumed after power off, power back on. By querying a Systems variable, the value in a tool offset can be obtained and perhaps that's whats being assigned to #526

Not sure why the 0.572 is used. If my assumptions are correct about the use of #526, 0.0, or + and - 3.0 in conjunction with a + or - #526 value would work just as well. The point is, no matter what the value of #526 is, it will offset the opposite direction when applied in N10 as it does in N8

Lets say that the cutter being used is 4mm dia. and the slot 6mm wide. Forgetting about a bit of tool spring, and run out of the cutter etc, then the value of #526 would be 0.426. On the minus side of the slot it would offset the tool in a minus direction and in plus direction on the plus side of the slot, thus putting the periphery of the cutter at Y-3.0, Y+3.0 respectively.

If the cutter being used was 5mm dia, then #526 would be -0.072. This being the case, the tool would be offset in a plus direction on the minus side of the slot and in a minus direction on the plus side of the slot. Again putting the periphery of the cutter at Y-3.0, Y+3.0 respectively.

Regards,
Bill
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
GE Fanuc & FANUC proprietary posts CNCadmin Fanuc 44 01-05-2012 08:54 AM
FANUC & GE FANUC Repairs RRL Product Announcements & Manufacturer News 1 04-17-2011 11:50 AM
can fanuc ac digital servo amplifiers be run by a controller other than fanuc? js412000 Servo Motors and Drives 5 03-09-2011 09:11 AM
Fanuc & GE Fanuc Repairs RRL Product Announcements & Manufacturer News 0 10-01-2008 12:42 PM




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