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-11-2007, 05:35 PM
 
Join Date: Jan 2004
Location: Gardnerville,Nevada
Posts: 256
cncwhiz is on a distinguished road
macro program for work offset

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
Reply With Quote

  #2  
Old 12-12-2007, 10:56 AM
*Registered User*
 
Join Date: Nov 2005
Location: USA
Posts: 274
Bluesman is on a distinguished road

Originally Posted by cncwhiz View Post
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

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
Reply With Quote

  #3   Ban this user!
Old 12-12-2007, 11:55 AM
 
Join Date: Jan 2004
Location: Gardnerville,Nevada
Posts: 256
cncwhiz is on a distinguished road

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?
Reply With Quote

  #4  
Old 12-12-2007, 01:20 PM
*Registered User*
 
Join Date: Nov 2005
Location: USA
Posts: 274
Bluesman is on a distinguished road

Originally Posted by cncwhiz View Post
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?
Here is a whole exsample i have the Main goemetry and the calc subs,Just follow it in and out and you should be able to figure it out

Bluesman
Attached Files
File Type: doc Offset calc.doc‎ (28.0 KB, 137 views)
Reply With Quote

  #5   Ban this user!
Old 12-14-2007, 06:28 AM
Sump Cleaner's Avatar  
Join Date: Dec 2005
Location: Canada
Posts: 55
Sump Cleaner is on a distinguished road

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
Reply With Quote

Sponsored Links
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
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




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