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 03-23-2010, 04:35 PM
M.B. Vanities's Avatar  
Join Date: May 2009
Location: Australia
Posts: 20
M.B. Vanities is on a distinguished road
Question Parametric math queastion

Need to know the calculation to keep ab equal when x and y vary. the distance from the outside line to the fist inside line stays the same as well as the first set of lines in each corner. Have to program this in G-Code for my Biesse. If i can work this out i can use the parametrics.
Click image for larger version

Name:	untitled.JPG
Views:	79
Size:	15.6 KB
ID:	103522
__________________
Measure twice, cut once and if it ain't broke, don't fix it.
There are 3 types of peaple in this world, those that can count and those that can't.
Reply With Quote

  #2   Ban this user!
Old 03-25-2010, 08:03 PM
 
Join Date: Feb 2008
Location: uk
Posts: 384
battwell is on a distinguished road

ab is a fixed measuremet like a hinge etc?

do you want the measurement to stay the same or be in the same exact position on the panel?

if ab is something like a hinge slot for example. write it as a subroutine at the end of program and call it with an offset shift. that way it stays the same.

if this isnt exactly what you want try to describe a bit more detail of what your making
__________________
so much to learn, so much to pass on.
Reply With Quote

  #3   Ban this user!
Old 03-25-2010, 08:08 PM
 
Join Date: Feb 2008
Location: uk
Posts: 384
battwell is on a distinguished road

if ab is 1/3 of x length?
use a line like n100 ab=lpx/3

if ab is different size on y, say 1/5th of length
use n100 aby=lpy/5

that way aby will be always 1 fith of the y length
__________________
so much to learn, so much to pass on.
Reply With Quote

  #4   Ban this user!
Old 03-25-2010, 10:26 PM
M.B. Vanities's Avatar  
Join Date: May 2009
Location: Australia
Posts: 20
M.B. Vanities is on a distinguished road

ab can vary but ab-ab-ab must stay equal (spacing between the line groups)
__________________
Measure twice, cut once and if it ain't broke, don't fix it.
There are 3 types of peaple in this world, those that can count and those that can't.
Reply With Quote

  #5   Ban this user!
Old 03-25-2010, 10:46 PM
M.B. Vanities's Avatar  
Join Date: May 2009
Location: Australia
Posts: 20
M.B. Vanities is on a distinguished road

This is what I have so far. I worked out that if x or y are constant I can find the calculation but it is when both vary that I have problems. Say that y=500 then the calculation would be (x-86)/3=ab and that would work no matter what x equals. But if you change y then it no longer works. The same will work if x is a constant and y varies. But I just can’t find the calculation if both x and y vary.
__________________
Measure twice, cut once and if it ain't broke, don't fix it.
There are 3 types of peaple in this world, those that can count and those that can't.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-26-2010, 06:04 AM
 
Join Date: Feb 2008
Location: uk
Posts: 384
battwell is on a distinguished road

if this is for kitchen doors etc you need all lines to be the same angle?
so x would matter but y would have to be sacrificed, otherwise angle would change?

you could offset by frame width in x and y
then do segment, angle (use finish coordinate for segment)
increment in y
segment angle
increment in x
segment angle
increment in 7y
segment angle
increment by ab
repeat
__________________
so much to learn, so much to pass on.
Reply With Quote

  #7   Ban this user!
Old 03-26-2010, 06:05 AM
 
Join Date: Feb 2008
Location: uk
Posts: 384
battwell is on a distinguished road

you would have to start at lpx/2 and increment out from there to centralise everything
__________________
so much to learn, so much to pass on.
Reply With Quote

  #8   Ban this user!
Old 03-27-2010, 04:34 PM
 
Join Date: Oct 2006
Location: Canada
Posts: 2
MRK1 is on a distinguished road

Assuming the endpoints of the corner lines are equal distances from the corners (ie the line is at a 45 degree angle) the solution is:

c = (y-a+x-a-3b) / 3
ab = c-3b

Example:
Given x=16, y=10, a=3, b=0.353553 (offset between lines is 0.250

c = (10-3+16-3-(3*0.353553)) / 3 = 6.313113
ab = 6.313113-1.060659 = 5.252452
Attached Thumbnails
Click image for larger version

Name:	MathProblemSolution.jpg‎
Views:	70
Size:	55.4 KB
ID:	103823  
Reply With Quote

  #9   Ban this user!
Old 03-28-2010, 06:52 PM
M.B. Vanities's Avatar  
Join Date: May 2009
Location: Australia
Posts: 20
M.B. Vanities is on a distinguished road

Ok maybe a bit more detail will help. What I want is to go from one size to the other in the attachment by only altering the x and y value. At the moment I have all the programming to do this design but I have to manually insert the measurement for ab when I put in the x and y value (in the attachment ab is rounded to 0 decimal places).

The constants are as follows-

All lines are 45 deg angles
x and y spacing between lines (not offset spacing) is 14mm
from both corners to first set of lines is 50mm (x-y spacing not offset)
outside edge to fist square is offset 74mm
from 1st square to second is offset 5mm

this is a door design I have always done manually on an old Multicam with no parametric. I am now swapping this design to my Biesse.
Attached Thumbnails
Click image for larger version

Name:	mb14.jpeg‎
Views:	52
Size:	49.6 KB
ID:	103879  
__________________
Measure twice, cut once and if it ain't broke, don't fix it.
There are 3 types of peaple in this world, those that can count and those that can't.
Reply With Quote

  #10   Ban this user!
Old 03-28-2010, 07:58 PM
M.B. Vanities's Avatar  
Join Date: May 2009
Location: Australia
Posts: 20
M.B. Vanities is on a distinguished road

Just thought id throw in my Gcode. Yes I know its messy but it was done at the machine on the fly and in a hurry so I have yet to clean it up. KK is where the calculation I'm after would go, but at the moment I work it out by designing it in autocad then throw in the lines and equal them up to get the measurement.
Attached Files
File Type: txt MB14-DOR.txt‎ (4.4 KB, 66 views)
__________________
Measure twice, cut once and if it ain't broke, don't fix it.
There are 3 types of peaple in this world, those that can count and those that can't.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 04-30-2010, 03:37 AM
bigz1's Avatar  
Join Date: Apr 2006
Location: NZ
Posts: 485
bigz1 is on a distinguished road

I am a bit confused. It would help me if you could describe how you manually get the ab.

eg (Overall width or height?-((First edge of square=72mm X 2)+(Offset 2nd square= 5mm X 2))-Gap to 45degree line 50mm)/???=ab

Looking at your drawing I would probably redefine ab as the first line of the first set to the first line of the 2nd set.

To get a whole number I use "I_"

So if ab=4.925 and I want a whole number.

GAP=I_AB

Gap will now equal 4.

I actually round up numbers in work and use a calculation like this

SPA=LPY/100+1 GAP=I_SPA

eg

810(LPY)/100+1=9.1(SPA)

I_9.1(SPA)=9

Once you have the ratio sorted.

I would use the segment angle command that Batwell suggests. Plus jump commands to make it fully parametric.
Reply With Quote

  #12   Ban this user!
Old 04-30-2010, 03:51 AM
bigz1's Avatar  
Join Date: Apr 2006
Location: NZ
Posts: 485
bigz1 is on a distinguished road

Jsut looking again at your drawing. Is it always 4 sets of diagonal lines in the square?
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
Parametric programming. chrisryn Parametric Programing 32 01-26-2009 05:14 AM
New to Parametric Programming weaston G-Code Programing 4 02-27-2007 07:40 AM
Parametric Programming weaston General CAM Discussion 4 02-20-2007 07:25 AM
Parametric Programming widgitmaster BobCad-Cam 7 05-04-2006 01:04 PM
Parametric equations itsme General CAM Discussion 4 06-16-2004 03:34 PM




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