CNC controller for lathe