New Codes Quick-Reference

We’re thrilled to introduce our new Codes Quick-Reference page. This interactive guide provides instant access to G-codes, M-codes, and special commands used in CNC Simulator Pro’s default configuration directly from our web.

Key Features:

  • Comprehensive list of CNC codes
  • Clear explanations and examples
  • Machine compatibility information

Check out the Codes Quick-Reference page today and elevate your CNC programming experience!

image

New Online Help in Spanish Now Available!

Great news for our Spanish-speaking users! We’re excited to announce the launch of our CNC Simulator Pro online help documentation in Spanish. While the software interface remains in English, we understand the value of offering support materials in your native language for a more accessible and seamless experience.

Our new Spanish online help offers comprehensive guides and tutorials, making it easier for you to navigate and maximize your use of CNC Simulator Pro. This addition is part of our ongoing effort to cater to our diverse user base and enhance your software experience, regardless of language barriers.

For access to the Spanish online help, visit this link. And, as always, we’re here to support you every step of the way.

Thank you for being part of our community!

Announcing Our New Video Tutorial Series: "CNC programming Introduction"

image

Welcome to Our Beginners Guide to CNC Programming video series!

Introduction

We are thrilled to announce our latest video tutorial series: “CNC programming Introduction.” This multi-part series is designed to introduce you to the world of Computer Numerical Control (CNC) machining and G-code programming. Whether you’re a hobbyist, a professional operator, or simply interested in CNC, this series has something for everyone.

What to Expect

The tutorial series consists of 15 episodes, each diving into different aspects of CNC machining and G-code programming. You’ll learn the basics of CNC machines, the importance of G-codes and M-codes, and how they work together to create precise and efficient machining operations. From understanding the CNC coordinate system to mastering the nuances of tool changes, this series has got you covered.

Key Highlights

  • CNC Basics: Learn what CNC machines are, the types available, and their applications.
  • G-codes and M-codes: Unravel the mystery behind these essential CNC commands.
  • Tool Changes & Spindle Control: Master the art of efficiently swapping tools and controlling the spindle speed.
  • Coolant Control: Discover the importance of coolants and how to manage them during operations.
  • Simulation and Debugging: Explore the capabilities of CNC Simulator Pro, a powerful tool for CNC programming and debugging.

Special Episode on CNC Simulator Pro

In our final episode, we dive into CNC Simulator Pro, a robust 3D CNC machine simulator that offers CAD/CAM CNC editing, 3D simulation, gear creation, training tools, and much more. This episode will not only wrap up our entire series but also introduce you to a tool that can bring your CNC programming and debugging to the next level.

Where to Watch

All episodes are available on our YouTube channel. Make sure to subscribe so you don’t miss out on any new videos!

Closing Remarks

We’re incredibly excited to offer this comprehensive guide to the world of CNC and G-codes. This series aims to bridge the gap between theory and practice, making CNC programming accessible and engaging for everyone. We hope you’ll join us for this educational journey.

For more tutorials and resources, visit us at https://cncsimulator.com.

See you there!

New CNC Video Series – Simplifying the Complex, One Step at a Time

image

Hello CNC Simulator Community,

We have exciting news! To make the world of Computer Numerical Control (CNC) even more accessible, we’re creating an introductory video series aimed at newcomers.

Our series will break down CNC basics, from understanding what CNC is, its key components, to writing and understanding G-code. With concise and focused videos, you can learn at your own pace, revisiting any topic as needed.

This video series will be beneficial for everyone – those new to CNC or those wanting a solid recap. We aim to make CNC easy to understand, so everyone can start their CNC journey with confidence.

Stay tuned for updates when the series launch. As always, your feedback is welcome.

Introducing Our Brand New Video Tutorial: A Beginner’s Guide to CNC and Milling in CNC Simulator Pro 4.0

Hello CNC enthusiasts,

We are thrilled to announce the release of our brand new video tutorial: An Introduction to CNC and Milling in CNC Simulator Pro 4.0. This tutorial is designed to help beginners navigate the exciting world of CNC programming and milling, using the latest version of our beloved CNC Simulator Pro.

CNC programming and milling can seem daunting to newcomers, but with the right guidance, anyone can master it. That’s why we’ve created this video tutorial. It’s a step-by-step guide that takes you through the basics of CNC programming, focusing on the new CNC Simulator Pro 4.0.

Our new tutorial covers everything from understanding G-codes to programming your first CNC machine operation. We’ve included a practical example and hands-on exercise to help you grasp the concepts faster and easier. By the end of the tutorial, you’ll be able to create your own CNC programs and run them on the simulator with confidence.

We believe in learning by doing, and that’s what CNC Simulator Pro 4.0 is all about. It’s a safe, virtual environment where you can practice and experiment without the risk of damaging expensive equipment. And with our new video tutorial, getting started has never been easier.

So, are you ready to embark on your CNC programming journey? Head over to our YouTube channel to watch the tutorial. Don’t forget to like, share, and subscribe to stay updated on our latest tutorials and guides.

Happy programming!

Link to the video

Blockscript

Advanced users who want to do customizations like plug-ins and custom postprocessors should have a look at this.

In version 3.0 we implemented a built-in Blockscript editor in the simulator. Blockscript is a graphical language specifically made to enable customizations in the CNCSimulator Pro environment.

image

You can download the Blockscript documentation from this link.

New tutorial

A customer made us aware of the fact that the radius compensation function (G40-G42) in CNCSimulator Pro was not very well documented. We agree and have now made a tutorial to explain it in much more detail with examples and illustrations. We hope that it will help our users to better understand how radius compensation in CNCSimulator Pro works.

Here is a link to the tutorial. Radius compensation for milling machines.

Tutorial: Arduino based Jog Controller for the CNCSimulator Pro

In beta 1.2.0.1 we introduce a serial port controller protocol that can be used to control the CNCSimulator via the serial port (actually the USB port via a “virtual com port”).

At CNCSimulator.com we always claim that CNC should be fun. And we think this project is a really fun one. Hobbyists and students, it is time for some Do It Yourself electronics!

Using an Arduino Uno and some basic components we can easily make a Jog controller. Here is how you can make your own:

image

You need:

3 1K-ohm Resistors
3 LED (Red, Green, Yellow)
1 Joystick Module (Amazon link)
1 Rotary Encoder (Amazon link)
Some cables, an Arduino Uno or compatible.
1 USB Cable
1 Breadboard

Let us test the circuit on the breadboard before putting everything together in a box.

image

image

  • Connect the short leg of each LED to ground via a 1K resistor.
  • Connect the long leg of the red LED to Arduino Pin 8.
  • Connect the long leg of the yellow LED to Arduino Pin 9.
  • Connect the long leg of the green LED to Arduino Pin 10.
  • Connect the leftmost pin of the Joystick and the Rotary encoder to the ground strip of the breadboard.
  • Connect the second left pin of both the Joystick and the Rotary encoder to the +5V strip of the breadboard.
  • Connect Arduino +5V to the positive strip of the breadboard.
  • Connect the Arduino GND (Ground) pin to the ground strip of the breadboard.
  • Connect the third pin from the left on the Joystick (VRx) to the A1 pin of the Arduino.
  • Connect the forth pin from the left on the Joystick (VRy) to the A0 pin of the Arduino.
  • Connect the rightmost pin on the Joystick (SW) to pin 0 on the Arduino.
  • Connect the forth pin on the Rotary encoder to pin 3 on the Arduino.
  • And finally, connect the fifth pin on the Rotary encoder to pin 2 on the Arduino.

When we have all wires and components in place, it is time to transfer the firmware program to the Arduino chip.

If you do not already have the Arduino software installed on your computer, please visit their website and download (and install it) using the following link.

Download the Arduino Software

Connect your Arduino and make sure you get it connected to the computer.

Copy and paste the CNCSimulator Jog Controller Sketch to the Arduino program and upload it to the board. The sketch (program) is open source, feel free to do changes as you like.

#include <Encoder.h>
// Encoder lib found here: 
// https://github.com/dc42/arduino/tree/master/Libraries/RotaryEncoder

// "Jog Controller" - CNCSimulator Pro Arduino Sketch for manual jog of the CNC axis
// Made for Arduino JoyStick Module and Rotary encoder.
// Press the center button to switch between input modes (X,Y,Z,XY,STEP etc.)
// Move joystick to jog axis or change step (depending on mode)
// Long press to set all axis to zero and generate G92 code.

// This code is provided free of charge and should be considered an experimental prototype.
// Optimize for own hardware as well as customized functionality.

// Commands to send to the CNCSimulator.
// ST+ or ST- = STEP+ and STEP- Rotary encoder increase/decrease
// J[PotH]:[PotV] Joystick Potentiometer values, both range from -100 to 100
// CJM Cycle Jog Mode - Joystick center button was pressed, cycles Jog mode settings
// SZP Joystick center button was long pressed (1 sec). Sets zero point
// JMX Jog Mode X  (unused here, we use CJM instead)
// JMY Jog Mode Y  (unused here, we use CJM instead)
// JMZ Jog Mode Z  (unused here, we use CJM instead)
// JXY Jog Mode XY  (unused here, we use CJM instead)
// STP Step Mode   (unused here, we use CJM instead)
// ETL Embedded Tool (unused here, we use CJM instead)

// Commands to receive from the CNCSimulator
// @R Simulator is running  (Red LED)
// @P Simulator has paused  (Yellow LED)
// @S Simulator has stopped (Green LED)
// @E Simulation error (Red and green LEDs)
// @C Cycle leds
// @O All LEDs off


#define joyPin1 0               // slider variable connected to analog pin 0
#define joyPin2 1               // slider variable connected to analog pin 1
#define redLedPin 8
#define yelLedPin 9
#define greenLedPin 10
#define button1Pin 0            // joystick center button
#define encoderPin1 2
#define encoderPin2 3
#define blinkdelay 50

int value1 = 0;                 // variable to read the value from the analog pin 0
int value2 = 0;                 // variable to read the value from the analog pin 1
int button1state; 
int btnval1;
int btnval2;                    // used to debounce buttons
boolean waitingForCmd = false;
int Counter = 0;
const int JoyStickDeadZone = 10;

volatile long encoderValue = 0;
long lastencoderValue = 0;

Encoder myEnc(encoderPin1, encoderPin2);

// Note: The Keyes Rot. Encoder is a bit bouncy with this sketch.
// Code changes or hardware debouncing might be needed.

void setup() 
{
  // Setup pin modes
  pinMode(button1Pin, INPUT);
  pinMode(redLedPin, OUTPUT);
  pinMode(yelLedPin, OUTPUT);
  pinMode(greenLedPin, OUTPUT);
  pinMode(encoderPin1, INPUT_PULLUP); 
  pinMode(encoderPin2, INPUT_PULLUP);

  Serial.begin(115200);
  button1state = digitalRead(button1Pin);

  // Do a little initial blink with the LEDs to signal wakeup
  cycleLEDs();
}

void loop() 
{
  // Rotary encoder part
  if((encoderValue =myEnc.read())!=lastencoderValue)
  {   
    if(encoderValue > lastencoderValue)
      Serial.println("ST+");
    else
      Serial.println("ST-");
    lastencoderValue = encoderValue;
  }

  // Joystick part
  if(Counter == 1)
    value1 = map(analogRead(joyPin1), 0,1023,-100,100);
  else if(Counter == 2)
    value2 = map(analogRead(joyPin2), 0,1023,-100,100);
    
  if(value1 < -JoyStickDeadZone || 
    value1 > JoyStickDeadZone || 
    value2 < -JoyStickDeadZone || 
    value2 > JoyStickDeadZone)
  {
    // joystick is off center, notify the CNCSimulator
    Serial.print('J');
    if(value1 < -5 || value1 > 5)
      Serial.print(value1);
    else
      Serial.print(0);
    Serial.print(':');
    if(value2 < -5 || value2 > 5)
      Serial.println(value2);
    else
      Serial.println(0);
  }
  else
  {
    btnval1 = digitalRead(button1Pin);
    delay(10);
    btnval2 = digitalRead(button1Pin);
    if(btnval1==btnval2)
      if(btnval1 != button1state)
      {        
        button1state = btnval1;
        if(btnval1 == LOW)
        {
          // Button 1 is pressed
          unsigned long timeStart = millis();
          while(digitalRead(button1Pin)==LOW)  // Wait for it to become released
            if(millis()-timeStart > 1000) // Long press
            {             
              Serial.println("SZP");
              return;
            }           
          Serial.println("CJM");
          delay(50);
        }
      }
  }

  Counter++;
  if(Counter==3)
    Counter = 1;

  delay(80);  // delay needed between analog reads

  // Receive commands from the CNCSimulator
  if(Serial.available() > 0)
  {
    char data = Serial.read();
    if(waitingForCmd)    
      doOneByteCmd(data);
    else if(data == '@')  // one byte command on its way
    {
      if(Serial.available()> 0)
        doOneByteCmd(Serial.read());
      else
        waitingForCmd = true;      
    }
  }
}

void doOneByteCmd(char cmd)
{
  waitingForCmd = false;

  if(cmd == 'R')  // Running
    setLEDs(true, false, false);
  else if(cmd=='P')  // Paused
    setLEDs(false, true, false);
  else if(cmd=='S')  // Stopped
    setLEDs(false, false, true);
  else if(cmd=='E')  // Error (Red + Green)
    setLEDs(true, false, true);
  else if(cmd=='O')  // All LEDs off
    setLEDs(false, false, false);
  else if(cmd=='C') // Cycle LEDs
    cycleLEDs();
}

void cycleLEDs()
{
  setLEDs(false, false, false);

  for(int l = 0; l<3; l++)
  {
    setLEDs(true, false, false);
    delay(blinkdelay);
    setLEDs(true, true, false);
    delay(blinkdelay);
    setLEDs(true, true, true);
    delay(blinkdelay);
    setLEDs(false, true, true);
    delay(blinkdelay);
    setLEDs(false, false, true);
    delay(blinkdelay);
    setLEDs(false, false, false);
    delay(blinkdelay);
  }
}

void setLEDs(bool red, bool yellow, bool green)
{
  digitalWrite(redLedPin, red);
  digitalWrite(yelLedPin, yellow);
  digitalWrite(greenLedPin, green);
}

Time to test it out!

Start the CNCSimulator (Ver 1.2.0.1 or later) and go to settings. Click on the Misc tab and check the Enable box. Set the com port (same as you have set in the Arduino software). Set the baud rate to 115200 to match the value in the Arduino sketch above.

image

When you close settings, the green LED should come on. This is a sign that the CNCSimulator and the Arduino is talking to each other.

Now when you turn the Rotary encoder, the feed knob should turn in the virtual CNC controller.

Feed Knob

If this does not work, check your circuit and do some checks using the serial monitor in the Arduino software to make sure the commands get sent on the com port.

If it on the other hand works, Congratulations! You have made your own hand controller! At least a prototype of it.

To activate the Jogging function in the CNCSimulator, click the Jog Enable switch at the virtual controller.

image

If you add a workpiece to the machine, you can even mill (or turn) it manually using the hand controller joystick.

JoyStick

Do you see that tiny yellow LED blinking fast on the Arduino board? It is the Tx (transmit) LED telling us that the Arduino is sending data over the serial port (via the USB cable). In this case the data is the Joystick movements.

And when you do normal simulation, check that the LEDs work. See manual below for LED signals.

Jog Controller Manual.

When Jogging is not enabled the Rotary encoder will increase and decrease simulation speed.

When Jogging is enabled it is used in the following way:

Click the center of the Joystick to cycle through the jogging modes. They are as follows for milling machines:

  • X – Jog the X axis only (Joystick sideways and Rotary encoder)
  • Y – Jog the Y axis only (Joystick vertically and Rotary encoder)
  • Z – Jog the Z axis only (Joystick vertically and Rotary encoder)
  • XY – Jog both the X and the Y axis (Joystick only)
  • ET – Cycle through the Embedded Tools (Rotary encoder)
  • STP – Increase and decrease step size (Rotary encoder)

If you long press (1 second or more) the center button, the zero point will move to the current tool position and a G92 block will be generated in the CNC program where the cursor is.

The LED:s works as follows:

Red: Simulator is running (busy)
Yellow: Simulator is paused
Green: Simulation is stopped (idle)

If you lose connection with the controller (for example if the Arduino loses power) the correct procedure to restart the connection is to exit the CNCSimulator, unplug the Arduino USB cable and after a few seconds, replug it. Then start the CNCSimulator again. The controller should now be reconnected.

Now, put everything in a nice box, put labels on it and send a picture to us, we would love to see what you come up with! 🙂