Chapter 18. Software and Testing

Now that you have your motors attached to your CNC machine, it's time to test! We'll start out by telling you where to download the special software you'll be using to control the CNC machine. Next, we'll show you how to properly configure the software. And finally, we'll give you some simple tests you can perform to verify you've wired up everything properly and that your CNC machine is ready for bigger and better things.

CAD, CAM, and Control Software

There are three types of software that you'll be using with your CNC machine. The first is CAD (computer-aided design). This is specialized software that allows you to design two- and three-dimensional objects for the CNC machine to cut, drill, and perform other actions on. The second is CAM (computer-aided manufacturing). CAM software takes the design you created with the CAD software and converts it into a "language" called G-Code. This G-Code is then used by the final type of software, Control. Control software is the actual application that talks to your CNC machine; it takes the G-Code from the CAM software and uses it to send the proper electrical signals (via the breakout board-see Chapter 6) to the three motors.

This is a very simplified explanation of the three types of software- you'll find that in this chapter we haven't even scratched the surface when it comes to providing comprehensive details and explanations on these three types of software.

We cannot predict all the uses you might have for your CNC machine; your imagination and skills with the CAD software are really the only limit to what you can do (and your CNC machine's capabilities must be factored in). While we cannot provide detailed instructions on the use of CAD and CAM software, we are happy to tell you that the Internet is filled with discussion, photos, trial software, and more. There are numerous companies that sell CAD and CAM applications, and there are many free and/or open source alternatives. You'll probably wish to read some reviews, participate in some web discussions, and get a feeling for what software is out there that will be best suited for your purposes.

As for Control software, the same situation exists-there are free and pay-to-use software solutions when it comes to Control applications. Fortunately, we're able to provide you with a link to download a fully functional Control application that won't cost you a penny. It does have some limitations (we'll talk about those), but for the purposes of testing your new CNC machine and performing some basic tasks, you may find that the free version is all you'll ever need.

The Mach3 Control Software

The Control application we're going to be referencing in this chapter is Mach3. It's from ArtSoft USA and is available in a free version and a commercial version. Both versions are identical, but the free version is going to limit you to 500 lines of G-Code; the version you can purchase removes this limitation (although it does have an upper limit of 10,000,000 lines of G-Code).

Figure 18-1 shows a screenshot of Mach3's main control screen.

The main screen of Mach3

Figure 18-1. The main screen of Mach3

The first time you view the main screen of Mach3, you're likely to be a little intimidated; there are a lot of buttons, readouts, and other elements crowding the screen, and none of it is likely to be familiar to you. But don't worry-fortunately, there are only a handful of things you need to configure in the software to get your machine up and running. (ArtSoft USA provides a thick manual on Mach3 that you are welcome to read at your leisure-plan on setting aside a few hours or more!)

Downloading and Installing Mach3

Before we can show you how to configure the software, though, you need to download a copy and install it. So, open up your web browser, visit www.machsupport.com, click the Downloads menu, select Mach and LazyCam, and follow the instructions on the page that opens to download the installation file.

Note

Be sure to download the lockdown version, not the development version. Also, if you're running the 32-bit version of Windows Vista, be sure to download the memoryoverride.zip file on the same page. Click the Vista README link for the extremely simple instructions on installing the patch. This will make a registry change in Vista that will allow you to run Mach3.

After downloading the installation file, double-click it and follow the instructions to install it. When you get to the screen for creating a profile (shown in Figure 18-2), just click the Next button to skip it.

Skip this step when installing Mach3.

Figure 18-2. Skip this step when installing Mach3.

The installation will also allow you to install LazyCam, a CAM application that can work hand in hand with Mach3 once you have a CAD file that needs converting to G-Code. You can choose to install it or not; we recommend going ahead and installing it as it doesn't take much hard drive space and you may find it useful for generating G-Code.

At some point in the installation, Mach3 will want to install a parallel port driver, as shown in Figure 18-3. This is normal, so click the Next button and follow the instructions to allow Mach3 to install this driver.

Let Mach3 install the parallel port driver.

Figure 18-3. Let Mach3 install the parallel port driver.

When the installation is complete, restart your system and when brought back to your desktop, you'll have a handful of shortcut applications added to your desktop. The shortcut icon that we'll be using is titled Mach3Mill-go ahead and double-click that icon to open Mach3.

Configuring Mach3

We know you're anxious to take your CNC machine for a spin, so we'll get straight to the key configurations.

If you haven't opened Mach3 yet, double-click the Mach3Mill icon on your desktop. You'll see a screen similar to Figure 18-1 appear. The Reset button will be flashing, and you'll see a large collection of readouts. There aren't that many configurations you'll need to perform, and we'll walk you through each of them.

Ports and Pins

Click the Config menu in the top-left corner of Mach3 and select Ports and Pins. A window like the one in Figure 18-4 will open, with the Port Setup and Axis Selection tab selected.

The Port Setup and Axis Selection tab of Mach3

Figure 18-4. The Port Setup and Axis Selection tab of Mach3

The only setting you really need to be concerned about on this screen is the Port #1 box in the upper-left corner of the window. Look at the value for Port Address. In Figure 18-4, the value is 0x378-it's a hexadecimal value. You need to make certain that this value matches the port value for your parallel port.

To do this, open the Device Manager (in Windows), expand the Ports listing, right-click the LPT port, and select Properties. The port value should also be 0x378. If it isn't, change the value for Port Address to match your LPT port's value.

Motor Outputs

Next, click the Motor Outputs tab, as shown in Figure 18-5. Verify that the X Axis, Y Axis, and Z Axis rows all have a green check mark in the Enabled column.

Verify that the three axes are all enabled.

Figure 18-5. Verify that the three axes are all enabled.

Next, change the values under Step Pin# and Dir Pin# as follows:

For X Axis

Step Pin#: 2

Dir Pin#: 3

For Y axis

Step Pin#: 4

Dir Pin#: 5

For Z axis

Step Pin#: 6

Dir Pin#: 7

These values correspond to the terminal port numbers found on the breakout board. Remember back in Chapter 6 when you wired up all three stepper motor drivers to the breakout board in the "Wiring Motor Drivers to the Breakout Board" section. The two wires on the breakout board's terminal ports 2 and 3 connected to the stepper motor driver for the x-axis motor. The y-axis stepper motor driver connected to terminal ports #4 and #5, and the z-axis stepper motor driver connected to terminal ports #6 and #7. You use the Motor Outputs tab to specify the port numbers that Mach3 will use to communicate with a specific motor.

Input Signals

Click the Input Signals tab next. Scroll down the list until you find the EStop listing, as shown in Figure 18-6. Change the Port# value from 1 to 0. (Chapter 19 covers upgrades that you may wish to include on your machine; we'll tell you how to add an emergency EStop button that can stop the CNC machine from running when you press the button-after you've added the EStop button, you'll want to change this value back to 1 to indicate it's installed and working.)

Turn off the EStop for testing.

Figure 18-6. Turn off the EStop for testing.

Click the OK button when done to close this configuration window.

Motor Tuning and Setup

Next, click the Config menu in Mach3 and select Motor Tuning. You'll see a window like the one in Figure 18-7 open.

A single screen is used to easily configure all three motor settings.

Figure 18-7. A single screen is used to easily configure all three motor settings.

There are three buttons of importance on this window: X Axis, Y Axis, and Z Axis. You must click a button (e.g., Z Axis) to set specific values for that motor. After setting any values, you must always click the Save Axis Settings button in the lower-right corner. (The button will remain disabled until you make a change to the x-axis motor, which is the default motor selected when you first select the Motor Tuning configuration tool.)

If you're using the motors we've recommended (see Chapter 6) as well as the microstep setting for the stepper motor drivers (also covered in Chapter 6), then you'll configure the following fields for the x-, y-, and z-axis motors as follows:

 

Steps per

 

Velocity

 

Acceleration

 

X Axis

 

10400

 

10

 

7

Y Axis

 

10400

 

10

 

7

Z Axis

 

10400

 

10

 

7

Again, always be sure to click the Save Axis Settings button after making any value changes for a motor.

Note

How did we obtain these values? The Velocity and Acceleration values can easily be changed by you, but these values were our test values that worked best for the motors we selected for our CNC machine. The "Steps per" value, however, requires a simple bit of math. You can use the following formula to calculate the "Steps per" value if you're using a lead screw with a TPI (threads per inch) value other than 13 or a microstep setting other than 1/4:

  • Steps per value = 200 * TPI * (1 / microstep)

  • So, our value was calculated using the following: 200 * 13 * 4 = 10400.

Click the OK button after you've configured the proper values for all three motors.

Configuring the Default Motor Units

This is the easiest configuration of the bunch; click the Config menu and choose Select Native Units-you'll be warned that this setting is only for configuring the motor units-click OK, select MM (millimeters) or Inches, and then click the OK button. (For our machine, we're using Inches.)

Testing Your Machine

Now it's time to test your machine! For the initial tests, we recommend you not turn on your router. There's no need to have it powered since you're not going to be cutting any material yet. You just want to test that the motors can move the router along the three axes-up/down, left/right, and backward/forward.

Connect your computer to the breakout board using a male-to-male 25-pin cable. You'll attach one end to the breakout board and the other end to your computer's parallel port.

Now plug in the power to the breakout board and the power supply. If you listen carefully, you may hear all three motors engage; it's nothing more than each motor powering up.

Open Mach3 and click the MDI (Alt-2) tab, as shown in Figure 18-8 (MDI stands for manual data input). You're going to tell various motors to move by actually typing in G-Code on this screen.

You can test your CNC machine using the MDI tab.

Figure 18-8. You can test your CNC machine using the MDI tab.

The first thing you need to do is click the Zero X, Zero Y, and Zero Z buttons to reset the initial values for your motors to zero (as pictured in Figure 18-9).

Set all the motors' starting position values to zero before testing.

Figure 18-9. Set all the motors' starting position values to zero before testing.

Now, if the big Reset button is blinking (see Figure 18-10), click it; it should stop blinking. Just above the Reset button is the Input box. Click inside the text field and type in G00 X1 (those are zeroes after the letter G). This is a simple bit of G-Code. When it is executed, Mach3 will instruct the x-axis motor to spin, and the router (and both the z-axis and y-axis frames) will move forward (or backward) a total of 1". Press the Enter key to execute the command.

Use the Input field to manually enter G-Code for testing.

Figure 18-10. Use the Input field to manually enter G-Code for testing.

Run a similar command-G00 X-1-and press Enter. Did the router move in the opposite direction 1"?

Can you guess what this command is for: G00 Y1? Run it and see if you're right. It should move the router along the y-axis a total of 1". But did it move to the left or right? Make note of this, as we'll discuss direction and how to change it shortly.

For the last test, you're going to execute G00 Z1-but before you do that, make sure that your router's collet (or bit if you've inserted one) is not close to the worktable surface. If it's too close to the surface and you execute the command, the z-axis frame may move down and the router may gouge the surface. If it's too close to the surface, power down the breakout board and the power supply, and manually rotate the z-axis motor in the direction that causes the router to move up (away) from the worktable. Power up the electronics once the router is a safe distance above the worktable.

Note

You need to power everything down because when the motors are powered, you will not be able to turn them by hand. And don't try-you can easily damage the motor.

Now execute G00 Z1 and make note of whether the router moves up or down 1". Executing G00 Z-1 should move the router in the opposite direction.

Before we test out our G-Code skills on a real piece of wood, however, let's talk about direction of movement for a moment. When you issue a G-Code command of G00 X3, do you want the router to move toward the front or the back of the table? What about the y-axis? If you execute G00 Y2, do you want the router to move to the left side of the worktable or the right side?

There is no industry standard for this type of configuration. Testing will allow you to decide what works best for you. Some prefer to configure their motor settings so that moving the router to the front of the table is a negative G-Code value (G00 X-1); some prefer to specify that moving the router bit down into a workpiece is a positive G-Code value (G00 Z4). This is one of those areas that will become clearer as you learn more about CAD and CAM software and get experience using your machine.

Tip

We do have a suggestion for the z-axis. If you consider the worktable to be where z has a value of 0, then anything below the table will have a negative value and anything above the table will be positive. When thinking about drilling into a workpiece, you can use this concept to remember that moving down will be a negative G-Code value (G00 Z-1) and moving up will be a positive. G00 Z-.5 is less than -1, so the router bit will be closer to the surface of the workpiece.

Let's say that when you issue a G-Code command such as G00 Z1, the router moves down, not up. How do you change the motor settings so the z-axis motor rotates in the opposite direction and makes G00 Z1 move the router up? Easy. Within Mach3, click the Config menu and choose Ports and Pins. Click the Motor Outputs tab, as shown in Figure 18-11. To change a motor's direction, simply change the default value in the Dir LowActive column. Notice in Figure 18-11 that the z-axis motor's Dir LowActive column now has a green check box in it. This simple change will cause the z-axis motor to spin in the opposite direction. Now the G-Code command G00 Z1 will make the router move up, not down. (You can make this change on any of the motors.)

Changing a motor's direction of spin is quick and easy.

Figure 18-11. Changing a motor's direction of spin is quick and easy.

Testing the Router

One of the first things we did once we figured out how to control the directions of movement for the router was to map out cutting a square using manual G-Code entry. Here's the code we entered, one line at a time (after zeroing all the motors and setting the router bit's tip 1" above the piece of wood we clamped to the worktable):

  • G00 Z1.25: This moves the spinning router bit 1/4" into the wood to begin cutting.

  • G00 X2: We're going to cut a 2" square so this moves the router forward 2".

  • G00 Y2: This cuts a 2" line by moving the router to the right.

  • G00 X-2: This cuts a 2" line by moving the router backward 2".

  • G00 Y-2: This cuts a 2" line by moving the router to the left and finishing the square.

  • G00 Z-1.25: This moves the router bit up and away from the material.

Try it! Be sure to use a piece of test wood that is 1/2" thick (or greater) and big enough to allow the router bit to cut the square with plenty of spare material surrounding it. Figure 18-12 shows the results of our first test.

Our first test allowed us to cut a square 1/4" deep into the plywood.

Figure 18-12. Our first test allowed us to cut a square 1/4" deep into the plywood.

School Starts

You're done . . . but only with building your CNC machine. Now comes the real fun: cutting, milling, drilling, and more. But this is going to require some more learning on your part. Our goal with this book was to give you the instructions for building your own CNC machine, and we hope we've accomplished that task and you're happy with the results.

You're going to need to learn a bit more about CAD-designing those things you wish to cut out and make using your CNC machine. CAD is one of those skills that you can spend as little or as much time developing as you desire. You'll want to investigate different CAD applications, and a good place to start is www.buildyourcnc.com/book.aspx and the forum we've set up for posting your questions, comments, pictures, and more. Internet searches are also a good way to find what you need, but be careful not to get overloaded with the sheer volume of information out there.

CAM software is yet another area you'll want to investigate; unless you enjoy entering G-Code by hand like we did earlier in the testing phase, converting your CAD designs into G-Code is just one of the functions of CAM software, and you'll want to do your research and test out various applications to find the one that works best for you.

Mach3 is free to use, but don't exceed the 500 G-Code line limit. The application is so good, however, that we encourage you to support the Mach3 application developers by purchasing the full version. You'll gain access to future upgrades of the product as well as tech support, but more importantly you'll be helping to keep Mach3 free to use for those newcomers to CNC who are just starting to experiment with their own machines.

What's Next?

To close out the book, Chapter 19 will give you a few suggestions for making your CNC machine more safe to operate as well as some references to check out for learning how to use your new machine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset