ExtruderController

From RepRap
Revision as of 06:36, 11 January 2015 by Glenn (talk | contribs) (catchg)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Extruder Controller SNAP Protocol Version 0

API

[0] Get Version

Returns the version of the module. This message is the only message universally supported by all devices and is therefore useful as a test.

Parameters:

  • None

Returns:

  • 1 byte: Response type (0)
  • 1 byte: minor version number
  • 1 byte: major version number

[1] Set forward motion

Starts the motor turning indefinitely in a forward direction. If the motor reaches the maximum position sensor (as defined by the maximum optointerrupter input), motion will stop.

Parameters:

  • 1 byte: Speed to turn (0 to 255)

Returns:

  • Nothing

[2] Set reverse motion

Starts the motor turning indefinitely in a reverse direction. If the motor reaches the minimum position sensor (as defined by the minimum optointerrupter input), motion will stop.

Parameters:

  • 1 byte: Speed to turn (0 to 255)

Returns:

  • Nothing

[3] Set position counter

Parameters:

  • 1 byte: low order byte of 16 bit position counter
  • 1 byte: high order byte of 16 bit position counter

Returns:

  • Nothing

[4] Get position counter

Parameters:

  • Nothing

Returns:

  • 1 byte: low order byte of 16 bit position counter
  • 1 byte: high order byte of 16 bit position counter

[5] Seek to position

Parameters:

  • 1 byte: Speed to move (1 to 255)
  • 1 byte: low order byte of 16 bit target position
  • 1 byte: high order byte of 16 bit target position

[6] Power down motor (torque off)

This is provided for compatibility with the Stepper Motor Controller API Version 0. In the case of the Extruder, this just stops extrusion. It is equivalent to setting the speed to 0.

Parameters:

  • None

Returns:

  • Nothing

[7] Enable asynchronous notifications

This is provided for compatibility with the Stepper Motor Controller API Version 0. In the case of the Extruder, this doesnt do anything.

Parameters:

  • 1 byte: address to notify

Returns:

  • Nothing

[8] Check if material is empty

Parameters:

  • Nothing

Returns:

  • 1 byte: 1 if empty, 0 if not empty

[9] Set heater output

Parameters:

  • 1 byte: PWM for heater on low setting (target < heat < max)
  • 1 byte: PWM for heater on low setting (heat < target)
  • 1 byte: target temperature for extruder (formatted for PIC timer)
  • 1 byte: maximum temperature for extruder (formatted for PIC timer)

Returns:

  • Nothing

[10] Get current heater temperature

Parameters:

  • Nothing

Returns:

  • 1 byte: temperature as measured in PIC timer format.

[52] Set voltage reference

Used to re-range the A/D temperature measurements to give the best possible precision. The general principle of ranging is to select the value that provides the largest possible temperature reading without overflowing beyond 255.

Firmware

There are two different versions of firmware: older, stable firmware designed for the PIC16F648 and newer firmware designed for the Arduino. They both function identically, and accept the same commands.

PIC Based Firmware

PIC16F628 code images and source are available from SourceForge.

More information on the electronics required to process the commands is located here.

Arduino Based Firmware

The Arduino is a much more powerful microcontroller board based on the atmega168, and it includes more advanced features such as an Analog to Digital Converter, which allows us to measure the temperature much more easily and robustly. Since the protocol is designed around the PIC microprocessor, the Arduino converts its temperature reading to the PIC timer based format.

Arduino firmware is available from SourceForge.

More information on the electronics required to process the commands is located here.