yarf 0.1
Yet Another RepRap Firmware
|
Contains all the user-configurable options of the firmware. More...
#include <math.h>
Go to the source code of this file.
Defines | |
#define | BOARD 1 |
Defines the electronics board for which the firmware will be compiled. | |
#define | HOST_BAUD_RATE 19200 |
The speed at which to communicate with the host computer. | |
#define | E_COORDINATES_ARE_INPUT 1 |
Determines whether the extruder coordinates received from the host (as part of g-code commands) are interpreted as the length of filament to push into the extruder, or the length of filament that needs to come out of the extruder. | |
#define | SOFTWARE_MAX_ENDSTOPS 1 |
Determines whether or not to emulate the endstops at the end of each axis (the max endstops) in software. | |
#define | X_LENGTH 160 |
The maximum distance (in mm) the carriage can move from its origin on the x axis. | |
#define | Y_LENGTH 180 |
The maximum distance (in mm) the print bed can move from its origin on the y axis. | |
#define | Z_LENGTH 80 |
The maximum distance (in mm) the z axis bed can move up from its origin. | |
#define | X_STEPS_PER_MM 80L |
The number of steps it takes the x axis' stepper motor to move the carriage 1 mm. | |
#define | Y_STEPS_PER_MM 80L |
The number of steps it takes the y axis' stepper motor to move the carriage 1 mm. | |
#define | Z_STEPS_PER_MM 2560L |
The number of steps it takes the z axis' stepper motors to move the z axis 1 mm. | |
#define | X_DIR_INVERTED 0 |
Whether the direction of the x axis' stepper motor is inverted. | |
#define | Y_DIR_INVERTED 1 |
Whether the direction of the y axis' stepper motor is inverted. | |
#define | Z_DIR_INVERTED 0 |
Whether the direction of the z axis' stepper motor is inverted. | |
#define | E_DIR_INVERTED 1 |
Whether the direction of the extruder's stepper motor is inverted. | |
#define | X_MAX_SPEED 6000 |
The absolute maximum speed (in mm/min) on the x axis. | |
#define | Y_MAX_SPEED 6000 |
The absolute maximum speed (in mm/min) on the y axis. | |
#define | Z_MAX_SPEED 170 |
The absolute maximum speed (in mm/min) on the z axis. | |
#define | E_MAX_SPEED_IN 100 |
The maximum continuous speed (in mm/min) of filament going into the extruder. | |
#define | E_MAX_ADVANCE_SPEED_IN 500 |
The absolute maximum speed (in mm/min) of filament going into the extruder. | |
#define | FD 2.92 |
The diameter of the filament going into the extruder in mm. | |
#define | ED 0.5 |
The diameter of the filament coming out of the extruder in mm. | |
#define | PWD 6.6 |
The diameter of the extruder's pinch wheel in mm. | |
#define | GEAR_RATIO (39.0/11.0) |
The extruder's gear ratio (dimensionless). | |
#define | E_STEPS_PER_REV (360.0*8.0/1.8) |
The number of steps the extruder stepper motor takes in order to make one full rotation. | |
#define | HEATER_MANAGEMENT_FREQUENCY_HZ 1.0 |
The number of times per second a temperature measurement and a heater power update for the nozzle and the print bed will be performed. | |
#define | NOZZLE_HEATER_PIN HEAT1_PIN |
The MCU pin the nozzle heater is connected to. | |
#define | NOZZLE_HEATER_PWM_REG OCR0A |
The PWM register associated with the pin selected for the nozzle heater. | |
#define | NOZZLE_HEATER_MAX_TEMP 250.0 |
The absolute maximum temperature the nozzle heater can be set to, in degrees Celsius. | |
#define | NOZZLE_HEATER_MAX_DUTY_CYCLE 180 |
The maximum relative amount of power that can be applied to the nozzle heater. | |
#define | NOZZLE_THERMISTOR_PIN TEMP2_PIN |
The MCU pin the nozzle thermistor is connected to. | |
#define | NOZZLE_THERMISTOR_TABLE thermistor_table |
The name of the thermistor table variable to use for converting the nozzle thermistor's ADC values to degrees Celcius. | |
#define | NOZZLE_PID_ENVELOPE 10 |
The number of degrees Celsius above or below the nozzle's target temperature, at which the PID algorithm kicks in. | |
#define | NOZZLE_PID_P_GAIN 20 |
The gain of the proportional component of the nozzle heater's PID algorithm instance. | |
#define | NOZZLE_PID_I_GAIN (1/HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the integral component of the nozzle heater's PID algorithm instance. | |
#define | NOZZLE_PID_D_GAIN (0*HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the derivative component of the nozzle heater's PID algorithm instance. | |
#define | PRINTBED_HEATER_PIN HEAT2_PIN |
The MCU pin the print bed heater is connected to. | |
#define | PRINTBED_HEATER_PWM_REG OCR0B |
The PWM register associated with the pin selected for the print bed heater. | |
#define | PRINTBED_HEATER_MAX_TEMP 130.0 |
The absolute maximum temperature the print bed can be set to, in degrees Celsius. | |
#define | PRINTBED_HEATER_MAX_DUTY_CYCLE 255 |
The maximum relative amount of power that can be applied to the print bed heater. | |
#define | PRINTBED_THERMISTOR_PIN TEMP1_PIN |
The MCU pin the print bed's thermistor is connected to. | |
#define | PRINTBED_THERMISTOR_TABLE thermistor_table |
The name of the thermistor table variable to use for converting the print bed thermistor's ADC values to degrees Celcius. | |
#define | PRINTBED_PID_ENVELOPE 3 |
The number of degrees Celsius above or below the print bed's target temperature, at which the PID algorithm kicks in. | |
#define | PRINTBED_PID_P_GAIN 20 |
The gain of the proportional component of the print bed heater's PID algorithm instance. | |
#define | PRINTBED_PID_I_GAIN (2/HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the integral component of the print bed heater's PID algorithm instance. | |
#define | PRINTBED_PID_D_GAIN (1*HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the derivative component of the print bed heater's PID algorithm instance. | |
#define | START_FEED_RATE 1000 |
The default initial feed rate (in mm/min) for each movement. | |
#define | ACCELERATION 2000000.0 |
The acceleration and deceleration rate (in mm/min²) for all movements. | |
#define | PLANNER_LOOKAHEAD 1 |
Whether to use the lookahead component. | |
#define | JUNCTION_DEVIATION ((float)START_FEED_RATE) |
The maximum instantaneous speed difference (in mm/min) between two adjacent perpendicular moves. | |
#define | ADVANCE_ALGORITHM 1 |
Whether to use the advance pressure management system. | |
#define | FILAMENT_DENSITY 0.0013 |
The density (in g/mm³) of the filament. | |
#define | EXTRUDER_K 1200000 |
The k-value (in g/min²) of the spring that models the extruder. | |
#define | ADVANCE_DEPRIME_MM_OUT 5 |
The number of output millimeters to reverse the extruder when no filament needs to be extruded, to prevent oozing. | |
#define | ADVANCE_BASE_FEEDRATE_E 0 |
Determines whether to base the advance calculations on the extruder's feed rate or on the 'overall' feed rate (as specified in the g-code commands). | |
#define | PLANNER_QUEUE_SIZE 32 |
The size of the planning queue in number of movements. | |
#define | STEPPER_HOLD_E 1 |
Whether to hold the extruder's stepper motors when it is not stepping. | |
#define | USART0_RECEIVE_BUFFER_SIZE 128 |
The size of the receive buffer of USART0. | |
#define | GCODE_BUFFER_SIZE 64 |
The size of the gcode component's command buffer. | |
#define | STEPPER_HOLD_X 1 |
Whether to hold the x axis' stepper motor when it is not stepping. | |
#define | STEPPER_HOLD_Y 1 |
Whether to hold the y axis' stepper motor when it is not stepping. | |
#define | STEPPER_HOLD_Z 0 |
Whether to hold the z axis' stepper motors when they are not stepping. |
Contains all the user-configurable options of the firmware.
Definition in file config.h.
#define ACCELERATION 2000000.0 |
#define ADVANCE_ALGORITHM 1 |
#define ADVANCE_BASE_FEEDRATE_E 0 |
Determines whether to base the advance calculations on the extruder's feed rate or on the 'overall' feed rate (as specified in the g-code commands).
Normally, these two should coincide but the host software might want to pull some tricks which makes them differ. To support these tricks, this parameter should be turned ON. However, this seems to give some problems due to round-off errors, so it is recommended to leave this parameter OFF. More information can be found in advance.h.
Valid values: 0 or 1
Note: this value is only relevant if ADVANCE_ALGORITHM is enabled.
#define ADVANCE_DEPRIME_MM_OUT 5 |
The number of output millimeters to reverse the extruder when no filament needs to be extruded, to prevent oozing.
Note that even when this parameter is set to 0, the extruder will still appear to reverse when no filament needs to be extruded, just because the extruder needs to undo the advance steps it took when extruding previously.
Valid values: positive floating point values
Note: this value is only relevant if ADVANCE_ALGORITHM is enabled.
#define BOARD 1 |
#define E_COORDINATES_ARE_INPUT 1 |
Determines whether the extruder coordinates received from the host (as part of g-code commands) are interpreted as the length of filament to push into the extruder, or the length of filament that needs to come out of the extruder.
If this is set to 1, the coordinates are interpreted as the length of filament to push IN to the extruder. If this is set to 0, the coordinates are interpreted as the length of filament that needs to come OUT of the extruder.
Valid values: 0 or 1
#define E_DIR_INVERTED 1 |
Whether the direction of the extruder's stepper motor is inverted.
Change this value if the extruder's stepper motor is rotating in the wrong direction.
Note: be careful about changing this parameter, as it can cause damage to some types of extruders if set incorrectly.
Valid values: 0 or 1
#define E_MAX_ADVANCE_SPEED_IN 500 |
The absolute maximum speed (in mm/min) of filament going into the extruder.
This rate will never be exceeded, even when the extruder is performing advance steps due to the advance pressure management system.
Valid values: positive integers greater than E_MAX_SPEED_IN
#define E_MAX_SPEED_IN 100 |
#define E_STEPS_PER_REV (360.0*8.0/1.8) |
The number of steps the extruder stepper motor takes in order to make one full rotation.
This can usually be calculated as: (360/degrees_per_step) * micro_stepping_rate where degrees_per_step is the number of degrees the stepper motor rotates for a single step and micro_stepping_rate is the stepper motor controller's micro-stepping rate.
Valid values: all positive floating point numbers
#define ED 0.5 |
#define EXTRUDER_K 1200000 |
The k-value (in g/min²) of the spring that models the extruder.
This is the k from Hooke's law. The higher this value, the less the advance algorithm will advance the extruder.
Valid values: positive floating point values
Note: this value is only relevant if ADVANCE_ALGORITHM is enabled.
#define FD 2.92 |
#define FILAMENT_DENSITY 0.0013 |
The density (in g/mm³) of the filament.
Valid values: positive floating point values
Note: this value is only relevant if ADVANCE_ALGORITHM is enabled.
#define GCODE_BUFFER_SIZE 64 |
#define GEAR_RATIO (39.0/11.0) |
#define HEATER_MANAGEMENT_FREQUENCY_HZ 1.0 |
#define HOST_BAUD_RATE 19200 |
The speed at which to communicate with the host computer.
Setting this too low will cause pauses when printing at high speeds, because movements will be executed faster than they are coming in. Setting this too high will cause communication errors because the MCU can't keep up.
Common serial baud rates include:
#define JUNCTION_DEVIATION ((float)START_FEED_RATE) |
The maximum instantaneous speed difference (in mm/min) between two adjacent perpendicular moves.
The lookahead component uses this to determine the maximum amount of jerkyness to allow between two moves.
Valid values: all positive floating point numbers
Note: this value is only relevant if PLANNER_LOOKAHEAD is enabled.
#define NOZZLE_HEATER_MAX_DUTY_CYCLE 180 |
#define NOZZLE_HEATER_MAX_TEMP 250.0 |
#define NOZZLE_HEATER_PIN HEAT1_PIN |
#define NOZZLE_HEATER_PWM_REG OCR0A |
#define NOZZLE_PID_D_GAIN (0*HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the derivative component of the nozzle heater's PID algorithm instance.
It is recommended to provide a constant multiplied by HEATER_MANAGEMENT_FREQUENCY_HZ, as doubling the measurement frequency would half the relative influence of the integral component otherwise.
Valid values: positive integers from 0 to 255
#define NOZZLE_PID_ENVELOPE 10 |
The number of degrees Celsius above or below the nozzle's target temperature, at which the PID algorithm kicks in.
Outside of this temperature range, the heater is turned off completely if the temperature is too high and the heater is turned on to its maximum duty cycle if the temperature is too low.
Valid values: positive integers from 1 to 255
#define NOZZLE_PID_I_GAIN (1/HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the integral component of the nozzle heater's PID algorithm instance.
It is recommended to provide a constant divided by HEATER_MANAGEMENT_FREQUENCY_HZ, as doubling the measurement frequency would double the relative influence of the integral component otherwise.
Valid values: positive integers from 0 to 255
#define NOZZLE_PID_P_GAIN 20 |
The gain of the proportional component of the nozzle heater's PID algorithm instance.
Valid values: positive integers from 0 to 255
#define NOZZLE_THERMISTOR_PIN TEMP2_PIN |
#define NOZZLE_THERMISTOR_TABLE thermistor_table |
The name of the thermistor table variable to use for converting the nozzle thermistor's ADC values to degrees Celcius.
#define PLANNER_LOOKAHEAD 1 |
Whether to use the lookahead component.
The lookahead component tries to keep the speed at which movements are made as high as possible. That is, it tries to raise the entry and exit speeds of blocks, while at the same time preventing jerky movement.
Valid values: 0 or 1
#define PLANNER_QUEUE_SIZE 32 |
The size of the planning queue in number of movements.
The planning queue stores movements that have been generated by the planner component (based on incoming g-code commands) and are waiting to be executed by the block handler component.
This size determines the number of movements that can be waiting for execution. If this size is set too low, the machine will start pausing between movements at high print speeds. The size of the planning queue also directly determines how many moves the lookahead component will look ahead to optimize the speed. If the size is set too large, the lookahead component will consume too much CPU time (if enabled).
Valid values: positive integers from 1 to 128
#define PRINTBED_HEATER_MAX_DUTY_CYCLE 255 |
#define PRINTBED_HEATER_MAX_TEMP 130.0 |
#define PRINTBED_HEATER_PIN HEAT2_PIN |
#define PRINTBED_HEATER_PWM_REG OCR0B |
#define PRINTBED_PID_D_GAIN (1*HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the derivative component of the print bed heater's PID algorithm instance.
It is recommended to provide a constant multiplied by HEATER_MANAGEMENT_FREQUENCY_HZ, as doubling the measurement frequency would half the relative influence of the integral component otherwise.
Valid values: positive integers from 0 to 255
#define PRINTBED_PID_ENVELOPE 3 |
The number of degrees Celsius above or below the print bed's target temperature, at which the PID algorithm kicks in.
Outside of this temperature range, the heater is turned off completely if the temperature is too high and the heater is turned on to its maximum duty cycle if the temperature is too low.
Valid values: positive integers from 1 to 255
#define PRINTBED_PID_I_GAIN (2/HEATER_MANAGEMENT_FREQUENCY_HZ) |
The gain of the integral component of the print bed heater's PID algorithm instance.
It is recommended to provide a constant divided by HEATER_MANAGEMENT_FREQUENCY_HZ, as doubling the measurement frequency would double the relative influence of the integral component otherwise.
Valid values: positive integers from 0 to 255
#define PRINTBED_PID_P_GAIN 20 |
The gain of the proportional component of the print bed heater's PID algorithm instance.
Valid values: positive integers from 0 to 255
#define PRINTBED_THERMISTOR_PIN TEMP1_PIN |
#define PRINTBED_THERMISTOR_TABLE thermistor_table |
The name of the thermistor table variable to use for converting the print bed thermistor's ADC values to degrees Celcius.
#define PWD 6.6 |
#define SOFTWARE_MAX_ENDSTOPS 1 |
Determines whether or not to emulate the endstops at the end of each axis (the max endstops) in software.
If this parameter is set to 1, the max endstops will be emulated in software. Otherwise, the actual hardware max enstops will be used. If the selected board does not support max endstops, this parameter has no effect (the max endstops will always be emulated in software).
Note: setting this parameter to 0 when there are no max endstops connected can cause the carriage or print bed to crash into the end of an axis, which will physically DAMAGE the machine!
#define START_FEED_RATE 1000 |
The default initial feed rate (in mm/min) for each movement.
Each movement will start at this speed and will accelerate up to the speed given in its g-code command at a rate of ACCELERATION, unless the lookahead component determines the movement can start at a higher speed without causing too much jerkyness.
Valid values: positive integers
#define STEPPER_HOLD_E 1 |
Whether to hold the extruder's stepper motors when it is not stepping.
This prevents the motor from moving but consumes power and continues to heat up the motor. It is HIGHLY recommended to enable this for for the e axis, because the motor will start reversing under the pressure of the filament otherwise.
Valid values: 0 or 1
#define STEPPER_HOLD_X 1 |
#define STEPPER_HOLD_Y 1 |
#define STEPPER_HOLD_Z 0 |
Whether to hold the z axis' stepper motors when they are not stepping.
This prevents the motors from moving but consumes power and continues to heat up the motor. It is recommended to disable this for the z axis, because it can't freely move up and down even when the motors are disabled.
Valid values: 0 or 1
#define USART0_RECEIVE_BUFFER_SIZE 128 |
#define X_DIR_INVERTED 0 |
Whether the direction of the x axis' stepper motor is inverted.
Change this value if the x axis' stepper motor is rotating in the wrong direction.
Note: be very careful about changing this parameter, as it can cause the carriage to crash into the end of the x axis during homing, which will physically DAMAGE the machine!
Valid values: 0 or 1
#define X_LENGTH 160 |
#define X_MAX_SPEED 6000 |
#define X_STEPS_PER_MM 80L |
#define Y_DIR_INVERTED 1 |
Whether the direction of the y axis' stepper motor is inverted.
Change this value if the y axis' stepper motor is rotating in the wrong direction.
Note: be very careful about changing this parameter, as it can cause the print bed to crash into the end of the y axis during homing, which will physically DAMAGE the machine!
Valid values: 0 or 1
#define Y_LENGTH 180 |
#define Y_MAX_SPEED 6000 |
#define Y_STEPS_PER_MM 80L |
#define Z_DIR_INVERTED 0 |
Whether the direction of the z axis' stepper motor is inverted.
Change this value if the z axis' stepper motor is rotating in the wrong direction.
Note: be very careful about changing this parameter, as it can cause the extruder to crash into top of the machine during homing, which will physically DAMAGE the machine!
Valid values: 0 or 1
#define Z_LENGTH 80 |
#define Z_MAX_SPEED 170 |