Repetier-Firmware 0.2
Repetier/Configuration.h File Reference
#include <avr/io.h>
#include "pins.h"

Go to the source code of this file.

Defines

#define MOTHERBOARD   5
#define XAXIS_STEPS_PER_MM   40
 Number of steps for a 1mm move in x direction.
#define YAXIS_STEPS_PER_MM   40
 Number of steps for a 1mm move in y direction.
#define ZAXIS_STEPS_PER_MM   3360
 Number of steps for a 1mm move in z direction.
#define NUM_EXTRUDER   1
#define EXT0_X_OFFSET   0
#define EXT0_Y_OFFSET   0
#define EXT0_STEPS_PER_MM   373
#define EXT0_TEMPSENSOR_TYPE   5
#define EXT0_TEMPSENSOR_PIN   0
#define EXT0_HEATER_PIN   HEATER_0_PIN
#define EXT0_STEP_PIN   E_STEP_PIN
#define EXT0_DIR_PIN   E_DIR_PIN
#define EXT0_INVERSE   false
#define EXT0_ENABLE_PIN   E_ENABLE_PIN
#define EXT0_ENABLE_ON   false
#define EXT0_MAX_FEEDRATE   1200
#define EXT0_MAX_START_FEEDRATE   10
#define EXT0_MAX_ACCELERATION   10000
#define EXT0_HEAT_MANAGER   1
#define EXT0_WATCHPERIOD   40
#define EXT0_PID_INTEGRAL_DRIVE_MAX   130
#define EXT0_PID_PGAIN   300
#define EXT0_PID_IGAIN   2
#define EXT0_PID_DGAIN   2000
#define EXT0_PID_MAX   200
#define EXT0_ADVANCE_K   0.0f
 Faktor for the advance algorithm. 0 disables the algorithm.
#define NUM_TEMPS_USERTHERMISTOR0   28
#define NUM_TEMPS_USERTHERMISTOR1   0
#define NUM_TEMPS_USERTHERMISTOR2   0
#define SCALE_PID_TO_MAX   0
 Set PID scaling.
#define USER_THERMISTORTABLE0
#define USER_THERMISTORTABLE1   {}
#define USER_THERMISTORTABLE2   {}
#define GENERIC_THERM_R0   1042.7
#define GENERIC_THERM_T0   170
#define GENERIC_THERM_BETA   4036
#define GENERIC_THERM_R1   0
#define GENERIC_THERM_R2   4700
#define GENERIC_THERM_VREF   5
#define GENERIC_THERM_VADC   5
#define GENERIC_THERM_NUM_ENTRIES   40
#define HEATED_BED_SENSOR_TYPE   0
#define HEATED_BED_SENSOR_PIN   -1
#define HEATED_BED_HEATER_PIN   -1
#define USE_AVCC_FOR_TEMP
#define ANALOG_SUPERSAMPLE   10
#define NUM_ANALOG_SENSORS   1
#define NUM_DIGITAL_SENSORS   0
#define TEMP_PID   true
#define MINTEMP   5
#define MAXTEMP   275
#define ANALOG_INPUTS   NUM_ANALOG_SENSORS
 number of analog input signals. Normally 1 for each temperature sensor
#define ANALOG_INPUT_CHANNELS   {TEMP_0_PIN}
#define ANALOG_INPUT_BITS   10
#define ANALOG_INPUT_SAMPLE   2
#define ANALOG_REF_AREF   0
#define ANALOG_REF_AVCC   _BV(REFS0)
#define ANALOG_REF_INT_1_1   _BV(REFS1)
#define ANALOG_REF_INT_2_56   _BV(REFS0) | _BV(REFS1)
#define ANALOG_REF   ANALOG_REF_AVCC
 Used reference, normally ANALOG_REF_AVCC or ANALOG_REF_AREF.
#define ANALOG_PRESCALER   _BV(ADPS0)|_BV(ADPS1)|_BV(ADPS2)
#define ENDSTOPPULLUPS   0
#define ENDSTOPS_INVERTING   false
#define X_ENABLE_ON   0
#define Y_ENABLE_ON   0
#define Z_ENABLE_ON   0
#define DISABLE_X   false
#define DISABLE_Y   false
#define DISABLE_Z   true
#define DISABLE_E   false
#define INVERT_X_DIR   false
#define INVERT_Y_DIR   true
#define INVERT_Z_DIR   false
#define X_HOME_DIR   -1
#define Y_HOME_DIR   -1
#define Z_HOME_DIR   -1
#define min_software_endstops   false
#define max_software_endstops   true
#define ALWAYS_CHECK_ENDSTOPS   false
#define X_MAX_LENGTH   200
#define Y_MAX_LENGTH   200
#define Z_MAX_LENGTH   100
#define STEPPER_INACTIVE_TIME   120L
#define MAX_INACTIVE_TIME   0L
#define MAX_FEEDRATE   {15000, 15000, 100, 100}
#define HOMING_FEEDRATE   {2400,2400,100}
#define RAMP_ACCELERATION   1
#define MAX_ACCELERATION_UNITS_PER_SQ_SECOND   {7000,7000,100,1000}
 Use RAMP acceleration for faster printing speed.
#define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND   {7000,7000,100,1000}
 X, Y, Z max acceleration in mm/s^2 for travel moves.
#define MAX_JERK   40.0
 Maximum allowable jerk.
#define MAX_ZJERK   0.3
#define TIMER0_PRESCALE   64
 Prescale factor, timer0 runs at.
#define EXTRUDER_SPEED   25.0
 speed of the extruder feeder
#define MIN_EXTRUDER_TEMP   160
#define USE_OPS   1
 Activate ooze prevention system.
#define OPS_MODE   0
 Sets the ops operation mode.
#define OPS_MIN_DISTANCE   0.8
 Minimum distance for retraction.
#define OPS_MOVE_AFTER   50.0
 Move printhead only after x% of retract distance have been retracted.
#define OPS_RETRACT_DISTANCE   3.0
 Retraction distance in mm. If you want to enable OPS only sometimes, compile with OPS support and set retraction distance to 0. If you set it to e.g. 3 in your eeprom settings it is enabled.
#define OPS_RETRACT_BACKSLASH   0.0
 Backslash produced by extruder reversal.
#define USE_ADVANCE
 Enable advance algorithm.
#define MAX_HALFSTEP_INTERVAL   1999
#define BAUDRATE   76800
 Communication speed.
#define OUTPUT_BUFFER_SIZE   64
 Size in byte of the output buffer.
#define USE_BUFFERED_OUTPUT
 Activates buffered output.
#define MOVE_CACHE_SIZE   16
 Number of moves we can cache in advance.
#define MOVE_CACHE_LOW   12
 Low filled cache size.
#define LOW_TICKS_PER_MOVE   200000
 Cycles per move, if move cache is low.
#define GCODE_BUFFER_SIZE   2
 Cache size for incoming commands.
#define ACK_WITH_LINENUMBER
#define WAITING_IDENTIFIER   "wait"
#define ECHO_ON_EXECUTE
 Sets time for echo debug.
#define EEPROM_MODE   1
 EEPROM storage mode.
#define INCLUDE_DEBUG_COMMUNICATION
#define DEBUG_ADVANCE

Define Documentation

#define ACK_WITH_LINENUMBER

Appends the linenumber after ever ok send, to acknowledge the received command. Uncomment for plain ok ACK if your host has problems with this

#define ALWAYS_CHECK_ENDSTOPS   false
#define ANALOG_INPUT_BITS   10
#define ANALOG_INPUT_CHANNELS   {TEMP_0_PIN}
#define ANALOG_INPUT_SAMPLE   2
#define ANALOG_INPUTS   NUM_ANALOG_SENSORS

number of analog input signals. Normally 1 for each temperature sensor

#define ANALOG_PRESCALER   _BV(ADPS0)|_BV(ADPS1)|_BV(ADPS2)
#define ANALOG_REF   ANALOG_REF_AVCC

Used reference, normally ANALOG_REF_AVCC or ANALOG_REF_AREF.

#define ANALOG_REF_AREF   0
#define ANALOG_REF_AVCC   _BV(REFS0)
#define ANALOG_REF_INT_1_1   _BV(REFS1)
#define ANALOG_REF_INT_2_56   _BV(REFS0) | _BV(REFS1)
#define ANALOG_SUPERSAMPLE   10
#define BAUDRATE   76800

Communication speed.

  • 250000 : Fastes with errorrate of 0% with 16 or 32 MHz - update wiring_serial.c in your board files. See boards/readme.txt
  • 115200 : Fast, but may produce communication errors on quite regular basis, Error rate -3,5%
  • 76800 : Best setting for Arduino with 16 MHz, Error rate 0,2% page 198 AVR1284 Manual. Result: Faster communication then 115200
  • 57600 : Should produce nearly no errors, on my gen 6 it's faster than 115200 because there are no errors slowing down the connection
  • 38600
#define DEBUG_ADVANCE

Allows M111 so set bit 6 (32) which disables moves, at the first tried step. In combination with a dry run, you can test the speed of path computations, which are still performed. Writes the free RAM to output, if it is less then at the last test. Should always return values >500 for safety, since it doesn't catch every function call. Nice to tweak cache usage or for seraching for memory induced errors. Switch it off for production, it costs execution time.

#define DISABLE_E   false
#define DISABLE_X   false
#define DISABLE_Y   false
#define DISABLE_Z   true
#define ECHO_ON_EXECUTE

Sets time for echo debug.

You can set M111 1 which enables ECHO of commands send. This define specifies the position, when it will be executed. In the original FiveD software, echo is done after receiving the command. With checksum you know, how it looks from the sending string. With this define uncommented, you will see the last command executed. To be more specific: It is written after execution. This helps tracking errors, because there may be 8 or more commands in the queue and it is elsewise difficult to know, what your reprap is currently doing.

#define EEPROM_MODE   1

EEPROM storage mode.

Set the EEPROM_MODE to 0 if you always wan't to use the settings in this configuration file. If not, set it to a value not stored in the first EEPROM-byte used. If you later want to overwrite your current eeprom settings with configuration defaults, just select an other value. On the first call to epr_init() it will detect a mismatch of the first byte and copys default values into EEPROM. If the first byte matches, the stored values are used to overwrite the settings.

#define ENDSTOPPULLUPS   0
#define ENDSTOPS_INVERTING   false
#define EXT0_ADVANCE_K   0.0f

Faktor for the advance algorithm. 0 disables the algorithm.

#define EXT0_DIR_PIN   E_DIR_PIN
#define EXT0_ENABLE_ON   false
#define EXT0_ENABLE_PIN   E_ENABLE_PIN
#define EXT0_HEAT_MANAGER   1

Type of heat manager for this extruder.

  • 0 = Simply switch on/off if temperature is reached. Works always.
  • 1 = PID Temperature control. Is better, but needs an output with PWM, which doesn't use Timer 0 and 1
#define EXT0_HEATER_PIN   HEATER_0_PIN
#define EXT0_INVERSE   false
#define EXT0_MAX_ACCELERATION   10000
#define EXT0_MAX_FEEDRATE   1200
#define EXT0_MAX_START_FEEDRATE   10
#define EXT0_PID_DGAIN   2000

Dgain in 0,01 units.

#define EXT0_PID_IGAIN   2

I-gain in 0,01 units

#define EXT0_PID_INTEGRAL_DRIVE_MAX   130

The maximum value, I-gain can contribute to the output.

#define EXT0_PID_MAX   200
#define EXT0_PID_PGAIN   300

P-gain in 0,01 units

#define EXT0_STEP_PIN   E_STEP_PIN
#define EXT0_STEPS_PER_MM   373
#define EXT0_TEMPSENSOR_PIN   0
#define EXT0_TEMPSENSOR_TYPE   5
#define EXT0_WATCHPERIOD   40

Wait x seconds, after reaching target temperature. Only used for M109

#define EXT0_X_OFFSET   0
#define EXT0_Y_OFFSET   0
#define EXTRUDER_SPEED   25.0

speed of the extruder feeder

This is the maximum speed, the filament can be moved forward and backward without acceleration. The value determines, how often we can update the extruder stepper, to come up with the desired extruder position. Higher values increase precision. If you set the value too high, you will lose steps. Only discrete values between 1 and 255 can be set for the timer. The effectife update frequency is computed as:

f = floor(F_CPU/(TIMER0_PRESCALE*EXTRUDER_SPEED*STEPS_PER_MM))

Important: This is the speed, filament is pushed inside the extruder not the speed at the nozzle! If you set the extruder steps_per_mm for 1mm pushed outside, sile skainforge<40 needed it, you must increase the value to reflect this. (*filament_diameter^2/nozzle_diameter^2)

#define GCODE_BUFFER_SIZE   2

Cache size for incoming commands.

There should be no reason to increase this cache. Commands are nearly immediately send to execution.

#define GENERIC_THERM_BETA   4036

Beta value of thermistor

You can use the beta from the datasheet or compute it yourself. See http://reprap.org/wiki/MeasuringThermistorBeta for more details.

#define GENERIC_THERM_NUM_ENTRIES   40

Number of entries in generated table. One entry takes 4 bytes. Higher number of entries increase computation time too.

#define GENERIC_THERM_R0   1042.7

If defined, creates a thermistortable at startup.

If you dont feel like computing the table on your own, you can use this generic method. It is a simple approximation which may be not as accurate as a good table computed from the reference values in the datasheet. You can increase precision if you use a temperature/resistance for R0/T0, which is near your operating temperature. This will reduce precision for lower temperatures, which are not realy important. The resistors must fit the following schematic:

VREF ---- R2 ---+--- Termistor ---+-- GND
                |                 |
                +------ R1 -------+
                |                 |
                +---- Capacitor --+
                |
                V measured

If you don't have R1, set it to 0. The capacitor is for reducing noise from long thermistor cable. If you don't have have one, it's OK.

If you don't need the generic table, uncomment the following define. Reference resistance

#define GENERIC_THERM_R1   0
#define GENERIC_THERM_R2   4700
#define GENERIC_THERM_T0   170

Temperature at reference resistance

#define GENERIC_THERM_VADC   5

Supply voltage to ADC, can be changed be setting ANALOG_REF below to different value.

#define GENERIC_THERM_VREF   5
#define HEATED_BED_HEATER_PIN   -1
#define HEATED_BED_SENSOR_PIN   -1
#define HEATED_BED_SENSOR_TYPE   0
#define HOMING_FEEDRATE   {2400,2400,100}

Speed in mm/min for finding the home position

#define INCLUDE_DEBUG_COMMUNICATION

Comment out (using // at the start of the line) to disable SD support: Uncomment, to see detailed data for every move. Only for debugging purposes! Allows M111 to set bit 5 (16) which disables all commands except M111. This can be used to test your data througput or search for communication problems.

#define INVERT_X_DIR   false
#define INVERT_Y_DIR   true
#define INVERT_Z_DIR   false
#define LOW_TICKS_PER_MOVE   200000

Cycles per move, if move cache is low.

This value must be high enough, that the buffer has time to fill up. The problem only occurs at the beginning of a print or if you are printing many very short segments at high speed.

#define MAX_ACCELERATION_UNITS_PER_SQ_SECOND   {7000,7000,100,1000}

Use RAMP acceleration for faster printing speed.

X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts. Make sure your printer can go that high!

#define MAX_FEEDRATE   {15000, 15000, 100, 100}

Maximum feedrate, the system allows. Higher feedrates are reduced to these values. The axis order in all axis related arrays is X, Y, Z, E

#define MAX_HALFSTEP_INTERVAL   1999

The firmware supports trajectory smoothing. To acieve this, it divides the stepsize by 2, resulting in the double computation cost. For slow movements this is not an issue, but for really fast moves this is too much. The value specified here is the number of clock cycles between a step on the driving axis. If the interval at full speed is below this value, smoothing is disabled for that line.

#define MAX_INACTIVE_TIME   0L

After x seconds of inactivity, the system will go down as far it can. It will at least disable all stepper motors and heaters. If the board has a power pin, it will be disabled, too. Set value to 0 for disabled.

#define MAX_JERK   40.0

Maximum allowable jerk.

Caution: This is no real jerk in a physical meaning.

The jerk determines your start speed and the maximum speed at the join of two segments. It's unit is mm/s. If the printer is standing still, the start speed is jerk/2. At the join of two segments, the speed difference is limited to the jerk value.

Examples: For all examples jerk is assumed as 40.

Segment 1: vx = 50, vy = 0 Segment 2: vx = 0, vy = 50 v_diff = sqrt((50-0)^2+(0-50)^2) = 70.71 v_diff > jerk => vx_1 = vy_2 = jerk/v_diff*vx_1 = 40/70.71*50 = 28.3 mm/s at the join

Segment 1: vx = 50, vy = 0 Segment 2: vx = 35.36, vy = 35.36 v_diff = sqrt((50-35.36)^2+(0-35.36)^2) = 38.27 < jerk Corner can be printed with full speed of 50 mm/s

#define max_software_endstops   true
#define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND   {7000,7000,100,1000}

X, Y, Z max acceleration in mm/s^2 for travel moves.

#define MAX_ZJERK   0.3
#define MAXTEMP   275
#define MIN_EXTRUDER_TEMP   160
#define min_software_endstops   false
#define MINTEMP   5
#define MOTHERBOARD   5
#define MOVE_CACHE_LOW   12

Low filled cache size.

If the cache contains less then MOVE_CACHE_LOW segments, the time per segment is limited to LOW_TICKS_PER_MOVE clock cycles. If a move would be shorter, the feedrate will be reduced. This should prevent buffer underflows. Set this to 0 if you don't care about empty buffers during print.

#define MOVE_CACHE_SIZE   16

Number of moves we can cache in advance.

This number of moves can be cached in advance. If you wan't to cache more, increase this. Especially on many very short moves the cache may go empty. The minimum value is 5.

#define NUM_ANALOG_SENSORS   1
#define NUM_DIGITAL_SENSORS   0
#define NUM_EXTRUDER   1

Number of extruders. Maximum 2 extruder.

#define NUM_TEMPS_USERTHERMISTOR0   28

Number of entries in the user thermistortable 0. Set to 0 to disable it.

#define NUM_TEMPS_USERTHERMISTOR1   0

Number of entries in the user thermistortable 1. Set to 0 to disable it.

#define NUM_TEMPS_USERTHERMISTOR2   0

Number of entries in the user thermistortable 2. Set to 0 to disable it.

#define OPS_MIN_DISTANCE   0.8

Minimum distance for retraction.

If a travel move is shorter than this distance, no retraction will occur. This is to prevent retraction with infill, where the angle to the perimeter needs a short stop. Unit is mm.

#define OPS_MODE   0

Sets the ops operation mode.

0: Off 1: Classic mode. Stop head, retract move to target, push filament back. 2: Fast mode. Retract during move, start pushing back the filament during move. For safty, we start at with a low speed and wait for the push back, before the pintmove starts. Normally there is some time needed to wait for the filament.

#define OPS_MOVE_AFTER   50.0

Move printhead only after x% of retract distance have been retracted.

#define OPS_RETRACT_BACKSLASH   0.0

Backslash produced by extruder reversal.

If you are using a bowden extruder, you may need some extra distance to push the filament back into the original place. This is the value you enter here. Unit is mm.

#define OPS_RETRACT_DISTANCE   3.0

Retraction distance in mm. If you want to enable OPS only sometimes, compile with OPS support and set retraction distance to 0. If you set it to e.g. 3 in your eeprom settings it is enabled.

#define OUTPUT_BUFFER_SIZE   64

Size in byte of the output buffer.

#define RAMP_ACCELERATION   1

Comment this to disable ramp acceleration

#define SCALE_PID_TO_MAX   0

Set PID scaling.

PID values assume a usable range from 0-255. This can be further limited to EXT0_PID_MAX by to methods. Set the value to 0: Normal computation, just clip output to EXT0_PID_MAX if computed value is too high. Set value to 1: Scale PID by EXT0_PID_MAX/256 and then clip to EXT0_PID_MAX. If your EXT0_PID_MAX is low, you should prefer the second method.

#define STEPPER_INACTIVE_TIME   120L

After x seconds of inactivity, the stepper motors are disabled. Set to 0 to leave them enabled. This helps cooling the Stepper motors between two print jobs.

#define TEMP_PID   true
#define TIMER0_PRESCALE   64

Prescale factor, timer0 runs at.

All known arduino boards use 64. This value is needed for the extruder timing.

#define USE_ADVANCE

Enable advance algorithm.

Without a correct adjusted advance algorithm, you get blobs at points, where acceleration changes. The effect increases with speed and acceleration difference. Using the advance method decreases this effect. For more informations, read the wiki.

#define USE_AVCC_FOR_TEMP
#define USE_BUFFERED_OUTPUT

Activates buffered output.

The Arduino libraries have a buffered input for serial connections. Write operations are always unbuffered, which means the controller will wait with execution, until the data is send. To solve this handicap, all write operations have to use out insted of Serial. If you uncomment this, you still have to use out, but it will use no buffers, so you keep with your slow communication version.

#define USE_OPS   1

Activate ooze prevention system.

The ooze prevention system tries to prevent ooze, by a fast retract of the filament every time printing stops. Most slicing software have already an option to do this. Using OPS_MODE=1 will in fact mimic this. This works good, but can increase printing time. To reduce the additional waiting time, the OPS has a fast mode, which performs the retraction during the travelling move. The only reason, your slicer doesn't do it, is because it can't tell. There is simple no G-Code command telling the firmware to do that.

You can always compile including OPS. Then you can disable/enable it anytime you want.

Caution: Don't enable anti-ooze in your slicer if you are using this.

#define USER_THERMISTORTABLE0
Value:
{\
  {1,864},{21,300},{25,290},{29,280},{33,270},{39,260},{46,250},{54,240},{64,230},{75,220},\
  {90,210},{107,200},{128,190},{154,180},{184,170},{221,160},{265,150},{316,140},{375,130},\
  {441,120},{513,110},{588,100},{734,80},{856,60},{938,40},{986,20},{1008,0},{1018,-20} }

Userdefined thermistor table

There are many different thermistors, which can be combined with different resistors. This result in unpredictable number of tables. As a resolution, the user can define one table here, that can be used as type 5 for thermister type in extruder/heated bed definition. Make sure, the number of entries matches the value in NUM_TEMPS_USERTHERMISTOR0. If you span definition over multiple lines, make sure to end each line, except the last, with a backslash. The table format is {{adc1,temp1},{adc2,temp2}...} with increasing adc values. For more informations, read http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html

#define USER_THERMISTORTABLE1   {}
#define USER_THERMISTORTABLE2   {}
#define WAITING_IDENTIFIER   "wait"

Communication errors can swollow part of the ok, which tells the host software to send the next command. Not receiving it will cause your printer to stop. Sending this string every second, if our queue is empty should prevent this. Uncomment if you don't wan't this feature.

#define X_ENABLE_ON   0
#define X_HOME_DIR   -1
#define X_MAX_LENGTH   200
#define XAXIS_STEPS_PER_MM   40

Number of steps for a 1mm move in x direction.

#define Y_ENABLE_ON   0
#define Y_HOME_DIR   -1
#define Y_MAX_LENGTH   200
#define YAXIS_STEPS_PER_MM   40

Number of steps for a 1mm move in y direction.

#define Z_ENABLE_ON   0
#define Z_HOME_DIR   -1
#define Z_MAX_LENGTH   100
#define ZAXIS_STEPS_PER_MM   3360

Number of steps for a 1mm move in z direction.

 All Data Structures Files Functions Variables Typedefs Friends Defines