Hello Guest it is December 01, 2020, 09:19:58 AM

### Author Topic: Any new WIZARD ideas to work on ???  (Read 27033 times)

0 Members and 1 Guest are viewing this topic.

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #20 on: October 15, 2012, 03:59:21 PM »
OK. Found the working version. Appears I made some modifications to the code at the machine itself. This one moves the A axis:

G0 G40  G17 G80 G50 G90

(A axis is in revolution mode)
(Program in Diameter mode)

#1 = 4  (number of sides)
#2 = 13 (distance across flats)
#3 = 300 (feed: mm/min)
#4 = 0.2 (Z feed per revolution)
#9 = 2 (length along Z)
#17 = 50 (resolution - number of segments in half flat size)

#5 =  [360/#1] (root angle)
#6 =  [2*[0.5*#2]/cos[0.5*#5]] (distance across corners)
#7 =  [[0.5*#2]*tan[0.5*#5]]  (half side length)
#10 = [[0.5*#5]/360] (single segment revolution amount of A axis)
#11 = [#10/#17] (single rotation fraction of A)
#16 = 0
#12 = [[-1*[#4/[#1*2]]]/#17] (Z advance per segment)
#13 = #12

G0 X[#2+1] A0
G0 Z1
G1 X#2 Z.1 F#3

#14 = [-1*[#4/#1]] (Z advance per main subroutine execution)

#15 = FIX[#9/#14] (Number of subroutine executions required - 'L')

#18 = #11

M98 P100 L100;#15

G0 X[#6+3]
G0 Z1 A0
M30

O100

M98 P101 L#17
#16 = 0
#18 = [#18 + [0.5*#5/360]]

M98 P102 L#17
#16 = 0
M99

O101
G1 X[2*[0.5*#2]/cos[#16*360]] A#18 Z#13
#16 = [#16 + #11]
#13 = [#13 + #12]
#18 = [#18 + #11]
M99

O102
G1 X[2*[0.5*#2]/cos[0.5*#5-#16*360]] A#18 Z#13
#16 = [#16 + #11]
#13 = [#13 + #12]
#18 = [#18 + #11]
M99
%

Just tested it on a piece of delrin and the concept works - see attached picture. Flats seem perfectly straight with resolution variable set to 50 and corners are sharp. Only thing is it's still twisted along Z. And the code has some problems with the variables as it cut the octagon in the pic with the flats number set to 4. If I set it to 3 it cuts two flats and if 5 it appears to cut 10 flats. But at least it shows that the concept works. Just requires some more thought and refinement. See if you find what's the problem.

Dan

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #21 on: October 15, 2012, 04:03:54 PM »
Hi Alex,

You are right the tool has to have a larger clearance angle as the number of flats gets smaller.

Dan

#### cncalex

• 244
##### Re: Any new WIZARD ideas to work on ???
« Reply #22 on: October 15, 2012, 04:05:21 PM »

Alex

#### BR549

• 6,939
##### Re: Any new WIZARD ideas to work on ???
« Reply #23 on: October 15, 2012, 05:41:25 PM »
IF you set up mill to see the code wrap A around Z. You can see the warp that it produces.

BUT I still don't see it rotating A all the way around from watching the DROs.

I will give this some more study to see if there is a different way.

I think INC may be a bit easier to deal with.

(;-) TP

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #24 on: October 16, 2012, 02:16:54 AM »
Hi Terry,

Ah... this was a good idea. I didn't think of changing the rotation axis to Z. Now I see the toolpath more nicely. And for some reason I am seeing it twisted in the Z instead of getting continuously lower. This is probably why the part gets twisted too.

I am using my A axis in revolution mode, as stated in the Gcode heading, not in degrees mode, so 1 in the A DRO means one revolution of the axis. This is why you think it's not rotating all the way around.

Dan
« Last Edit: October 16, 2012, 02:21:55 AM by Dan13 »

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #25 on: October 16, 2012, 03:21:24 AM »
Found the problem of the part being twisted - had the wrong setting for the A axis steps in Mach3 tuning. See a new one - now perfect. Only problem remaining now is the number of sides cut being wrong. This octagon is cut with the number of sides to 4. I can't find the error in the code, it looks correct to me.

Now regarding the ability to do arcs on a rotary axis, I have a workaround for this. I tried to asign the Y axis to the rotary - works fine only problem is I can't get my head around to figure how to program the arcs. Do you have any idea?

Dan

#### BR549

• 6,939
##### Re: Any new WIZARD ideas to work on ???
« Reply #26 on: October 16, 2012, 03:27:24 PM »
OK NOW the display makes since IF 1 unit is 1 rev.  YA had me there.(;-)

Y arcs program the same BUT you have to do the math to convert the values  back and for from linear to polar.   Calculate the diam of the part then convert the cut into linear disatnce for the Y to travel. It is a battle to keep it all straight in your head at least MINE(;-)

Some Machines can take the offset from the A center line and do the calcs on the fly for you so you would program the Rotaries the same as the linear. With mach3 you have to do the arcs as micro segments of straight lines to form the arc.

Looks like you have the loops going x2 to get double the flats (;-).

I was thinking to do the flat segments as a series of threading cuts with e flats code intertwinded so small machines would talke multi cuts like a series of threading passes down to the finish size.

IF you change the #flats to 2 do you get 4 ?

(;-) TP

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #27 on: October 17, 2012, 01:56:46 PM »
Yes, I was meaning the math behind the arc programming. Just can't figure it.

Afraid I still don't understand what you mean with the threading like flats cutting.

Very busty now. Will check what happens if I enter 2 flats in a couple of days.

Dan

#### BR549

• 6,939
##### Re: Any new WIZARD ideas to work on ???
« Reply #28 on: October 19, 2012, 12:10:45 AM »
Dan here is what I meant for cutting the flats like a thread.  The Program is just a demo I cooked up to test the idea. THe math is NOT DONE for cutting the flats as an arc(working on that part). THere is just a simple cut where the flats arc CODE will be.

It creates the proper number of flats as requested.  AND yes SOME of the math is fixed for now more Variables to be added later.

It runs like a thread cutting the flats along the way AND then come back and cuts the flat deeper and so on until you get to the end value of the flat.

Just a thought, (;-) TP

#### Dan13

• 1,208
##### Re: Any new WIZARD ideas to work on ???
« Reply #29 on: October 19, 2012, 02:28:29 AM »
Ah.. I see now what you mean. Cutting the shape in multiple passes. This is more powerful than my approach. And you code looks much simpler too Not that I figured the math though.

Dan