Check out the https://buildbotics.com CNC controller and the https://CAMotics.org CNC simulator. Both are Open-Source. These are my projects.