hi guys i'm mark from g code cheetah i'm here with practical machinist to discuss cannes cycles today so we used canned cycles to greatly speed up our programming with g-code and it gets rid of a lot of code it also makes it a lot easier for us to read mccann cycles is our g81 drilling cycle our g82 countersink cycle a g83 pec drilling cycle a g84 tapping cycle or g85 and g86 boring cycles these are our canned cycles and we know their canned cycles because we have to cancel them once they're active with g80 so once we've seen one of these g codes we would always end the sequence with g80 to tell the machine that we have finished using this cycle now canned cycles is not the only type of cycle our machine is capable of it's also capable of multiple repetitive cycles now we tend to use these more on a lathe than a mill but they're there for our use so for example our g70 is our finishing cycle g71 would be our ruffin cycle g72 our face and cycle g74 is our face grooving cycle and g76 is a screw cutting cycle now these cycles we don't need to finish with g80 to cancel them these are used to remove material and they're multiple repetitive cycles so back to cannes cycles this is a full sequence of codes to drill these three holes using a drilling cycle or g81 drilling cycle to be exact and the g81 drilling cycle block of code looks like this so we can see how condensed the code is when we start working with cycles now if we compare this to an output of code from a cad cam machine we would see pages and pages of spaghetti code now going through everything that these cycles do like point by point by using cycles when we're programming gcode we can speed that up and compress the program to just a few lines and i think that's why a lot of people are a bit put off by g code programming at first because they first see it produced by cad cam machine and think well that's a lot of code i've got to write but not so now cad cam programs and software is actually getting a lot better for using cycles in the modern times over the years i've started to see cycles being introduced to our cad program so this is not always the case now but certainly the older cad cam programs would always output point to point and we'd end up with pages and pages of code to do a very simple part so that's what a canned cycle is so let's have a look at how they work so i'm going to take the most simplest of canned cycles that we have the g81 drilling cycle this is the most basic drilling cycle so we're starting off our block of code with g81 and we're also ending it with g80 once the drilling cycle is complete just to let the machine know that we're no longer using the drilling cycle on the first line the cycle line we have some more information about what we expect our cycle to do now if we add a z-depth to any position of the hole this will overwrite this depth here but if we do not have a depth it will default back to this depth so in this case it would drill all holes at 12 millimeters deep assuming that our dating position is the top face of the part now again if any holes in our sequence are at a different depth we just state that z-depth next to the hole and by emitting it it defaults back to the one in the cycle line at the top here this r value here is our retract value if we don't have this on this line the tool will automatically retract back to the last known rapid position in zed but by adding this here it will come up plus one millimeter above our datum position so again if our datum is the top face of the component this will wrap it up our tool after each hole is drilled to one millimeter above the surface of the component and at the end of the line here we have to issue a feed rate so the machine knows how fast to remove material so that completes our can cycled line our first line of our cycle now we can add our x and y dimensions here to locate the position of the first hole or we can position it before this line as i've done with this program here but it's not showing so i've already positioned above the first hole before i run this sequence so the machine will read this line drill the first hole to 12 millimeters of depth wrap it up to one millimeter above the surface and wait for the next command and the next command is to move in 50 millimeters along our x-axis so all we have to do is give the position of the next hole and the machine will take care of everything else it will drill it straight to 12 millimeters depth and wrap it up to one millimeter above the surface at a feed rate of 250 millimeters per minute so the machine knows we're using the canned cycle it knows it's a g81 drilling cycle so we just need to give it to positions of the holes from now on and the machine will take care of the rest it will fill in the blanks for us and this is why coding with canned cycles is so much quicker so our third and final hole here is a two move we're moving both x and y to the position of this hole and we can add more information here if we need to if this hole is a different depth we can give a different z-depth here so it drills to that depth and not the one on the g81 line now you may have noticed we're using incremental movements here our axis movements are relative to the last known position of the cutter this is in contrast to absolutes where all dimensions come from the datum now this is where we need to be careful and know our machine because some machines when we go into g81 mode into a canned cycle into a drilling cycle it automatically puts the machine into incremental mode for us other machines we have to do it ourselves by adding the g91 to put the machine into incremental if we wish to do this so just bear that in mind it does depend on the makeup of your machine the make the model the age the software it runs and all sorts of other variables that will affect this so not all machines do switch into incremental when we switch into a drilling cycle mode so just bear that in mind and if your machine does not we need to add g91 to switch into incremental and once we're done with our incremental mode and we wish to switch back to absolute we would issue g90 now if we're doing a countersink hole maybe a spot drill we might want to have our cutter dwell at the final depth of the hole and for that we would need to use a g82 now by adding a p value here we can add a dwell time to the bottom of that drilled hole so p 500 would add half a second dwell time when the cutter reaches the full depth of that hole with the different canned cycles we can add in different information for example if we are pect drilled in with g83 we can add the depth of pec using a q value so q3 would take a three millimeter cut between each peck and we can add a lot of other information here with pec drilling this is just a quick look at one option of why we use different canned cycles for different features and finally i just want to mention if we are tapping with g84 we would use a feed rate that is equal to the pitch of the tap or the picture the thread that we are going to machine so we would change our feed rate to this because it would switch over the machine to feed per revolution and not feed rates per minute when we are tapping so that's a very brief introduction to ken cycles and the reasons why we would use them