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 > Parametric Programing


Parametric Programing (custom macro b, fadal macro, okuma user task)


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-24-2010, 02:20 PM
 
Join Date: Oct 2009
Location: Canada
Posts: 84
glenthemann is on a distinguished road
macro lag?

I wrote a macro to create true spirals for use in my shop for things like threadmilling or some roughing. All the caclulations are correct and Ive used the verify function on the mill I tested it on and it is spot on for what I want it to do.

I control the spiral by the base radius, the number of revolutions I want, the step over per revolution and the resolution of the spiral (ie how many points along the 360 there are)

I tested it out running the mill and every time it gets to a point it stops and it seems it has to make the calculation before it moves so the spiral itself is "jumpy"

I guess this just comes down to the controls ability to do the math on the fly?
Reply With Quote

  #2  
Old 04-24-2010, 03:22 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,463
ger21 is on a distinguished road
Buy me a Beer?

The router where I used to work could move faster than it could process the g-code, so with lots of small segments, it would stop until it got caught up again. Sounds very similar. If you cut the feedrate in half, does it still do it?
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3   Ban this user!
Old 04-24-2010, 07:22 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

I have created a similar macro so I can perform these kind of motions using my milling head attachment set at an angle other than G18/19. It also means I can retain a basic kind of cutter compensation.

Found that once you take away the arc functions the possibilities for the cycle are virtually limitless (involute, helical, trochoidal, parabolic). Put in an argument for the 'working plane' of the polygon that allows other applications eg pecking, plung milling, ramping a slot.

Also incorporated some features to link the cycles together to create contours, an oscillating feedrate to reduce air-cutting and an incremental rotation to reduce cutter engagement in corners.

The main drawback is the amount of calcs per move, and you really have to streamline your macro, take out all unnecessary brackets and arrange your formula in the most efficient way possible.

I'm lucky my control is reasonably fast and as long as I don't set a crazy no. of points per pass I can feed at about 10m/min. One thing I did find helped a lot was removing the fractional part of the feedrate oscillation, so maybe if you can sacrifice some of the accuracy by using [FIX] function on your values it may help some.

DP
Reply With Quote

  #4   Ban this user!
Old 04-26-2010, 10:45 PM
 
Join Date: Mar 2005
Location: Silicon Valley, CA
Posts: 982
psychomill is on a distinguished road

Just a thought.... do you have to have "resolution" calcs involved?
Can you not feed in Z with an XY arc? That would take out a lot calculations the control has to process....
__________________
It's just a part..... cutter still goes round and round....
Reply With Quote

  #5   Ban this user!
Old 04-27-2010, 05:01 PM
 
Join Date: Oct 2009
Location: Canada
Posts: 84
glenthemann is on a distinguished road

Originally Posted by psychomill View Post
Just a thought.... do you have to have "resolution" calcs involved?
Can you not feed in Z with an XY arc? That would take out a lot calculations the control has to process....
Do you mean two seperate things by your post?

By "resolution" I mean the number of points per 360 degree rotation along the spiral. A value of 2 would have 2 points, and thus 2 half circles, which isnt very close to accurate. The higher the better, I'll work out a medium and then yes Ill most likely be able to remove that calculation.

As far as feeding in Z with an xy arc, yes I can do that but none of my calculations factor into the Z feed at all.

Ive rewritten my macro 2 different ways.. I think the problem was that I had 6 lines within my WHILE loop and the control cannot look that many lines ahead, so there was a pause until it reached the next G2/G3 move.

I simplified the calculations as much as I could and I have two other methods to try which include 2 lines and 4 lines within the while loop.

I was told to try not to have any calculations within the actual movement command, but I cannot get away with this otherwise, and in hindsight even if I do get rid of the resolution variable, I will still need a fixed value which will be part of a calculation.

I'll get back to you guys once Ive tested out my newer methods (its kind of a side project so I really only get some time on the weekend to toy)

Thanks for the replies.

edit::
Could it be the use of the while loop?

Last edited by glenthemann; 04-27-2010 at 06:14 PM.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-27-2010, 07:27 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

The while loop is definitely faster than if, goto.

The fanuc manual I have says it can do involute arcs using G2/3 - a few more arguments involved that sound like what you are using. No good in my case 'cause you still wouldn't be able to rotate it. I can stick to small linear increments because my control automatically adjusts to a smooth limited feedrate if it can't look ahead far enough.

DP
Reply With Quote

  #7   Ban this user!
Old 04-27-2010, 09:30 PM
 
Join Date: Oct 2009
Location: Canada
Posts: 84
glenthemann is on a distinguished road

Originally Posted by christinandavid View Post
The while loop is definitely faster than if, goto.

The fanuc manual I have says it can do involute arcs using G2/3 - a few more arguments involved that sound like what you are using. No good in my case 'cause you still wouldn't be able to rotate it. I can stick to small linear increments because my control automatically adjusts to a smooth limited feedrate if it can't look ahead far enough.

DP
Well I can go with the linear increments, but that just means a lot more calculations, and if it is 'lagging' like it is with only 8 points per 360 then I could only imagine going the linear route.

Ill have to look into that involute arc function, im currently trying to run this on a milltronics centurion9, some differences from fanuc but Im going to port it over (few syntax diffs.. same stuff), so I want it to be as non machine specific as I can. What do you mean you cant rotate it? you mean the starting angle of the spiral? if you cannot within the function what if you were to perform a coordinate rotation before doing your moves? I also want to map the macro as a G code for use wherever and whenever as well, I just need to fix this current issue before I go doing such things.

For all I know I could be going about this arse-backwards, but figuring out code and simplifying things turns my crank so I'll keep at it until I get it just the way I want it.
Reply With Quote

  #8   Ban this user!
Old 04-28-2010, 06:51 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

Originally Posted by glenthemann View Post
What do you mean you cant rotate it?
For my milling attachment application I may need to pocket/slot or simply move in an arc at an angle that differs from the three standard working planes available on my control. In other words I am programming as in G19 mode but rotating with a G68 around the spindle axis (G17) to suit the current angular position of the milling head attachment. I'm pretty sure I can't use G2/G3 in this scenario, unless somebody out there knows otherwise?

Apart from that fact, using linear moves means I can move my 'circle centre' from one point to another point during the cycle, as well as altering the circle size, with interesting results. I can also set a width and length, so I'm not limited to 'circular' pockets!

DP
Reply With Quote

  #9   Ban this user!
Old 04-30-2010, 01:16 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

eight points in 360 deg is low resolution, and it should be pretty fast. In fact, for smoothness, less than 100 points may not be acceptable. Of course, the control should be capable of doing fast calculations. And, make sure that you are cutting in "cutting mode" (G64 on Fanuc 0i), not in "exact-stop mode". Manipulating "in-position" width also might help.
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
"difference between Custom Macro A and Custom Macro B" arulthambi Parametric Programing 4 10-05-2009 03:34 PM
Need Help!- Macro A or Macro B On fanuc o-md macrosat Fanuc 1 07-29-2009 06:49 AM
Testing program for Macro (Fanuc Macro B) NickDP Fanuc 2 03-27-2009 03:15 PM
Convert Fanuc Macro to Fadal Macro bfoster59 Fadal 1 11-08-2007 11:41 PM
Macro omkargupta Fanuc 1 09-11-2007 02:35 PM




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