KRMx01 Build Log
KRMx01 Build Log
Chapter 14 - Finishing the KRMx01
If you have the book you know that there are a total of 17 chapters. My intention is to jam the last little bit of the initial build into this last chapter. Now this does not mean I am done building or upgrading on the machine, but instead, this marks the finish of the initial build to get it running. I will document the other stuff I do to the machine, upgrades and add-ons in a different section.
Cable Hookup (Book Chapter 14)
The Side Table
In this image you see the side table cut out and laying on the machine. The only thing extra I done to it was to use a round over bit in a router to knock down the hard edge and corner on the top of the table. In a future upgrade, I hope to have a monitor that will slide out of the rack far enough so that I can dispense with the table part that sticks out, leaving only the shelf for bale management.
The Cable Hangers
Here are a couple of pictures of the cable hangers installed. These are only temporary and will be removed when the energy chain or dragon cable has been made and installed. I am not too worried about how neat this looks as I have lots of other work to do on the machine and will tidy this up when I get the upgrades and add-ons done.
Connecting the Motors
This first image is of the electronics drawer installed into the rack. More electronics will be going into the drawer over time but this gives you a pretty good idea of what is going where. At this time I am not worried about getting the motor cables and other wires into the wire managers until more of the upgrades have been completed. The second picture shows the motors connected to the drawer. The cables are just laying inside the frame. When I get more of the upgrades done, these motor cables and other related cables will be run through the two cable managers you see attached to the PC drawer and electronics drawer.
Adjusting the Drive Train (Book Chapter 15)
Adjusting the drive train was a pretty straight forward process and Zachary and I only ran into one difficult spot. The problem happened when we tightened up the top anti-backlash nut on the Z-Axis. It wanted to bind the travel a bit. The solution was to run the Z-Axis to the very top of travel, loosen the bearing blocks back up, tighten the top anti-backlash nut, then adjust and tighten the bearing block back again. After we done this there seemed to be no issues with it.
The video below shows the machine moving under its own power. I apologize for the poor lighting and audio. The tablet I used didn't record it well, but at least you will get the idea.
Router Hookup (Book Chapter 16)
Attaching the K2CNC Router Clamp
This was a pretty straight forward thing to do. Insert the 8 screws, washers, lock washers and nuts. Square the assembly up to the table and lock it down. The image to the left shows the router clamp installed.
Attaching the Hitachi Router
I just knew this was going way to smooth! The router would not fit in the router clamp. There was not enough clearance between the support above and the head of the router. If you recall, I had to add shims to the supports for the anti-backlash nuts to clear the extrusion. Looks like I will have to add shims under the router back plate as well to get the router installed.
Making the spacers
The spacers are cut from 1/8" x 2" strap and are 5 inches long. The same as the height of the router plate on the Z-Axis. I used the same template as for the Z-Axis router plate to mark and punch the holes. The last image shows them drilled and ready to paint. I am going to do a test install before painting them.
Hitachi Router installed into K2CNC Clamp
Finally I have the router installed into the clamp. To do it, I had to have the clamp loose, then slide the router into the clamp, then finally square the clamp to the bed and tighten the clamp to the router plate. Lastly, I tightened the clamp on the router.
It has taken me quite some time to complete the basic KRMx01 CNC Router. There is still lots to do with add-ons and upgrades. Please follow along if you are interested. This has been a fun project and as a result got to spend some time with my son Zachary that I don't know I would have gotten otherwise. The attached images show where the machine stands at this point.
See you in Upgrades and Add-ons!!!
Chapter 10.1 - The Computer Rack
This isn't an official chapter of Building the KRMx01 CNC Machine, but it has to be done before I can continue with the next chapter of the book. I decided that rather than place the computer on a shelf that maybe I would have a go at some sort of computer rack and drawer system (to come later as an upgrade) to maximize the space available from the CNC stand.
I also need to mention that I built this from materials on hand so can only give you general information on how it is made. I am sure you can replicate it with other materials you have available to you.
The computer rack is made from aluminum stock and pieces of cut 2" angle iron used as connectors. The aluminum stock I used was U-Channel from an old stand up rack and some 1-1/4" x 2-1/2" material with slots of sorts that was salvaged from some pharmacy fixtures. I realize that isn't the greatest description, but it was just some stuff I had on hand.
The U Defined
Before I start on the actual build of the rack it is important to know what a U is. If you look at the image to the left, you will see that the mounting holes for a computer rack are defined in to spaces called U's which the best I can tell is shorthand for units. Each U consists of three holes equally spaced on .625 (5/8"), and the distance between the U's are .5" (1/2") from center to center of the U holes. The holes are typically drilled and tapped for #12-24 or #10-32 screws. This configuration is handy for things like switches, drawers and keyboards, but when dealing with heavy items like computers and monitor trays, you will discover that the mounting holes will not work using the standard size. Most computer racks for business use use square holes of about 3/8" on the side. These holes still use the standard spacing but instead of being threaded use a square nut held inside a clip that will clip it to the hole for mounting.
Building the Rack
Again, I reiterate that I made the rack from materials on hand and you can do the same. The only thing to consider are the pieces that you use to make the uprights. You will want to make sure they are heavy enough to handle the weight and pressure of whatever you have hung inside it and that you follow the drilling schedule for the U spacing.
Use the four images above to follow along with the steps below.
I started by measuring from the front to back of the KRMx01 stand on the inside of the angle on the far left side of the stand. My stand is not perfectly square so my sizes are a little off from each other. With these measurements I deducted about 1/8" from the lengths to allow for some play.
Cut two supports to this length. I used some aluminum stock that was used for some pharmacy fixtures but you could use something like square or rectangular tube stock. The idea is that it will be rigid enough to bolt it to the stand and support the weight of the uprights and the equipment you bolt to the uprights.
Next you will need to make some sort of connectors to connect these support to your stand. I used 2" x 2" x 1/8" angle iron. I cut two pieces 1-1/4" long and two pieces at 1-3/4" long.
Next I attached the angle pieces to my supports. I started with the bottom support by placing the 1-3/4" angle iron piece on the side of the support pointing towards the center of the stand flush with the end. I drilled a 3/8" hole through both the angle Iron and the support. I used 1/4-20 bolts to bolt them together but I wanted some play so I could move the angle a little bit at both ends. The top support I done a little bit different. Because the extrusion I was using had a slot on the ends I fashioned a nut from a piece of steel that would slide in the slot. I drilled and tapped it for a 1/4-20 bolt. This would allow the angle iron bracket to slide. The 1-1/4" angle bracket is fastened to the top of the support so that the support will hang down and clear the bolts on the table top.
Next I attached the supports to the stand. I wanted my computer rack to be as far to the left side of the stand as I could get it. So to do that, I started with the bottom support and clamped it to the angle iron of the bottom of the stand and adjusted it so that its face was flush with the inside edge of the stand. The images above show what I mean. With the support clamped in position, I clamped the angle iron pieces to the front and back of the stand and tightened the bolts that held them through the support piece. Next I found the center of the angle against the front and back of the stand and center punched and step drilled a 3/8" hole through the stand and the angle iron piece on the support. These were bolted in place using a 3/8-16 x 1" bolt with a washer on each side, a lock washer and a nut.
The top support was put in place and the angles clamped to the stand and the 1/4-20 bolts holding the angle were tightened.
Next it is time to position the uprights. Since I am using parts from an old computer rack, all I have to mind is the position of the U's on the rack. My solution to this was to make the other bottom support like above and have it ready to clamp in place. To cut the upright to length, I measured the width of the bottom support to the top of the stands bottom piece of angle iron. Next, I marked the center between two U's and measured below the distance I found previously. Next, I measured from the bottom of the lower support and the top of the upper support. Using this measurement, I marked the upright to this dimension using the bottom marked line I just made on it. I cut four of these out. Next I used a rack mount drawer as a spacer and attached to two of the uprights. I placed the drawer and two uprights into the rack using a couple of 1/8" thick material to set the height of the bottom of the drawer off the stands angle iron. You can see this clearly in the first and second image above. Finally I clamped the second lower support beam in place.
Next pull the upright against the lower corner of the stand and clamp it into place. Take a level and plumb the left upright on both sides. You may have to reposition the top support to do this. When all is good, clamp everything into place.
Now take and drill a 1/4" hole through the top left upright and the support. Bolt together with 1/4-20 bolts using a washer on both sides, a lock washer and nut. With the first bolt in place remove the clamp and drill a hole for a second bolt. Add the second bolt to the upright. With the second bolt in and tight, double check that the upright is plumb. Then drill a 3/8" hole through the stand and the top support angle connector and bolt with a 3/8-16 bolt. Again using a washer on both sides, a lock washer and a nut.
Next I took a rack mounted keyboard drawer and mounted it between the other pair of uprights and put it in position between the lower supports. I placed a piece of 1/8" thick angle on the right bottom support and laid a piece of 1/8" strap across the right support and stand angle just like the drawer in the front to keep the bottom spacing correct. Next I made sure that the front of the front upright and the back of the back upright were spaced 29-3/16" inches apart on both sides and clamped them into place. With both bottoms in position, I drilled and bolted the lower right support on both the front and back. Next I made sure the right side uprights were plumb and clamped to the upper support. Next I drilled and bolted the uprights to the supports.
When all four uprights were bolted to the top supports, I moved the drawer and keyboard tray to the top of the uprights to ensure the spacing. Once they were moved to the top, I drilled and bolted the top right support both front and back.
Once all the supports were bolted in, I drilled and bolted the uprights to the supports, minding that I kept the 29-3/16" spacing from the front of the front uprights and the back of the back uprights. The uprights on the left side were drilled through the uprights, support and stand angle. The uprights on the right were just drilled and bolted to the supports.
I know that was a long drawn out description that may have been hard to follow, but if you look at the images above it will be pretty self explanatory on how the thing went together. There may be much better ways of getting a rack in the KRMx01 stand, but this is what I had on hand and worked for me. Granted, it ain't "PERTY" but I will make some trim to clean it up a bit. Besides, I need to make progress so I can get the electronics done.
The completed computer rack
Here is an image of the completed computer rack. From the top down is a Keyboard tray, a drawer to put goodies in, a slide out shelf with cable management for the PC that will control the KRMx01 machine. A couple of things to point out. If you are making your rack uprights from scratch, it may be best to just punch and pilot the U's with an 1/8" bit and leave them until you are ready to use them. This way, if you have to make larger holes for bigger mounting rack equipment you are not re-doing anything and for equipment that take multiple U's you are only setting the holes you really need to use.
Below are some more images of the computer rack with equipment installed. Additionally they show how easy it is to access stuff in the rack. Also, i want to point out that when the machine is up and running I will do some more stuff for trim and beautification. (Well at least as much as my limited abilities will allow.)
I have included another picture for you to look at. This one shows the cable / wire management in the back of the rack. As things progress, many more wires will be added and will get tidied up some more.
With the Rack completed I can move on to the next chapter, the KRMx01 Electronics. See you there.
Chapter 12 - Mach 3 LinuxCNC
If you have this book, you know that Michael Simpson suggests the use of the Mach 3 controller software to run it. Mach 3 is both stable and affordable and easy to get. Again, as with the electronics of the machine I am going to take a bit of a different path for the controller. Now, this change isn't a slight against Mach 3 or anything like that. I just want to use LinuxCNC because I am used to it and have no experience with Mach 3. Additionally, I like the openness of the LinuxCNC project and the almost infinite ways it can be used and configured. Additionally, I want to provide more choice to the homebuilt CNC community who may be on a shoe string budget or just want to do something different. This page is not intended to start a boxer -vs- briefs war, just a choice.
*** CAVEAT EMPTOR ***
LinuxCNC is open source software and is free of charge. While the creators of this controller software do their best to provide a robust, bug free platform to run your CNC machine, there is no guarantee that it will work for you. Additionally, Open source software will require work on your part to configure and use. LinuxCNC can be complicated and it is highly recommended that you read the Getting Started Guide and the User Manual. This notice is not meant to scare or intimidate you, it is just a fact that the open source community expects you to do your part too. That does not mean that help isn't available, there are a lot of people who use LinuxCNC who are willing to help you diagnose and use the software. The best place to find information is the LinuxCNC website by viewing the documentation and visiting the Wiki and Forums.
Moving on ...
I have been using LinuxCNC since 2006 when I built my first CNC router. With a little patience and work, I am sure it will be a good controller for the KRMx01 CNC Router as well. I will attempt to document what I have done to install and configure the software to give the same functionality that Mr. Simpson provides with the Mach 3 software in his book. Hopefully, with some feedback from you all we can put together a page or pages to make that happen.
I will be making a couple of assumptions before I start. I am assuming that you will be using a dedicated PC for your CNC machine and that you will not be dual booting different operating systems and other stuff like that. If you are the type who dual-boot operating systems on your computer, then your skill set will allow you to fill in the details not presented here to get the software installed.
LinuxCNC is free and available for download from linuxcnc.org. When you go to the site, you actually have a lot of different choices on how to get the software installed. You can for example, compile it your self, download a live CD, install it as a simulator, etcetera. This guide will focus on installing LinuxCNC as a stand alone system from a Live CD ISO. LinuxCNC 2.6 on Debian Wheezy is the newest live CD offered by the LinuxCNC community. It installs LinuxCNC v2.6.1 and the XFCE desktop. It is currently supported by Debian and will be for about a year after Debian Jessie is released. Many folks do not like the light weight XFCE window manager, but this can be easily changed if you desire.
Getting it all installed
I have created a screen cast on how to download and install LinuxCNC on your computer. You can watch it below. If you have any questions, please email me using the contact us link from the menu above.
Updating LinuxCNC to the newest Version
I have created another video that will show you how to update your LinuxCNC install above to the most current release of LinuxCNC. At the time of this writing it is 2.6.3. Again, if you have any questions, please use the contact us link from above.
Running the Latency Test
The next thing to do is to run the latency test. This test determines ultimately how fast your computer will be able to run the controller. The video below shows this process and also gives some reasons why.
Gathering Data for configuring LinuxCNC
Now that we have LinuxCNC installed and at the most current version, we need now to collect some data so that LinuxCNC can be configured to run the machine. We will need to collect the following information to set up a bare minimum configuration. As time goes by and additions to the machine are made we will be adding other information to the data sheet or information sheet we put together. When you create this document, it would be a good idea to keep it with your other documentation for the machine. We will need the following data:
- Results from the latency test above.
- Stepper controller information for Step Time, Step Space, Direction Hold and Direction set up
- Step and Direction pins for each of the four joints that make up the X, Y and Z axis.
- Mechanical information about each axis on the machine.
Later we will be adding information like pins used for home and limit switches, pins for the probe, pins for the Super PID closed loop router control, etc.
Results of the latency test
If you have not done so yet, you will need to run the latency test from the CNC menu. The latency test determines just how fast your computer can respond to a request. If you look at section 5.3 of the Getting Started document, you will see that it describes the use of the latency test in detail, including how to trouble shoot some possible SMI latency related issues. In a nutshell, you want to start the test and then abuse the computer as much as you can. By abuse, it means run a bunch of programs, play a game, browse the Internet. The idea is to try to work the machine hard to see what the worst case scenario is for the test. Also, the longer the test the better. Occasionally, something will pop up and cause you latency issues that would best be caught when you run the test for a long period of time. I wouldn't hurt to run it over night. When that is done we will add it to our list of configuration for safe keeping.
|Configuration information for KRMx01 CNC Router for LinuxCNC|
|Latency Test||19732 ≈ (20 µs)|
Stepper Controller Information
When you bought your stepper controller, it should have came with a data sheet giving you the timing specifications. Some controller manufacturers give a great amount of information with their product, and others you are lucky to get the pin out diagrams. The controllers I have are really somewhere in the middle bordering on the ladder. The specification sheet for the CW230 stepper controller only tells me a couple of important details aside from what connections do what. If you want to follow along here, you can get the specification sheet from the electronics page on the KRMx01 build log. If you look at the sheet, you see the only timing information is the stepping pulse. It reads that the stepping pulse is 5V, rising edge effective and must be greater than or equal to 10µs. However, if you look at the opto-isolated diagram you see that the CP+ has to be wired to 5V and that the CP- will have to go low to activate the circuit. Something is wrong here. Assuming that the circuit is correct (Because I have run it this way) our signal then is active on the falling edge of the pulse when it drops low. This will become more important later. So for Step Time and Step Space I am going to use 15000 ns. This is 10000 ns (10 µs) + another 5000 (5 µs) for any propagation delay. I may be able to bump these values down, but these are safe and will get us up and running. Finally, because the sheet does not give any specifications for the direction pin, we are going to use a save long value of 20000 ns (20 µs). Updating our table we should have the following:
|Configuration information for KRMx01 CNC Router for LinuxCNC|
|Latency Test||19732 ≈ (20 µs)|
|Step Time||15000 = (15 µs)|
|Step Space||15000 = (15 µs)|
|Direction Hold||20000 = (20 µs)|
|Direction Setup||20000 = (20 µs)|
If you don't have the timing values for your driver, take a look at the LinuxCNC Wiki under Stepper Driver Timing. There are several drivers listed there. If that does not work, please email me or post a message to the LinuxCNC forums and someone will try to help you out. For a explanation of Step Time, Step Space, Direction Hold and Direction set-up, see section 5.2 of the getting started guide.
Step and Direction Pins for the Axis Joints
The book for the KRMx01 suggests that you have a Y-Axis and an A-Axis and that they are slaved together. Truthfully, there is only the Y-Axis and it has two motors running it. These motors are really two joints driving the same axis. That bears repeating. These two motors are really two joints driving the same axis. This is an important distinction to make. Later, when we delve into kinematics we have to understand what is meant by a joint and an axis. A joint moves something, like an axis or rotary table. An axis is something referenced by g-code. To make the distinction on the KRMx01, I will call the motors (joints), Y-Axis-Left and Y-Axis-Right. The left and right as when viewed from the front of the machine.
When I laid out my electronics drawer I simply laid out the drivers all in a row, and connected the step and direction pins to each one in line. The motor output of the drivers were soldered to the 4 pin microphone connectors attached to the plate in the back of my electronics drawer. You can see this on the previous electronics page. I did, however, want my axis to come out in a specific order in the back of the drawer. I wanted the X, Y-Left, Y-Right and Z to come out of the box in that order from right to left as looking from the connectors. So, I had to determine which pins were going to what controller and look to see if they were direction or step pins. Remember I told you that the Step and Direction pins on the controller were active low? Well I need to note that on the configuration sheet as well. You will notice that I am only documenting the step pins as active low logic. According to the specification sheet for the driver the direction pin (CW-) is high towards and low reverse. When we drive the screw we may need to invert these to get the proper direction on the motor. With this information ferreted out, I can fill in the chart below as follows:
|Configuration information for KRMx01 CNC Router for LinuxCNC|
|Latency Test||19732 ns ≈ (20 µs)|
|Step Time||15000 ns = (15 µs)|
|Step Space||15000 ns = (15 µs)|
|Direction Hold||20000 ns = (20 µs)|
|Direction Setup||20000 ns = (20 µs)|
|X Step (Active Low)||Break Out Board Pin 8|
|X Direction||Break Out Board Pin 9|
|Y-Left Step (Active Low)||Break Out Board Pin 4|
|Y-Left Direction||Break Out Board Pin 5|
|Y-Right Step (Active Low)||Break Out Board Pin 6|
|Y-Right Direction||Break Out Board Pin 7|
|Z Step (Active Low)||Break Out Board Pin 2|
|Z Direction||Break Out Board Pin 3|
That is all the electrical configuration we need to get started. Now we need to fill in the gaps for the mechanical components of each axis of the machine.
Before we can configure LinuxCNC to run the machine, we have to gather a bit more information. This information is the mechanical details of each axis. This includes things like, the number of steps per revolution of the motor, the thread pitch of the screws, if there is any gearing, and if we are using micro-stepping on the controller. For the KRMx01, if you have followed the plans, there is no gearing between the stepper motor and the screw as they are directly coupled. So motor teeth and lead screw teeth will both be set to 1 indicating there is no ratio in the drive train between the motor and the screw. The steps per revolution for the motors I am using is 200. (This is standard for most motors) I am using 1/2 stepping or put another way, it takes 2 microsteps to make one full step on the motor. Finally, the lead screws are 1/2-10 acme 5 start screws. What this means is that there are 10 threads per inch of screw, and the screw has 5 threads. two full turns of the screw will move the nut 1 inch, so 1 turn will move the nut .500 inch. The thread pitch is .500 inch. All axis are the same, so the information should look like the following:
|Axis||Motor Steps / Rev.||Driver Micro Steps||Motor Teeth||Leadscrew Teeth||Leadscrew Pitch||Turns / Inch|
|X||200 steps||2 steps||1||1||0.5 inch||2|
|Y||200 steps||2 steps||1||1||0.5 inch||2|
|Z||200 steps||2 steps||1||1||0.5 inch||2|
We now have all the basic information we need to set up LinuxCNC with a basic configuration. Later, when we add things like limit and home switches, a touch off probe and a PID to control the router we will be modifying this configuration and adding more to our notes.
Setting up LinuxCNC to run the KRMx01
With all the information gathered, we are ready to configure LinuxCNC to run the KRMx01 CNC Router. The simplest way to do this is to run the stepconf program under the CNC menu. Stepconf will take all the basic information about your machine and build the configuration files for you. Later if you want to make changes you can either run stepconf again, loading your existing configuration (if your making simple changes) or you can edit the configuration files with a text editor (If you are doing more complicated stuff) One gotcha that you need to be aware of using stepconf if if you have made any edits by hand to your configuration, then later load your configuration with the stepconf program, when it writes the data back to disk it will overwrite any changes you made. Below is a video walking through the process of setting up the KRMx01 using the stepconf program.
The video below shows the motors connected to the drawer and being jogged through the LinuxCNC control software. I also talk about motor direction and changing it in the controller. I want to apologize for the poor audio quality of the video.
With the basic configuration done and out of the way we are ready to connect the motors to the machine. One thing that I would like to mention here. LinuxCNC can control a wide range of hardware and systems. If you are building a machine with different stepper drivers, or using servos, a plasma cutter or just about anything you can imaging, there is a good chance LinuxCNC may be able to control it for you. I encourage you to read the documentation, visit the forums and wiki. It can be hard work but the end result is rewarding. Additionally, upgrades to the machine will be done separately from the mail build, but I will document them. I will most likely create a KRMx01 Upgrades section and put them under there.
See you in the next Chapter!!!
Chapter 13 - Installing Stepper Motors
With the Electronics drawer completed enough for the basic operation of the machine, I can now turn my attention to installing the motors on the machine. It is gratifying to be on the home stretch of this build. That doesn't mean there isn't a lot to do yet, but it does mean the machine is very close to moving under its own power and soon can be cutting parts for itself.
Materials needed to install the motors
Pretty much like every other chapter of the book, I start with gathering all the materials I will need to complete the chapter. Here you see the motors and the additional hardware to get them connected to the machine and leadscrews. The careful eye may have noticed that I do not have the same slotted couplers as called for in the book. Those couplers are no longer sold by cncrouterparts.com and instead sell these spider gear couplers.
Installing Motors to Motor Mounts
Zachary and i had to make a couple of slight modifications to the screws and motors to get them installed on the motor mounts. The 10-24 machine screws had to have the heads ground on the sides a little to clear the motor itself. The holes in the motors were too small for the screws and had to be enlarged to 3/16" for the screw to pass through. Other than this, the assembly went pretty smooth. The image shows the motors attached to the motor mounts.
Mounting the Motors to the Machine
Chapter 11 - KRMx01 Electronics
I am excited about this chapter. Getting the electronics installed just lets you know that you are getting close to a moving runnable machine. However, I have just a little bit more to do to get them installed. In the last chapter I built a small computer rack into the KRMx01 stand to house the computer and electronics. I had a convenient slide out shelf for the computer, but I wasn't quite so lucky about the compartment for the electronics. I did however have a pair of old slides I salvaged from an old computer and a piece of heavy sheet metal laying around, So I thought I would just make one.
Preparing the sheet metal
The first thing my son Zachary and I done was to install the rails into the rack and get a measurement between them. Next we laid out a box on the sheet metal that would fit the width and go as deep as the piece of sheet metal would allow. We made the box with 5" sides. The piece of metal that I had has been sitting around my shop since I built the gas fired crucible furnace and had a fair amount of surface rust. In the images to the left you will see Zachary using the air sander to remove the loose rust, and in the next you see the sheet metal prepared and ready to be bent.
Bending and riveting the box
For sheet metal you really need a brake. Unfortunately I don't have one so I had to improvise. I admit that the quality of the bends made from a break are far superior to what we done. We made our bend by clamping the metal between a pair of angle iron pieces and slowly working it up with a mallet and a ball peen hammer. The short sides were done with a piece of 3/4" MDF cut to width and clamped with a piece of angle on the outside and bent the same way. Finally, with the box bent to its intended shape, two pop rivets were put in place at each seam on the corners.
Painting the box
Before going any further it is time to paint the box before all the work that went into removing the loose rust goes to waste. I decided on black since most of the stuff I have for my little computer rack is that color already. The only drawback is that the black really shows off our poor bending job. But it will be tucked away in the rack and no one will be the wiser.
Installing the Rails
In order to use the drawer we bent, it will need rails attached to it and some cable management. I had a couple of options on attaching the rails. I elected to use sheet metal screws, but could change to 1/8" pop rivets if the pointy ends of the screws prove to be a bit to hazardous.
Installing the cable manager
The cable manager was salvaged from an old rack mount computer from back in 04 or 05. Now that I think about it, One of those old computer cases all gutted out may have made a decent cabinet for the electronics. I will have to keep that in mind in the event that this idea doesn't work out so well.
Making and installing the drawer front
The drawer for the electronics is just about complete. It lacks a front and a pull hand to finish it off. The front isn't really mandatory but will prevent the drawer from sliding too deeply into the rack and will give it a more finished look. I am using an old rack blank to make the drawer front. The notches in the corners are to clear the mounting for the slides. You can see the finished drawer front in the second image and in the first image above under the "Installing the cable manager" section above.
I should start this section with a small treatise on the difference between the electronics called out in the KRMx01 book and what I am using here. Although they are radically different in appearance, operationally they are much the same. The KRMx01 book specifies the NEMA 23, 4 axis electronic kit supplied by CNCRouterParts.com. This kit consists of (4) NEMA 23, 380 oz-in stepper motors, (1) 48V, 12.5A Power supply, (1) Gecko G540, 4 axis stepper motor driver and (4) cables to hook the motors to the driver. Now, before I start, there is nothing wrong with this kit and if you have not purchased your electronics yet, perhaps you should consider it. I, on the other hand, already have electronics that I purchased for my last CNC machine and plan to reuse them to save some money.
So I stated that what I am using looks radically different than the Gecko system, but is the same functionally. Let me explain. The Heart of the Gecko system is the Gecko G540 controller. This controller is actually a parallel break out board and 4 individual controllers all packaged into one nice little box. Really it is quite nice in that it takes less space and has all been configured internally for you. But aside from that, I cannot say any more about it because I have never owned one or read the manual for it.
My electronic system will be configured using a separate breakout board and four individual controllers, think of these five devices like the single G540 device. At least in the abstract. I will talk briefly about each component and its use before talking about connecting them up.
The Breakout Board
The Breakout Board, sometimes called a BOB, allows you to attach to a computer parallel port and bring those signals to the outside world. These discrete signals can be used for inputs and output to just about anything you can interface with TTL logic. There are a bunch of manufacturers of breakout board. Some better than others. Some with LOTS of features and other with the bare minimum. The particular breakout board I have is sold by CNC4PC. You can find more information about this card on the cnc4pc website. Some of the features of this card include pull up or pull down selection for inputs, buffered inputs and outputs and the ability to select either input or output on the bidirectional pins. Additionally, the card has an external enable pin that allows you to enable or disable all the outputs at once. This is like the charge pump on the G540.
Click the ICON to the left to download the specification sheet for the C10 Parallel Port Interface Card from cnc4pc.com. You may have different hardware, but will be helpful to follow along and adapting to your own hardware.
The Stepper Drivers
The stepper drivers I have are CW230 2-Phase Micro-stepping Motor Drivers. These drivers will run on an input voltage of 24V - 36V. They have an programmable output current of 0.9 - 3A. They will micro-step from 1, 1/2, 1/4, 1/8, 1/16, 1/32 and 1/64. Unfortunately, there isn't much data on pulse lengths for hold times, stepping and reverse. The only thing listed is that the step pulse is on the rising edge and that it must be greater than 10μs. This is where the better controllers give you more complete information. But, when I bought these, I was green and didn't know any better. I purchased these from buildyourcnc.com.
The Stepper Motors
The stepper motors I have are NEMA 23 type 60BYGH303-13. These are 8 wire motors that can be wired in series, parallel and unipolar. There are pros and cons to each set up. These motors are 1/4" shaft and are rated at 425 oz-in holding torque. These motors were purchased from buildyourcnc.com.
The Power Supply
The power supply that I have was purchased from buildyourcnc.com and is a 36V, 10A supply. The only label on it looks to be a company logo or something called HNR. The numbers on the supply are S-350-36. One issue I will run into is that it may not be enough to run four motors. But more on that later.
Mounting the electronics in the drawer
I tried to give some thought on mounting the electronic and another devices to the drawer to maximize space and still leave room for some expansion. Here you can see that I have cut a hole to allow the parallel port connector of the breakout board to be accessed from the outside of the drawer. I located the breakout board as close to the rear left of the drawer as I could. I have a second parallel port in my PC and if I decide I need to expand, I would have room to add another board next to this one. Also, the board is mounted to the bottom of the drawer by using plastic stand-offs to prevent it from being shorted by the metal drawer.
Next came the power supply and the stepper motor controllers. There is enough room that I can add an additional controller, a 5V power supply and perhaps a little more stuff. I am thinking I will get a second 36V supply like the one I have as well. With this supply I will have to wire the motors in series to reduce the current load, but I would rather wire them in parallel for the added torque. More on that later.
Next I cut a slot in the top of the back right portion of the drawer to bring in the AC power. This plug was salvaged from an old Genicom Printer that I scavenged stepper motors from way back in 2006 when I was first inspired to build a CNC router. I made sure to leave enough room to attach the cable manager to the drawer.
Wiring the electronics
Wiring the AC socket and power supply
To start the wiring, I need to get AC power to the 36V power supply. To do this I had to connect the Line, Neutral and Ground wires to the AC plug that I located on the back of the drawer. To find these, I first plugged a power cord into the socket and set my meter on continuity. If you are looking at the plug of the power cord and orientate the ground pin (The round pin between the two blades) to the bottom the neutral blade will be on your right. If the blades are different widths, it will be the wider of the two. The other blade will be the line (or hot) leg of the plug. Next I took my meter and held it to the ground pin of the plug and found the ground tab of the socket. I marked this tab with the letter 'G'. I done the same thing for the Neutral and Line blades of the plug and marked the tabs on the socket with 'N' and 'L' respectively. You can see the markings in the photo. Next I attached the wires to the plug. Most of these are color coded. Green is ground. White is Neutral. Black is Line. I connected them with crimp on insulated spade connectors. I wired with 18 AWG stranded wire that would be long enough that when I fastened them down would reach the power supply.
Next I re-attached the AC socket back on the electronics drawer. I routed the AC wires to the 36V power supply. These wires are neatly routed and fastened down to the bottom of the drawer with cable ties. The wires are then connected to the power supply with insulated fork connectors slid under the mounting screws. The black wire connects to the Line lug of the power supply. The white wire will connects to the Neutral lug of the power supply and the green to the Ground lug. The image shows the finished power supply wiring. One thing to note here is that this supply will only handle 3 of the motors I have when wired in parallel. The motors will draw 2.8 Amps each in parallel mode. I will have to add an additional supply for the fourth motor. More on this later.
Running power to the stepper motor drivers
Next power is run to the stepper motor drivers. These drivers can operate on an input voltage of 24V - 36V DC. The 36V positive voltage is run to the Vcc input of the driver and the Ground (-V) of the power supply id run to the GND (Ground) connection of the driver. Again, I have only run three of the drivers because running all four on this supply would exceed the current output of the power supply. More on that next.
Setting the DIP switches on the drivers
There are two sets of DIP switches on the stepper drivers. One set sets the maximum current the driver will be able to deliver to the motors and the other set of DIP switches set the micro-stepping of the driver. Setting these switches depends on two separate conditions.
Setting the current DIP switches. The CW230 drivers have the ability to deliver 0.9A, 1.2A, 1.5A, 1.8A, 2.1A, 2.4A, 2.7A or 3.0A to the motor. The setting that will be used depends on the current requirements of the stepper motor being used and its wiring configuration. The 425 oz-in motors that I am using have 8 wires and four coils. These coils can be wired in parallel, series or uni-polar. There are pros and cons of each wiring scheme. For example, wiring the coils in parallel will give you more torque and speed at the cost of higher current and more heat generated. Wiring the coils in series uses less current and generates less heat but at a loss of torque and speed. I have opted to run mine in parallel for the additional torque and speed. The data sheet for these motors claim that the motor will need 2.8A of current to drive it. So I set the DIP switches to handle 3.0A. Now because I selected to run the drivers at 3.0A I have to make sure that I don't try to use more power than my supply can handle. My supply reads that it is 36VDC and can deliver 10A of current. Now you know the reason I only wired 3 of the drivers to the supply. I will get an additional supply for the other driver and have power to spare in the event I want to add another driver for a 3D print head or rotary axis of some sort.
Setting the micro-stepping of the driver depends on the ratios of your drive train for the axis that the driver will drive. In the case of the KRMx01, the lead screw is 2 turns per inch, and the motors in single step mode have 200 steps per revolution. This means that in one inch of travel, there will be 400 steps to the motor. If we take 1 inch and divide by 400 we get a travel of 0.0025" per step. I want more resolution than this. If the driver is set to half stepping, then it will take 200 * 2 = 400 steps per revolution of the motor and double that to travel 1 inch. This means that each step moves 1" / 800 steps = 0.00125. That would probably be fine in all practical purpose, but I still want a bit finer resolution. And I could always bump back down if speed becomes an issue. So 1/4 stepping means that the motor will have 200 * 4 = 800 steps per revolution and 800 * 2 revolutions per inch. This calculates into 1" / 1600 steps = 0.000625 inch per step. This is where I will set my machine for. So the DIP switches are set to step at 1/4 step.
Wiring the I/O and motor wires
The next two images show the completed job and you can use them to follow along. Next we will wire the control logic to the stepper drivers and bring the wires from the stepper driver to extend past the panel so that panel mount connectors can be added to them.
The motor wires is a pretty simple job. The controller has a an output for two sets of motor windings labeled A+, A-, B+ and B-. Wires of Green and Black are run from the A+ and A- and wires of White and Black are run from the B+ and B- connector. These wires are left long enough to extend past the outside of the drawer so panel connectors can be soldered to them. (later) If you look at the specifications of the stepper driver, you will see that the maximum current the driver can deliver is 3.0 Amps. When selecting the wire to run your motors, keep in mind the amount of current they have to carry. You can find wire gauge charts on line. To safely carry the 3 amps that the driver can deliver, I will need in theory 24 AWG. But like anything, you always want to play it safe. ALWAYS select a wire at least twice the rated current you will draw. I am using 20 AWG wire which is rated for 11 Amps for chassis wiring. Smaller gauge wire will run hotter and produce more of a voltage drop than heavier wire.
The I/O connections for the stepper drivers is only a little more complicated. Looking at the specification sheet for the controller, we see that the inputs for step and direction are opto-isolated. This provides a layer of protection between the parallel breakout board and the drivers at the cost of some latency to switch the circuit on and off. To make these work the STEP+ and DIR+ have to have 5 volts on them. This can be done with a 5 Volt supply, or the breakout board if it is capable of supplying it. If you look at the specification sheet for the breakout board, you see that pins 2 through 9 on the breakout board can be setup as either inputs or outputs. I have the jumper set so they are outputs from the computer to the drivers. Another jumper allows you to set the common leads between the outputs at either GND or +5V. Because I need a 5V source on the drivers I will set the jumper to +5V.
Wiring is now a matter of running pins 2-9 on the breakout board to the controllers. I used the following to wire mine.
|PIN #||Controller Connection|
|Pin 2||STEP- for controller 1|
|Pin 3||DIR- for controller 1|
|Pin 4||STEP- for controller 2|
|Pin 5||DIR- for controller 2|
|Pin 6||STEP- for controller 3|
|Pin 7||DIR- for controller 3|
|Pin 8||STEP- for controller 4|
|Pin 9||DIR- for controller 4|
|+5V||STEP+ and DIR+ on all controllers|
It doesn't really matter if you wire them the other way, for example PIn2 to DIR- and Pin 3 to STEP- because the actual use of the pin will be set up in software. I would however pair pins together to each controller, pins 2 and 3 to a controller, 4 and 5 to a controller, etc. Additionally, since these are signal wires smaller wire size is acceptable here. I used the same 20 AWG wires that I used for the motor coils but smaller wire would have been fine here.
I had to order some additional components for my electronics drawer. For example, recall that the 36V power supply could not deliver enough current to run all four motors. So I have ordered another 36VDC supply and some other stuff. See below:
S-350-36 Power Supply
This is the same power supply as the one you see above. It is a 36 VDC supply rated at 9.7A. I could have purchased a larger supply and replaced the one above, but by looking on EBAY, I found this one. It was $34.00 with free shipping. It did have to ship from China though. Interestingly enough, it only took 8 days to arrive at my door. I will simply add this power supply to the drawer and run the other driver from it. I also now have the capacity to run an additional stepper driver if I like. You can download the specification sheet for this supply by clicking on the link above for the other supply.
S-100-5 Power Supply
My breakout board requires 5VDC to enable it. I had a lot of options here that I could have done. For example, I could have used a wall wart or taken the 5VDC from the computers USB cable. Instead, I just bought this supply, 5VDC, 20A to power the board and additional cooling fans that I plan on adding to the drawer. This leaves me with enough extra capacity that I can run other electronic equipment. For example, a TTL circuit or something. Even if I don't use the extra capacity, this was a good buy from EBAY for $18.99 with free shipping. It was shipped from the U.S.
4 Pin Chassis and in-line Mic Connectors
A lot of folks use 9 pin D connectors for their stepper motors, and if you have gecko hardware, the drivers have them on there to use. Now these are a relatively cheap solution to be able to remove a motor and you can get pre-made cables at different lengths. I decided to go with something a little different and will be using 4 pin microphone connectors like you find on CB radios. These cost a little more but your less likely to bend a pin and they have a higher current carrying capacity. The chassis mount males will fit firmly to the drawer and the females have a threaded collar that attaches to the male connectors. The are also keyed so they cannot be connected wrong. I purchased these from CB world and the information for them is: Code: CBC4MX (4 pin in-line microphone connector) at $3.50 each and Code CBC4PX (4 pin panel mount microphone connectors) at $4.50 ea. Here is a link to the CB World website.
2 PIn Chassis and In-line Mic Connectors
These are basically the same thing as you see above but with only 2 pins. I will use these to run my signal wires for limit and home switches and a probe. I purchased 5 pairs of these. I do not know how many at this time I will be using. I could have used 1/4" or 1/8" audio jacks and would have been cheaper, but these are a little more rugged and will go well with the motor connectors. I purchased these from Vetco Electronics and the parts are GL-A286C (2 pin male chassis mount Microphone Connector) and PH-61-602B (2 pin female in-line Microphone Connector). The price for both of these are the same at $3.99 each.
Wiring in the new power supplies
Here you see the two new power supplies have been mounted and wired up. When I wired the first supply, I used 18 AWG wire, but have changed it out to 14 AWG because of the current load that could be produced by the supplies. When I examined the data sheets for the supplies, the AC input current for the S-350-36 supplies was 6.5 Amps and the AC input current for the S-100-5 supply was 1.9 (2) Amps giving a total of 15 Amps. Now this would be the current if all three supplies were dishing out the maximum DC current they can produce. 18 AWG has a chassis rating of 16 Amps putting it at the maximum. The solution was to double the input current and then find the size wire that could handle that current. Looking at the wire chart, 14 AWG can handle up to 32 Amps in chassis wiring.
The mounting plate for the microphone connectors
I have to give all the credit to my son Zachary for this part of the project. This plate will be used to mount the chassis mount microphone connectors pictured above. Space was allocated for up to 12 connectors, although we only purchased 9. Tape will be placed over the unused holes so as not to disrupt air flow when we add the fans and cooling vents. My wife had surgery and I have nor had any time to mess with the project, but Zachary picked up the torch and ran with it. The holes are spaced on 1.5" centers to leave enough room for my big hands to screw on the in-line connectors. This probably could have been reduced to 1.25" and worked fine. Good job son!
Wiring the motor outputs to the connectors
To start, the 2 Pin chassis mount connectors were installed in the bottom of the panel. These will be used later to bring limit switches, probe, and other signals out from the electronics drawer. The (4) 4 Pin connectors have the A+, A-, B+ and B- connections soldered to them and are attached to the stepper controllers. It really doesn't matter how you wire these but you should be consistent. I wired A+ to pin 1, A- to pin 2, B- to pin 3 and B+ to pin four. I also made a not of it and when I make the top to the drawer, I will print my notes out and glue them to the lid. This is a good way to remember what is what way down the road when you have to figure things out if it breaks. The second image shows the in-line connectors attached to the plate. I done this mostly so they would not get lost until I was ready for them. But this gives you a good idea of what the finished product would be. Just image the wires running from these connectors to the motors, switches and what have you. Finally, the last image gives you a good view of the drawer up to this point.
Next, I will add a pair of 5 VDC fans and some vents. To finish the drawer I will make a top cover. This top cover is necessary so that air will be pulled across the electronics to help keep them cool. The fans are ordered but have not arrived yet.
The cooling fans
The image to the left is of the two 5 VDC fans i purchased from Jameco Electronics. According to the site, these fans can deliver 16.6 CFM (cubic feet per minute) of air movement and draw 0.37 Amps. The fans are 60 mm (about 2.3 inches) square and 15 mm (about 0.6 inch) thick. To determine the air exchange rate I must take the dimensions of the electronics drawer and convert it to cubic feet. My drawer roughly measures 17" wide x 22" deep x 5" tall. Multiplying these together gives me the cubic inches of the drawer. 17 * 22 * 5 = 1870 cubic inches. To convert cubic inches to feed I need to divide this number by (12*12*12 = 1728) 1728 cubic inches to the cubic foot. So the drawer is 1870 / 1728 = 1.082 cubic feet, or roughly 1.1 cubic feet. Now the fans each deliver 16.6 CFM x 2 = 33.2 CFM. So in theory, the fans will replace the air 33.2 / 1.1 = 30.182 times per minutes or roughly 1 per every 2 seconds. That seams like a lot of air, but truthfully it will be something less than that because of the restriction of the air inlet and filter. The idea here is to get enough air flow through the drawer to keep the enclosed electronics as cool as possible. I may have been able to get by with a single fan but I think I will stick with overkill.