uery for Trevor re Compensation Calculations

You can ask questions here about Trevor and Gerard's exciting new book on Luthiery.

Moderators: kiwigeo, Jeremy D

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Wed Jun 01, 2016 11:07 am

Hi Trevor,

I'm currently coding up a spreadsheet to take care of all the calculations required to work out nut and saddle compensation. I have a couple of queries regarding calculation of L values (change in string length when fretted):

1. (Design Book P4-114). Equation 4.7-26 which calculates L3 - should L1 in this equation actually be L as per Fig 4.7-15? Is this a typo?
2. On same page, third para down from top - you define Ls as the straight line distance between nut and saddle _including_ any compensation. I'm a bit puzzled on this one as how will I know the compensated length L for each string before I've actually completed all the various calculations? I'm obviously missing something here.
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: Query for Trevor re Compensation Calculations

Post by Trevor Gore » Wed Jun 01, 2016 1:45 pm

Hi Martin,

Yes, there is a typo (well spotted!).

1) L1 in Equ. 4.7.26 should read Ls (and see below)

2) Ls is defined correctly. You just have to code it in in a way that doesn't give a circular reference.

One of the beauties of numerical optimisation methods is that they can handle this sort of stuff to iterate to a solution. (If you leave out the compensation length initially, the error will be small).

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: Query for Trevor re Compensation Calculations

Post by kiwigeo » Wed Jun 01, 2016 2:14 pm

Trevor Gore wrote:Hi Martin,

Yes, there is a typo (well spotted!).

1) L1 in Equ. 4.7.26 should read Ls (and see below)

2) Ls is defined correctly. You just have to code it in in a way that doesn't give a circular reference.

One of the beauties of numerical optimisation methods is that they can handle this sort of stuff to iterate to a solution. (If you leave out the compensation length initially, the error will be small).
So what I have to do is apply some compensation to arrive at an Ls value....ie use values quoted in the book?
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: uery for Trevor re Compensation Calculations

Post by Trevor Gore » Wed Jun 01, 2016 7:43 pm

In an optimisation routine the compensation number is both an input and an output. It's an output in the sense that the compensation number is the output you are seeking, but it is also an input in the sense that an optimiser works by making small increments (or decrements) in the compensation number until the objective function that it features in (Equ. 4.7.37) is optimised, i.e. reduced to a maximum (or minimum) value within the constraints that are set.

So Ls can feature in the equations, with its compensation components included as a variable in its total value, with the value of the compensation components being picked up from the value that the optimiser selects during any iteration. In complex optimisation routines (this one isn't) the initial value has often to be seeded so that the optimiser goes looking in the right places. For example, when seeking a minimum value, as we are, it is like looking for the deepest valley in a landscape. In a mountainous landscape there are lots of valleys and you only know which is the deepest after "visiting" a lot of them or after being given a hint (i.e. seeded) as to which direction to go looking. The intonation equations (at least how I've set them up) are quite well behaved in that we are essentially looking for a valley in the middle of a plain, so we shouldn't get lost in the wrong valley. In coding terms this means that we establish the intonation term as a variable, existing wherever it needs to exist in the equation set, and can put its initial value =0 (or likely any other number < 1% of scale length, because the functions are pretty stable). The optimiser then "nudges" that value around until the conditions of the objective function are met, in our case that being that the total intonation error is minimised.

[Hope that makes sense. I did say optimisation was a fairly specialist field - not seen even in most university maths courses!]

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Wed Jun 01, 2016 8:25 pm

Trevor Gore wrote:In an optimisation routine the compensation number is both an input and an output. It's an output in the sense that the compensation number is the output you are seeking, but it is also an input in the sense that an optimiser works by making small increments (or decrements) in the compensation number until the objective function that it features in (Equ. 4.7.37) is optimised, i.e. reduced to a maximum (or minimum) value within the constraints that are set.

So Ls can feature in the equations, with its compensation components included as a variable in its total value, with the value of the compensation components being picked up from the value that the optimiser selects during any iteration. In complex optimisation routines (this one isn't) the initial value has often to be seeded so that the optimiser goes looking in the right places. For example, when seeking a minimum value, as we are, it is like looking for the deepest valley in a landscape. In a mountainous landscape there are lots of valleys and you only know which is the deepest after "visiting" a lot of them or after being given a hint (i.e. seeded) as to which direction to go looking. The intonation equations (at least how I've set them up) are quite well behaved in that we are essentially looking for a valley in the middle of a plain, so we shouldn't get lost in the wrong valley. In coding terms this means that we establish the intonation term as a variable, existing wherever it needs to exist in the equation set, and can put its initial value =0 (or likely any other number < 1% of scale length, because the functions are pretty stable). The optimiser then "nudges" that value around until the conditions of the objective function are met, in our case that being that the total intonation error is minimised.

[Hope that makes sense. I did say optimisation was a fairly specialist field - not seen even in most university maths courses!]
Thanks for taking the time to address my queries. Does it make sense.......sort of. Im sure it will make more sense once I knuckle down and spend a day or two finishing off the spreadsheet and then playing around with the input data.

Cheers Martin
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: uery for Trevor re Compensation Calculations

Post by Trevor Gore » Thu Jun 02, 2016 12:57 am

Where I said "intonation" here:
Trevor Gore wrote:In coding terms this means that we establish the intonation term as a variable, existing wherever it needs to exist in the equation set...

I should have said compensation... but I guess you figured that...

Sorry! T.

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Thu Jun 02, 2016 11:35 am

Trevor Gore wrote:Where I said "intonation" here:
Trevor Gore wrote:In coding terms this means that we establish the intonation term as a variable, existing wherever it needs to exist in the equation set...

I should have said compensation... but I guess you figured that...

Sorry! T.
Didn't actually notice your gaff.....but would have worked it out.

Tonight I'll have a spreadsheet..accompanied by a size pack of Beechworth Porters......those equations always seem to become more "user friendly" after a few beers :dru
Martin

Woodsy23
Blackwood
Posts: 100
Joined: Sat Mar 16, 2013 10:23 pm
Location: Sydney

Re: uery for Trevor re Compensation Calculations

Post by Woodsy23 » Thu Jun 02, 2016 1:38 pm

Martin,

I may have mentioned this before in another thread. I adopted the "trial value" approach to the calculation of nut and saddle compensation for each string using Excel. Choose a value for both then get Excel to create a graph of the intonation error. Keep adjusting the trial values until you get the result you want. It will take less than 30 seconds to settle on appropriate compensations for each string.

However, if you love working in Excel and want to use the optimisation routine, go for it.

The graphs are also useful to see how other assumptions affects the results. Get good looking graphs for all six strings (like in Trevor's books) then change the value of the deflection of the string between frets from 0.5mm to 0.6mm. See what happens to those lovely graphs.
Richard

johnparchem
Blackwood
Posts: 377
Joined: Mon Jan 21, 2013 2:59 am
Location: Seattle
Contact:

Re: uery for Trevor re Compensation Calculations

Post by johnparchem » Thu Jun 02, 2016 2:30 pm

You encouraged me to look at this as well, a couple of gin and tonics in and no experience with OR it looks like with just two variables in Equ 4.7-37 the Excel Solver add-in can solve for the minimum solution.

I wondering, with only two variables being nudged around in a rather constrained range. It might be easier to brute force this simulation in matlab for each string with a nested for loop with equation 4.7-37 inside and just keep the set of values with the smallest error.

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Thu Jun 02, 2016 9:44 pm

Thanks for the input John and Richard.
Martin

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Tue Jun 07, 2016 9:01 pm

Still slogging away on the spreadsheet.......doing manual calculations to check accuracy of spreadsheet calculations which is time consuming.
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: uery for Trevor re Compensation Calculations

Post by Trevor Gore » Fri Jun 10, 2016 6:04 pm

kiwigeo wrote:Still slogging away on the spreadsheet.......doing manual calculations to check accuracy of spreadsheet calculations which is time consuming.
It only took me about 10 years... :D

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Sat Jun 11, 2016 1:59 pm

Trevor Gore wrote:
kiwigeo wrote:Still slogging away on the spreadsheet.......doing manual calculations to check accuracy of spreadsheet calculations which is time consuming.
It only took me about 10 years... :D
I see a dull glow on the distant horizon :cry:
Martin

User avatar
Nick
Blackwood
Posts: 3645
Joined: Thu Feb 26, 2009 11:20 am
Location: Christchurch, New Zealand
Contact:

Re: uery for Trevor re Compensation Calculations

Post by Nick » Mon Jun 13, 2016 6:26 am

More booze sounds like the answer Martin. If other Uni's are the same as Canterbury, we all know how engineering students get through University, maybe a massive hangover makes this stuff easier! :wink:
"Jesus Loves You."
Nice to hear in church but not in a Mexican prison.

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Mon Jun 13, 2016 5:35 pm

Nick wrote:More booze sounds like the answer Martin. If other Uni's are the same as Canterbury, we all know how engineering students get through University, maybe a massive hangover makes this stuff easier! :wink:
I'm constantly reminded why i did Geology and my brother who managed an honours degree in mathematics and is now a Maths teacher.
Martin

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Mon Jun 13, 2016 8:59 pm

Picturing my gravestone: "Here lies Martin Turner....Died at Equation 4.7-26" :shock:
Martin

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Fri Jun 17, 2016 1:12 pm

Not dead yet but still struggling with this compensation spreadsheet. Notes as follows:

1. String longitudinal stiffness calculations seem to be in the ball park and agree with each other when plugged into Mersenne's equation. Eg k value for a .056" wound Daddario EJ17 E 6th string calculates out at 31887.84 N/m.
2. Action calculations seem to give reasonable values but I have a query regarding measurement of l and x values relative to the nut. If not specifically instructed in the text should I be using measurements back to compensated or uncompensated nut position for each string?
Eg. Equation 4.7-18 which calculates the elliptical component of action (hesn) requires x and a as inputs. Should "a" be the compensated or nominal scale length and should x be distance from fret to compensated or uncompensated nut position?
3. String length change calculations again seem to be giving believable values. Text stipulates to use compensated string length for Ls and I assume all x values used in L1, L3, f and g calculations should also be measured from compensated nut?
4. Change in tension calculations. I’m getting deltaT values of between 0.5 and 1.9N for the E6th string but have no way of really knowing if these figures are realistic.
Martin

Woodsy23
Blackwood
Posts: 100
Joined: Sat Mar 16, 2013 10:23 pm
Location: Sydney

Re: uery for Trevor re Compensation Calculations

Post by Woodsy23 » Sat Jun 18, 2016 7:41 pm

Martin,

I'll give you my 2 cents worth in response to questions 2 and 3. For calculating the action values at each fret position, I don't think it really matters whether you use the compensated length or uncompensated length. The component of the action value due to neck relief is quite small and the method of combining an circular component and an elliptical component is an approximation anyway. The real curved shape of an initially straight neck that results from the tension applied by the strings and the forces applied by the adjusted truss rod can only bet determined by structural analysis. It depends on the shape and the taper.

When I was first tackling the compensation calculations, I was also unsure whether to use compensated or uncompensated lengths in the various formulae. That's why I developed a "Trial Compensation Value" approach. I could use the trial compensation values in every equation. It was also easier for me to understand the process with this approach.

Following is a brief description of the method I used. Of course, it is based entirely on the method and formulas in Trevor’s books. While the results I got in my calculation spreadsheet seemed correct, I can’t guarantee the method is correct. That’s one of the reasons why I am giving the description below. Perhaps some learned luthiers could review it to see if there any errors of logic. I would be quite happy to send the Excel spreadsheet to anyone interested (PM me).

The part of the calculation process that I will describe starts with a set of action values, ds,n, one for each fret. The method for calculating these is as in the book. Here is the main section of the spreadsheet.
Nut and Saddle Compensation Calc Spreadsheet.pdf
(59.83 KiB) Downloaded 163 times
At the top of the spreadsheet is the basic input data which should be self-explanatory. Yellow cells contain input values. The trial compensation values are in the blue cells.
Columns 4 to 8 calculate the components of the “path Length” Ls,n which is in column 9. The value of l1 is determined using the trial nut compensation and l3 is determined using the trial saddle compensation. The length increment in column 10 is calculated using Equations 4.7-24 and includes the trial compensations. The tension increment in column 11 is calculated using Equations 4.7-31. The target frequency in column 12 is calculated using Equ 4.7-33.

The tension of the unfretted string is calculated using Mersenne’s formula, using the actual (trial) string length (= scale length – nut comp + saddle comp). The fretted tension values in column 14 are obtained by adding the appropriate tension increment in column 11 to this value. The fretted frequency is then calculated using Mersenne’s formula from the fretted tension and the vibrating length of the string, which is l3. The intonation error in Hz and in cents is then simply calculated from the fretted frequency and the target frequency.

Following are graphs of intonation error vs fret no. The first is with no compensation and the second with nut compensation of 0.8mm and saddle compensation of 0.5mm.
No Compensation.jpg
Best comp.jpg
It is really quite a quick exercise to determine a suitable compensation amount for the nut and saddle. Using optimisation techniques to determine these is great if you are a spreadsheet whiz. However, there are only two values to optimise for each string. One of those mainly affects the lower frets and the other the upper frets.

Any comments, verification of method or results would be appreciated.
Richard

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Sat Jun 18, 2016 11:15 pm

Richard, thanks alot for your post.

I'm just home from a night out with friends so I'll have a good hard look at your post and the attached PDF tomorrow and compare results with output values from my spreadsheet.
Martin

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Sun Jun 19, 2016 5:19 pm

Richard I rejigged my spreadsheet to present target and fretted string frequencies and it all seems to work.
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: uery for Trevor re Compensation Calculations

Post by Trevor Gore » Mon Jun 20, 2016 7:26 pm

Well done Richard and Martin.

There's always more than one way to skin a cat!

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Mon Jun 20, 2016 7:34 pm

Trevor Gore wrote:Well done Richard and Martin.

There's always more than one way to skin a cat!
I'd still like to get to the bottom of the problems I was having with my original spreadsheet. Everything was ok until it came to the Lscn calculations......I was getting compensation values of up to 50mm.

Ive managed to get a modified spreadsheet based on Richards method to work but am having issues with getting consistant and sensible mass per unit length and k values. Part of the problem may be the test rig...the Frequency values for a single run seem to vary a bit more than they should. mass per unit length results from the spreadsheet and input data from the test rig dont seem to match with mass per unit length value calculated from tension and target frequency data on the string packet.
Martin

User avatar
Trevor Gore
Blackwood
Posts: 1306
Joined: Mon Jun 20, 2011 8:11 pm

Re: uery for Trevor re Compensation Calculations

Post by Trevor Gore » Tue Jun 21, 2016 9:20 am

Martin, you're best off ignoring the tension/frequency data on the string packet. D'Addario, (for example) who are one of the few who publish this information, rarely have test results from the string you're using - they extrapolate them from the few tests they have done. If that is an extrapolation from a .012" steel string to a 0.016" steel string that's not so much of a problem, but for their wound strings they may be extrapolating using the gauge of the winding and the winding density to get to a theoretical mass per unit length which is then used in Mersenne's equation to get the published tension at pitch (at their chosen string length) by which time the answer is nowhere near reality. The "plastic" strings suffer even more from this process, because they're not elastic. For example, (Savarez this time and quoting from fallible memory) they give a tension at pitch for the high E of the high tension fluorocarbon set at ~75N (iirc), but when I measure it after a minimum 3 day stretch-out period it is over 100N.

Regarding use of the test rig, if you've set it up like mine (as per the book) be sure you're not getting coupling between your bench/rig and string that shift frequencies and make sure the fretting point is dead centre. When the string is "fretted" the two halves of the string should ring at the same frequency (you can pick this up with a mic, but you'll hear it anyway). If you're not getting the same frequency on both sides of the fret, either the fret is not in the middle (easy to fix in theory) or your string is not uniform, which happens too often. I've measured 20 cents error between two halves of a string with the fretting dead centre, so depending on which half you take you can get some very different answers. Ideally, find a more uniform string but if push comes to shove, take the average of the two halves.

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Tue Jun 21, 2016 10:22 am

Trevor Gore wrote:Martin, you're best off ignoring the tension/frequency data on the string packet. D'Addario, (for example) who are one of the few who publish this information, rarely have test results from the string you're using - they extrapolate them from the few tests they have done. If that is an extrapolation from a .012" steel string to a 0.016" steel string that's not so much of a problem, but for their wound strings they may be extrapolating using the gauge of the winding and the winding density to get to a theoretical mass per unit length which is then used in Mersenne's equation to get the published tension at pitch (at their chosen string length) by which time the answer is nowhere near reality. The "plastic" strings suffer even more from this process, because they're not elastic. For example, (Savarez this time and quoting from fallible memory) they give a tension at pitch for the high E of the high tension fluorocarbon set at ~75N (iirc), but when I measure it after a minimum 3 day stretch-out period it is over 100N.

Regarding use of the test rig, if you've set it up like mine (as per the book) be sure you're not getting coupling between your bench/rig and string that shift frequencies and make sure the fretting point is dead centre. When the string is "fretted" the two halves of the string should ring at the same frequency (you can pick this up with a mic, but you'll hear it anyway). If you're not getting the same frequency on both sides of the fret, either the fret is not in the middle (easy to fix in theory) or your string is not uniform, which happens too often. I've measured 20 cents error between two halves of a string with the fretting dead centre, so depending on which half you take you can get some very different answers. Ideally, find a more uniform string but if push comes to shove, take the average of the two halves.
Thanks Trevor...you've (again) provided some very useful information there. I'm currently testing wound strings so was wondering about how Daddario reach there packet tension figures. Ive also noticed that using the tensions quoted on the packet I nearly always end up with the open string frequency short of the desired open tuning frequency for the string.
Martin

User avatar
kiwigeo
Admin
Posts: 9287
Joined: Sat Sep 29, 2007 5:57 pm
Location: Adelaide, Sth Australia

Re: uery for Trevor re Compensation Calculations

Post by kiwigeo » Tue Jun 21, 2016 10:12 pm

Still fine tuning the string testing rig. There was a bit of flex in the base board so Ive now bolted it to a piece of 4 x 2. I have some rubber vibration isolating mounts that will be used between the rig and the bench. I was using a bucket of water as a "weight" but I've now set up for metal weights......my neighbour is currently missing a few dumbell weights from her home gym.
Martin

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests