00001 /* Notice to developers: this file is intentionally included twice. */ 00002 00006 /* 00007 CONTENTS 00008 00009 1. Mechanical/Hardware 00010 2. Acceleration settings 00011 3. Pinouts 00012 4. Temperature sensors 00013 5. Heaters 00014 6. Communication options 00015 7. Miscellaneous 00016 8. Appendix A - PWMable pins and mappings 00017 */ 00018 00019 #error this config is not tested, and may be incorrect! please post in forum or via git any corrections 00020 00021 /***************************************************************************\ 00022 * * 00023 * 1. MECHANICAL/HARDWARE * 00024 * * 00025 \***************************************************************************/ 00026 00027 /* 00028 Set your microcontroller type in Makefile! atmega168/atmega328p/atmega644p/atmega1280 00029 00030 If you want to port this to a new chip, start off with arduino.h and see how you go. 00031 */ 00032 #if ! ( defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__) ) 00033 #error GEN3 has a 644P/644PA! set your cpu type in Makefile! 00034 #endif 00035 00039 #ifndef F_CPU 00040 #define F_CPU 16000000L 00041 #endif 00042 00046 #define HOST 00047 00048 /* 00049 Values reflecting the gearing of your machine. 00050 All numbers are fixed point integers, so no more than 3 digits to the right of the decimal point, please :-) 00051 00052 calculate these values appropriate for your machine 00053 for threaded rods, this is (steps motor per turn) / (pitch of the thread) 00054 for belts, this is (steps per motor turn) / (number of gear teeth) / (belt module) 00055 half-stepping doubles the number, quarter stepping requires * 4, etc. 00056 */ 00057 #define STEPS_PER_MM_X 320.000 00058 #define STEPS_PER_MM_Y 320.000 00059 #define STEPS_PER_MM_Z 200.000 00060 00062 #define STEPS_PER_MM_E 320.000 00063 00064 00065 /* 00066 Values depending on the capabilities of your stepper motors and other mechanics. 00067 All numbers are integers, no decimals allowed. 00068 00069 Units are mm/min 00070 */ 00071 00073 #define MAXIMUM_FEEDRATE_X 200 00074 #define MAXIMUM_FEEDRATE_Y 200 00075 #define MAXIMUM_FEEDRATE_Z 100 00076 #define MAXIMUM_FEEDRATE_E 200 00077 00079 #define SEARCH_FEEDRATE_X 50 00080 #define SEARCH_FEEDRATE_Y 50 00081 #define SEARCH_FEEDRATE_Z 50 00082 #define SEARCH_FEEDRATE_E 50 00083 00085 #define E_STARTSTOP_STEPS 20 00086 00087 00093 #define X_MIN 0.0 00094 #define X_MAX 200.0 00095 00096 #define Y_MIN 0.0 00097 #define Y_MAX 200.0 00098 00099 #define Z_MIN 0.0 00100 #define Z_MAX 140.0 00101 00102 00103 00104 /***************************************************************************\ 00105 * * 00106 * 2. ACCELERATION * 00107 * * 00108 * IMPORTANT: choose only one! These algorithms choose when to step, trying * 00109 * to use more than one will have undefined and probably * 00110 * disastrous results! * 00111 * * 00112 \***************************************************************************/ 00113 00118 // #define ACCELERATION_REPRAP 00119 00120 00125 #define ACCELERATION_RAMPING 00126 00130 #define ACCELERATION_STEEPNESS 500000 00131 00144 // #define ACCELERATION_TEMPORAL 00145 00146 00147 00148 /***************************************************************************\ 00149 * * 00150 * 3. PINOUTS * 00151 * * 00152 \***************************************************************************/ 00153 00160 #include "arduino.h" 00161 00166 //#define USE_INTERNAL_PULLUPS 00167 00171 #define TX_ENABLE_PIN DIO12 00172 #define RX_ENABLE_PIN DIO13 00173 00174 #define X_STEP_PIN DIO15 00175 #define X_DIR_PIN DIO18 00176 #define X_MIN_PIN DIO20 00177 #define X_MAX_PIN DIO21 00178 #define X_ENABLE_PIN DIO19 00179 //#define X_INVERT_DIR 00180 //#define X_INVERT_MIN 00181 //#define X_INVERT_MAX 00182 //#define X_INVERT_ENABLE 00183 00184 #define Y_STEP_PIN DIO23 00185 #define Y_DIR_PIN DIO22 00186 #define Y_MIN_PIN AIO6 00187 #define Y_MAX_PIN AIO5 00188 #define Y_ENABLE_PIN DIO7 00189 //#define Y_INVERT_DIR 00190 //#define Y_INVERT_MIN 00191 //#define Y_INVERT_MAX 00192 //#define Y_INVERT_ENABLE 00193 00194 #define Z_STEP_PIN AIO4 00195 #define Z_DIR_PIN AIO3 00196 #define Z_MIN_PIN AIO1 00197 #define Z_MAX_PIN AIO0 00198 #define Z_ENABLE_PIN AIO2 00199 //#define Z_INVERT_DIR 00200 //#define Z_INVERT_MIN 00201 //#define Z_INVERT_MAX 00202 //#define Z_INVERT_ENABLE 00203 00204 #define E_STEP_PIN DIO16 00205 #define E_DIR_PIN DIO17 00206 //#define E_ENABLE_PIN xxxx 00207 //#define E_INVERT_DIR 00208 00209 #define SD_CARD_DETECT DIO2 00210 #define SD_WRITE_PROTECT DIO3 00211 00212 00213 00214 /***************************************************************************\ 00215 * * 00216 * 4. TEMPERATURE SENSORS * 00217 * * 00218 \***************************************************************************/ 00219 00224 #define TEMP_HYSTERESIS 20 00225 00231 #define TEMP_RESIDENCY_TIME 60 00232 00233 // which temperature sensors are you using? (intercom is the gen3-style separate extruder board) 00234 // #define TEMP_MAX6675 00235 // #define TEMP_THERMISTOR 00236 // #define TEMP_AD595 00237 // #define TEMP_PT100 00238 #define TEMP_INTERCOM 00239 00240 /***************************************************************************\ 00241 * * 00242 * Define your temperature sensors here * 00243 * * 00244 * for GEN3 set temp_type to TT_INTERCOM and temp_pin to 0 * 00245 * * 00246 * Types are same as TEMP_ list above- TT_MAX6675, TT_THERMISTOR, TT_AD595, * 00247 * TT_PT100, TT_INTERCOM. See list in temp.c. * 00248 * * 00249 \***************************************************************************/ 00250 00251 #ifndef DEFINE_TEMP_SENSOR 00252 #define DEFINE_TEMP_SENSOR(...) 00253 #endif 00254 00255 // name type pin 00256 DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, 0) 00257 // DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, 1) 00258 00259 00260 00261 /***************************************************************************\ 00262 * * 00263 * 5. HEATERS * 00264 * * 00265 \***************************************************************************/ 00266 00267 00271 // #define HEATER_SANITY_CHECK 00272 00273 /***************************************************************************\ 00274 * * 00275 * Define your heaters here * 00276 * * 00277 * \WARNING For GEN3, ONLY DEFINE HEATERS CONNECTED TO YOUR MOTHERBOARD HERE * 00278 * Heaters connected to your extruder controller belong in extruder/config.h * 00279 * * 00280 * If your heater isn't on a PWM-able pin, set heater_pwm to zero and we'll * 00281 * use bang-bang output. Note that PID will still be used * 00282 * * 00283 * See Appendix 8 at the end of this file for PWMable pin mappings * 00284 * * 00285 * If a heater isn't attached to a temperature sensor above, it can still be * 00286 * controlled by host but otherwise is ignored by firmware * 00287 * * 00288 * To attach a heater to a temp sensor above, simply use exactly the same * 00289 * name - copy+paste is your friend * 00290 * * 00291 * Some common names are 'extruder', 'bed', 'fan', 'motor' * 00292 * * 00293 \***************************************************************************/ 00294 00295 #ifndef DEFINE_HEATER 00296 #define DEFINE_HEATER(...) 00297 #endif 00298 00299 // name port pin pwm 00300 // DEFINE_HEATER(extruder, PORTB, PINB3, OCR0A) 00301 // DEFINE_HEATER(bed, PORTB, PINB4, OCR0B) 00302 // DEFINE_HEATER(fan, PORTB, PINB4, OCR0B) 00303 // DEFINE_HEATER(chamber, PORTD, PIND7, OCR2A) 00304 // DEFINE_HEATER(motor, PORTD, PIND6, OCR2B) 00305 00316 // #define HEATER_EXTRUDER HEATER_extruder 00317 // #define HEATER_BED HEATER_bed 00318 // #define HEATER_FAN HEATER_fan 00319 00320 00321 00322 /***************************************************************************\ 00323 * * 00324 * 6. COMMUNICATION OPTIONS * 00325 * * 00326 \***************************************************************************/ 00327 00334 // #define REPRAP_HOST_COMPATIBILITY 19750101 00335 #define REPRAP_HOST_COMPATIBILITY 20100806 00336 // #define REPRAP_HOST_COMPATIBILITY <date of next RepRap Host compatibility break> 00337 00341 #define BAUD 115200 00342 00348 // #define XONXOFF 00349 00350 00351 00352 /***************************************************************************\ 00353 * * 00354 * 7. MISCELLANEOUS OPTIONS * 00355 * * 00356 \***************************************************************************/ 00357 00364 // #define DEBUG 00365 00377 // #define BANG_BANG 00378 // #define BANG_BANG_ON 200 00379 // #define BANG_BANG_OFF 45 00380 00386 #define MOVEBUFFER_SIZE 8 00387 00392 // #define DC_EXTRUDER HEATER_motor 00393 // #define DC_EXTRUDER_PWM 180 00394 00398 // #define USE_WATCHDOG 00399 00404 #define REFERENCE REFERENCE_AVCC 00405 00410 #define STEP_INTERRUPT_INTERRUPTIBLE 1 00411 00416 #define TH_COUNT 8 00417 00419 #define PID_SCALE 1024L 00420 00421 00422 00423 /***************************************************************************\ 00424 * * 00425 * 8. APPENDIX A - PWMABLE PINS AND MAPPINGS * 00426 * * 00427 * * 00428 * list of PWM-able pins and corresponding timers * 00429 * timer1 is used for step timing so don't use OC1A/OC1B * 00430 * they are omitted from this listing for that reason * 00431 * * 00432 * For the atmega168/328, timer/pin mappings are as follows * 00433 * * 00434 * OCR0A - PD6 - DIO6 * 00435 * OCR0B - PD5 - DIO5 * 00436 * OCR2A - PB3 - DIO11 * 00437 * OCR2B - PD3 - DIO3 * 00438 * * 00439 * For the atmega644, timer/pin mappings are as follows * 00440 * * 00441 * OCR0A - PB3 - DIO3 * 00442 * OCR0B - PB4 - DIO4 * 00443 * OCR2A - PD7 - DIO15 * 00444 * OCR2B - PD6 - DIO14 * 00445 * * 00446 * For the atmega1280, timer/pin mappings are as follows * 00447 * * 00448 * OCR0A - PB7 - DIO13 * 00449 * OCR0B - PG5 - DIO4 * 00450 * OCR2A - PB4 - DIO10 * 00451 * OCR2B - PH6 - DIO9 * 00452 * OCR3AL - PE3 - DIO5 * 00453 * OCR3BL - PE4 - DIO2 * 00454 * OCR3CL - PE5 - DIO3 * 00455 * OCR4AL - PH3 - DIO6 * 00456 * OCR4BL - PH4 - DIO7 * 00457 * OCR4CL - PH5 - DIO8 * 00458 * OCR5AL - PL3 - DIO46 * 00459 * OCR5BL - PL4 - DIO45 * 00460 * OCR5CL - PL5 - DIO44 * 00461 * * 00462 \***************************************************************************/