Basic user guide - Paciente8159/uCNC Wiki

Jump to section

Using µCNC

Since µCNC was designed over Grbl protocol most of the details regarding interfacing, connecting, commands, jogging and other can be refereed to the Grbl Wiki page. About ~95% of the commands and interfacing is the same except a few minor things that will be covered in this page.

µCNC commands

For the full list of supported commands by µCNC read Grbl's configurations wiki page. The following commands don't match the existing ones in Grbl.

µCNC system commands

µCNC gcode commands

Note: G92.x offsets are stored in non volatile memory in µCNC version 1.0.x. From version 1.1.x forward this will only be kept in RAM. Values will be mantained during a soft reset, but a hard reset will delete previous values.

µCNC configurations

For the full list of settings by µCNC read Grbl configuration wiki page. The following configurations don't match the existing ones in Grbl.

Settings and sample values Description
$0=30000 Instead of the Step pulse in microseconds this stores the maximum step rate allowed
$5=0 Limit pins invert, mask
$7=0 Control pins invert, mask
$11 Junction deviation not implemented. Instead the juntion cosine factor is used (value must be set between -1.0 and 1.0 If set to 0.0 is the same as exact path mode (G61) and -1.0 is the same as exact stop mode (G61.1))

$5 - Limit pins invert, mask

By default, the limit pins are held normally-high with the MCU's internal pull-up resistor (has configured in the respective boardmap and if supported by the hardware). When a limit pin is high, µCNC interprets this as triggered. This differs from Grbl's default (this way if you forget to plugin the end-stop(NC to ground) for example the limit will be active). For the opposite behavior, just invert the limit pin by masking it with the appropriate int (0-255) value. The following table describes the bit in the value:

Bit Limit
0 LIMIT_X
1 LIMIT_Y
2 LIMIT_Z
3 LIMIT_A
4 LIMIT_B
5 LIMIT_C
6 should always be 0
7 LIMIT_X2 or LIMIT_Y2 or LIMIT_Z2

NOTE: For more advanced usage, the internal pull-up resistor on the limit pins may be disabled in boardmap file that matches your board.

$7 - Control pins invert, mask

By default, the control pins are held normally-high with the MCU's internal pull-up (has configured in the respective boardmap and if supported by the hardware). When a control pin is high, µCNC interprets this as triggered. This differs from Grbl's default (this way if you forget to plugin the control button/switch(NC to ground) for example the control will be active). For the opposite behavior, just invert the control pin by masking it with the appropriate int (0-255) value. The following table describes the bit in the value:

Bit Limit
0 ESTOP (Emergency stop)
1 SAFETY_DOOR (Safety door)
2 FHOLD (Feed hold)
3 CS_RES (Cycle start/Resume)
4 not used
5 not used
6 not used
7 not used

NOTE: For more advanced usage, the internal pull-up resistor on the limit pins may be disabled in boardmap file that matches your board.

µCNC interface

µCNC's interface is very similar to Grbl but some features are not yet implemented or have extra codes. The full list of interface messages can be check at Grbl interface wiki page. The following messages, errors and reports don't match Grbl.

Streaming a G-Code Program to µCNC

µCNC only implements the recommended streaming protocol which is simple Send-Response. Since most applications that work with Grbl also use this protocol there was no point in implementing other less reliable protocols.

µCNC Response Messages

Besides the existing error and alarm codes used in Grbl the following codes are added to µCNC.

Errors

ID Error Code Description
39 A comment is in an invalid format.
40 An invalid tool number was chosen.
41 Issued motion command (except G0) without setting the feed rate.
42 Failed to write settings to non volatile memory (programming error).
43 Failed to write settings to non volatile memory (write protected).
255 A critical failure of some sort has happen. This can be any failure of a safety mechanism in the interlocking loop check.

Alarms

ID Alarm Code Description
10 Homing position with dual drive axis (auto square) was not achieved.
11 Homing can not start due to a prior active limit alarm.

µCNC Push Messages

Feedback Messages

µCNC supports feedback messages inserted in comments like defined in the NIST RS274NGC. If this option is enabled, when presented with a comment µCNC will output the comment in a Non-Queried Feedback Message [MSG: ] [OPT:] Queried Feedback Messages are not implemented on µCNC.

Real-time Status Reports

µCNC jogging

To check how jog works on µCNC check the Grbl jogging wiki page. Jogging behavior should match Grbl.

µCNC laser mode

Since µCNC v1.2.0 this is now fully capable of driving a laser engraver/cutter. For more info check the Grbl laser mode wiki page. It's possible to completely disable this feature in the cnc_config.h file