Search the Community
Showing results for tags 'fretslots'.
In the previous article on fret slotting using a compact CNC machine we explored a sectionalised approach to milling a big object in multiple stages, also known as tiling. We also went through the process of constructing a jig that allowed us to accurately position the workpiece such that the end of the first stage of the milling process would align successfully with the next. In this week's write-up we will go through the process of generating a custom template using the online FretFind2D fret board designing tool and formatting the drawing and G-code ready for the milling process, Let's assume that we're in the process of making a guitar and, for whatever reason - be it ergonomic, tonal, a request from a client or sheer curiosity - the design has called for a slightly unusual scale length of 24.6" with 24 frets, made from some eastern-Martian Grumblebum wood we have laying around. No ready-made pre-slotted fret board can be found with this scale length in the timber that we want to use, so we're stuck with having to make our own. Designing a fret board with a particular scale length in itself presents no real challenges; there are several online calculators that will automatically spit out the a table of fret spacings based on an input of scale length It's just a matter for us to transfer this table of measurements onto a blank piece of timber and start sawing away. But in our case we want more precision than simply eyeballing the cut. FretFind2D is an excellent online tool to assist with laying out a graphical representation of a fret board based on some input parameters. It also includes a DXF export function that will generate a CAD drawing file that can be (almost) directly used to generate the G-code in order to drive the CNC mill. Based on our design requirements lets enter the appropriate values into FretFind2D and make up our fret board layout: Units = Inches Scale length = 24.6" String width at Nut = 1.375" String width at bridge = 2.125" Fret board Overhang = 0.125" Calculation method = 12th root of 2 Number of strings = 6 After entering the above data click on the 'DXF - Save to Disk' button and choose a convenient name and location to save this file as. Upon opening this DXF file in a CAD application it is clear that a little formatting work will need to be done before we can start milling; Along with modelling each fret position, FretFind2D also includes the generation of the strings and bridge location, which we won't need when milling the fret slots. Spend some time deleting the unnecessary components - the strings, fret board edges and bridge position lines are not required for our work. I also like to orient the drawing such that the nut is at the top of the screen rather than at the bottom (as FretFind2D positions it in the export), If you normally work in metric units of measurement, scale the drawing up by a factor of 25.4 or allows your software to convert it. You should end up with something that looks similar to this: You will recall in the previous instalment of this series we created a CAD drawing of the fret board holding plate, including the drill hole locations for the tiling jig. We need to now open this drawing and copy it into the fret board layout. When doing so ensure that the lower-left drill hole position gets inserted at X0, Y0. When this is complete re-position the fret slots such that they roughly sit in the middle of the fret board holding plate. Absolute accuracy isn't critical, just make sure you have roughly-equal space around the fret slots: Note the position of the middle drill holes on the tiling jig relative to the fret slots. When moving the fret slots onto the tiling jig, position them vertically such that an imaginary horizontal line drawn between these two holes would fall within the gap between two frets. One limitation of the drawing generated by FretFind2D is that it models each intersection of a fret with a string as a short 'fretlet', each one overlapping the next to give the impression of a continuous line. What we really want is each fret to be a single line. Depending on the CAD package used it may be possible to select each group of 'fretlets' and perform a union operation on them. Failing this we will need to manually rebuild the fret lines. Fortunately this is a simple task of using the existing outer end points of the 'fretlets' to draw straight lines utilising object oriented snapping. It is also a good idea to place the new one-piece fret lines on a new layer to assist with being able to delete or turn off the original 'fretlets' that FretFind2D generated. In the example below I have created two new layers - one for the redrawn frets below the midpoint of the jig (green) and one for the frets above the midpoint (yellow). Now we have our fret board formatted it is time to split it into the two tiles for our jig. Select the upper 8 frets and move them down using a middle drill hole as a start point and a lower drill hole as the end point. The result should look like this: While this looks messy at the moment, each layer can be independently turned on and off to display each half of the fret board. This forms the basis of the phyical alignment of the two tiles that need to be cut on the machine to complete the full fret board. In the above image, the green slots would be milled on the fret board blank in the position as shown. At the end of this milling operation the workpiece gets shifted down and the yellow slots are then milled at the positions shown. But because the fret board blank has been moved to a new position the remaining yellow slots get milled above the relative position of the green slots, thus completing the full fret board. Turn off any remaining layers and leave the (green) layer containing the lower 16 frets visible. Perform a CAM export of this drawing with a feedrate of 300mm/min and a Z depth of -0.3mm (or 12 inches/min, Z-0.0118" if you work in imperial units). Switch off the lower-16 layer and switch on the upper-8 layer. Perform a CAM export of this display with the same values as before. You should now have two G-code files describing the geometry of each half of the fret board. It is tempting to now simply run these two G-codes and complete the fret slotting operation, and indeed you could conceivably run these G-code listings and have the slots scribed onto a timber blank right now. The limitation is that we currently are only cutting the slots to a fixed depth of 0,3mm. We want the fret slots to be deep enough to accept the tangs of our fret wire, which could be a couple of mm tall. So maybe we could increase the depth of cut when we export the G-code from CAD? The problem here is that the cutters used to mill a fret slot are only 0.6mm in diameter and extremely brittle. Attempting to move such a tiny endmill through a hard material like ebony or rosewood at the full depth is likely to immediately destroy the endmill. So perhaps we could run the entire program multiple times and bit-by-bit increase the depth of cut on each successive pass? That is an option, provided your step change in cutting depth is quite small. The risk here is that even if the cutter is plunged in only a small amount the sudden lateral jerk as the endmill begins its traverse slotting operation can again stress the cutter too much and break it. The process of copying and pasting the entire run of code many times over is also very wasteful and hard to follow if something needs debugging. What we can do is gently ramp the endmill into each cut and zig-zag our way to the bottom of the slot. That way we can break up a deep slot into smaller steps that won't overly stress the endmill, and avoid the shock of suddenly forcing the cutter to remove too much material as soon as we move sideways after plunging: Anyone who spent time at school in the computer lab may recall programming FOR-TO loops or IF-THEN-ELSE evaluations using BASIC language. G-code features similar abilities to run repetitive milling operations and allow milling parameters to change based on variables. We can use this feature to implement our zig-zag slotting operation and make the code run more efficiently. Below is the first few lines of one of the raw fret slot G-code listings for our fret board. The code dealing with the first slot has been highlighted: Each fret slot is nothing more than a horizontal line between two points - X18.297 Y50.087 and X73.22 (the second instance of Y50.087 is not required as it only needs to be defined once when describing a straight horizontal line). Initially what we want is for the endmill to run repeatedly left and right between the two points . Using pseudo-BASIC code this could look something like the following (NB, there is no literal G-Code equivalent to a GOTO loop, this is just for illustrative purposes): Each subroutine must have a unique 'O' number. When the subroutine starts the cutter moves to X18.297, Y50.087. The next line plunges the cutter into the workpiece by 0.3mm. The slot is then cut with the endmill moving to X73.22 with Y unchanged. The endmill then moves back to its starting position of X18.297. (NB, the return X co-ordinate is simply copied from the original start point of the fret slot, three lines above it). The 'GOTO LOOP' command at the end of the subroutine returns us to the start and the process is repeated. Shuttle right. Shuttle left. Repeat. But we're still not moving the Z axis any deeper than 0.3mm, so no change in slot depth is being achieved. The other bug in this program is that because the 'G0 Z2' line falls outside the O100 LOOP it never gets executed, and the cutter remains stuck at a depth of Z-0.3mm. The next trick we need the cutter to do is gradually ramp the Z-axis down on each left-to-right run to increase the depth of cut. G-code allows the use of variables to substitue for direct co-ordinates. If we assign an automatically-changing variable to the Z-axis we could increase the depth of cut gradually to perform the ramping operation: Breaking this down line by line: A variable called #1 is assigned a value of 0 and a second variable #2 is created with a value of 0.3. On the first run of the subroutine the cutter will move to X18.297, Y50.087. The cutter then gets plunged to Z=0 (the value assigned to #1 gets substituted in place of the literal Z co-ordinate). The value currently stored in variable #2 (ie, 0.3) then gets subtracted from variable #1 (ie, 0) and the result stored back into variable #1, so now variable #1 has been updated to -0.3. The cutter then moves right to X73.22, and Z uses the new value of variable #1 as its destination. This creates the downwardly-ramping cut that we're after, starting from a depth of Z0 and finishing with a depth of Z-0.3. The cutter then moves back to its starting point of X18.297, but because Z is not listed it simply moves back at the last recorded depth of Z-0.3, flattening off the top of the initial ramping cut. The routine then returns to the top and runs again. Variable #2 once more gets subtracted from variable #1 and the result stored back into #1. But because #1 was set to -0.3 from the last run of the subroutine the new result of #1 - #2 (-0.3 - 0.3) is now -0.6. So when #1 gets used for the next Z co-ordinate it will ramp from -0.3 down to -0.6. With a bit of mental gymnastics it can be seen that on each successive pass of the subroutine Z will continually ramp down in increments of 0.3mm. But we still need some way of determining when we've cut the slot deep enough. At the moment there's nothing to stop the loop running for ever and giving us infinitely-deep slots. By changing our pseudo-GOTO loop to a WHILE/ENDWHILE statement we can place a limit on how many times the subroutine runs before it stops. Here's what the new version looks like: The WHILE/ENDWHILE loop will run until the expression evaluated by the WHILE statement is determined to be false. In our case we have specified that the G-code commands contained between the WHILE/ENDWHILE statements will run until the value stored in #1 is no longer greater than -1.5 ('GT' in the WHILE statement is short for 'Greater Than'). As variable #1 is being used to control the depth of cut within the subroutine and gets 0.3 subtracted from it on every cycle, when #1 eventually becomes less than -1.5 this will trigger the subroutine to finish and jump to 'G0 Z2' which retracts the endmill out of the bottom of the cut, ready to move to the next fret slot. Further refinement of this subroutine can be performed by removing or repositioning unnecessary or duplicated steps within the WHILE/ENDWHILE loop, giving: So now the only thing left to do is step through the remainder of the G-code listing, identify the start and end points of each fret slot and apply the same subroutines to them. Remember to use a unique O-number for each new subroutine. If you get stuck performing this manual G-code manipulation, both the raw and formatted versions are available to download at the end of this article to reference against, along with the DXF files used to generate the fret board geometry used in this article. ---------- In the next and final instalment we will get down to the nitty-gritty of using the fret slotting G-code and finally machine ourselves a fret board. We will also discuss some further ideas and applications of tiling on the CNC machine relevant to guitar building. Fretboard 24_6.zip