My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tool_change.h 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../inc/MarlinConfigPre.h"
  24. #include "../core/types.h"
  25. #if EXTRUDERS > 1
  26. typedef struct {
  27. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  28. float swap_length, extra_prime;
  29. int16_t prime_speed, retract_speed;
  30. #endif
  31. #if ENABLED(TOOLCHANGE_PARK)
  32. xy_pos_t change_point;
  33. #endif
  34. float z_raise;
  35. } toolchange_settings_t;
  36. extern toolchange_settings_t toolchange_settings;
  37. #endif
  38. #if DO_SWITCH_EXTRUDER
  39. void move_extruder_servo(const uint8_t e);
  40. #endif
  41. #if ENABLED(SWITCHING_NOZZLE)
  42. #if SWITCHING_NOZZLE_TWO_SERVOS
  43. void lower_nozzle(const uint8_t e);
  44. void raise_nozzle(const uint8_t e);
  45. #else
  46. void move_nozzle_servo(const uint8_t angle_index);
  47. #endif
  48. #endif
  49. #if ENABLED(PARKING_EXTRUDER)
  50. #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT)
  51. #define PE_MAGNET_ON_STATE !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
  52. #else
  53. #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
  54. #endif
  55. void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state);
  56. inline void pe_activate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, PE_MAGNET_ON_STATE); }
  57. inline void pe_deactivate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, !PE_MAGNET_ON_STATE); }
  58. void pe_solenoid_init();
  59. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  60. typedef struct MPESettings {
  61. float parking_xpos[2], // M951 L R
  62. grab_distance; // M951 I
  63. feedRate_t slow_feedrate, // M951 J
  64. fast_feedrate; // M951 H
  65. float travel_distance, // M951 D
  66. compensation_factor; // M951 C
  67. } mpe_settings_t;
  68. extern mpe_settings_t mpe_settings;
  69. void mpe_settings_init();
  70. #endif
  71. #if ENABLED(SINGLENOZZLE)
  72. extern uint16_t singlenozzle_temp[EXTRUDERS];
  73. #if FAN_COUNT > 0
  74. extern uint8_t singlenozzle_fan_speed[EXTRUDERS];
  75. #endif
  76. #endif
  77. #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  78. void est_init();
  79. #endif
  80. #if ENABLED(SWITCHING_TOOLHEAD)
  81. void swt_init();
  82. #endif
  83. /**
  84. * Perform a tool-change, which may result in moving the
  85. * previous tool out of the way and the new tool into place.
  86. */
  87. void tool_change(const uint8_t tmp_extruder, bool no_move=false);