#ifndef CONFIGURATION_H #define CONFIGURATION_H #include "features.h" /* * This is the configuration file for the RepRap Motherboard microcontroller. * Set values in it to match your RepRap machine. * * Lines in here with a * * // *RO * * Comment at the end (read-only) should probably only be changed if you really * know what you are doing... */ // Here are the Motherboard codes; set MOTHERBOARD to the right one // A standard Mendel is MOTHERBOARD 2 // pre-select a typical setup from the below list // using typical pinouts and typical capabilities. see features.h for what typical setups we have available //#define DEFAULTS DARWIN_DEFAULTS //#define DEFAULTS MENDEL_DEFAULTS #define DEFAULTS MENDEL_MEGA_DEFAULTS //********************************************************************************************* // These settings are for a typical "Darwin" machine: //********************************************************************************************* #if DEFAULTS == DARWIN_DEFAULTS #define CPUTYPE CPUTYPE_ATMEL168 //darwin ran on a classic arduino, but may also run on a CPUTYPE_ATMEL328 or CPUTYPE_MEGA etc. #define TEMP_SENSOR TEMP_SENSOR_RRRF10K_THERMISTOR // Temperature measurement ( BED or Internal Extruder code. IF you use BOTH, you MUST use same measurement type - TODO fix this). //#define PASTE_EXTRUDER // Uncomment this line if this is driving a paste extruder #define EXTRUDER_CONTROLLER EXTRUDER_CONTROLLER_INTERNAL // darwins traditionally had a DC extruder (EXTRUDER_CONTROLLER_DC). later ones have had a direct drive stepper extruder (EXTRUDER_CONTROLLER_INTERNAL) #define ENABLE_PIN_STATE ENABLE_PIN_STATE_NORMAL // For RepRap stepper boards version 1.x the enable pins are *not* inverting. later version are. // RepRap opto endstops with H21LOI sensors are not inverting; ones with H21LOB are inverting. #define ENDSTOP_OPTO_TYPE ENDSTOP_OPTO_TYPE_H21LOI // are all axes using the same opto? #define X_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Y_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Z_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define MOVEMENT_TYPE MOVEMENT_TYPE_STEP_DIR // darwin axes are moved around with STEP/DIRECTION logic. #define STEPPER_TYPE STEPPER_TYPE_LIN_4118S //to be checked - what was darwins recommended ? it was a NEMA23, wasn't it? // Axis scaling in stepper-motor steps per mm of movement #define X_STEPS_PER_MM 7.99735 #define INVERT_X_DIR 0 #define Y_STEPS_PER_MM 7.99735 #define INVERT_Y_DIR 0 #define Z_STEPS_PER_MM 320 #define INVERT_Z_DIR 0 #define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR // RRRF 100k thermistor was typical for darwin, yes? #define DATA_SOURCE DATA_SOURCE_USB_SERIAL // well stream the data from USB to the CPU. // Stepper-driven extruder // E_STEPS_PER_MM is the number of steps needed to extrude 1mm out of the nozzle. // E0 for extruder 0; E1 for extruder 1, and so on. #define E_STEPS_PER_MM 0.9 // NEMA 17 extruder 5mm diameter drive - empirically adjusted //#define E0_STEPS_PER_MM 2.2 // NEMA 17 59/11 geared extruder 8mm diameter drive //#define E1_STEPS_PER_MM 2.2 // NEMA 17 59/11 geared extruder 8mm diameter drive // The number of real extruders in this machine #define EXTRUDER_COUNT 1 // Both Darwin and Mendel have MIN endstops, but not MAX ones. #define ENDSTOPS_MIN_ENABLED 1 #define ENDSTOPS_MAX_ENABLED 0 //our maximum feedrates in mm/minute #define FAST_XY_FEEDRATE 3000.0 #define FAST_Z_FEEDRATE 50.0 //darwin didn't support acceleration normally #define ACCELERATION ACCELERATION_OFF // Set these to 1 to disable an axis when it's not being used, // and for the extruder. Usually only Z is disabled when not in // use. You will probably find that disabling the others (i.e. // powering down the steppers that drive them) when the ends of // movements are reached causes poor-quality builds. (Inertia // causes overshoot if the motors are not left powered up.) #define DISABLE_X 0 #define DISABLE_Y 0 #define DISABLE_Z 1 #define DISABLE_E 0 #endif //********************************************************************************************** // These settings are typical for a standard Mendel //********************************************************************************************* #if DEFAULTS == MENDEL_DEFAULTS //#define MENDEL 1 #define CPUTYPE CPUTYPE_SANGUINO #define ENABLE_PIN_STATE ENABLE_PIN_STATE_INVERTING // For RepRap stepper boards version 2.x and above the enable pins are inverting. // RepRap opto endstops with H21LOI sensors are not inverting; ones with H21LOB are inverting. #define ENDSTOP_OPTO_TYPE ENDSTOP_OPTO_TYPE_H21LOI // are all axes using the same opto? #define X_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Y_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Z_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE // normal Mendel uses neither a heated bed, nor an Internal extruder PID code: //#define TEMP_SENSOR TEMP_SENSOR_RRRF10K_THERMISTOR // Temperature measurement ( BED or Internal Extruder code. IF you use BOTH, you MUST use same measurement type - TODO fix this). #define EXTRUDER_CONTROLLER EXTRUDER_CONTROLLER_RS485 // mendel usuallty uses RS485 extruder #if EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_RS485 #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 // *RO #endif #define MOVEMENT_TYPE MOVEMENT_TYPE_STEP_DIR // darwin axes are moved around with STEP/DIRECTION logic. // Axis scaling in stepper-motor steps per mm of movement #define X_STEPS_PER_MM 10.047 #define INVERT_X_DIR 0 #define Y_STEPS_PER_MM 10.047 #define INVERT_Y_DIR 0 #define Z_STEPS_PER_MM 833.398 #define INVERT_Z_DIR 0 #define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR // RRRF 100k thermistor is typical for mendel, yes? #define DATA_SOURCE DATA_SOURCE_USB_SERIAL // well stream the data from USB to the CPU. // Stepper-driven extruder // E_STEPS_PER_MM is the number of steps needed to extrude 1mm out of the nozzle. // E0 for extruder 0; E1 for extruder 1, and so on. //#define E_STEPS_PER_MM 0.9 // NEMA 17 extruder 5mm diameter drive - empirically adjusted #define E0_STEPS_PER_MM 2.2 // NEMA 17 59/11 geared extruder 8mm diameter drive //#define E1_STEPS_PER_MM 2.2 // NEMA 17 59/11 geared extruder 8mm diameter drive // The number of real extruders in this machine #define EXTRUDER_COUNT 1 // Both Darwin and Mendel have MIN endstops, but not MAX ones. #define ENDSTOPS_MIN_ENABLED 1 #define ENDSTOPS_MAX_ENABLED 0 //our maximum feedrates in mm/minute #define FAST_XY_FEEDRATE 3000.0 #define FAST_Z_FEEDRATE 50.0 #define ACCELERATION ACCELERATION_ON // Set these to 1 to disable an axis when it's not being used, // and for the extruder. Usually only Z is disabled when not in // use. You will probably find that disabling the others (i.e. // powering down the steppers that drive them) when the ends of // movements are reached causes poor-quality builds. (Inertia // causes overshoot if the motors are not left powered up.) #define DISABLE_X 0 #define DISABLE_Y 0 #define DISABLE_Z 1 #define DISABLE_E 0 #endif //********************************************************************************************** // These settings are typical for a Mendel with an Arduino Mega controller and Pololu stepper drivers or similar // See http://reprap.org/wiki/Pololu_Electronics //********************************************************************************************* #if DEFAULTS == MENDEL_MEGA_DEFAULTS //#define MENDEL 1 #define CPUTYPE CPUTYPE_MEGA #define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR // RRRF 100k thermistor is typical yes? ( BED or Internal Extruder code. IF you use BOTH, you MUST use same measurement type - TODO fix this). #define EXTRUDER_CONTROLLER EXTRUDER_CONTROLLER_INTERNAL // mendel usuallty uses RS485 extruder // 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 #define ENABLE_PIN_STATE ENABLE_PIN_STATE_INVERTING // For RepRap stepper boards version 2.x and above the enable pins are inverting. // Both Darwin and Mendel have MIN endstops, but not MAX ones. #define ENDSTOPS_MIN_ENABLED 1 #define ENDSTOPS_MAX_ENABLED 0 #define MOVEMENT_TYPE MOVEMENT_TYPE_STEP_DIR // darwin axes are moved around with STEP/DIRECTION logic. // Set to one if the axis opto-sensor outputs inverting (ie: 1 means open, 0 means closed) // RepRap opto endstops with H21LOI sensors are not inverting; ones with H21LOB // are inverting. // RepRap opto endstops with H21LOI sensors are not inverting; ones with H21LOB are inverting. #define ENDSTOP_OPTO_TYPE ENDSTOP_OPTO_TYPE_H21LOI // are all axes using the same opto? #define X_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Y_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE #define Z_ENDSTOP_INVERTING ENDSTOP_OPTO_TYPE // Motherboard 3 driving Pololu microstepping controllers - 16 microsteps #define MICROSTEPPING 16 // Axis scaling in stepper-motor steps per mm of movement #define X_STEPS_PER_MM MICROSTEPPING*5.0235 #define INVERT_X_DIR 0 #define Y_STEPS_PER_MM MICROSTEPPING*5.0235 #define INVERT_Y_DIR 0 #define Z_STEPS_PER_MM MICROSTEPPING*416.699 #define INVERT_Z_DIR 1 // Stepper-driven extruder // E_STEPS_PER_MM is the number of steps needed to extrude 1mm out of the nozzle. // E0 for extruder 0; E1 for extruder 1, and so on. //TODO use MICROSTEPPING constant here too? //#define E_STEPS_PER_MM 0.9 // NEMA 17 extruder 5mm diameter drive - empirically adjusted #define E0_STEPS_PER_MM 17.6 // NEMA 17 59/11 geared extruder 8mm diameter drive #define E1_STEPS_PER_MM 17.6 // NEMA 17 59/11 geared extruder 8mm diameter drive // The number of real extruders in this machine #define EXTRUDER_COUNT 1 #define DATA_SOURCE DATA_SOURCE_USB_SERIAL // well stream the data from USB to the CPU. //our maximum feedrates in mm/minute #define FAST_XY_FEEDRATE 3000.0 #define FAST_Z_FEEDRATE 50.0 #define ACCELERATION ACCELERATION_ON #define HEATED_BED HEATED_BED_ON // Set these to 1 to disable an axis when it's not being used, // and for the extruder. Usually only Z is disabled when not in // use. You will probably find that disabling the others (i.e. // powering down the steppers that drive them) when the ends of // movements are reached causes poor-quality builds. (Inertia // causes overshoot if the motors are not left powered up.) #define DISABLE_X 0 #define DISABLE_Y 0 #define DISABLE_Z 0 #define DISABLE_E 0 #endif //********************************************************************************************** // These settings are for the Bath prototype Mendel //********************************************************************************************* #if DEFAULTS == BATHPROTO_DEFAULTS #define MOVEMENT_TYPE MOVEMENT_TYPE_STEP_DIR // darwin axes are moved around with STEP/DIRECTION logic. // 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 INVERT_X_DIR 0 #define Y_STEPS_PER_MM 13.333333 #define Y_STEPS_PER_INCH (Y_STEPS_PER_MM*INCHES_TO_MM) #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 INVERT_Z_DIR 0 // The number of real extruders in this machine #define EXTRUDER_COUNT 1 #define DATA_SOURCE DATA_SOURCE_USB_SERIAL // well stream the data from USB to the CPU. // Both Darwin and Mendel have MIN endstops, but not MAX ones. #define ENDSTOPS_MIN_ENABLED 1 #define ENDSTOPS_MAX_ENABLED 0 //our maximum feedrates in mm/minute #define FAST_XY_FEEDRATE 3000.0 #define FAST_Z_FEEDRATE 50.0 #define ACCELERATION ACCELERATION_ON // Set these to 1 to disable an axis when it's not being used, // and for the extruder. Usually only Z is disabled when not in // use. You will probably find that disabling the others (i.e. // powering down the steppers that drive them) when the ends of // movements are reached causes poor-quality builds. (Inertia // causes overshoot if the motors are not left powered up.) #define DISABLE_X 0 #define DISABLE_Y 0 #define DISABLE_Z 1 #define DISABLE_E 0 #endif //********************************************************************************************** // These settings are for Makerbot hardware running Reprap firmware! //********************************************************************************************* #if DEFAULTS == MAKERBOT_DEFAULTS // add your own settings here if you have a makerbot and know what to use! #define ACCELERATION ACCELERATION_OFF //makerbot DC extruders are not acceleration capable //TODO add more here! #endif //********************************************************************************************** // These settings are for CUSTOM RepStraps, etc. //********************************************************************************************* #if DEFAULTS == CUSTOM_DEFAULTS // add your own custom settings here if you aren't using any of the above common types! //TODO add more here! #endif //********************************************************************************************** // All other Settings not specific to the motherboard type, or derived from the above settings //********************************************************************************************* // support imperial settings derived from metric: #define X_STEPS_PER_INCH (X_STEPS_PER_MM*INCHES_TO_MM) // *RO #define Y_STEPS_PER_INCH (Y_STEPS_PER_MM*INCHES_TO_MM) // *RO #define Z_STEPS_PER_INCH (Z_STEPS_PER_MM*INCHES_TO_MM) // *RO // Data for acceleration calculations - change the ACCELERATION variable above, not here #if ACCELERATION == ACCELERATION_ON #define SLOW_XY_FEEDRATE 1000.0 // Speed from which to start accelerating #define SLOW_Z_FEEDRATE 20 #endif #if ENABLE_PIN_STATE == ENABLE_PIN_STATE_INVERTING #define ENABLE_ON LOW // *RO #else // *RO #define ENABLE_ON HIGH // *RO #endif // *RO //derived generic thermistor truth test? #if ((TEMP_SENSOR == TEMP_SENSOR_EPCOS540_THERMISTOR) || (TEMP_SENSOR == TEMP_SENSOR_EPCOS560_THERMISTOR) || (TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR) || (TEMP_SENSOR == TEMP_SENSOR_RRRF10K_THERMISTOR) || (TEMP_SENSOR == TEMP_SENSOR_RS10K_THERMISTOR )) #define USE_THERMISTOR 1 //generic definition, set by the above. #endif // The number of 5-second intervals to wait at the target temperature for things to stabilise. // Too short, and the extruder will jam as only part of it will be hot enough. // Too long and the melt will extend too far up the insulating tube. // Default value: 10 #define WAIT_AT_TEMPERATURE 10 // PID gains. These are about right for a brass extruder about 8 mm // in diameter and 30 mm long heated by a 6 ohm coil with a 12v supply. #define TEMP_PID_PGAIN 2 #define TEMP_PID_IGAIN 0.07 #define TEMP_PID_DGAIN 1 //****************************************************************************** // You probably only want to edit things below this line if you really really // know what you are doing... void delayMicrosecondsInterruptible(unsigned int us); // Inline interrupt control functions inline void enableTimerInterrupt() { TIMSK1 |= (1<