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 03-17-2008, 09:29 AM
 
Join Date: Nov 2006
Location: USA
Posts: 38
NL2000 is on a distinguished road
Macro for B-Axis rotation

Looking for a macro that will recalculate work offsets when B axis is rotated.

Starting with X and Z zero as center of rotation and Y zero as pallet surface. I want to be able to recalculate a new work offset when say pallet is rotated from B zero to B30. etc. I know only the Z & X will change, but I'm having a hard time trying to write this macro.

Thanks.
Reply With Quote

  #2   Ban this user!
Old 03-18-2008, 07:12 AM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road
Angry

.
Sorry...I think I put you wrong.

Last edited by Kiwi; 03-18-2008 at 07:20 AM. Reason: withdrawn...back to the calculator.
Reply With Quote

  #3   Ban this user!
Old 03-18-2008, 07:16 AM
 
Join Date: Nov 2006
Location: USA
Posts: 38
NL2000 is on a distinguished road

Thanks.

That might be all I need. I just need to calculate current position from center of rotation and then calculate new X and Z at whatever angle the B is rotated too and then write those values to a new work offset. Forcing absolute numbers should take care of any negatives.
Reply With Quote

  #4   Ban this user!
Old 03-18-2008, 07:19 AM
Laurence Nelson's Avatar  
Join Date: Mar 2008
Location: USA
Posts: 2
Laurence Nelson is on a distinguished road

I know this is not the place to introduce myself to this site, but I cant find the Introductions forum anywhere, some direction would be helpful,

This was the message I got when I signed up and have spent 2 days looking for the Introductions forum,

"Hello Laurence Nelson,
Our records indicate that you have never posted to our site before! Why not make your first post today by saying hello to our community in our Introductions forum."
Reply With Quote

  #5   Ban this user!
Old 03-18-2008, 07:44 AM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road

L2000
Here is a formula if this helps.
R = Sqr(X ^ 2 + Z ^ 2)
Angle = Atn(Z / X)

X = Cos(Angle + 30) * R
Z = Sin(Angle + 30) * R

This time I think I have a formula. Watch when numbers are negative.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-18-2008, 07:40 PM
CNCRim's Avatar  
Join Date: Feb 2006
Location: usa
Posts: 947
CNCRim is on a distinguished road

You need to make quite improvement. I just write a glim program and it is only come off of my head, hasnt test.


#100=3.34(pivot distance from center of rotation)
#101=30(1st angle)
#102=22(2nd angle)

G10L2P1Xx.xxxxYx.xxxxZ#100 (Center of the rotary table, I guess the table is not moving, so I don't you need to change X and Y location)
G10L2P2Xx.xxxxYx.xxxxZ#100
G10L2P3Xx.xxxxYx.xxxxZ#100
G10L2P4Xx.xxxxYx.xxxxZ#100

#104=1
WHILE[#104GE5] DO 1
#[#101]+1
#107=SIN[#101]*#100
#108=COS[#101]*#100
G91 X#105
#109=#106-#100
G91 Z-#107

#104=#104+1
END 1

somthing like that..... it's not 100% working so don't.....
__________________
The best way to learn is trial error.
Reply With Quote

  #7   Ban this user!
Old 03-19-2008, 06:49 AM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road

L2000
Attached is a program which may be of use.
Attached Files
File Type: zip CoOrdsRotate.zip‎ (5.5 KB, 89 views)
Reply With Quote

  #8   Ban this user!
Old 03-19-2008, 07:41 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road
Question

newtexas
I'm trying to understand your program and how it relates to the question.
Things that I don't understand.
Where does the value of #100 come from.
I thought the 1st angle was 0 deg and the 2nd 30 deg.
'WHILE[#104GE5] DO 1' Doesn't GE stand for Greater or Equal. Wont this run from 5 until eternity.
Where is #108 and 109 used.
Where does #105 and 106 come from.
I'm just a learner when it comes to CNC macros.
Reply With Quote

  #9   Ban this user!
Old 03-24-2008, 03:02 AM
uav uav is offline
 
Join Date: Sep 2004
Location: Russia
Posts: 38
uav is on a distinguished road

I think that GE is wrong. May be LE?

Attached file with macro programm verification..
Attached Files
File Type: zip macro.zip‎ (264.3 KB, 78 views)
Reply With Quote

  #10   Ban this user!
Old 03-24-2008, 04:19 PM
CNCRim's Avatar  
Join Date: Feb 2006
Location: usa
Posts: 947
CNCRim is on a distinguished road

Originally Posted by Kiwi View Post
newtexas
I'm trying to understand your program and how it relates to the question.
Things that I don't understand.
Where does the value of #100 come from.
I thought the 1st angle was 0 deg and the 2nd 30 deg.
'WHILE[#104GE5] DO 1' Doesn't GE stand for Greater or Equal. Wont this run from 5 until eternity.
Where is #108 and 109 used.
Where does #105 and 106 come from.
I'm just a learner when it comes to CNC macros.

My bad. I had this program wrote couple years back and now I haven't work with CNC anymore. Unfortunately, where I left the company I left in the machine. Now I only remember glim structure of the program I wrote. It will be so much easier if I can draw you a picture of what i did. Keep in mind that my program will best working, if the programmer is program X Y center of the part and Z on top of the part. And if the programmer have difference idea than me it's won't work, calculation will be way off.



Ok now explaination, bare with me. I used to work for a company and we measured all tools with presetter and presetter is 6" height from the cnc table.
Before go on and calculate all the angle, first you need to find out the distance from top of the piece to center of the pivot(that's #100). And for the 1st angle is 0deg, it is straight up forward, I don't think we need to calculate that angle.

I attachment s**t picture I made hopefully it is help you understanding what I am talking about. If you still have question just PM. I can try make program work... but your programmer and setup person must be also on the same page as I am.
Attached Thumbnails
Click image for larger version

Name:	angle rotation.jpg‎
Views:	94
Size:	27.2 KB
ID:	56311  
__________________
The best way to learn is trial error.

Last edited by CNCRim; 03-24-2008 at 05:15 PM.
Reply With Quote

Sponsored Links
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
A axis continues rotation ? thirty78 G-Code Programing 4 12-13-2006 01:47 PM
Rotation control help on A axis Art Ransom DIY-CNC Router Table Machines 27 09-23-2006 07:04 AM
A Axis Constant Rotation 1ctoolfool Haas Mills 9 09-22-2006 09:57 AM
X axis to A rotation quemast G-Code Programing 6 06-17-2006 08:36 PM
Converting X axis to A rotation quemast GibbsCAM 2 06-09-2006 10:17 AM




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