123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifndef _CONFIG_H_
- #define _CONFIG_H_
-
- /***************************************
- ********** Firmware Settings **********
- ***************************************/
-
- #define FIRMWARE_VERSION "0.1"
-
- #define LED_BLINK_INTERVAL 1000
- #define DEBOUNCE_DELAY 50
-
- #define ENCODER_CLICK_BEEP_FREQ 2000
- #define ENCODER_CLICK_BEEP_TIME 50
-
- #define HOMING_BEEP_FREQ 3000
- #define HOMING_BEEP_TIME 100
-
- #define KILL_BEEP_FREQ 3000
- #define KILL_BEEP_TIME 100
- #define KILL_BEEP_REPEAT 5
-
- /***************************************
- ********** Hardware Settings **********
- ***************************************/
-
- #define AXIS_COUNT 4
- #define X_AXIS 0
- #define Y_AXIS 1
- #define Z_AXIS 2
- #define E_AXIS 3
-
- // xy steps per mm
- #define XY_BELT_PITCH 2.0
- #define XY_PULLEY_TEETH 40.0
- #define XY_MICRO_STEPS 16.0
- #define XY_MOTOR_STEPS_PER_REV (200.0 * XY_MICRO_STEPS)
- #define XY_STEPS_PER_MM (XY_MOTOR_STEPS_PER_REV / XY_PULLEY_TEETH / XY_BELT_PITCH)
-
- // z steps per mm
- #define Z_ROD_PITCH 2.0
- #define Z_MICRO_STEPS 16.0
- #define Z_MOTOR_STEPS_PER_REV (200.0 * Z_MICRO_STEPS)
- #define Z_STEPS_PER_MM (Z_MOTOR_STEPS_PER_REV / Z_ROD_PITCH)
-
- // e steps per mm
- // 1/2 turn of output is movement range
- // gear box factor 3:1 output:input
- // 3/2 turns of motor equals 100% movement
- // (16 * 200) = 3200 steps for motor turn
- // 3200 * 3 / 2 = 4800 steps for 3/2 turn
- // 4800 / 100 = 48 steps for one percent of movement
- #define GEARBOX_MULT 3
- #define OUTPUT_TURN_DIV 2
- #define E_MICRO_STEPS 16.0
- #define E_MOTOR_STEPS_PER_REV (200.0 * E_MICRO_STEPS)
- #define E_STEPS_PER_PERCENT (E_MOTOR_STEPS_PER_REV * GEARBOX_MULT / OUTPUT_TURN_DIV / 100.0)
-
- // travel lengths
- #define X_AXIS_MIN -5.0 // in mm
- #define X_AXIS_MAX 260.0 // in mm
- #define Y_AXIS_MIN -5.0 // in mm
- #define Y_AXIS_MAX 360.0 // in mm
- #define Z_AXIS_MIN 0.0 // TODO in mm
- #define Z_AXIS_MAX 100.0 // TODO in mm
- #define E_AXIS_MIN 0.0 // in mm
- #define E_AXIS_MAX 6.0 // in mm
-
- // 0 degree = 0 percent = pi = 0mm
- // 180 degree = 100 percent = 2pi = 6mm
- // (cos(pi + x / 100 * pi) + 1) / 2 * 6mm
- #define E_PERCENT_TO_MM(x) ((cos(PI + (x * PI / 100.0)) + 1.0) / 2.0 * E_AXIS_MAX)
- #define E_MM_TO_PERCENT(x) ((acos((x * 2.0 / E_AXIS_MAX) - 1.0) - PI) * 100.0 / PI)
-
- // maximum speeds
- #define XY_MAX_SPEED 50.0 // in mm/s --> 50mm/s = 2000steps/s
- #define Z_MAX_SPEED 1.2 // in mm/s --> 20mm/s = 32000steps/s
- #define E_MAX_SPEED 30.0 // in percent/s --> 50%/s = 2400steps/s
-
- // homing speeds
- #define XY_FAST_HOME_SPEED 25.0 // in mm/s
- #define XY_SLOW_HOME_SPEED 5.0 // in mm/s
- #define Z_FAST_HOME_SPEED 5.0 // in mm/s
- #define Z_SLOW_HOME_SPEED 1.0 // in mm/s
- #define E_FAST_HOME_SPEED 10.0 // in percent/s
- #define E_SLOW_HOME_SPEED 2.0 // in percent/s
-
- // accelerations
- #define XY_MAX_ACCEL 100.0 // in mm/s^2
- #define Z_MAX_ACCEL 50.0 // in mm/s^2
- #define E_MAX_ACCEL 1000.0 // in percent/s^2
-
- // axis movement directions (1.0 normal, -1.0 inverted)
- #define X_AXIS_MOVEMENT_DIR 1.0
- #define Y_AXIS_MOVEMENT_DIR 1.0
- #define Z_AXIS_MOVEMENT_DIR 1.0
- #define E_AXIS_MOVEMENT_DIR 1.0
-
- // homing back-off
- #define XY_BACK_OFF_DISTANCE 5.0 // in mm
- #define Z_BACK_OFF_DISTANCE 2.0 // in mm
- #define E_BACK_OFF_DISTANCE 1.0 // in mm
-
- #define XY_HOME_BACK_OFF_TIME (XY_BACK_OFF_DISTANCE / XY_FAST_HOME_SPEED * 1000)
- #define Z_HOME_BACK_OFF_TIME (Z_BACK_OFF_DISTANCE / Z_FAST_HOME_SPEED * 1000)
- #define E_HOME_BACK_OFF_TIME (E_BACK_OFF_DISTANCE / E_FAST_HOME_SPEED * 1000)
-
- // epsilon around expected endstop position where we dont abort on hits
- // if you need to increase this value, try to reduce play in your axis
- #define X_AXIS_EPSILON 1.0
- #define Y_AXIS_EPSILON 1.0
- #define Z_AXIS_EPSILON 1.0
- #define E_AXIS_EPSILON 1.0
-
- #define ENCODER_RPM_VALUE_FACTOR 2.0
- #define IDLE_TIMEOUT (5UL * 60UL * 1000UL) // ms, 0 to disable
-
- // TimerOne freq for steppers
- #define XY_MAX_HZ (XY_MAX_SPEED * XY_STEPS_PER_MM)
- #define Z_MAX_HZ (Z_MAX_SPEED * Z_STEPS_PER_MM)
- #define E_MAX_HZ (E_MAX_SPEED * E_STEPS_PER_PERCENT)
- #define MAX_SAMPLE_FREQ 2500
-
- #endif // _CONFIG_H_
|