Virtual CNC / hardware simulator?

Hi all,
I’m looking to write a few custom macros for gSender to simplify my life in the shop. My issue is that there is no internet in the shop and real desk to sit at, making it a real pain to try to look up help and write code.

Are there any fake hardware CNC softwares that I could run at home that would spoof a machine so that I could connect gSender and test out some things?

My needs aren’t crazy, I just want to do some simple things like showing dialogs for different scenarios. But having the gap of writing some code at home, going to the shop in order to test it, then returning home to fix or make any updates is pretty prohibitive.

Any suggestions?

Thanks in advance

I believe there is some software out there that allows you to view your gcode output. I don’t remember the names but some of the other posters should be able to provide that info. In my case I have a spare arduino that I have hooked up to my design computer that lets me experiment with gSender. I loaded it with the gSender firmware so it mimics the CNC version.

There are a lot of gcode viewers online and some for download as well, but they’re mostly a copy-paste and run gcode. I’m looking for live feedback from gsender ↔ CNC, except without the CNC.

In your setup, the arduino is acting as the CNC? If it can do simple things like simulate travel and give warnings about limits, that would be super handy if you could share where you found the info to set that up.

Thank you

Unfortunately it probably won’t do what you’re asking. Since it’s just the arduino there are no switches attached therefore no feedback. I just use it to very basically simulate the gcode and the appearance of the project. Sorry if I misunderstood your objective.

1 Like

The Arduino should work as long as you don’t need hardware (homing/limit switches or probes). Just connect it, load the firmware, and it will “think” it’s a machine.
grblHAL would be a little more involved.

1 Like

Arduino will work for GRBL macro development and I’m guessing also for grblHAL as long as it’s not grblHAL specific code you’re writing.

I don’t recommended doing this, but you could just connect one wire to the ground and one to each sensor input, touch the sensor wire to the ground wire to trigger it.
A better way is to wire switches up to do the same thing. I recommend a breadboard and buttons, LED’s and supporting circuitry, for noise filtering, etc.

        |--> Coolant/Spindle Output--> 220ohm Resistor--> LED--> GND  
        |
Arduino |                      |--> 10kohm Resistor--> 5v
        |--> Limit/Probe Input |--> 0.1uF Capacitor--> GND
        |                      |--> Button--> GND

Some resources
https://github.com/gnea/grbl/wiki/Connecting-Grbl
https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches
Easiest way to flash GRBL to the Arduino is to use the GSender Firmware Flash GRBL tool.

Below is my setup, I have a little extra going on with the Arduino Mega 2560, Ignore that one.
The Virtual CNC is the Arduino Uno Rev3 sitting on a breadboard, connected is two LED’s, one each for the coolant and spindle output, and then five buttons on the limit and probe inputs.

I don’t often test with the limits enabled, I usually only have the single button for the probe connected, so I don’t have a resistor or capacitor connected on the limit pins. GRBL has Arduino’s internal pull up resistors enabled so it works okay without the external ones.

3 Likes

Thanks @cjm, this looks great. I have a spare Arduino or two laying around with some switches already attached. I’ll try this out.

Especially thank you for the specific wiring/resistor callout, that’s super helpful.
Much appreciated!

1 Like

@Ternary, any luck with this? I’d like to do the same while I wait for my Altmill (late May)

hey @Chucky_ott , I haven’t had a chance to try this yet, unfortunately been busy with other things.

Having done a lot of work with arduino in the past, however, this seems like a pretty reasonable and straightforward way to work.

I’ll update here once I get the chance to test this out. Sorry I don’t have anything concrete for you.