ok i just got my first cnc mill a few months ago and i have been writing g code for it using rhino cam and so far its been working well. my problem arose the other day when i tried to use rhino to program a 4th axis path to profile a part. the problem is at the beginning of the code it sets the feed rate to 18 which is fine for the actual pass but when the part needs to index on the a axis it keeps the 18 feed rate and its KILLING my cycle time and i know their has to be a better way. so i did some research into hand writing code and found out about sub routines. this looks like exactly what i want but im having a difficult time completely understanding how to get it to do what i want it to. here is a rough code for what i have now
(introductory code turning on spindle and coolant)
g00 z1
m98 01
m98 02
(end program lines)
o01
g1 z.5f20
(block of code to produce profile)
g00 z1
g00 x0
m99
(this is where i get lost)
o02
g1 a "+1" f300 (what i want to do is increment the a axis 1 degree untill a=360)
m99
if anybody has any ideas on how to accomplish this please help