![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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. |
|
#3
| |||
| |||
| 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. |
|
#4
| ||||
| ||||
| 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." |
|
#5
| |||
| |||
| 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. |
| Sponsored Links |
|
#6
| ||||
| ||||
| 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. |
|
#8
| |||
| |||
| 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. |
|
#10
| ||||
| ||||
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.
__________________ The best way to learn is trial error. Last edited by CNCRim; 03-24-2008 at 05:15 PM. |
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |