When you try to use a 3d printing specific mainboard for a non-3d printer you face a special set of configuration requirements, so I go over my experience with setting up reprapfirmware on duet2 for a cnc as I hope this helps in your config planning for other firmwares/boards in case you try to do something non standard or outright crazy.
The procedure to get a CNC to move from a workflow perspective is as follows:
3D model -> CAM -> (postprocessor)-> gcode interpreter -> motor controller -> motor
Our 3D model is designed in your favourite 3d modelling software, in my case Freecad.
- our only special requirement is that we construct our desired shape in a machinable way.
--Similar to how we specifically construct for 3d printing ,but with the constraints of the machine and the material in mind.
the CAM step is much more specific to our machine. In general you can either implement your machine directly in the CAM program, so the CAM system already knows about how axis can move and how far. this is generally the best approach if doable as setup errors will be detected in this stage and wont kill your machine or material if something was configured wrong.
Big manufacturers provide ready made models for advanced CAM systems to make this process easier for the user or even turn it into a one click solution, but it can be very tricky to set up a custom machine in this stage.
A system that supports this and is open source would be GRBLGru , but at this point I have no practical experience with it.
The optional postprocessor stage converts GCode into GCode but with a custom twist.
In our Case we have a fourth Axis consistent of two independent motors, this weird configuration will usually be called Axis A in most CAm tools, but for our 3d-printer-centric firmware A is not a valid name for an Axis. Instead since this is a continous rotation axis we will use E0 or E1 as the name for this axis in firmware. (E0 short for Extruder 0)
Our postprocessor (that we will most likely have to write from scratch ) will look through a given gcode file and replace every in the first position of every line A with E0 therefore translating our output into a usable format.
postprocessors are very common in robotics and industrial machinery as they often use standard movement planing tools but a proprietyry Gcode-like language on the machine itself.
this step can sometimes also be integrated into the CAM, or become fully automated once fully tested.
the Firmware running on the control board parses the gcode file and issues the respective commands to the motor drivers, it has no awareness of any errors and will strictly do what the gcode commands...unless it detects critical errors, like movements that go over the soft limits, but often it will just act within its limits to avoid crashes, but the output will not be what we intended.
Configuring a 3d printer firmware for a different purpose can be tricky.
So here is a little video on how to approach this for reprapfirmware:
find the RepRap config tool here: https://configtool.reprapfirmware.org
here are the docs regarding firmware flashing:
https://docs.duet3d.com/User_manual/RepRapFirmware/Updating_firmware
https://github.com/Duet3D/RepRapFirmware/releases
within reprapfirmware it is even possible to control the CNC spindle with a heater output (as it is mosfet buffered) and pretty reliably control its speed.
We use an external BLDC motor controller that came with the spindle like this one:
During the configuration with the online tool we did not get a chance to set cnc mode and configure the spindle settings so we have to do it with startup gcode:
Here are the docs for the CNC mode config:
https://docs.duet3d.com/User_manual/Machine_configuration/Configuration_CNC
https://docs.duet3d.com/User_manual/Reference/Gcodes#m453-select-cnc-device-mode
I hope this little software excursion helps in case you are designing a weird 3d printer, CNC, or Laser.
But of course the challenge with setting up suitable CAM prevails and might be the hardest challenge...
This blog is a part of Clem's CNC Control Project. Click the Previous button to jump to the previous blog in the series.