![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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] |
|
#2
| |||
| |||
| 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 |
|
#6
| |||
| |||
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 |
|
#7
| |||
| |||
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 |
|
#8
| |||
| |||
| 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 |
|
#9
| |||
| |||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |