ExtruderController

From RepRap
Revision as of 21:22, 23 December 2007 by ZachSmith (talk) (version migrated from twiki)
Jump to: navigation, search

Extruder Controller

Pinouts

When programmed into a PIC16F628 (default), the pinouts are:

Device pinouts

  1. RA2/AN2/Vref ...... Cooler output
  2. RA3/AN3/Cmp1 ......
  3. RA4/T0CK1/Cmp2 .... Reserved for LED output
  4. RA5/MCLR/Vpp ......
  5. Vss ............... Ground
  6. RB0/INT ........... Heater PWM output
  7. RB1/RX/DT ......... RX
  8. RB2/TX/CK ......... TX
  9. RB3/CCP1........... Extruder motor PWM output
  10. RB4/PGM ........... Forward signal
  11. RB5 ............... Reverse signal
  12. RB6/T1OSO/T1CK1/PGC Feedstock empty sensor
  13. RB7/T1OS1/PGD ..... Motor position opto-interrupter input
  14. Vdd ............... +5V
  15. RA6/OSC2/CLKOUT ... Temperature slope A/D test charge
  16. RA7/OSC1/CLKIN .... Temperature slope A/D thermistor charge
  17. RA0/AN0 ........... -
  18. RA1/AN1 ........... Temperature slope A/D input

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 position counter
  • 1 byte: high order byte of 16 bit position counter

[6] Power down motor (torque off)

This is provided for compatibility with the Stepper Motor Controller API. 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

[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

A PIC16F628 code image is available from SourceForge. The firmware responds to address 8.

See Also

-- Main.SimonMcAuliffe - 03 Apr 2006