Ingen beskrivning
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

config.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef _CONFIG_H_
  2. #define _CONFIG_H_
  3. /***************************************
  4. ********** Firmware Settings **********
  5. ***************************************/
  6. #define FIRMWARE_VERSION "0.1"
  7. #define LED_BLINK_INTERVAL 1000
  8. #define DEBOUNCE_DELAY 50
  9. #define ENCODER_CLICK_BEEP_FREQ 2000
  10. #define ENCODER_CLICK_BEEP_TIME 50
  11. #define HOMING_BEEP_FREQ 3000
  12. #define HOMING_BEEP_TIME 100
  13. #define KILL_BEEP_FREQ 3000
  14. #define KILL_BEEP_TIME 100
  15. #define KILL_BEEP_REPEAT 5
  16. /***************************************
  17. ********** Hardware Settings **********
  18. ***************************************/
  19. // xy steps per mm
  20. #define XY_BELT_PITCH 2.0
  21. #define XY_PULLEY_TEETH 40.0
  22. #define XY_MICRO_STEPS 16.0
  23. #define XY_MOTOR_STEPS_PER_REV (200.0 * XY_MICRO_STEPS)
  24. #define XY_STEPS_PER_MM (XY_MOTOR_STEPS_PER_REV / XY_PULLEY_TEETH / XY_BELT_PITCH)
  25. // z steps per mm
  26. #define Z_ROD_PITCH 2.0
  27. #define Z_MICRO_STEPS 16.0
  28. #define Z_MOTOR_STEPS_PER_REV (200.0 * Z_MICRO_STEPS)
  29. #define Z_STEPS_PER_MM (Z_MOTOR_STEPS_PER_REV / Z_ROD_PITCH)
  30. // e steps per mm
  31. // 1/2 turn of output is movement range
  32. // gear box factor 3:1 output:input
  33. // 3/2 turns of motor equals 100% movement
  34. // (16 * 200) = 3200 steps for motor turn
  35. // 3200 * 3 / 2 = 4800 steps for 3/2 turn
  36. // 4800 / 100 = 48 steps for one percent of movement
  37. #define GEARBOX_MULT 3
  38. #define OUTPUT_TURN_DIV 2
  39. #define E_MICRO_STEPS 16.0
  40. #define E_MOTOR_STEPS_PER_REV (200.0 * E_MICRO_STEPS)
  41. #define E_STEPS_PER_PERCENT (E_MOTOR_STEPS_PER_REV * GEARBOX_MULT / OUTPUT_TURN_DIV / 100.0)
  42. // travel lengths
  43. #define X_AXIS_MIN -5.0 // in mm
  44. #define X_AXIS_MAX 260.0 // in mm
  45. #define Y_AXIS_MIN -5.0 // in mm
  46. #define Y_AXIS_MAX 360.0 // in mm
  47. #define Z_AXIS_MIN 0.0 // TODO in mm
  48. #define Z_AXIS_MAX 100.0 // TODO in mm
  49. #define E_AXIS_MIN 0.0 // in mm
  50. #define E_AXIS_MAX 6.0 // in mm
  51. // 0 degree = 0 percent = pi = 0mm
  52. // 180 degree = 100 percent = 2pi = 6mm
  53. // (cos(pi + x / 100 * pi) + 1) / 2 * 6mm
  54. #define E_PERCENT_TO_MM(x) ((cos(PI + (x * PI / 100.0)) + 1.0) / 2.0 * E_AXIS_MAX)
  55. #define E_MM_TO_PERCENT(x) ((acos((x * 2.0 / E_AXIS_MAX) - 1.0) - PI) * 100.0 / PI)
  56. // maximum speeds
  57. #define XY_MAX_SPEED 50.0 // in mm/s
  58. #define Z_MAX_SPEED 20.0 // in mm/s
  59. #define E_MAX_SPEED 50.0 // in percent/s
  60. // homing speeds
  61. #define XY_FAST_HOME_SPEED 2.5 // in mm/s
  62. #define XY_SLOW_HOME_SPEED 1.0 // in mm/s
  63. #define Z_FAST_HOME_SPEED 2.0 // in mm/s
  64. #define Z_SLOW_HOME_SPEED 1.0 // in mm/s
  65. #define E_FAST_HOME_SPEED 10.0 // in percent/s
  66. #define E_SLOW_HOME_SPEED 5.0 // in percent/s
  67. // accelerations
  68. #define XY_MAX_ACCEL 100.0 // in mm/s^2
  69. #define Z_MAX_ACCEL 50.0 // in mm/s^2
  70. #define E_MAX_ACCEL 1000.0 // in percent/s^2
  71. // axis movement directions (1.0 normal, -1.0 inverted)
  72. #define X_AXIS_MOVEMENT_DIR 1.0
  73. #define Y_AXIS_MOVEMENT_DIR 1.0
  74. #define Z_AXIS_MOVEMENT_DIR 1.0
  75. #define E_AXIS_MOVEMENT_DIR 1.0
  76. // homing back-off
  77. #define XY_BACK_OFF_DISTANCE 10.0 // in mm
  78. #define Z_BACK_OFF_DISTANCE 5.0 // in mm
  79. #define E_BACK_OFF_DISTANCE 2.0 // in mm
  80. #define XY_HOME_BACK_OFF_TIME (XY_BACK_OFF_DISTANCE / XY_FAST_HOME_SPEED * 1000)
  81. #define Z_HOME_BACK_OFF_TIME (Z_BACK_OFF_DISTANCE / Z_FAST_HOME_SPEED * 1000)
  82. #define E_HOME_BACK_OFF_TIME (E_BACK_OFF_DISTANCE / E_FAST_HOME_SPEED * 1000)
  83. #endif // _CONFIG_H_