ExtruderController
Contents
- 1 Extruder Controller
- 1.1 Pinouts
- 1.2 API
- 1.2.1 [0] Get Version
- 1.2.2 [1] Set forward motion
- 1.2.3 [2] Set reverse motion
- 1.2.4 [3] Set position counter
- 1.2.5 [4] Get position counter
- 1.2.6 [5] Seek to position
- 1.2.7 [6] Power down motor (torque off)
- 1.2.8 [7] Enable asynchronous notifications
- 1.2.9 [8] Check if material is empty
- 1.2.10 [9] Set heater output
- 1.2.11 [10] Get current heater temperature
- 1.2.12 [50] Set PWM period
- 1.2.13 [51] Set prescaler
- 1.2.14 [52] Set voltage reference
- 1.3 Firmware
- 1.4 See Also
Extruder Controller
Pinouts
When programmed into a PIC16F628 (default), the pinouts are:
Device pinouts
- RA2/AN2/Vref ......
- RA3/AN3/Cmp1 ......
- RA4/T0CK1/Cmp2 .... Not used
- RA5/MCLR/Vpp ......
- Vss ............... Ground
- RB0/INT ...........
- RB1/RX/DT ......... RX
- RB2/TX/CK ......... TX
- RB3/CCP1...........
- RB4/PGM ...........
- RB5 ...............
- RB6/T1OSO/T1CK1/PGC
- RB7/T1OS1/PGD .....
- Vdd ............... +5V
- RA6/OSC2/CLKOUT ...
- RA7/OSC1/CLKIN ....
- RA0/AN0 ...........
- RA1/AN1 ...........
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
[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
[9] Set heater output
[10] Get current heater temperature
[50] Set PWM period
Low level control to fine-tune motor usage. Should not normally be needed, but adjusting these values may optimise torque at certain speeds.
[51] Set prescaler
[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 included below. The attached image responds to address 5.
See Also
See Building A Stripboard Stepper Controller for construction details of a stripboard version for use with a unipolar stepper motor. See Building a bipolar stripboard stepper controller for a version that works with a bipolar motor.
-- Main.SimonMcAuliffe - 03 Apr 2006