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! > MetalWorking Machines > CNC Swiss Screw Machines


CNC Swiss Screw Machines Discuss CNC Swiss Screw Machines here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 08-24-2011, 07:12 PM
 
Join Date: Aug 2010
Location: United States
Posts: 6
Machinist_X is on a distinguished road
Macro Math formula problem

Hi all here is the problem the new citizens when using H cant go past 9999. So I was wanting to maybe make a (while/do) formula that can do the formula and decide how many times it needs to divide itself so I can make a universal program to work with older and newer machines. (I am Thread whirling B.T.W.) Here is what I was thinking so far. I haven't tried this yet just wanting some feedback to see if I'm going in the right direction.

Example

#501= Thread length
#502= Pitch
#503=[[[#501+.05]/#502]*360]
IF[#503LT9999.]GOTO77
#504=2
WHILE[#503GT9999.]DO1
#506=#503/#504
#503=#506
#504=#504+1
END1

Basically what I want is to pass the #503 and #504 variable down to the the next while/do with the new numbers to perform the whirling as needed in increments less than 9999. (I'm just not sure if you can do it like this or if it will confuse the machine)

example for the next while/do in the program.

#507=[[#503/360]*#502]
#508=1
WHILE[#504GT1]DO2
#509=#507*#508
X-.075Z#509H[[[#507]/#502]*360]
G50 C0
#508=[#508-#504]+#504
#508=#508+1
#504=#504-1
END2

So what I am wanting this to do is create the amount of H loops I need and each one will subtract till at 0 and also I need it to add to the final z each loops so if I started off at .250 for each z the second z needs to be .5 3rd .75 etc. Not even sure if I'm even close to being right or if its even possible just wanted to through this out to some of you programing wiz's and see what you think.

I know I could use G32 and have separate programs but I like to tinker


Thanks

Last edited by Machinist_X; 08-24-2011 at 08:49 PM.
Reply With Quote

  #2   Ban this user!
Old 08-25-2011, 08:49 AM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by Machinist_X View Post
...the new citizens ...
What are considering new?
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #3   Ban this user!
Old 08-25-2011, 11:17 AM
 
Join Date: Jul 2010
Location: united states
Posts: 22
tea hole is on a distinguished road

So you want us to stare blankly at macro programming because you like to tinker?

sure, i'm game.
Reply With Quote

  #4   Ban this user!
Old 08-29-2011, 04:24 PM
 
Join Date: Aug 2010
Location: United States
Posts: 6
Machinist_X is on a distinguished road
Smile

As for how old of machine's i would say any we have from the last 6 or 7 years or so, also we installed a new motherboard on a m12 2m3 and it now wont take H past 9999.

Lol Tea hole yep. No I was just wanting you guys to punch in some numbers for 501 and 502 and see if you thought it would work out b4 I tested it in a machine. Hopefully this week I will have time to put it in a machine and test it to see if it works just thought I would throw it out b4 I tried to test it to see if I was close or way wrong and needed to do it a different way.
Reply With Quote

  #5   Ban this user!
Old 08-29-2011, 09:34 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

There are more concise ways to achieve what you want to do.
The issue is not with the machines ability to read a C value beyond 9999 but rather the softwares ability to accept an input value greater than 9999 for C or H.
For that reason, you would not need to us G50 C0 in your WHILE/DO loop.

Here is the basic problem at hand...
  • Given the total thread length and pitch, how many full rotations exsist?
  • How do I handle the last partial rotation

Once you determine these two things, you can achieve what you want in a single W/D loop.
If you want to put some more thought into it using the above ideas, I would be happy to assist you here.
If not, that's fine too, and good luck to you.
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 09-01-2011, 05:05 PM
 
Join Date: Aug 2010
Location: United States
Posts: 6
Machinist_X is on a distinguished road

Thanks for the reply pro-process and if there is a better way to do what I'm trying to do I would greatly appreciate your assistance. Thanks
Reply With Quote

  #7   Ban this user!
Old 09-01-2011, 06:32 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by Machinist_X View Post
Thanks for the reply pro-process and if there is a better way to do what I'm trying to do I would greatly appreciate your assistance. Thanks


Well, I've given you the two main components of what you need to solve your issue ...

Originally Posted by ProProcess View Post
...
Here is the basic problem at hand...
  • Given the total thread length and pitch, how many full rotations exsist?
  • How do I handle the last partial rotation

....
I'm not going to write out your soloution for you.
Give the info I'ver provided, what can YOU come up with that is different than what you've already done?
Show some code using the new info and lets work form there.
I would be happy to help you work through the thinking.
Good luck!
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #8   Ban this user!
Old 09-02-2011, 01:30 PM
 
Join Date: Jan 2005
Location: USA
Posts: 237
cogsman1 is on a distinguished road

How often do you think you will need to do 10 thousand loops?
Seems to me that nine thousand, nine hundred and ninety nine should be enough.
Reply With Quote

  #9   Ban this user!
Old 09-02-2011, 02:04 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by cogsman1 View Post
How often do you think you will need to do 10 thousand loops?
Seems to me that nine thousand, nine hundred and ninety nine should be enough.
The issue is not that the loop is 9,999 it's that the Input for commanding C/H can only handle up to 9999 as in

Code:
G1 G98 Z3.7 H9999(THIS IS THE MAX INPUT FOR C OR H)
So if you had a thread that was 3/8"-16 and it was 2.5 long and you wanted to thread whirl using C/H instead of G32...

1/16=.0625
2.5 / .0625 = 40 revoloutions.
360° * 40 revolutions = 14,400°

so that code would be...

Code:
G1 Z0
Z2.5 H14400.(THIS WILL ALARM AS THE INPUT IS OUT OF RANGE)
According to the OP this limitation did not exsist in some older models and the OP want to Macro a utility that will be usable on new and old machines.
Not a bad idea .
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #10   Ban this user!
Old 09-08-2011, 10:23 PM
 
Join Date: Aug 2010
Location: United States
Posts: 6
Machinist_X is on a distinguished road

Sorry for the slow response back but I don't get online much but thank you very much Pro-Process for the hints in the right direction after I read your post I didn't think I would figure out a easier way but put a couple of days into thinking about what you said and it clicked. I got a nice streamlined macro'd program that I will now start using for all my whirl programs thanks again.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 09-08-2011, 11:00 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by Machinist_X View Post
Sorry for the slow response back but I don't get online much but thank you very much Pro-Process for the hints in the right direction after I read your post I didn't think I would figure out a easier way but put a couple of days into thinking about what you said and it clicked. I got a nice streamlined macro'd program that I will now start using for all my whirl programs thanks again.
Cool!
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
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!- Macro problem w/16i marcwdci Fanuc 13 06-29-2011 08:21 AM
Scale math formula ? timmydabull Mastercam 3 08-30-2008 11:50 PM
Drill Macro problem toolmanwaz CamSoft Products 5 04-01-2008 10:47 AM
VF0E Macro Problem stang5197 Haas Mills 1 06-14-2007 05:34 PM
Math Formula Required Kiwi Mechanical Calculations/Engineering Design 51 08-20-2006 07:44 AM




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