![]() | |
| 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
| |||
| |||
I have been going back and forth with a few guys on another topic on four axis programming. They were talking about using a macro to calculate the position of part position. Now they did it, they made me think I am working on a post for a machine we have here in our shop. This controller is a "FAPT" control and will not allow "G54.1". I need to program my angle holes on the parts from the centerline "X, Z". I need to use "G10's" to do this. I need to shift my "G54, G55" back and forth to get this done as that the remaining work on the parts are done on the face of the part. I was working on my post to use a "G10" shift line to go from the centerline to the face of the part. The problem with this is everytime the shift takes place the is a "G10" line. When they need to adjust the work offsets, they need to change all of them. If they forget then they can scrap parts. I want to build a macro to control this. The first macro will be controlled by the system variable for "G54, G55 Z". The other macro will just be the distance from the spindle face to the center line of the "B axis" Does anyone have either the macro to do this or a list of system variables so I can build these macros? I have built some simple macros for the machines allready so I have a general understanding of what I need to do.TIA TIA |
|
#2
| |||
| |||
Like This ???????? It calculates position at an angle from the X Z position on the Fixture. :8701(MOVE SIDE) (SIDE B) #150=710.-ABS[#5223] (SIDE C) #151=ABS[#5221] (ANGLE THETA) #152=[ATAN[#150]/[#151]]-11.000(ANGLE) (SIDE A) #153=SQRT[[#150*#150]+[#151*#151]] (NEW SIDE B) #154=#153*[SIN[#152]] (NEW SIDE C) #155=#153*[COS[#152]] (X AXIS ADJ) #156=#155-#151 (Z AXIS ADJ) #157=#150-#154 #528=ABS[#156] #529=ABS[#157] G91 G10L2G54P01X#528Y0.0Z-#529 (LOAD WORKSHIFT) G90 #150=#0 #151=#0 #152=#0 #153=#0 #154=#0 #155=#0 #156=#0 #157=#0 M99 :8702(RETURN FACE) G91 G10L2G54P01X-#528Y0.0Z#529(CLEAR WORKSHIFT) G90 #525=2 #528=#0 #529=#0 M99 :8703(MOVE @ LEFT) (SIDE B) #150=710.-ABS[#5223] (SIDE C) #151=ABS[#5221] (ANGLE THETA) #152=[ATAN[#150]/[#151]]-11.000(ANGLE) (SIDE A) #153=SQRT[[#150*#150]+[#151*#151]] (NEW SIDE B) #154=#153*[SIN[#152]] (NEW SIDE C) #155=#153*[COS[#152]] (X AXIS ADJ) #156=#155-#151 (Z AXIS ADJ) #157=#150-#154 #528=ABS[#156] #529=[#157] G91 G10L2G54P01X-#528Y0.0Z-#529(LOAD WORKSHIFT) G90 #150=#0 #151=#0 #152=#0 #153=#0 #154=#0 #155=#0 #156=#0 #157=#0 M99 :8704(RETURN @ LEFT) G91 G10L2G54P01X#528Y0.0Z#529(CLEAR WORKSHIFT) G90 #525=2 #528=#0 #529=#0 M99 |
|
#3
| |||
| |||
| That is cool macro. Are you using the center of the tonbstone to calculate the angle? The is missing sides to the angles to calculate? Also lets say that my part is 10 inches from the center line. When it rotates, this is not a typical right triangle? The do you canculate this? The rotation is actually a for lack of better words a radial tringle? Also how do you set your tool offsets and "Z" plane? Do you calculate from gage line zero? You reset all of your values so where are your known distances or missing sides of the triagle? |
|
#4
| |||
| |||
Bluesman |
|
#5
| ||||
| ||||
| Cncwhiz, I program like this all of the time. We have horizontal machines so you might need to change this around a bit. Also, I do use G54.1P1 but there is nothing to say you can't use G54 to G59 for this. % :0002(PALLET A) #149=0(THIS TELLS THE CONTROL TO READ PALLET A COORDS) M98P1000 M30 :0003(PALLET B) #149=1 (THIS TELLS THE CONTROL TO READ PALLET B COORDS) M98P1000 M30 :1000(2342 ALL MAIN) (2342A&B REVD) (2342C REVE) (15NOV07 JK) (LAST RUN 15NOV07) (0M0S) (DO NOT ADJUST ANY X OR Y) (VALUES IN MAIN PROGRAM) G0G17G40G80 G90G94G98 G91G28Z0 M1(DRILL LONG PORT) G0G17G40G80 G90G94G98 T1M6(S2342-6) B90. M98P1100 S3500M3 G54.1P1X0Y0M8 G43Z1.2H1T2 G81Z-1.143R.1F18. G54.1P2X0Y0 G80G0Z2.5 G54.1P4X0Y0 Z1.2 G81Z-1.143R.1 G54.1P3X0Y0 G80G0Z6.M9 G91G28X0Y0M29 M1(DRILL SHORT PORT) G0G17G40G80 G90G94G98 T2M6(S2342-5) B270. M98P1100 #502=0(THIS IS THE SIGNED DISTANCE FROM THE X DATUM OF THE PART) #503=-2.09(THIS IS THE SIGNED DATUM FROM THE Z VALUE OF THE PART) M98P1200 S3500M3 G54.1P3X-.562Y0M8 G43Z1.H2T3 G81Z-.66R.1F18. G54.1P4X-.562Y0 G80G0Z2.5 G54.1P2X.562Y0 Z1. G81Z-.66R.1 G54.1P1X.562Y0 G80G0Z6.M9 G91G28X0Y0M29 M1(1/4-18 NPT) G0G17G40G80 G90G94G98 T3M6(LAKESHORE 18NPT TRML) (D23) B270. M98P1100 #502=0 #503=-2.09 M98P1200 S8000M3 G54.1P1X.562Y0M8 G43Z1.2H3T4 M98P1400 G54.1P2X.562Y0 M98P1400 G0Z2.5 G54.1P4X-.562Y0 M98P1400 G54.1P3X-.562Y0 M98P1400 G0Z3. B90. M98P1100 G54.1P1X0Y0 M98P1400 G54.1P2X0Y0 M98P1400 G0Z2.5 G54.1P4X0Y0 M98P1400 G54.1P3X0Y0 M98P1400 G0Z7.M9 G91G28X0Y0M29 M1(FACE) G0G17G40G80 G90G94G98 BLAH, BLAH, BLAH.......... :1100(2342 ALL 90 COORDS) #501=90.(THIS IS THE ANGLE FROM ZEOR ON THE AXIS TO WHERE YOUR PARTS ARE) #101=-9.921(THIS IS THE DIST FROM MACHINE ZERO TO THE CENTERLINE OF ROTATION IN X) #102=-20.4725(THIS IS THE DIST FROM MACHINE ZERO TO THE CONTERLINE OF ROTATION IN Z) IF[#149GT0]GOTO10 (PALLET A) (G54.1P1 LEFT TOP) G10L20P1X-14.149Y-7.854Z-19.552 (G54.1P2 LEFT BOTTOM) G10L20P2X#7001Y-11.522Z-19.552 (G54.1P3 RIGHT TOP) G10L20P3X-5.694Y-7.854Z-19.552 (G54.1P4 RIGHT BOTTOM) G10L20P4X#7041Y-11.522Z-19.552 GOTO20 N10 (PALLET B) G10L20P1X-14.149Y-7.854Z-19.552 (G54.1P2 LEFT BOTTOM) G10L20P2X#7001Y-11.522Z-19.552 (G54.1P3 RIGHT TOP) G10L20P3X-5.694Y-7.854Z-19.552 (G54.1P4 RIGHT BOTTOM) G10L20P4X#7041Y-11.522Z-19.552 N20 M99 :1200(2342 P1-4 TRANSLATION) #504=#7001(SETS #504 TO X VALUE) #506=#7003(SETS #506 TO Z VALUE) M98P1300 #7001=#512(REWRITES X VALUE) #7003=#513(REWRITES Z VALUE) #504=#7021 #506=#7023 M98P1300 #7021=#512 #7023=#513 #504=#7041 #506=#7043 M98P1300 #7041=#512 #7043=#513 #504=#7061 #506=#7063 M98P1300 #7061=#512 #7063=#513 M99 :1300(2342 TRANSLATOR) #510=ATAN[#101-#504-#502]/[#102-#506-#503] (CALCULATES THE ANGLE) #511=[#102-#506-#503]/COS[#510](CALCULATES THE RADIUS) #512=#101+[SIN[#5024-#501-#510]*#511](CALCULATES THE NEW X COORD) #513=#102-[COS[#5024-#501-#510]*#511](CALCULATES THE NEW Z COORD) M99 This is the general idea I use but the explanation may be a bit bleek. If you want to pursue this idea more, let me know and I will try to give you a better explanation. After all, it is the last Monday of the week! Cheers Guys... JK |
| Sponsored Links |
![]() |
| 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 |
| Macro program | pioneerproducts | Product Announcements & Manufacturer News | 4 | 10-08-2007 03:44 PM |
| Changing Work offset from the program | WITOMCIO | Haas Mills | 16 | 05-14-2007 07:40 AM |
| How to set part program offset | wayneman | Bridgeport and Hardinge Mills | 0 | 01-25-2007 12:22 PM |
| Macro for positive offset | qmas99 | General CAM Discussion | 0 | 02-11-2006 09:37 PM |
| change offset in program | jianjianca | G-Code Programing | 11 | 12-22-2005 10:48 AM |