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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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. #if EXTRUDERS > 1
  25. typedef struct {
  26. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  27. float swap_length, extra_prime;
  28. int16_t prime_speed, retract_speed;
  29. #endif
  30. #if ENABLED(TOOLCHANGE_PARK)
  31. struct { float x, y; } change_point;
  32. #endif
  33. float z_raise;
  34. } toolchange_settings_t;
  35. extern toolchange_settings_t toolchange_settings;
  36. #endif
  37. #if DO_SWITCH_EXTRUDER
  38. void move_extruder_servo(const uint8_t e);
  39. #endif
  40. #if ENABLED(SWITCHING_NOZZLE)
  41. #if SWITCHING_NOZZLE_TWO_SERVOS
  42. void lower_nozzle(const uint8_t e);
  43. void raise_nozzle(const uint8_t e);
  44. #else
  45. void move_nozzle_servo(const uint8_t angle_index);
  46. #endif
  47. #endif
  48. #if ENABLED(PARKING_EXTRUDER)
  49. #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT)
  50. #define PE_MAGNET_ON_STATE !PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
  51. #else
  52. #define PE_MAGNET_ON_STATE PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
  53. #endif
  54. void pe_set_solenoid(const uint8_t extruder_num, const uint8_t state);
  55. inline void pe_activate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, PE_MAGNET_ON_STATE); }
  56. inline void pe_deactivate_solenoid(const uint8_t extruder_num) { pe_set_solenoid(extruder_num, !PE_MAGNET_ON_STATE); }
  57. void pe_solenoid_init();
  58. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  59. typedef struct MPESettings {
  60. float parking_xpos[2], // M951 L R
  61. grab_distance, // M951 I
  62. slow_feedrate, // M951 J
  63. fast_feedrate, // M951 H
  64. travel_distance, // M951 D
  65. compensation_factor; // M951 C
  66. } mpe_settings_t;
  67. extern mpe_settings_t mpe_settings;
  68. void mpe_settings_init();
  69. #endif
  70. #if ENABLED(SINGLENOZZLE)
  71. extern uint16_t singlenozzle_temp[EXTRUDERS];
  72. #if FAN_COUNT > 0
  73. extern uint8_t singlenozzle_fan_speed[EXTRUDERS];
  74. #endif
  75. #endif
  76. #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  77. void est_init();
  78. #endif
  79. /**
  80. * Perform a tool-change, which may result in moving the
  81. * previous tool out of the way and the new tool into place.
  82. */
  83. void tool_change(const uint8_t tmp_extruder, bool no_move=false);