Skip to content
Simone C edited this page Jun 1, 2018 · 3 revisions

Head Development Kit

G-code commands

In this page we give a summary of new and existing g-code commands and commands relevant to the development of custom heads.

Command index:


M563: Define tool configuration

This command let you define different configurations for the peripherals available on the FABtotum.

Parameters

  • Pnnn Tool configuration number (Only 0 is supported and accepted at the moment)
  • Snnn Enable (1) or disable (0) serial communication

Output

  • When a configuration is given, a ok is returned for confirmation.
  • When no configuration is given the current configurations are returned.

Each configuration defines a logical tool. A tool configuration can be activated issuing a Tnnn command. Installing a factory head through FAB-UI automatically configures the FABtotum for that head, possibly overriding any manual setup.

Serial communication parameters can be configured separately for each serial interface available with the command M575. Toolheads are linked to communication interface 4.

M575: Set serial communication parameters

This command let you set communication parameters for one of the communication interfaces available on the FABtotum.

Parameters

  • Pnnn Interface number
  • Rnnn Set receiving pin number on TOTUMduino
  • Tnnn Set trasmitting pin number on TOTUMduino
  • Bnnn Set interface baud rate

Output

  • ok for confirmation

Interface indexes 0-3 are reserved. Interface 4 is linked to the toolhead.

M790: Send text to head

This command can either send a single line of text to the head, or activate a text forwarding mode.

Parameters

  • Pnnn The interface number
  • "..." String of text to send

Output

  • Any output read from the interface

Parameter P selects the communication interface where to send the text. Interface number for heads is 4.

When a string enclosed in double quotes is specified, the content of the string are sent on the selected interface. Double quotes inside the string cannot be neither identified nor escaped, so the string must not contain any instance of double quotes.

If no string is given, the firmware enters in relay mode wherein any subsequent line of text received on input is sent as-is the the head. To exit from relay-mode the user must send a line containing only a dot.

Whatever the mode, any output read from the head (interface 4) is repeated on the main serial interface.

M793: Read or set installed head id

With this command you manually set the ID for the installed head, or read its current value.

Parameters

  • Snnn Set installed head ID

Ouput

  • The presently or newly set id

IDs from 0 to 99 are reserved. IDs from 100 upwards are free to use for third-party and custom applications.

Warning: the manually set value is overridden by FAB-UI when rebooting the machine or after resetting the controller.