V1.0: November, 2018 (KN)
V2.0: February, 2019 (KN) Updates to Simulator: 1. Ability to change the G code in the G pane, then rename .ngc file, save and download new file.
2. Ability to move non-sequentially through the code by highlighting the line of the G code.
3. Ability to store a tool length offset without pressing enter.
4. There is now a camera parenting option which more clearly shows that the tool is not moving in Y. There is now a Base option that will always focus on the machine origin, and demonstrates that the trunnion is actually what is moving.
This document covers how to use the Pocket NC Simulator which is found at https://sim.pocketnc.com/. Note that some browsers are not supported. We recommend using the Chrome browser.
If you have any questions about how to use this tutorial, please contact us here.
Section 1: Overview of Functions
When you navigate to sim.pocketnc.com you will see the screen shown in Figure 1. First, a brief overview of the functionalities of the components of the Simulator outlined in colored boxes in Figure 1, moving counterclockwise from the upper left hand corner of the figure below:
- The G code and Summary panes are shown in the purple box. When on the G code pane the line-by-line G code is shown. The highlighted line tracks with the line of code that is running on the Simulator. In the left hand column of the G code pane you’ll notice a caution symbol and an information symbol. To see the feedback on lines with these symbols either hover over the line in this view, or click over to the Summary pane and see the explanation.
- The yellow box outlines the playback controls. In this panel you can play, pause, or stop the Simulator. In the upper right of this panel you can increase or decrease the speed at which the Simulator moves through the program. On the progress bar you can skip ahead in the program by dragging the circle forward. In the upper left corner of the playback control panel you can press the button that looks like a page and hide the G code and Summary pane.
Figure 1: Pocket NC Simulator highlighted functions
- The green box outlines the digital readout (DRO), showing what the X, Y, Z, A, and B axes would read if the software UI was running the code.
- The blue box outlines the various views you can track when using the Simulator.
- The red box outlines the G code and Model upload functions. The Model is an optional upload. When either of these buttons are clicked a file finder pops up and the user can navigate to the file they want to upload. G code files should either be .ngc or .nc files. Note, the Pocket NC will only read .ngc files. The Model will only upload .STL, or .OBJ files.
Section 2: G code and Summary Panes
To upload a file click on the G code button in the upper right hand corner and select a .ngc or .nc file. It may take a few seconds to load depending on the size of the file. There is a status circle to the left of the G code upload button. The image below shows the file almost completely loaded. The status circle disappears when the file is uploaded.
Figure 2: G code and Model Upload
Once the G code is loaded take a look at the G code pane. There will be several caution signs. These signs indicate that there is an unimplemented line of code, such as a pause, stop, or coolant added. There are also “i” symbols for information, which indicates where user information needs to be provided for the tooling parameters (tool length offset, tool diameter, and tool holder type). To see more information click over to the Summary tab. The code can be edited within the G Code pane, be sure you are in the 'Stop' mode, change the code, and then select 'Run Program' to store changes. Download the program by pressing the download button below the G code pane.
Figure 3: G code pane information
The Summary tab gives a more complete look at the program. At the very top the Summary pane highlights any errors which are indicated with a red circle and exclamation point and suggest changes to rectify the error. In the example shown in Figure 4 changing the tool length offset removed the error. The Summary tab also provides information on how many lines are in the program and approximate run time.
Figure 4: Summary pane information
Section 3: Setting Tool Parameters
The tooling parameters can be determined before using the Pocket NC Simulator or you can use the default values, however your program will simulate more accurately with correct tooling parameters entered. When you have the value for the offset, first press the stop program button in the playback control panel, shown in Figure 5. Clicking stop allows you to edit the tool parameters in the Summary pane turning the values from gray to black.
Figure 5: Press stop to set tool parameters in Summary pane
You can now go in and change the tool length offset, the tool diameter, and select if you are using a standard (short) or extended (long) tool holder. If you have more than one tool in the program, modify them all at this time.
Figure 6: Changing tool length offset values
With the new tool length offset values programmed go back to the playback control and press the run program button. At this time the G code will reload with the new values, so it may take a few moments. Then proceed with running the simulation.
Figure 7: Select Run Program to reload G code with new tool parameters
Figure 8: New tool length offset is now stored
Section 4: Playback Control Panel
The playback control panel is shown in Figure 9. In the upper left corner the page icon will collapse the G code/Summary panes from view. There are the standard stop, pause, and play buttons in the center of the control panel. Additionally, you can toggle through the program line by line with the |< and >| buttons. In the upper right you can change the speed of the simulation to go faster or slower by changing where the slider is located. Finally, the slider at the bottom tracks where you are in the program. You can skip to various parts of the program by moving the slider or by highlighting the line in the G code pane. The G code pane will track where you are in the program by highlighting the line in the program it is moving through.
Figure 9: Playback control panel
Figure 10 shows the progress halfway through the G code and the speed at which the simulation is running is about 20 times standard speed. Pressing the clock button to the left of the speed will return the speed to 1.00.
Figure 10: Playback control panel with slider moved and speed adjusted
Section 5: Digital Readout (DRO) and View Changer
On the upper right of the Pocket NC Simulator is a panel with the DRO for each axis, as would be shown in the software UI if running the machine real time.
Figure 11: DRO (bottom), view cube (upper left), perspective options (upper right)
Just above the DRO are a few ways to manipulate the view of the Pocket NC machine in the Simulator. There is a view cube that allows you to choose different perspectives such as top, right, bottom, etc. This view cube will also show you from which perspective you are currently viewing the machine since you can also use your mouse within the viewer to change perspective on the machine and zoom in and out. Click your mouse and drag to change perspective manually within the viewer.
The target symbol gives the option of changing what object the camera follows, see Figure 12. The camera can follow Y, A, B, or Tool. The Y-axis is the default.
Figure 12: Options for which axis or tool to parent
The camera symbol has two options for camera projection either orthographic or perspective. The perspective is default. The orthographic view keeps parallel lines straight throughout, so if you’re concerned with following straight lines you may want to switch to this view. The perspective does not keep lines parallel. The view that you choose can be very helpful in determining any bugs or issues within the G code.
Figure 13: Perspective and Orthographic Options
Section 6: Running a Simulation
Note, the Pocket NC Simulator does not need a model in order to simulate, but it is an option. The file types that can be uploaded for the G code are .ngc or .nc. Note, the machine will only work with .ngc files. The models that can be uploaded can only be in the file format STL or .OBJ. The Simulator will not let you upload any other file type at this time.
To upload G code, press the G code button in the upper right corner of the Simulator. Select the G code file. If you have a large file it may take a few moments to upload. There is a circle that will appear just to the left of the upload button that indicates the status as shown below. Do not start running the simulation until the G code is fully uploaded.
Figure 14: Uploading G code
You can also upload a model in the same way, press the Model button, select the file and wait for it to upload.
Once the file is uploaded you will want to check the Summary tab of the pane on the left. This will show you any errors, unimplemented lines of code, and show you the length of the program as well as the approximate run time.
Figure 15 shows an example of the Summary pane. There is an error where the axis limit is exceeded and gives you a suggestion of how to remedy it. This is a fairly common error which can be addressed by adjusting the tool length offset value.
Figure 15: Feedback on Summary pane
The errors in the Summary pane are also shown in the G code pane. When the Simulator comes to one of these lines of code that has an error designated by a red X to the left of it, as shown below, the machine will turn red indicating this error.
Figure 16: Errors shown in the Simulator
Part of the value of the Simulator is that you can see these errors before running the program and make modifications to alleviate errors without causing any errors on the machine itself or spending time running a program up until it has an issue.
Section 7: Common Errors
Not all errors are caught by the G code and Summary pane. Here are a few common errors to also look for in the Simulator before running the part on your machine:
- Incorrect work coordinate system: If you upload your G code and your model and notice that the model is offset from the tool paths you may have your origin set incorrectly. This may look like the photo below.
Figure 17: Example of incorrect origin
- Bugs in the post processor: Post processors can have bugs and the simulator can help spot those bugs, by showing odd movements in 3D, such as the one below, where the machine was being instructed to plunge into the part in between rewinding the B axis. Our machine has a continuous B axis, but has a software limit of 9999 degrees, so if a program needs to keep turning the B axis beyond 9999 degrees, it will need to back off the part, rewind B and pick up where it left off. Something was wrong with this edge case within the post processor and would have resulted in a ruined part, a stalled machine and/or a broken tool, but could be spotted ahead of time with the simulator.
Figure 18: Bug in post-processor
Section 8: Caveats
The goal of the simulator is to be a helpful tool while debugging G code programs and learning to machine in general, but there are some important caveats when using the Simulator. For starters, since it is implemented independently of the software that actually runs on the Pocket NC, there is a chance that the behavior shown in the simulator will differ from the real behavior of the machine. We’ve made every effort to make you aware of situations where behaviors can differ between the simulator and a real machine by warning you when a specific G code that is used in your program isn’t implemented in the simulator. While we strive for the simulator to match the behavior of the real machine, bugs can and do occur, so precautions should always be taken when machining and you should never leave a program running on a real machine unattended, even if it checks out on the simulator. We hope you find the simulator helpful, and appreciate any feedback you may have.