603,884 active members*
5,994 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2006
    Posts
    38

    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.

  2. #2
    Join Date
    Jul 2003
    Posts
    1220

    Angry

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

  3. #3
    Join Date
    Nov 2006
    Posts
    38
    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. #4
    Join Date
    Mar 2008
    Posts
    2
    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. #5
    Join Date
    Jul 2003
    Posts
    1220
    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.

  6. #6
    Join Date
    Feb 2006
    Posts
    992
    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.

  7. #7
    Join Date
    Jul 2003
    Posts
    1220
    L2000
    Attached is a program which may be of use.
    Attached Files Attached Files

  8. #8
    Join Date
    Jul 2003
    Posts
    1220

    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.

  9. #9
    Join Date
    Sep 2004
    Posts
    38
    I think that GE is wrong. May be LE?

    Attached file with macro programm verification..
    Attached Files Attached Files

  10. #10
    Join Date
    Feb 2006
    Posts
    992
    Quote 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 Attached Thumbnails angle rotation.jpg  
    The best way to learn is trial error.

Similar Threads

  1. A axis continues rotation ?
    By thirty78 in forum G-Code Programing
    Replies: 4
    Last Post: 12-13-2006, 08:47 PM
  2. Rotation control help on A axis
    By Art Ransom in forum DIY CNC Router Table Machines
    Replies: 27
    Last Post: 09-23-2006, 01:04 PM
  3. A Axis Constant Rotation
    By 1ctoolfool in forum Haas Mills
    Replies: 9
    Last Post: 09-22-2006, 03:57 PM
  4. X axis to A rotation
    By quemast in forum G-Code Programing
    Replies: 6
    Last Post: 06-18-2006, 02:36 AM
  5. Converting X axis to A rotation
    By quemast in forum GibbsCAM
    Replies: 2
    Last Post: 06-09-2006, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •