|
3.2. Tutorial 2 turning
The purpose of this tutorial is to teach the basic concepts of how to use CNC Simulator Pro turning. We are going to make a very simple part, taking a few rough cuts, fine cuts, and drilling a hole.
This is the part we are going to make:

This tutorial is made in millimeters, so the first thing we have to do is to ensure we have millimeters set as units in the program settings. Click Settings – Program Settings from the main menu.

While we are at it, set all other settings like in the picture above. Click OK.
Now what we have to do is to load a machine for the project. Click on the Open Machine button
to show the Select Machine dialog. You can also click File – Load Machine from the main menu.

Click on the Turning button.

Uncheck the Load example checkbox and click on the Turning Center machine, then click the Load button.
This is how your CNC Simulator Pro window should look like now.

OK, now we need to create a workpiece for your project. Press F2 to open the Inventory Browser where we keep all our tools, workpieces, materials, and offsets.
Click the Lathe Workpieces tab.

If you have not previously created any workpieces, this is what you will see.

Click on the Add New button to add a new workpiece.
Enter 50 for diameter, 100 for length, the name for the workpiece, and ignore all other settings.

As you can see on the blue/gray bar below the workpiece picture, our index for this workpiece is one. Yours might be another index if you already had workpieces stored.
OK, great! Now, let's start writing the CNC program!
We start with a special CNC Simulator Pro command to put the workpiece we just created in the chuck. It is called $AddRegPart. You can either type in the command by hand, followed by the index number for the workpiece, or take a shortcut by clicking the Insert at cursor button. This button will automatically put the command in the editor.

Put the cursor at the end of the first line and press enter. This is to ensure that the next command we insert will end up on a new line.
Type in $AddRegPart 1 or click "Insert at cursor".
The next step is to select a tool to use for our rough cuts.
Press F2 again to open the Inventory Browser. This time we are going to stay on the first page (Tools). Click on the Embedded lathe tools option.

We are going to use one of the fixed embedded tools that come with the CNC Simulator Pro. Actually, we are going to use the first one, so you could just go ahead and click the Insert at cursor button again.

This is what you should have in the editor at the moment:

Normally, to select a tool, you use only the code letter T but as this is an embedded tool, we use ET as in “Embedded Tool”. If you create your own tools later, you will use only T for tool selections.
Note that ET is a simulator-specific code and it is not used in real machines.
Besides selecting the tool, we need to execute the actual tool change by putting the code M06 after the tool selection. Note, when you press M (or G or any other recognized code), a list of available codes will pop-up.

Either, type 06 or select M06 from the list by using the mouse or the arrow keys on the keyboard.
OK, by now we are all set to start cutting the workpiece.
Click the Reset the view button to zoom in on the workpiece.

Zoom in a bit further by clicking on the 3D view and roll the mouse wheel away from you.
Click the Start simulation button to execute the commands we have entered so far.

Now, this is what the 3D view should look like:

As you can see, the workpiece that we made and the tool we selected are in place.
Let's move the tool in position for the first rough cut by using the G00 code.
Note! The G00 command is a rapid positioning command that moves the tool quickly to the specified position at the maximum speed available.
When G00 is used, the machine will move as fast as it can from the current position to the specified position without regard for the path taken or the material being cut. This command is used to move the tool quickly and efficiently between two points without performing any cutting operations.
Important! CNC Simulator Pro automatically puts the zero point at the right plane of the jaws. The distance from the plane to the spindle is 23 millimeters. That means that the right end of our 100 mm long workpiece is at (100-23) 77, in the Z-axis. This rule goes for all lathes in CNC Simulator Pro. Always take the 23 millimeters into account!

We want to take away 10 millimeters from the diameter per cut (5 mm material), so we should put the tool on X40 as our initial diameter is 50. Let us also put the tool on Z 80, so we have some space (3 mm) between the tool and the workpiece end plane.
Type G00 X40 Z80 and press Enter.
Fine, now let's take the first actual cut.
Type G01 Z50 F250 S1000 M04 M08 and press Enter.
Note! G01 is a G-code command that is used to move the tool along a straight line from the current position to a specified target position at a specified feed rate. This is known as a linear interpolation or a linear move.
If you move the mouse over the codes in the block above, you will see tooltip windows explaining what they do.

OK, now we back out the tool a bit before going with fast traverse back to Z80.
Type X44 Z52 and press Enter.
Note that we did not have to write G01 again as it is already activated. The code is modal.
To help us see clearly how the tool moves, we can turn on the toolpath display. Click on the glasses button and check the Feeds and Rapids checkboxes.

Now if you simulate, you will see feed movements (G01-G03) in green and rapids (G00) in red.
We continue by going back to 80 in the Z-axis with rapids.
Type G00 Z80 and press Enter.
We then go down to diameter 30.
Type X30 and press Enter.
Type G01 Z60 and press Enter.
Again, we back off a little.
Type X34 Z62 and press Enter.
Now, we need another tool for the fine cut. Press F2 to open the inventory browser again, then select Embedded lathe tools and click the right arrow to go to the second tool.
Click the Insert at cursor button.

Without pressing Enter, write M06 to execute the tool change, then press Enter.
After a tool change, the tool is at the tool change position of the machine and we need to go back to the workpiece.
Type G00 X28 Z80 and press Enter.
Enter the following blocks to finish the fine cut:
G01 Z59
X38
Z49
X45
X50 Z45
This is how your program should look by now:


Back off again as we did earlier.
Type X54 Z47 and press Enter.
Time to select a drilling tool to drill the hole.
Press F2 on the keyboard, click Embedded lathe tools, and browse to tool number 17 (drill diameter 10 mm).
Click the Insert at cursor button.
Enter M06 and press Enter.
We will now take the tool back from the tool change position and place it in the center of the workpiece.
Type G00 X0 Z80 and press Enter.
We are going to use a canned drilling cycle to make the hole.
Type G81 Z60 R78 and press Enter.
Type G00 X100 Z200 and press Enter.
Type M30 to end the program and press Enter.
Excellent! We are done. Simulate the program and then click the cutting (knife) button.

Check the Show inside checkbox.

The final program:
