Wednesday, December 9, 2015

Craftsman 109 Lathe - New Homemade Spindle

I  have known that the spindle on my lathe is old and worn out. I am not sure if it is bent, but I like to replace it. There are spindles available on eBay and Home Shop Supply. They run for about $100. But where the fun is if I just bought it.

There are people who has made the spindles themselves. For example, this gentleman in SHDesigns made one from tool steel, and has a page for it. But he turned it on an Atlas/Craftsman 12x36. I don't have a machine of that size or accuracy. All I have is a semi-working Craftsman 109. And even if it cuts, I am not sure if I can make the finishing smooth enough for the bearing surface.

I have been thinking and search for a while. And one day, I realized something. We all know that the spindle size of the Craftsman 109 is 0.551". That is a strange number. I have seen people doing things in strange numbers, but there has to be a reason. And it turns out that 0.551" is 14mm. The all American Craftsman has a metric heart. How interesting is that.

So all I got to do is to find a grounded 14mm rod, and that could be my new spindle. But what about the collar part? I have spent quite some time thinking about it, and there are a few ways I came up with. I did a few experiment to decide the precision of my cut and measurement, and decided that I can bore the hole precise enough for an interference fit (or shrink fit), with my BBQ stove as heating source (no need for a propane torch).



So here we go. First I got the 14mm rod from eBay. It is grounded 1144 steel. Even though it is not as hard as tool steel, I figured that it will do for me now. The piece I got is 24 inches long, just enough to make three spindles (the original spindle is about 7-1/2" long).

So I cut a piece of 12L14 that is about 3/4 inch long, and bored a hole that is just one thou smaller than the spindle rod (which measured to be 0.550"). For some reason, I can not even bore a smooth surface in the collar. But I figured that this would be a good thing here, as it would grab tighter when the two surfaces are shrink fit together.

Before I shrink fit, I made a wood jig (that is nothing more than a large enough hole drilled for about 1 inch deep). That's how much I like the spindle to stick out. And then I put that collar piece on the BBQ stove. After a while, I took it out, put on the wood jig, and stick in the spindle piece. I even brought a hammer, in case I will have to force it in. But it slides right through with a light tap. I kind of worried if I have machined them too close, but it turned out beautifully when everything is cooled down.

Next I put it on my lathe to finish the backside of the collar. The rest of it can be machined when the spindle is on the lathe.

The next challenge is to get the groove for the Woodruff key. For this I just used my Dremal tool with a disk shaped cutter. It is a bit larger than the original, but it works its way in just fine.

Here are the new spindle and the old spindle show side-by-side. As one can see, I left a bit more material on the new spindle, as those will be cut down in the future when fitting the chucks. Plus I like to have some safety margin to give my shrink fit more surface to grab on.

The old spindle is shown here. As one can see, it has been worn out quite a bit on its bearing surface. I guess that this spindle might have never been replaced since the lathe is first sold in late 1940s. It is an old lathe.

Now the spindle is put on the lathe in its place, and nose of the spindle is cut down to 0.5 inches, ready to be threaded. The spindle nose on the 109 lathe has a 1/2-20 thread. It is great that I have fitted my lathe with all the necessary threading gears so I can cut those threads in place.

Because these threads are so close to the end of the ways, we need to be very careful in setting it up. I happened to have grounded a v-shaped cutter that is tilted to the right. So as we can see here, I can cut pretty close to the register surface and still have room for the indicator wheels.


Cutting the threads are largely uneventful. I did have a few mistakes when the gear pops out. But I got it realigned easily. I finished the thread with a die. As always, that is not an easy work, and took significant force at the end. The die set I have is a cheapo set from Harbor Freight. Maybe I will need a better die set someday.

So finally, here is my new spindle on the lathe. All home made cheaply and proudly on the Craftsman 109 lathe I have.

Thursday, December 3, 2015

Craftsman 109 Lathe - Easy Tool Post Steady Rest

My Craftsman 109 lathe does not come with a steady rest. That makes it really inconvenient to drill a center hole at the end of a long slender piece.

I was looking around Internet the other day, and found this article in an old issue of Popular Mechanics. That is really a smart idea. The tool post steady rest goes on the tool post, so it would preclude cutting with a tool at the same time. So it is not a real steady rest. But for the purpose of drill a center hole, it works perfectly.

So I went out and build one myself. This is how it looks on my lathe. Now I can work on the spindle to replace the one I have.


Wednesday, November 18, 2015

Craftsman 109 Lathe - Spindle Adaptor 3/4-16

Using tailstock to start a straight tapping
To make the lathe usable, I will start with the chuck. First I would need to get a chuck that is shorter. It looks like that all the plane back chucks stick out too much because of the extra space taken by the back plate. So the one that would fit well would be the screw mount chucks. I happened to have have read about the 3/4-16 adapter for Taig chucks in Dean's website. So I put in an order to purchase one of 4-jaw chucks from Taig, and getting ready to make the adapter.

Finishing tapping on a vise
To start out, I have cut out a piece of 12L14 round rod. For my weak lathe, it seems that the only steel I can cut at this time is the free machining 12L14. The rod is held in my old 3-jaw chuck, and it is faced and drilled a through hole to about 15/32. Then the hole is tapped with a 1/2-20 tap. The tap was held in a drill chuck from endstock to start the thread straight. It went pretty well initially, but soon it become really hard to turn. Maybe it is because that I don't have a sharp enough tap, but I have to take it out from the lathe to be held on a vise. This is different from what Dean did on his page. Everything looks so easy there. Another thing that I did differently is that I didn't turn the outside down in this step. Part of the reason is because I am not sure if my lathe can turn well with the chuck it has. Well, I am fortunately I didn't, because holding it in a vise will ruin the finish, and it did slip pretty badly. Like all my projects, I always have to go through some rough patches along the road.

Then the piece is thread on the spindle nose and faced. Since the thread on the nose did not go all the way to the register surface, a few threads need to be bored away. I don't have a boring bar, so I have tried to grind a drill bit to be held on tool post as a boring bar. I have tried it on aluminum just to make sure it works. It did. But when I put it on use on steel, it turns out did not cut as well. Maybe I didn't grind the cutting edge well enough. But I ended up just enlarge the hole with the 1/2 drill I have to get it against the register.

3/4-16 Adapter
The picture to the left is the piece mounted on the nose ready to be turned down. A hole is drilled on the back for inserting a bar to remove the adapter if it gets too tight. The front 1/2 in or so is turned down to 3/4 in size. The turning down was so smooth, and it cuts like butter. Turning steel has never felt so good with my mis-aligned chuck. That further confirmed to me that it can work well if I can bring it closer to the nose and the spindle.

As I mentioned earlier, I was able to get the thread cutting of the lathe working. So I got that ready and start threading it. Contrary to Dean's experience, I was able to cut the entire length with the threading indicator mounted. This is the first real thread I am cutting, so I have also bought a 3/4-16 die ready to finish it. I really have no idea how deep it should go, and learnt my share of lessons there. I thought I got it deep enough, and tried it with the die. In the process, I have removed the tool and soon realize that it would not be in the same place when I put it back. Fortunately I have the die ready, and  I would finish the thread with it.

That turned out to be another tough operation I have to drive to the maximum that my little vise can handle. In that process, the surface is destroyed again, which I have to turn down afterward to clear the deep marks. But all in all, I have a cool looking adapter ready to mount my Taig chuck (which I purchased for this modification).

So here is my new chuck, sitting nicely on the lathe ready for the next project.




Sunday, November 15, 2015

Craftsman 109 Lathe - Thread Cutting Gears

One reason that drives me to keep the 109 lathe as my project is that it has building setups to for thread cutting. I have got many gears with my original acquisition of the lathe. However, the set is not complete. I have asked the seller about it, but he said that he has never used it.

I looked through the gears that I have. It looks like that I am missing the gears that are on the tumbler assembly. Those gears are available on eBay, but are generally going for $15 to $20 a piece. I have been contemplating about cutting them myself, but I would need to build a milling attachment as well as an indexer. Thread cutting seems to be a rather important part of the projects I have in mind. So I decided to get those gears complete first.

On Dean's webpage (from the same gear cutting link above), it was stated that the 109 lathe uses the same gear as the 618 lathe. So I have been scouting eBay for some time, and found a tumbler assembly. I got it for about $40 (including shipping). But when it arrives, I found to my surprise that they don't fit the tumbler I have. Didn't Dean said so? I went back to read his comments, and it turns out that what he says are that the gears fits (I think he means the change sets).

Fortunately, I think the gears pretty much looked in place, except with a bigger hub size. That should be easy on the lathe. I quickly machined some bushing, and now it goes on like they are made for it.

After some work and additional money out of pocket, my lathe is finally up cutting threads. I have heard that people complaining that the motor is too fast for cutting threads, but mine works just fine for me. I will be using that in my coming projects.

Friday, November 13, 2015

Craftsman 109 Lathe - Chatter

My 109 lathe has serious chatter problem. It is so bad that I could not even turn a small aluminum piece. I have made a few small modifications previously (such as replacing all the jibs with copper ones following Dean's webpage). But it helped little.

The chatter remains, even when the piece was relatively short and hold close to chuck. I have tried may tricks I read on the Internet, slow feeding, deeper cuts, etc. The vibration will still come. The only way I have found that I can turn anything on this lathe is to hold the end of a piece with a center from tailstock.

After playing with it for some time, I finally got a lathe dog so I can turn between centers. Finally I was able to turn a piece and it cuts smoothly. What a wonderful feeling when the cutter just glide through steel like butter.

I have tried to measure the vibration frequency, and it is somewhere around 100 Hz. My lathe at the setting I used most is turning at around 700 RPM. Interesting at one of the pieces I can see the chatter marks that goes about 8 cycles per turn. For 700 RPM and 8 dimples per turn, it turns out at right about 100 Hz. That's what I am seeing.

I have tried to tighten down my tool post, and it did not help. And the disappearance of chatter when turning between centers confirmed that the vibration is probably in the headstock and chuck.
On this lathe I have a standard plain back 3" 3-jaw chuck. It extends quite a bit from the headstock. And it is a big piece of steel. I took the chuck off, cleaned it, and faced the backplate. And it did not help.

Then I realized that the problem is probably with this size of the chuck and the lathe. The chuck is quite heavy, and it sticks out quite a bit. At the same time, the spindle that supports it is relatively small 0.5" steel rod. That is an ideal case for some good oscillation. This chuck does not fit this lathe. I will need a lighter chuck that sits closer to the headstock. It turns out there are many choices.





Wednesday, November 11, 2015

Why Craftsman 109 Lathe

I happened to have bought the Craftsman 109 lathe more than a year ago. I believe I paid about $140 for it. It comes with gears but not a complete set.

The 109 lathe has a lot of weakness. The most obvious ones are:
  • A weak spindle. The spindle is 0.55" diameter. From what I read, it is very easily bent. I suspect that in my playing with the limit of it, I have probably bent mine also.
  • No graduated dial.
While contemplating on different options, there are a few choices when it comes to hobbies lathes. Among the most obvious ones are:
Each have its advantage and shortcomings. I have been scanning the local Craigslist hoping to find something interesting. Soon, a HF 7x10 came up at an amazing price of $150. That is a very good price. And I am the first one to respond to the buyer and setup the time to take it.

I thought through that again and again. Yes, at that price the value would be hard to beat. But I don't need two lathes. Yes, I can sell the old one and get my money back probably. But what is the purpose of having a lathe? I am not having a project that needed a lathe to complete. The lathe itself IS the project. Indeed, I have more (easier projects, for beginner at least) to work on on the old 109 lathe than those of the HF lathe. Plus, it is a simple lathe that everything is out in the open. The fact that it is weaker could actually be its strength for me to really learn how to do things properly.

We all know the most important use of a tool is to build other tools. So to build these I have in mind with the challenging weak inaccurate lathe would make things really interesting. These weaknesses are not insurmountable. They just require you to be more creative and do things properly. Take for example the weak spindle. If I am doing something that bents a half inch steel bar unintentionally in my garage, I am probably doing something wrong.

So I have cancelled my appointment with the seller. My project is now playing with the 109 lathe and see where I can bring it up to. I think it will be a fun journey.


Sunday, March 15, 2015

SVN with LDAP authentication - Step 2

In the first step, I have setup SVN with SASL authentication using a password file. The next step is to use LDAP authentication instead. To do that, we will need SASLAUTHD. SASLAUTHD is an authentication daemon that provides authentication service. To configure it, we will need to edit two configuration files on Debian. The first one is /etc/default/saslauthd. The following lines need to be changed.

START=yes
MECHANISMS="ldap"

While you are at it, take a note at the last line. Mine has

OPTIONS="-c -m /var/run/saslauthd"

This line tells you where the daemon is listening at (in this case /var/run/saslauthd). Now the second configuration file /etc/saslauthd.conf.

ldap_servers: ldap://myldapserver.mydomain.com
ldap_start_tls: yes
ldap_tls_cacert_file: /etc/ldap/myldapca.crt
ldap_auth_method: bind
ldap_bind_dn: cn=bindcn,dc=mydomain,dc=com
ldap_password: supersecretstuff
ldap_search_base: ou=Users,dc=mydomain,dc=com
ldap_filter: (&(uid=%U))

This file simply tells SASLAUTHD how to contact the LDAP server. Save and restart the saslauthd by typing

service saslauthd restart

Then you are good to go. First to test the SASLAUTHD authentication by

testsaslauthd -u username -p password

In this way, we can verify that the SASLAUTHD is working as intended. Once that is verified, the last step is to modify SASL to use SASLAUTHD. This is done by changing /usr/lib/sasl2/svn.conf (see my Step 1 post) to the following:

pwcheck_method: saslauthd
saslauthd_path: /run/saslauthd/mux
mech_list: PLAIN LOGIN

Notice the saslauthd_path. It is the path where the SASLAUTHD is listening (which we got earlier in this post form /etc/default/saslauthd). Your process do need to have read/write access to that folder. This can be done by adding the user you are running svnserve with to the sasl group.

One more note here: in the svnserve.conf file (under conf directory of the repository), the min-encryption need to be set to 0, otherwise it would not work on my setting. Also I read somewhere that SASLAUTHD only supports plain and login, not any of the digest methods. This really make this method un-secure because the password will be transmitted in clear text.

So in the end, after all these trouble, I went back to move my SVN server to be served with Apache2 server through SSL (sorry, no Nginx or anything else, only Apache2 works). That seems to be the only secure solution right now (other than SVN+SSH, then I will need to create many user accounts on my SVN server, which is not good).



Sunday, March 8, 2015

SVN with LDAP authentication: Step 1

My work setup has got too many places that needs authentication. There has been six or seven logins and passwords I need to use constantly, so I have finally decided to spend some time to get LDAP working. I have wanted to do that for a while, but every time I looked at it, it looks pretty thick and complicated. It indeed is. There is very few documentations, and I found that there are fair amount of mistakes in them. So I am writing this down as a record, and also as a way to share my mistakes.

LDAP

First, it is probably a good idea to read some introduction to LDAP. This 10-min tutorial is so thick that I am not sure it is actually helping. Later, I found one that is actually just a personal note, but is surprisingly clear and helpful. That is a must read for a quick understanding of what everything is there.

Svnserve with SASL

The first step is to setup svnserve with SASL. This is a well documented process, and easy to test to be sure that everything works. First of all, run svnserve to make sure that SASL is supported. I installed this on Debian 7.8.0 (March 2015), and the output is as below.

Two configuration files need to be modified. The first one is svnserve.conf. It is located at the "conf" directory of the repository to be served. The line of "use_sasl" need to be set true.

[sasl]
use-sasl = true

The second file is svn.conf for SASL. This is a little tricky, and not much information is available. I believe the svnserve will need to use SASL library to access authentication, and SASL library will load a configuration file for the application (which is svn in this case) in a known folder (which is /usr/lib/sasl2 in Debian). The file does not exist and will need to be created.

In this first step, I tried to use a password file that holds the username and password hash for SASL. This is so that I can first verify that svnserve is correctly working with SASL, and then later I will change that to use LDAP. For now, my svn.conf looks like following (in this first step).

pwcheck_method: auxprop
auxprop_plugin: sasldb
# you may use /etc/svn_sasldb here
sasldb_path: /path/db_name
mech_list: DIGEST-MD5

Then the password file can be created with the following command.
 
saslpasswd2 -f /path/db_name -c -u realmname username

Restart svnserve and test away. That is the first step.

Sunday, February 22, 2015

Using FFMPEG library in Visual Studio

Ffmpeg is a very flexible and comprehensive library for decoding and playing media files. However, the code is written conformed to C99 while Visual Studio (version 2012 or earlier) is primarily C89 compliant. There are several ways to do it. One way is to use C99-to-C89 converter to convert the source code so it builds as explained in the ffmpeg website. It may now also be possible to build ffmepg with Visual Studio 2013 and Intel C++ Compiler (ICL).

But I am a little lazy and choose to use the pre-compiled binary. The only problem with those library is that they are built with MinGW instead of Visual Studio. The project I am working on is built with Visual Studio (because it uses some Windows specific features). So the question is figure out a way to link to the pre-built libraries so the pre-built DLLs can be loaded.

In general, binaries compiled with different compiler can not be linked together. There are different name mangling rules, and more importantly they are using different ABIs (Application Binary Interfaces). However, in this case it is actually doable. Using the shared DLLs are generally done by linking to a small "loading" library that actually loads the DLL binaries. As explained in a MinGW wiki page, the "loading" library in Visual Studio can be generated from the DEF file (which is a text file defines all the exposed functions) with the LIB tool provided in Visual Studio.

It turns out that even this is already done. The Zeranoe website with the pre-built ffmepg provides all the pieces that are needed. All it needs is the "shared" package (which contains the DLLs) and the "dev" package (which contains the include and the libraries that loads the DLLs). All the necessary .h, .lib and .dll files are included for building apps to using the ffmpeg DLLs.

One additional small step is that if the main project is in C++, the included headers of ffmpeg need to be enclosed in an extern "C" declaration.