Skip to content

Reliability

Pascal Roobrouck edited this page Jan 11, 2017 · 6 revisions

When something goes wrong during CNC operations, this can destroy the piece you are producing, ccan damage the milling tools or even the whole machine. In a worst case it can cause injuries to the operator.
That is why it is highest priority to make the CNC Controller Safe and Reliable.

Communications

The CNC controller receives its commmands and G-Code from a client computer, running a GUI. The connection between them can be made with several kinds of interfaces (Serial, USB, Ethernet, Bluetooth, ..). Most popular are Serial (RS-232) and USB. The Serial RS-232 communications does not provide adequate error detection mechanisms by itself. It can use a parity-bit, but this is not strong enough, as .eg losing a complete byte is undetected, but could still cause big trouble in the machine. (Think what would happen if Z-0.100 would become Z-0100)

In order to provide a more secure Serial RS-232 communications, Mooov can use an error-detection scheme at the message level : each line sent will be protected with a checksum or CRC and a sequence number. After receiving an error-free message, this will be ACKnowledged to the client computer, so it cans end the next message. When errors are detected, the received message is rejected, not acknowledged, and after some time-out the clioent computer will retransmit.

USB itself is already protected with a built-in scheme as the one described above, so the errors will be detected. Still they need to be handled in a fail-safe way..

It is the intention to keep the error-detection and handling isolated in the Comms part, so it can be different among the different types of interfaces. But at the output of the Comms, we receive all messages, error-free.

Limit Switches

Error Handling

There are an endless list of things that can go wrong:

  • each of the buffers can have underrun or overflow
  • G-Code syntax errors

In order to keep the code simple and still properly handle all the errors, the following approach is implemented:

  • fatal errors return immediately to the main controller
  • non-fatal errors are logged in each module in 'lastError'. The main controller loop then regularly checks for errors and communicates them back in the status reporting.