blob: b3cc53dfd0dbe0d915f0ab3f4a07a8fed5d8d10e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/*
ThermoplastExtruder_SNAP_v1.h - Thermoplastic Extruder SNAP Communications library for Arduino
This library implements/emulates v1 of the RepRap Thermoplastic Extruder communications protocol.
The initial protocol was designed around measuring temperature by the amount of time
it takes to charge a capacitor through the thermistor. In order to maintain compatibility,
the Arduino takes its analog reading and converts it into the value a PIC would return.
More information on the protocol here: http://reprap.org/bin/view/Main/ExtruderController
Memory Usage Estimate: 5 - 50? + ThermoplastExtruder
History:
* (0.1) Created intial library by Zach Smith.
* (0.2) Updated to emulate PIC based temperature measuring.
* (0.3) Updated with new values from Steve DeGroof (http://forums.reprap.org/read.php?70,8034)
* (0.4) Rewrote and refactored all code. Fixed major interrupt bug by Zach Smith.
License: GPL v2.0
*/
#ifndef THERMOPLAST_EXTRUDER_SNAP_V1H
#define THERMOPLAST_EXTRUDER_SNAP_V1_H
//
// constants for temp/pic temp conversion. from reprap.properties.dist
//
#define BETA 550.0
#define CAPACITOR 0.000003
#define RZ 4837
#define ABSOLUTE_ZERO 273.15
//our include files.
#include <ThermoplastExtruder.h>
#include <SNAP.h>
#undef round
#include <math.h>
//
// Various processing commands.
//
void setup_extruder_snap_v1();
void process_thermoplast_extruder_snap_commands_v1();
//
// Conversion commands
//
int calculateTemperatureForPicTemp(int picTemp);
int calculatePicTempForCelsius(int temperature);
//
// Version information
//
#include <../version.h>
#define EXTRUDER_ADDRESS 8
#define DEVICE_TYPE 1
//
// Extruder commands
//
#define CMD_VERSION 0
#define CMD_FORWARD 1
#define CMD_REVERSE 2
#define CMD_SETPOS 3
#define CMD_GETPOS 4
#define CMD_SEEK 5
#define CMD_FREE 6
#define CMD_NOTIFY 7
#define CMD_ISEMPTY 8
#define CMD_SETHEAT 9
#define CMD_GETTEMP 10
#define CMD_SETCOOLER 11
#define CMD_VALVEOPEN 12
#define CMD_VALVECLOSE 13
#define CMD_PWMPERIOD 50
#define CMD_PRESCALER 51 //apparently doesnt exist...
#define CMD_SETVREF 52
#define CMD_SETTEMPSCALER 53
#define CMD_GETDEBUGINFO 54 //apparently doesnt exist...
#define CMD_GETTEMPINFO 55 //apparently doesnt exist...
#define CMD_DEVICE_TYPE 255
extern ThermoplastExtruder extruder;
#endif
|