config_MMU2.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include <inttypes.h>
  3. #include <avr/pgmspace.h>
  4. // Settings for filament load / unload from the LCD menu.
  5. // This is for Prusa MK3-style extruders. Customize for your hardware.
  6. #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
  7. #define NOZZLE_PARK_XY_FEEDRATE 50
  8. #define NOZZLE_PARK_Z_FEEDRATE 15
  9. // Nominal distance from the extruder gear to the nozzle tip is 87mm
  10. // However, some slipping may occur and we need separate distances for
  11. // LoadToNozzle and ToolChange.
  12. // - +5mm seemed good for LoadToNozzle,
  13. // - but too much (made blobs) for a ToolChange
  14. static constexpr float MMU2_LOAD_TO_NOZZLE_LENGTH = 87.0F + 5.0F;
  15. // As discussed with our PrusaSlicer profile specialist
  16. // - ToolChange shall not try to push filament into the very tip of the nozzle
  17. // to have some space for additional G-code to tune the extruded filament length
  18. // in the profile
  19. // Beware - this value is used to initialize the MMU logic layer - it will be sent to the MMU upon line up (written into its 8bit register 0x0b)
  20. // However - in the G-code we can get a request to set the extra load distance at runtime to something else (M708 A0xb Xsomething).
  21. // The printer intercepts such a call and sets its extra load distance to match the new value as well.
  22. static constexpr float MMU2_FILAMENT_SENSOR_POSITION = 16; // mm
  23. static constexpr float MMU2_LOAD_DISTANCE_PAST_GEARS = 5; // mm
  24. static constexpr uint8_t MMU2_TOOL_CHANGE_LOAD_LENGTH = static_cast<uint8_t>(MMU2_FILAMENT_SENSOR_POSITION + MMU2_LOAD_DISTANCE_PAST_GEARS); // mm
  25. static constexpr float MMU2_EXTRUDER_PTFE_LENGTH = 50.f; // mm
  26. static constexpr float MMU2_EXTRUDER_HEATBREAK_LENGTH = 17.7f; // mm
  27. static constexpr float MMU2_LOAD_TO_NOZZLE_FEED_RATE = 20.0F; // mm/s
  28. static constexpr float MMU2_UNLOAD_TO_FINDA_FEED_RATE = 120.0F; // mm/s
  29. // The first the MMU does is initialise its axis. Meanwhile the E-motor will unload 20mm of filament in approx. 1 second.
  30. static constexpr float MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH = 80.0f; // mm
  31. static constexpr float MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE = 80.0f; // mm/s
  32. static constexpr uint8_t MMU2_NO_TOOL = 99;
  33. static constexpr uint32_t MMU_BAUD = 115200;
  34. struct E_Step {
  35. float extrude; ///< extrude distance in mm
  36. float feedRate; ///< feed rate in mm/s
  37. };
  38. static constexpr E_Step ramming_sequence[] PROGMEM = {
  39. { 0.2816F, 1339.0F / 60.F},
  40. { 0.3051F, 1451.0F / 60.F},
  41. { 0.3453F, 1642.0F / 60.F},
  42. { 0.3990F, 1897.0F / 60.F},
  43. { 0.4761F, 2264.0F / 60.F},
  44. { 0.5767F, 2742.0F / 60.F},
  45. { 0.5691F, 3220.0F / 60.F},
  46. { 0.1081F, 3220.0F / 60.F},
  47. { 0.7644F, 3635.0F / 60.F},
  48. { 0.8248F, 3921.0F / 60.F},
  49. { 0.8483F, 4033.0F / 60.F},
  50. { -15.0F, 6000.0F / 60.F},
  51. { -24.5F, 1200.0F / 60.F},
  52. { -7.0F, 600.0F / 60.F},
  53. { -3.5F, 360.0F / 60.F},
  54. { 20.0F, 454.0F / 60.F},
  55. { -20.0F, 303.0F / 60.F},
  56. { -35.0F, 2000.0F / 60.F},
  57. };
  58. static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = {
  59. { MMU2_EXTRUDER_PTFE_LENGTH, 810.0F / 60.F}, // feed rate = 13.5mm/s - Load fast while not at heatbreak
  60. { MMU2_EXTRUDER_HEATBREAK_LENGTH, 198.0F / 60.F}, // feed rate = 3.3mm/s - Load slower once filament reaches heatbreak
  61. };