For controlling your machine there is LinuxCNC (formerly Enhanced Machine Controller, created at NIST) http://www.linuxcnc.org and the fork MachineKit http://www.machinekit.io/
Also, latest FreeCAD has a CAM module ("Path workbench") that has come a long way and really is useful.