CNC Machine Prototype
CNC Machine Prototype
Keyboard Controls Only
This is a recreation of a CNC machine I made, trying to understand how they work and how I can reproduce the logic that keeps the gantry, carriage, and device within bounds. The actual CNC machine uses servos to move and sensors at the limits to determine absolute position. In Unity, I set up collision zones acting as digital sensors and have each "sensor" call a public method that informs the table manager when an axis has reached its max or min bounds.
The code is all my own, though I wouldn't have been able to get here if it weren't for the following texts:
- Unity In Action by Joseph Hocking
- Learning C# by Developing Games with Unity 2021 by Harrison Ferrone
- The C# Programming Yellow Book by Rob Miles
- (additionally, the syntax is informed by the work of 1zed1 Games)
As for the future of this project, I intended to cast the mouse pointer to screen space so that you control where the bit is with your mouse, but I've been struggling to get the model rigged, given the free time I have to do so. I have detailed plans on gamefying the project, so I'd like to return to this at some point to get it somewhere near a working rough. We shall see!
Full Code:
- Table Control: https://pastebin.com/XCrUJPSm
| Status | Prototype |
| Platforms | HTML5 |
| Rating | Rated 5.0 out of 5 stars (1 total ratings) |
| Author | Evan Kurtz |
| Genre | Simulation |
| Made with | Unity, Blender |
| Tags | cnc, Prototype, workshop |
| Asset license | Creative Commons Attribution_ShareAlike v4.0 International |
| Average session | A few seconds |
| Languages | English |
| Inputs | Keyboard |





Comments
Log in with itch.io to leave a comment.
I really like the idea - people and companies who develop software for real CNC would appreciate it immensely, for example for simulating collisions with material. It would be good to add G-code reading and automatic machine mode, and physically machining the material, that would be really amazing. Then it could also be turned into a game project, for example a simulator of a factory that produces some parts, I will definitely follow you, thanks for this experience
The simulator thing is something I was considering, but it's still definitely outside of my skillset at the moment. I don't even mess with g-code myself, I just let Aspire do all that.
Thanks for your kind words though! I appreciate it.