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 > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-04-2008, 09:02 AM
 
Join Date: Nov 2008
Location: Ireland
Posts: 33
scrapper400 is on a distinguished road
Short macro problem

Hi all,
Can anyone shed any light on why this macro won't work. I'm just trying something simple (or so I thought) but it still won't rotate, it is now carrying out the G01 cycles 5 times and then stopping.
Very frustrating.
Cheers,
Scrap.


%
G71 G90 G40 G80
T03 M06
S1500 M03
G00 X0 Y0 Z10

#1=0
WHILE[#1LE360]DO1
G01 Z-10 F200
G01 X40 Y0 F200
G00 Z10
G00 X0
G68 X0 Y0 R#1
#1=#1+1
END1

M05
M30
Reply With Quote

  #2   Ban this user!
Old 12-04-2008, 09:35 AM
extanker59's Avatar  
Join Date: Mar 2008
Location: USA
Age: 53
Posts: 426
extanker59 is on a distinguished road

I'm no macro guy but could it be the look ahead feature? I had a similar problem on our Haas. I had to limit the number of blocks the controller would look ahead with G103 P0. Then cancel that with a G103 and no "P" at the end. The P0 is disabling look ahead. P1 would limit it to 1 block, etc...
I guess it would depend on your controller.
Reply With Quote

  #3   Ban this user!
Old 12-04-2008, 11:09 AM
beege's Avatar  
Join Date: Feb 2008
Location: USA
Posts: 518
beege is on a distinguished road

Could it be rotating at the smallest increment? Try 360.(with decimal point) and #1=#1+1.
Reply With Quote

  #4   Ban this user!
Old 12-04-2008, 12:13 PM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road

I modified your program and ran it on our Haas simulator and it runs OK for me
I did put in a G43 Z1. H3 D3 to call the correct offset.
I put in a movement from X0. Y0. to X4. Y0. and returned to X0. Y0. so I could see if your logic was working. You can change the adder to 10 and it makes 36 - 4 inch long spokes from center out. I also switched from metric to english for a quicker display. I also turned off rotation with G69.
Edit--
I also put the #1=#1+10 before your G68 line and changed WHILE[#1LE360]DO1 to WHILE[#1LT360]DO1 because it was cutting the first pass twice.



%
O1000 (TEST 123)
G17 G40 G80 G90 G00
G53 G00 X-20. Y0.
G53 G00 Z0.
T03 M06
S1500 M03
G54 G00 X0. Y0. (added G54)
G43 Z1. H3 D3
#1=0
WHILE[#1LT360]DO1
G01 Z-.4 F200
G01 X4.0 Y0. F200.
G00 Z1.
X0. Y0.
#1=#1+10
G68 X0. Y0. R#1
END1
G69
G53 G00 Z0.
G53 G00 X-20. Y0.
M30
%

Last edited by JWK42; 12-04-2008 at 03:34 PM. Reason: Added G54
Reply With Quote

  #5   Ban this user!
Old 12-04-2008, 03:18 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Ok your problem was annoying me so I dug through some of my old notes and I think that I found the problem. What’s going on is it does not know what to rotate around. When you program G68X0Y0R#1 it is rotating around the current X,Y value. There is a few ways you can program this. Are you using work coordinates G54-G59 for your part center? You have to rotate around your part center. If your home position G53 is your part center position then you have to send it to the center at each rotation. I use G54. So your program must look like this.


G71G90G40G80
T3M6
S1500M3
G0X0Y0Z10

#1=0
WHILE[#1LT360]DO1
G1Z-10F200
X10Y0
G0Z10
X0
#1=#1+1----JWK42 is right this should be before the G68 line
G54G68X0Y0R#1---this way it rotates around the center of your part
END1
M5
M30

If you are using G53 as your center then you have to program it right before the G68 line with G0G53X0Y0 to send it to the center of the rotation, then let it run the G68 line then program your X,Y position from center.

Stevo
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-04-2008, 03:32 PM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road

Stevo1
I think Haas comes up with G54 as Modal Coordinate system
I did this one very quickly over lunch and left out the G54 line.
I got a range error the first test run that is why I moved the #1=#1+10 and changed the LE to LT. I think Haas can only rotate +/- 360.0 degrees. I have ran into this before and when you get past 360 degrees you have to subtract 360 from your #1 value and than you start over at 0 degrees or 3 O:Clock.
I think it would look like this
If[ #1 GT 360 ] #1 = [ #1 - 360 ]

Edit
With Haas you don't have to return to the X-Y center of rotation as long as you include the X-Y rotate points in your G68 line. We use rotate on some really big parts and it would be a big pain to return to center for each new operation.

Last edited by JWK42; 12-04-2008 at 03:43 PM. Reason: Haas G68 rotate
Reply With Quote

  #7   Ban this user!
Old 12-04-2008, 03:49 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

I think thats pretty standard. The Fanuc's are the same way were at reset your G54 is your default modal coordinate. I used the program above with G54-G59 and worked like a charm.

The Fanuc is nice that you can rotate over 360. Most of the time not really much of a reason to do so.

I know it would be a PITA to send it to center at every rotation on a big part or on many rotations. I am sure there is a trick when using G53 so that you don't have to send it home but if you have G54-G59 better off just using them. I try to stay away from the G53's,G50's ect. To many oops's . I only use them when using G28 when the part is done or at tool changes.

Stevo
Reply With Quote

  #8   Ban this user!
Old 12-05-2008, 04:09 AM
 
Join Date: Nov 2008
Location: Ireland
Posts: 33
scrapper400 is on a distinguished road

Cheers for all your help guys.
I'll try it this afternoon.

Thanks again to all for your time.

Scrap.
Reply With Quote

  #9   Ban this user!
Old 12-05-2008, 07:16 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

No problem. Let us know how it comes out.

Stevo
Reply With Quote

  #10   Ban this user!
Old 12-05-2008, 07:36 AM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road
G53 ?

Stevo
I think there is a question about G53 use on a Haas.
I only use G53 to send the tool home and position the table to load/unload.
Ex. G53 G00 Z0. sends the tool all the way to the top or home.
G53 G00 X-20. Y0. sends the table to the front in Y and center of door in X when I have a 40 inch travel in X.
G53 is Non Modal and only uses Minus values. Our instructor on our first Haas machine trained us to use G53 instead of G28 to return home and tool change. I don't think you could ever machine a part using G53.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-05-2008, 07:49 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

I agree with you I don't use G53 when programming or running a part. The reason I use the G53 and G28 together is because not all machines are set up with the "Machine 0" and the "Machine Orgin" in the same position. So if my machine 0 was the center of the table and programmed G53Y0 it would go to the center of the table and hit a part if it were there. But if program G53G28 it takes the machine to machine origin which is usually safe off all axis.

In our Fanucs we don't have to use minus directions when using G53. G53 is common work coordinate this should act like any other workshift like G54-G59 except the common is applied to every move regardless of which workshift is modal.

The only reason I suggested to scrapper is because some people don't use there G54-G59. They use the machine 0 which is G53. If they clock a part around this machine 0 and have to send it there before rotating with G68, the G53X0Y0 is the way you have to program it.

I to have my machine set up to do pallet changes with the G53 to bring it to position.

Fun Stuff

Stevo
Reply With Quote

  #12   Ban this user!
Old 12-05-2008, 07:56 AM
 
Join Date: May 2007
Location: US
Posts: 779
Andre' B is on a distinguished road

Originally Posted by JWK42 View Post
G53 is Non Modal and only uses Minus values.
Mostly but not always true (minus values), it all depends on where the home switch is located relative to the travel limits. There are machines that put the home position at the minus end of travel and there are a few with the home position in the middle of the travel.

Our instructor on our first Haas machine trained us to use G53 instead of G28 to return home and tool change. I don't think you could ever machine a part using G53.
In some very early NC machines you had no choice there were no G54, 55 etc. or even G92 work shift commands. If you wanted to move the zero point you physically moved the home switch.
But yep it was such a PITA that they very quickly developed the concept of work offsets.
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
Drill Macro problem toolmanwaz CamSoft Products 5 04-01-2008 10:47 AM
Convert Fanuc Macro to Fadal Macro bfoster59 Fadal 1 11-08-2007 11:41 PM
VF0E Macro Problem stang5197 Haas Mills 1 06-14-2007 05:34 PM
A short cut is not always the best way! planescott Mach Software (ArtSoft software) 4 03-12-2006 08:58 PM
Short G1 ignored in ver 14.7 CNC Pro HuFlungDung CamSoft Products 6 10-13-2005 10:05 AM




All times are GMT -5. The time now is 12:08 AM.





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