So I spent much of the day chasing a silly bug in my embryo program (it wouldn't loop and denied knowing the loop back destination - solved, too many zeros on a line number

)
But I don't think the maths is right. I set up some variables:
R10 = starting angle
R11 = angle span
R12 = angle step
R13 = stock diameter
R14 = End Mill diameter
Then having selected the correct tool the @714 command ensures tool changing is completed before I set it spinning I move to a safe distance from the stock
Then I rotate the stock to the starting angle and calculate the term X = (D+R)/ Cos (Angle) and move the cutter to that point at feed rate then move in rapid back to my safe height.
Then I calculate the next angle by adding the step, and if the angle span hasn't been exceeded, loop back and do it all over again.
For testing purposes I I have kept the cutter well clear of the stock and temporarily added a 500 millisecond delay when the cutter is at full depth so I stood a chance of reading its position on the screen. This has given me the following X values which obviously are not correct:
A=00, X=30.000
A=05, X=30.114
A=10, X=30.462
A=15, X=31.058
A=20, X=31.925
A=25, X=33.101
A=30, X=34.641
A=35, X=36.623
A=40, X=39.162
A=45, X=42.426
A=50, X=46.671
A=55, X=52.303
A=60, X=60.000
So no metal cut yet, but then no cutters broken either

I suppose that it's possible that the cosine function work in radians rather than degrees, but I can find absolutely no reference to radians in the book of words, and all other values are expressed in degrees.
If anyone can please critique the code - I attach a copy and also the relevant crib sheet - I'd be most grateful
[youtube]J0XkURqI1M8[/youtube]