How to Wind a Coil Spring on the Metal Lathe
#41
Hey Chuck, good to see you've found your way over. Be sure to check in at the intro section and tell us a little about yourself.

Tom
[Image: TomsTechLogo-Profile.png]
Reply
Thanks given by:
#42
(06-28-2013, 06:33 PM)chucketn Wrote: ...Marv explains his programs don't run under Windoz. He recommends a DOS emulator program called DosBox. The spring programs run fine on Windoz under DosBox...

Hi Chuck - nice to see you over here. Thanks for reminding me about DOSBox. I downloaded it years ago and had forgotten about it. Just tried it and both programmes worked fine. I'll have to see what else Marv has on his site (I recall there being a long, long list!).

Is there a way to program a script that will open DOSBox and mount a drive? I intend to make a specific directory just for programs that require DOSBox to run.
Hunting American dentists since 2015.
Reply
Thanks given by:
#43
(06-29-2013, 10:33 PM)Mayhem Wrote:
(06-28-2013, 06:33 PM)chucketn Wrote: ...Marv explains his programs don't run under Windoz. He recommends a DOS emulator program called DosBox. The spring programs run fine on Windoz under DosBox...

Hi Chuck - nice to see you over here. Thanks for reminding me about DOSBox. I downloaded it years ago and had forgotten about it. Just tried it and both programmes worked fine. I'll have to see what else Marv has on his site (I recall there being a long, long list!).

Is there a way to program a script that will open DOSBox and mount a drive? I intend to make a specific directory just for programs that require DOSBox to run.

Maybe something like this?

http://www.dosbox.com/wiki/Basic_Setup_a...uick_start

Quick start
You can save yourself some time by having DOSBox automatically MOUNT your folders and change the drive to C:. In original DOS based operating systems a file called AUTOEXEC.BAT contained any commands that the user wanted executed every time the computer booted up. This functionality is simulated by the [autoexec] section of the dosbox.conf file.
For DOSBox versions older than 0.73 browse into program installation folder and open the dosbox.conf file in any text editor. For version 0.73 go to Start Menu and click on "Configuration" and then "Edit Configuration". Then scroll down to the very end, and add these lines:
MOUNT C C:\OLDGAMES
C:
Now those commands will be executed automatically when starting! If you're having trouble with that, make sure it looks like this (look at the bottom):
Reply
Thanks given by: Mayhem
#44
(06-30-2013, 08:24 PM)arvidj Wrote: Maybe something like this?

http://www.dosbox.com/wiki/Basic_Setup_a...uick_start...

Thanks Arvid - I just edited the config settings and now it opens up and shows the directory of the folder I wanted mounting.

Next I need to make a simple documents that provides a description of each programme, as I can't always figure it out from the name Big Grin
Hunting American dentists since 2015.
Reply
Thanks given by:
#45
Hmmm, I don't seem to see any difference in the mandrel diameters when I choose phosphorus bronze versus music wire. This is running Marv's program from DOSBox. Anyone else test it out with the two types of wires?

Ed
Reply
Thanks given by:
#46
I aquired a copy of the article on springs by Kozo Hiraoka and put his formula for calculating the mandrel diameter into my Excel spreadsheet on threading. It does not agree with Marv's mandrel program. Haven't figured out why.

Chuck
Micromark 7x14 Lathe, X2 Mill , old Green 4x6 bandsaw
The difficult takes me a while, the impossible takes a little longer.
Reply
Thanks given by:
#47
(07-01-2013, 06:50 PM)chucketn Wrote: I aquired a copy of the article on springs by Kozo Hiraoka and put his formula for calculating the mandrel diameter into my Excel spreadsheet on threading. It does not agree with Marv's mandrel program. Haven't figured out why.

Chuck

My program agrees with Marv's when I use the music wire selection. But then I used Marv's source code to write my program so it should match, theoretically.

Ed
Reply
Thanks given by:
#48
(07-01-2013, 06:50 PM)chucketn Wrote: I aquired a copy of the article on springs by Kozo Hiraoka and put his formula for calculating the mandrel diameter into my Excel spreadsheet on threading. It does not agree with Marv's mandrel program. Haven't figured out why.

Chuck

Care to share the article? I'll take a shot at it.
Reply
Thanks given by:
#49
Here's the link to the article.

http://www.oldengine.org/members/holland...nails.html

Ed
Reply
Thanks given by: Highpower
#50
Ok, I think there is a bug in Marv's code.

We are going to focus in page 20 of the article.

In the article the mandrel size hinges on the value of k.

Based on the graph on page 20, the y axis of the graph is k and it is labeled k = Dm / D where Dm is the diameter of the mandrel and D is the diameter of the spring. The x axis of the chart is the Spring Index, D / d where D is the diameter of the spring and d is the diameter of the wire.

There are two lines on the graph which represent the relationship between the Spring Index and k for Music and Stainless Steel wire and for Phosphor Bronze wire. We know the desired diameter of the spring and the wire size so the calculation of the Spring Index is straight forward.

Regretfully the only source for the value of k is the graph ... no formula is given. Given that we can not teach the computer to look at the graph to determine k we will try to do something reasonable.

If we take the information that we see on the graph it appears to be a straight line. If we put the values of k that we see for each type of wire for the Spring Index values of 5 thru 15 that are on graph into Excel and then do a least squares regression on it we see that it is a reasonably straight line ... a coefficient of determination of .98 is really, really good ... and therefore we can calculate k with a simple equation

k = mx + b

where m = -0.0124727272727273 and b = 0.980818181818182 for music and stainless steel wire

and m = -0.0109727272727273 and b = 0.984909090909091 for phosphor bronze wire.

and x is the Spring Index.

Now that we have all the numbers we need, we simply put them into the formula at the bottom of the page

Dm = (k * D) - d and come up with the mandrel size.

If we look at the code, we see the following bits ...

Variables defined

Code:
dbl c0[]={0.980364,0.012436};  //constant coefficient
dbl c1[]={-0.012436,-0.11018}; //first order coefficient
dbl id;                        //spring internal diameter (in)
dbl ds;                        //average spring diameter (in)
dbl dw;                        //wire diameter (in)
dbl fact;                      //empirical factor (nd)
dbl dm;                        //mandrel diameter (in)

and the following calculations after the user is asked to provide wire type ... a number of 0 for music and stainless steel wire and 1 for phosphor bronze wire, the wire diameter and the spring inside diameter

Code:
ds=id+dw;                      //spring average diameter
fact=c0[wt]+c1[wt]*ds/dw;      //empirical factor
dm=fact*ds-dw;                 //mandrel diameter

The first line simply calculated D, the average spring diameter in our previous analysis and the article, by adding the desired inside spring diameter to the wire size.

The second line calculates k based on the type of wire the user entered. It gets the value of b from c0 then adds it to the value of m from c1 divided by the spring index. Given that there are no parenthesis used in the formula the author is counting on the operator hierarchy in C to make sure the multiplication and division happens first followed by the addition. [side note ... I am not a big fan of this practice but ...]

If the wire type entered by the user was 0 for music and stainless steel wire then the first value ... the value before the comma ... in c0 and c1 are used in the calculation of k.

If the wire type entered by the user was 1 for phosphor bronze wire the the second value ... the value after the comma ... in c0 and c1 are used in the calculation of k.

Finally the last line does the same calculation that we discussed in our analysis where we take k and multiply is by the spring diameter and then add the wire size.

I do believe the bug is in the second value of c0.

If you look at the first values of c0 and c1 they are very close to the values we discovered for m and b with Excel ... certainly close enough for this type of work.

However, if you look at the second values of c0 and c1 the m values again are very close but the b value is way off. This would explain why the phosphor bronze calculations seem to be so far off.

I can not explain where that value might have come from but it certainly seems out of place.

Comments? Thoughts? Concerns?

Arvid
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)