What's new
What's new

DWO Macro for 4th axis

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
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
%
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
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
%
 

JFettig

Aluminum
Joined
Apr 1, 2009
Location
Blaine, MN
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?
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
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.
 

Twice

Plastic
Joined
Jan 24, 2019
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.
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
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.
 

friesen

Cast Iron
Joined
Jul 13, 2016
Thanks for this macro. So far it is working as designed on my VF2. It definitely beats modeling the whole thing in cam.
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
Hello!

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

Is this compatible with a Haas using the NextGen Control?
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
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
%
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
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!
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
I made a few modifications to your DWO macro from your most recent post to change it from a B axis to an A axis. Would you mind checking it over and making sure I didn't screw something up?

Thanks!

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[#20256-#10512] GT .005 ] THEN #3000= 1 (Y MRZP ERROR)
IF [ABS[#20257-#10513] GT .005 ] THEN #3000= 1 (Z MRZP ERROR)

(Y-Z ROTARY CENTER)
#12= #10512
#13= #10513


(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]*[#21-#12]-SIN[#24]*[#23-#13]+#12

(NEW Z POS)
#33= SIN[#24]*[#21-#12]+COS[#24]*[#23-#13]+#13

(SET DIFF AS G52)
G52 Y[#32-#22] Z[#33-#23]

G103
M99 #3003= 0
%
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
I made a few modifications to your DWO macro from your most recent post to change it from a B axis to an A axis. Would you mind checking it over and making sure I didn't screw something up?

Thanks!

Code:
...
(CURRENT WORKOFFSET Y&Z SETTING)
[B]#22= #5022 - #5042[/B]
#23= #5023 - #5043

(NEW Y POS)
#32= COS[#24]*[[B]#21[/B]-#12]-SIN[#24]*[#23-#13]+#12

(NEW Z POS)
#33= SIN[#24]*[[B]#21[/B]-#12]+COS[#24]*[#23-#13]+#13
...

Hi Mitch, be careful here - see bold. Those should be 22



Also just noticed I made some typos post #11. The comments should have some X's for the B-axis version ... I left some as Y, whoops. That's what copy/paste gets ya. Stupid mistakes. Doesn't affect usage though.
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
Awesome, Thanks! I made those changes and will report back next week with how it works. Running some 3+1 parts that will be the perfect test!
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
Gave this a try over the weekend and had success! However, I am fairly sure my MRZP calculation is not all that accurate based on how I am setting it without a tooling ball (like in your initial video). Do you have any tips on how to set the MRZP without a tooling ball? Haas is trying to stick me for $1,300 for the ball and stem kit that normally ships with DWO.
 

thesidetalker

Hot Rolled
Joined
Jan 11, 2015
Location
Bay Area, CA
Gave this a try over the weekend and had success! However, I am fairly sure my MRZP calculation is not all that accurate based on how I am setting it without a tooling ball (like in your initial video). Do you have any tips on how to set the MRZP without a tooling ball? Haas is trying to stick me for $1,300 for the ball and stem kit that normally ships with DWO.

Clamp a piece of material to your rotary table/vise/collet/etc.

Take a light cut across the top in the Y-direction, rotate rotary 180°, then make another cut in Y, without moving in Z. Same Z-level is important! That way the cuts should be equidistant from centerline.

Now rotate 90°. Use your spindle probe to measure a Y-web to find center. Also take note of the width. You can measure with caliper/mic/ or look in variable #10188 (#188) for the size.

Rotate another 90° and use Z-measure. Now adjust downward half your measurement from previous step.

That should get you pretty close. Make small adjustments afterward as needed.


With a tooling ball it is easier to make small adjustments to dial in, since you can change the centerpoint as a check-program is running. (This is why I prefer using variables vs setting. You can't change MRZP setting while a program is running)

Many ways to adjust or check without a tooling ball, though. Off the top of my head:

For checking Y-center, you can program to cut along the X-direction on one side of a part (picture a cube?) half way down in Z. Then rotate 180° and cut on the opposite side, half way down again. They should line up. Any mismatch you have, adjust Y-center by half.

For Z, I find doing a fresh spindle probe length calibration before starting helps get closer the first time. You could mill a slot or pocket at A0, then mill a shoulder at A90 and A-90. If your slot is right on Y-center, perhaps you could mic the dist from shoulder to slot on each side and compare/adjust the Z-center.
 

Mitch_Pricer

Plastic
Joined
Jul 24, 2019
Decided to go the tooling ball route using the single-axis MRZP set template in the Haas VPS. I made this tool to pull it off (sorry it's rotated, can't seem to get it to upload straight):
 

Attachments

  • E07D9ABB-7063-42BC-8F06-51F72046BB11.jpg
    E07D9ABB-7063-42BC-8F06-51F72046BB11.jpg
    82.7 KB · Views: 217








 
Top