blob: 6045d22c295d8ef54a0e283f145297e9fd617563 (
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
#ifndef PARAMETERS_H
#define PARAMETERS_H
// Here are the moterboard codes; set MOTHERBOARD to the right one
// (Arduino: 0 - no longer in use)
// Sanguino or RepRap Motherboard with direct drive extruders: 1
// RepRap Motherboard with RS485 extruders: 2
// Arduino Mega: 3
#define MOTHERBOARD 2
// Comment out the next line if you are running a Darwin
#define MENDEL 1
// The speed at which to talk with the host computer
#define HOST_BAUD 19200
// Set 1s where you have endstops; 0s where you don't
#define ENDSTOPS_MIN_ENABLED 1
#define ENDSTOPS_MAX_ENABLED 0
#define INCHES_TO_MM 25.4
#ifdef MENDEL
#if 0
// define the XYZ parameters of Mendel
#define X_STEPS_PER_MM 10.047
#define X_STEPS_PER_INCH (X_STEPS_PER_MM*INCHES_TO_MM)
#define X_MOTOR_STEPS 400
#define INVERT_X_DIR 0
#define Y_STEPS_PER_MM 10.047
#define Y_STEPS_PER_INCH (Y_STEPS_PER_MM*INCHES_TO_MM)
#define Y_MOTOR_STEPS 400
#define INVERT_Y_DIR 0
#define Z_STEPS_PER_MM 563.877
#define Z_STEPS_PER_INCH (Z_STEPS_PER_MM*INCHES_TO_MM)
#define Z_MOTOR_STEPS 400
#define INVERT_Z_DIR 0
#else
// parameters for the Bath U. mendel prototype
#define X_STEPS_PER_MM 13.333333
#define X_STEPS_PER_INCH (X_STEPS_PER_MM*INCHES_TO_MM)
#define X_MOTOR_STEPS 400
#define INVERT_X_DIR 0
#define Y_STEPS_PER_MM 13.333333
#define Y_STEPS_PER_INCH (Y_STEPS_PER_MM*INCHES_TO_MM)
#define Y_MOTOR_STEPS 400
#define INVERT_Y_DIR 0
#define Z_STEPS_PER_MM 938.64
#define Z_STEPS_PER_INCH (Z_STEPS_PER_MM*INCHES_TO_MM)
#define Z_MOTOR_STEPS 400
#define INVERT_Z_DIR 0
#endif
#else
// This is for Darwin.
#define X_STEPS_PER_MM 7.99735
#define X_STEPS_PER_INCH (X_STEPS_PER_MM*INCHES_TO_MM)
#define X_MOTOR_STEPS 400
#define INVERT_X_DIR 0
#define Y_STEPS_PER_MM 7.99735
#define Y_STEPS_PER_INCH (Y_STEPS_PER_MM*INCHES_TO_MM)
#define Y_MOTOR_STEPS 400
#define INVERT_Y_DIR 0
#define Z_STEPS_PER_MM 320
#define Z_STEPS_PER_INCH (Z_STEPS_PER_MM*INCHES_TO_MM)
#define Z_MOTOR_STEPS 400
#define INVERT_Z_DIR 0
#endif
// For when we have a stepper-driven extruder
// E_STEPS_PER_MM is the number of steps needed to
// extrude 1mm out of the nozzle.
#define E_STEPS_PER_MM 0.706 // NEMA 17 extruder 5mm diameter drive - empirically adjusted
//#define E_STEPS_PER_MM 2.2 // NEMA 14 geared extruder 8mm diameter drive
#define E_STEPS_PER_INCH (E_STEPS_PER_MM*INCHES_TO_MM)
#define E_MOTOR_STEPS 400
//our maximum feedrates
#define FAST_XY_FEEDRATE 3000.0
#define FAST_Z_FEEDRATE 50.0
// Data for acceleration calculations
// Comment out the next line to turn accelerations off
#define ACCELERATION_ON
#define SLOW_XY_FEEDRATE 1000.0 // Speed from which to start accelerating
#define SLOW_Z_FEEDRATE 20
// Set to 1 if enable pins are inverting
// For RepRap stepper boards version 1.x the enable pins are *not* inverting.
// For RepRap stepper boards version 2.x and above the enable pins are inverting.
#define INVERT_ENABLE_PINS 1
#if INVERT_ENABLE_PINS == 1
#define ENABLE_ON LOW
#else
#define ENABLE_ON HIGH
#endif
// Set these to 1 to disable an axis when it's not being used,
// and for the extruder
#define DISABLE_X 0
#define DISABLE_Y 0
#define DISABLE_Z 1
#define DISABLE_E 0
// Set to one if sensor outputs inverting (ie: 1 means open, 0 means closed)
// RepRap opto endstops with H21LOI sensors are not inverting; ones with H21LOB
// are inverting
#define ENDSTOPS_INVERTING 1
//our command string length
#define COMMAND_SIZE 128
// The size of the movement buffer
#define BUFFER_SIZE 4
// Number of microseconds between timer interrupts when no movement
// is happening
#define DEFAULT_TICK (long)1000
// What delay() value to use when waiting for things to free up in milliseconds
#define WAITING_DELAY 1
#if MOTHERBOARD > 1
#define MY_NAME 'H' // Byte representing the name of this device
#define E0_NAME '0' // Byte representing the name of extruder 0
#define E1_NAME '1' // Byte representing the name of extruder 1
#define RS485_MASTER 1 // Set 0 for the slave
#endif
extern char debugstring[];
void delayMicrosecondsInterruptible(unsigned int us);
// Inline interrupt control functions
inline void enableTimerInterrupt()
{
TIMSK1 |= (1<<OCIE1A);
}
inline void disableTimerInterrupt()
{
TIMSK1 &= ~(1<<OCIE1A);
}
inline void setTimerCeiling(unsigned int c)
{
OCR1A = c;
}
inline void resetTimer()
{
TCNT2 = 0;
}
#endif
|