Tutorial 1 – getting started with the CNCSimulator Pro

Made for Version 1.0.6.5 or later.

The purpose of this tutorial is to learn the basic concepts of how to use the CNCSimulator Pro from scratch. We are going to make a very simple part, milling a slot and drilling four holes on a 100 x 100 x 20 millimeter workpiece. For simplicity we are going to ignore radius compensation and we work only in absolute coordinates.

This is the part we are going to make:

image

image

First of all, we need to set millimeters as units and load an appropriate machine for our project.

From the main menu, select Settings and click on Settings.

Ensure that you have millimeters selected as this tutorial is made in millimeters.

image

Click OK to close the settings dialog.

Click File – Load Machine from the main menu or click the open machine button image 

In the dialog that shows, please deselect “Load demo”. Then click on the “Milling Center” button.

image

Fine, now let’s get started by defining our workpiece. Press F2 on the keyboard to open the Inventory Browser.

Click on the “Mill Workpieces” tab at the top of the dialog.

Click on the green plus button to add a new workpiece.

image

In the “Workpiece Name” field, enter a name for your new workpiece, let’s call it “Tutorial1”.
Enter X, Y and Z size as 100, 100 and 20.
Take a mental note of the workpiece index number. Here we did not have any workpieces before in the registry, hence the index number became 1. In your case, the number could be different. See the red arrow.

image

Ignore the rest of the settings and click OK to close the Inventory Browser.

Now we need to call up our new workpiece from the program. We do that by using the command $AddRegPart followed by the workpiece index number (we use 1)  and the table displacement values.

We are going to put our new workpiece 30 millimeter from the machine zero in both X and Y. The machine zero is placed near the lower left corner of the machine table and it is marked by a cross symbol (could be somewhat hard to spot).

image

To call up our workpiece number one (or your index number if different) on X30 Y30 from the machine zero, we write $AddRegPart 1 30 30

Now you can go ahead and click on the Play button image (simulation start) to see that your workpiece shows up on the table.
In the lower toolbar, click this button image to zoom in on the machine table.

image

At this moment, please note that you can click in the simulation window with the left mouse button and drag the mouse around to rotate the view. If you click with the right mouse button and drag you will pan the view. Also please note that you can roll the mouse wheel to zoom in and out.

Ok, let’s get started with the actual CNC program!

As we moved the workpiece in on the machine table and away from the machine zero our lower left corner on the workpiece now is at X30 Y30. That is not very practical so let’s move the programming zero point to X30 Y30 Z20. This will result in a zero point in the upper (Z) lower left corner (XY) of the workpiece.

We move the programming zero point by using the G-code G92. (This can also be done from a zero point registry using G54 to G59 but that is out of scope of this tutorial).

Type G92 X30 Y30 Z20 in the editor.

Click on the Play button again and note how the zero point moves to the corner of your workpiece.

image

Now, we need tools to mill the 10 mm wide slot and drill the diameter 10 mm holes.

Again, press F2 on the keyboard to open the Inventory Browser (or select Settings – Inventory Browser from the main menu).

In this tutorial, we assume you have no previous custom made tools, if you do, please add these two new tools at the end of your list and use the tool index you get.

Select “My milling tools” and click on the button with the green plus icon, the Add button.

First we will add the tool to mill the slot. Select a flat tool tip, enter 10 as diameter and 50 as length. Enter the name of the tool “Tutorial1 flat mill”. Ignore all other settings and click OK.

image

In our case, this new tool will get tool index number 1 (take a note of yours).

Now, we repeat the procedure adding the drilling tool. Click the Add button again.

This time, select a pointed tool tip and enter diameter 10, length 50 and tip angle 80 degrees. Name it “Tutorial1 drill”. Click OK.
Click on the X in the upper right corner of the Tool Browser to close it.

image

Congratulations! Now we have a workpiece and tools and can start programming the rest of our part.

To call up our new milling tool we use T1 (or your tool index number) followed by M6 to tell the virtual machine to go to its tool change position and execute the tool change.
T1 M6

image

Next, let us move the tool to the start position. We have decided to use the lower left corner of the slot as the start where we will drill down into the material.

We use G-code G0 to move with rapid speed to the position stopping 2 mm over the workpiece.
G0 X15 Y15 Z2

Now, press Play to see that the positioning works.

image

We now enter the G-code G1 for feed movement down to working depth. We also need to start the spindle (M3) and set the Feed rate (F) and spindle RPM (S).
G1 Z-5 F250 S2000 M3

 image

Now we will move the mill to the start point of the arc, there is no need to type G1 in this block as the code is modal meaning it will remember the G1 code from the previous block (“block” = line).
Y70

From now on, feel free to click the Play button at any time to check the simulation.

Now, let’s program the clockwise arc movement. To do so, we use the G2 code followed by the X/Y coordinates of the endpoint and the I/J coordinates of the relative center point (I stands for incremental distance from starting point to center in X and J is the same in Y).
G2 X30 Y85 I15 J0

image

Great! Let’s enter the rest of the blocks to finish the slot.
G1 X85
Y15
X15

How about that? We are back to where we started. Let’s go up in Z to a safe position and then change tool for the drillings.
G0 Z2
T2 M6

image

Make sure you use your tool index after T for the drilling tool we created.

Now we can come back from tool change position and put the drill over the first hole.
G0 X30 Y30 Z2

Next, we will start a drill cycle. We only need to start it and then it will drill on each position we program until we tell it to stop. For this we use a common drill G-code called G81. We tell the cycle to drill to a total depth of 15 mm and a start depth of 1 mm above the workpiece. As we have changed tool, we need to start the spindle again (M3). This time, let us also use coolant water (M8) to not overheat the tool.
G81 Z-15 R1 M3 M8

Now we can just position over each hole center and the drilling will start automatically.
Y70
X70
Y30

Now we need to end the drilling cycle using the G80 code.
G80

Finally we go up in Z and the write M30 to end the program.
Z50
M30

image

Congratulations! You have done your first CNC program in the famous CNCSimulator!

The complete program:

$AddRegPart 1, 30, 30

G92 X30 Y30 Z20
T1 M6
G0 X15 Y15 Z2
G1 Z-5 F250 S2000 M3
Y70
G2 X30 Y85 I15 J0
G1 X85
Y15
X15
G0 Z2
T2 M6
G0 X30 Y30 Z2
G81 Z-15 R1 M3 M8
Y70
X70
Y30
G80
Z50
M30

Comments are closed.