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 11-25-2010, 07:06 PM
 
Join Date: Sep 2005
Location: Canada
Posts: 23
rapid is on a distinguished road
Smile without coordinate rotation option looking for macro to do same thing okuma/fanuc

just wondered if anyone has already tried to do this.
i normally use g68 rotation on work offset if casting datums are out of square.
but i wonder if someone has already developed a macro where it would take the normal programmed coordinates and convert each into the rotated coordinates.
have not done a lot of trig programming with macros and not looking for a bolt circle program.
just want normal x y coordinate then convert to new x y coordinate with rotation added.
looking mainly for okuma control
thanks
Reply With Quote

  #2   Ban this user!
Old 11-26-2010, 02:19 AM
 
Join Date: Oct 2007
Location: United Kingdom
Posts: 393
Brakeman Bob is on a distinguished road

I have seen this thing done at post processor level but never on the control except for the G68 you mention. Consider this, for every line of code to position the tool you would have to have a macro call to adjust the tool position. Very dodgy in my view. I think you would be better writing a program in VB or Java to read in your program, adjust all your X & Y's by a given amount and output a new, compensated version of the program. A sort of second level post processor if you like.

The math is relatively simple except for the cardinal points i.e. 0°, 90°, 180° and 270° where the tangent can be eith 0 or infinity.

Maybe some of the higher end CNC editors have this function. Can anyone tell us?
Reply With Quote

  #3   Ban this user!
Old 11-26-2010, 02:26 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

Not easy to implement.

For general milling/positioning, you would need to set up a macro that requires the arguments Move Type (linear/circular/rapid), finish X pos, finish Y pos, I and J or R (as required for circular move), Feedrate.

You could also have an argument to specify cutter compensation, but it would probably be easiest in the beginning to apply cutter compensation in a safe position off the finished profile before using your macro.

You would need to define your rotation angle as a common variable at the start of the program.

In your macro you need to calculate the polar length and angle of the programmed X and Y position from zero using pythagoras for the length (hypotenuse) and arctan (type 2) for the angle. Hint: - Use absolute X and Y values to calc the length so you always get a positive result.

You add your rotation to this angle to find the new angle, then recalculate the X (=cos(new angle)*length) and Y (=sin(new angle)*length). Obviously the circular move requires the same for I and J.

Your macro then performs the required movement to the new X and Y.

Unfortunately this approach is very limited, you will need to program contours line-by-line as any milling cycles will not be rotated.

I have implemented a similar thing on Fanuc, but only to recalculate the work offset position.

DP
Reply With Quote

  #4   Ban this user!
Old 11-26-2010, 07:40 PM
 
Join Date: Sep 2005
Location: Canada
Posts: 23
rapid is on a distinguished road

Thanks
was just looking to use on straight drilling coordinates not milling.
understand that milling would require to store a lot more positions.
thought along the line using regular coordinates:
g65p___ x___y____
g65p___ x___y____
etc

then in sub to convert the x and y to whatever with r adjusted.
at least on fanuc but with the okumas would have to delve into their style a bit more.
i use macros for simple things but when it gets into the trig can be a little more hairy.
no not mind ordering the option it is just the hassle of having to wait.
Thanks again
Reply With Quote

  #5   Ban this user!
Old 11-28-2010, 09:36 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

First off what series Fanuc control are you using??

Can you tell us a bit more in detail of what exactly you are doing? By the looks of your last post you may have the ability of using a macro "modal" call where you can just specify the points after.

In order to find the best calculation method we need more detail.

Stevo
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-28-2010, 09:40 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

First off what model Fanuc are you using?

With milling it is going to be pretty involved, as already stated above. If you give us more detail we may be able to help some more. What exactly are you trying to do? How do you want to specify the drilling angle for each hole?

By the looks of your last post using a macro "modal" call may be an option but need to know more details.

Stevo
Reply With Quote

  #7   Ban this user!
Old 11-29-2010, 07:18 PM
 
Join Date: Sep 2005
Location: Canada
Posts: 23
rapid is on a distinguished road

Hi stevo1:
actually i wanted to do it on a okuma mill horizontal with the 5000 series control.
just drills a bolt circle but because of some stupid -c- datum angular back to the casting they need to adjust.
they can have a moveable stop but it seems too difficult for modern day.
i did do it with g68 on fanuc and a r set with variable.
the problem is they like it so i told them we would have to get the option for okuma.
we did get it for one machine smaller model and had to wait about six weeks for software from japan.
it was same type of deal back to cast datum on angular.
would be no problem if they had not invented cmm machines.
i think i cold manage with the fanuc.
off track but i did find g68 good for angle heads 90 degree head at a angle just put in the r value and program a y movement in incremental for the feed distance.
easy to adjust for different tool length.
anyhow not that up on the okumas with trig in program.
thanks for any input.
Reply With Quote

  #8   Ban this user!
Old 11-30-2010, 08:52 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Yes G68 on Fanuc is pretty easy. I have never used it or programmed any macros for a 5000series control.

I had to do this some time ago on a new product that we brought to our Midwest operation. The product never did fully launch before outsourcing it but I got most of the macro programming done before hand. I had a wicked smart mathematics guy working with me and he had a bunch of formulas I used and converted into macros. I don’t remember the names of the formulas off hand but I do believe that I still have all of the documents at home. I have the macros handy but without the formulas it is hard to figure what I was doing. I will dig them up and post them when I get some time.

Stevo
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
Need Help!- Coordinate Rotation G68 dougtyler Fanuc 10 09-21-2010 11:00 AM
Fanuc 16T Macro Option MarkT Fanuc 3 08-31-2009 07:18 AM
Need Help!- WITH COORDINATE ROTATION (G68) FANUC 18-M PICMAN Fanuc 5 06-25-2009 09:03 AM
Haas Coordinate Rotation G68 ddk114 Haas Visual Quick Code 1 02-19-2008 01:48 PM
G68 Coordinate Rotation System ebigfoot2 Fanuc 2 08-13-2007 07:33 AM




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