DWO Macro for 4th axis
Close
Login to Your Account
Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default DWO Macro for 4th axis

    Thought I'd share a new macro I wrote to use DWO on the old control similar to the new one, where you rotate to a new angle, call G254, then move to next XY, Z position. Code is below. On my VF2 I saved it as program 9013, then aliased G254 to it. (parameter 94) I've only done some testing with indicators for now. I haven't run any parts with it just yet.

    It uses G52 to modify your work offset, so at the end of program, poweroff, or pressing reset restores any changes. Setting 33 should be on Fanuc.

    Just be sure to set the Y/Z center point for your machine.

    Code:
    %
    O09013 (DWO)
    G103 P1
    (USAGE:)
    (USE THIS PROGRAM JUST LIKE)
    (DWO ON NGC - ROTATE TO NEW)
    (ANGLE, CALL THIS PROGRAM, THEN)
    (RAPID TO NEXT XY, Z POSITION)
    
    (BE SURE ROTARY CENTER POINT)
    (SETTING BELOW IS GOOD)
    
    (Y-Z ROTARY CENTER)
    #12= -9.9957
    #13= -16.8942
    
    
    (CHECK SETTING 33 EQ. FANUC)
    IF [ #6033 NE 0 ] THEN #3000= 1 (SETTING 33 NOT FANUC) 
    
    (CANCEL G52 OFFSET)
    G52 Y0 Z0
    
    (CURRENT WORKOFFSET Y&Z SETTING)
    #22= #5022 - #5042
    #23= #5023 - #5043
    (CURRENT WORKOFFSET ANGLE TO CALCULATE)
    #24= #5044
    
    
    (NEW Y POS)
    #32= COS[#24]*[#22-#12]-SIN[#24]*[#23-#13]+#12
    
    (NEW Z POS)
    #33= SIN[#24]*[#22-#12]+COS[#24]*[#23-#13]+#13
    
    (SET DIFF AS G52)
    G52 Y[#32-#22] Z[#33-#23]
    
    G103
    M99
    %

  2. Likes Zahnrad Kopf, JMC, JFettig, Mstcnc, countryguy and 1 others liked this post
  3. #2
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default


  4. Likes Zahnrad Kopf, Twice, Mitch_Pricer, mkd liked this post
  5. #3
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default

    Updated this a while back and added single block suppression with #3003. Figured I'd update this thread. With single block suppression on, it jumps through quickly if proving out a program with single block on.

    Also made a simple DWO-cancel program, which is just G52 Y0 Z0, aliased to G255. That way my indexing sequence for rotary stuff is the same as the post for my UMC. My indexing sequence is setup to retract to safe distance and cancel DWO(if on), then rotate and apply DWO, if new angle is not A0 (or B0C0)

    One other thing I changed on my machine is the rotary center point setting. I use #512 & #513 to store the center points, that way it is easier to adjust slightly if needed, since I keep 9000-series programs locked.

    So you could use this or whatever other variable you want:
    (Y-Z ROTARY CENTER)
    #12= #512
    #13= #513


    Code:
    %
    O09014 (DWO CANCEL) #3003= 1
    G103 P1
    
    (CANCEL G52 OFFSET)
    G52 Y0 Z0
    
    G103
    M99 #3003= 0
    %
    Code:
    %
    O09013 (DWO) #3003= 1
    G103 P1
    (USAGE:)
    (USE THIS PROGRAM JUST LIKE)
    (DWO ON NGC - ROTATE TO NEW)
    (ANGLE, CALL THIS PROGRAM, THEN)
    (RAPID TO NEXT XY, Z POSITION)
    
    (BE SURE ROTARY CENTER POINT)
    (SETTING BELOW IS GOOD)
    
    (Y-Z ROTARY CENTER)
    #12= -9.9957
    #13= -16.8942
    
    
    (CHECK SETTING 33 EQ. FANUC)
    IF [ #6033 NE 0 ] THEN #3000= 1 (SETTING 33 NOT FANUC) 
    
    (CANCEL G52 OFFSET)
    G52 Y0 Z0
    
    (CURRENT WORKOFFSET Y&Z SETTING)
    #22= #5022 - #5042
    #23= #5023 - #5043
    (CURRENT WORKOFFSET ANGLE TO CALCULATE)
    #24= #5044
    
    
    (NEW Y POS)
    #32= COS[#24]*[#22-#12]-SIN[#24]*[#23-#13]+#12
    
    (NEW Z POS)
    #33= SIN[#24]*[#22-#12]+COS[#24]*[#23-#13]+#13
    
    (SET DIFF AS G52)
    G52 Y[#32-#22] Z[#33-#23]
    
    G103
    M99 #3003= 0
    %

  6. Likes Mitch_Pricer, mkd liked this post
  7. #4
    Join Date
    Apr 2009
    Country
    UNITED STATES
    State/Province
    Minnesota
    Posts
    74
    Post Thanks / Like
    Likes (Given)
    14
    Likes (Received)
    25

    Default

    This is very cool, I've been thinking about this a lot actually - I bet it would be pretty simple to set it up for 5-axis?

    I haven't looked this over or tried it yet - will it work with simultaneous 4th axis motion? Can you post the code you used for checking on the ball so I can see how this is executed in the main program?

  8. #5
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default

    Quote Originally Posted by JFettig View Post
    This is very cool, I've been thinking about this a lot actually - I bet it would be pretty simple to set it up for 5-axis?

    I haven't looked this over or tried it yet - will it work with simultaneous 4th axis motion? Can you post the code you used for checking on the ball so I can see how this is executed in the main program?
    Yep the calculation is very similar to do with 5-axis. I use that to use the probe at different angles on my UMC. I thought about making one for use with the 5-axis rotaries, but haven't had a need for it yet. Maybe later.

    No it wont do anything for you as far as simultaneous 4axis. It is for positioning only. For simultaneous, you either need to setup your cam program exactly as the part on the machine, or use TCPC. TCPC is doing the calculation in real time.

    You can actually use DWO/TCPC as a trial or buy as option on the old gen control, depending on your version. Just found that out recently. Not sure which control version it was added on, but it is parameter 737:19 on my VF2.

    To use this in your program, all you do is rotate to a new position, call G254, then move to next Y(and Z) position.

  9. Likes countryguy liked this post
  10. #6
    Join Date
    Jan 2019
    Country
    SWEDEN
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    1
    Likes (Received)
    0

    Default

    Really cool.
    do you put a zero in the center on the b-axis and one on top of the detail?
    I don't really understand.
    You can view the program that you have in the video.

  11. #7
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default

    Quote Originally Posted by Twice View Post
    Really cool.
    do you put a zero in the center on the b-axis and one on top of the detail?
    I don't really understand.
    You can view the program that you have in the video.
    In the video the program basically says rotate to a new angle, then move back to G54Y0Z0.

    In this example, the zero point is the center of the tooling ball. If you want to try that, the "Tool length" of the Z-indicators needs to have the radius of the tooling ball added.

  12. #8
    Join Date
    Jan 2019
    Country
    SWEDEN
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    1
    Likes (Received)
    0

    Default

    okay.
    thanks so much.
    I think I understand.
    should take o test

  13. #9
    Join Date
    Jul 2016
    Country
    UNITED STATES
    State/Province
    Indiana
    Posts
    232
    Post Thanks / Like
    Likes (Given)
    2
    Likes (Received)
    31

    Default

    Thanks for this macro. So far it is working as designed on my VF2. It definitely beats modeling the whole thing in cam.

  14. #10
    Join Date
    Jul 2019
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    4
    Likes (Received)
    0

    Default

    Hello!

    Stumbled across this beautiful macro and couldn't be more thrilled.

    Is this compatible with a Haas using the NextGen Control?

  15. #11
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    California
    Posts
    671
    Post Thanks / Like
    Likes (Given)
    102
    Likes (Received)
    350

    Default

    Quote Originally Posted by Mitch_Pricer View Post
    Hello!

    Stumbled across this beautiful macro and couldn't be more thrilled.

    Is this compatible with a Haas using the NextGen Control?
    Yes, the NGC reads old non-10000 variables just fine, like #100 or #500, etc.

    I'm using this on my new EC400 right now. Just got a brand new one with pallet pool last month. Slightly modified since it is B-axis rotary translating X and Z instead of Y and Z.

    I use 511, 512, 513 for my rotary center points and compare to the machine setting. That way I can easily adjust stuff mid program, if the machine is running, or recalibrate automatically, etc. It compares values to machine setting and if not within ±.005, will alarm.

    Code:
    %
    O09016 (DWO) #3003= 1
    G103 P1
    (USAGE:)
    (USE THIS PROGRAM JUST LIKE)
    (DWO ON NGC - ROTATE TO NEW)
    (ANGLE, CALL THIS PROGRAM, THEN)
    (RAPID TO NEXT XY, Z POSITION)
    
    (BE SURE ROTARY CENTER POINT)
    (SETTING BELOW IS GOOD)
    
    IF [ABS[#20255-#10511] GT .005 ] THEN #3000= 1 (X MRZP ERROR)
    IF [ABS[#20257-#10513] GT .005 ] THEN #3000= 1 (Z MRZP ERROR)
    
    (Y-Z ROTARY CENTER)
    #11= #10511
    #13= #10513
    
    
    (CHECK SETTING 33 EQ. FANUC)
    IF [ #6033 NE 0 ] THEN #3000= 1 (SETTING 33 NOT FANUC) 
    
    (CANCEL G52 OFFSET)
    G52 X0 Z0
    
    (CURRENT WORKOFFSET Y&Z SETTING)
    #21= #5021 - #5041
    #23= #5023 - #5043
    (CURRENT WORKOFFSET ANGLE TO CALCULATE)
    #25= #5045
    
    
    (NEW Y POS)
    #31= COS[#25]*[#21-#11]-SIN[#25]*[#23-#13]+#11
    
    (NEW Z POS)
    #33= SIN[#25]*[#21-#11]+COS[#25]*[#23-#13]+#13
    
    (SET DIFF AS G52)
    G52 X[#31-#21] Z[#33-#23]
    
    G103
    M99 #3003= 0
    %

  16. Likes Mitch_Pricer liked this post
  17. #12
    Join Date
    Jul 2019
    Country
    UNITED STATES
    State/Province
    Texas
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    4
    Likes (Received)
    0

    Default

    Thank you! Can't wait to give this a shot in the near future. I am a small shop, so anything to avoid buying DWO, but simplifying workholding, is a must.

    Again, thank you!


Tags for this Thread

Bookmarks

Posting Permissions

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