- LinuxCNC
- General LinuxCNC Questions
- Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
- fmueller
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 5
11 Oct 2026 23:16 #350201
by fmueller
Replied by fmueller on topic Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
Hi tuxcnc,Thank you for your feedback and suggestions! You have actually touched on two of the next major features we are planning: physical tools and tool measurement.I think it would be useful to explain the underlying concept of this simulator, because it is slightly different from a traditional G-code simulator.Our goal is to simulate a real CNC machine, including its capabilities, limitations, and potential mistakes.A real CNC machine does not interpret G-code itself. LinuxCNC is responsible for interpreting G-code, planning trajectories, applying tool offsets, and controlling the hardware. The machine simply responds to the commands it receives.We want our simulator to behave in exactly the same way.The virtual machine will have its own physical state: axis positions, spindle, installed tool, tool geometry, workpiece, sensors, and eventually machine geometry and collisions.An important design principle is that the physical state of the simulated machine must remain independent of what LinuxCNC believes that state to be.For example:
- If LinuxCNC requests tool T5 but the operator installs the wrong tool, the simulator should use the geometry of the tool that was actually installed.
- If the physical tool length differs from the value in LinuxCNC's tool table, that difference should affect the machining result.
- A virtual toolsetter should be able to detect the actual tool length, just like a real toolsetter.
- Incorrect offsets, incorrect tools, or incorrect workpiece positioning should be capable of producing incorrect machining results or collisions.
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 276
- Thank you received: 52
12 Oct 2026 03:44 #350206
by tuxcnc
The simulator cannot use information that is not available.
If, for example, we have a manual tool change, the simulator can at most receive information that the tool has been replaced. LinuxCNC does not ask what physical tool the operator has installed, cannot use the answer to a question he did not ask and cannot transfer information to the simulator that he does not have.
I wrote about tool measurement simulation only in the sense that the simulator would show the movements that will actually be made.
I have a remap that goes to the manual tool change position, then moves to the height sensor, and then returns to where it started. Showing these movements would make the simulation more realistic, but it seems impossible to simulate operator error.
There are simply things that cannot be done and you have to accept it.
Coming back to REMAP M6, it could probably be done.
You could use a shell script that would first run a program to tell the simulator to change the tool, and then run the user remapĀ program. This should work.
An alternative would be to change the stepper-ninja code so that additional information is transmitted. Maybe it's worth going in this direction, because it would provide additional possibilities that could be useful in the future...
Replied by tuxcnc on topic Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
I can't imagine it.
- If LinuxCNC requests tool T5 but the operator installs the wrong tool, the simulator should use the geometry of the tool that was actually installed.
- If the physical tool length differs from the value in LinuxCNC's tool table, that difference should affect the machining result.
- A virtual toolsetter should be able to detect the actual tool length, just like a real toolsetter.
- Incorrect offsets, incorrect tools, or incorrect workpiece positioning should be capable of producing incorrect machining results or collisions.
The simulator cannot use information that is not available.
If, for example, we have a manual tool change, the simulator can at most receive information that the tool has been replaced. LinuxCNC does not ask what physical tool the operator has installed, cannot use the answer to a question he did not ask and cannot transfer information to the simulator that he does not have.
I wrote about tool measurement simulation only in the sense that the simulator would show the movements that will actually be made.
I have a remap that goes to the manual tool change position, then moves to the height sensor, and then returns to where it started. Showing these movements would make the simulation more realistic, but it seems impossible to simulate operator error.
There are simply things that cannot be done and you have to accept it.
Coming back to REMAP M6, it could probably be done.
You could use a shell script that would first run a program to tell the simulator to change the tool, and then run the user remapĀ program. This should work.
An alternative would be to change the stepper-ninja code so that additional information is transmitted. Maybe it's worth going in this direction, because it would provide additional possibilities that could be useful in the future...
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
Time to create page: 0.093 seconds