My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

M290.cpp 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. #include "../../inc/MarlinConfig.h"
  23. #if ENABLED(BABYSTEPPING)
  24. #include "../gcode.h"
  25. #include "../../module/probe.h"
  26. #include "../../module/temperature.h"
  27. #include "../../module/planner.h"
  28. #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
  29. #include "../../core/serial.h"
  30. #endif
  31. #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
  32. FORCE_INLINE void mod_zprobe_zoffset(const float &offs) {
  33. zprobe_zoffset += offs;
  34. SERIAL_ECHO_START();
  35. SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset);
  36. }
  37. #endif
  38. /**
  39. * M290: Babystepping
  40. */
  41. void GcodeSuite::M290() {
  42. #if ENABLED(BABYSTEP_XY)
  43. for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
  44. if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
  45. const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
  46. thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
  47. #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
  48. if (a == Z_AXIS && parser.boolval('P', true)) mod_zprobe_zoffset(offs);
  49. #endif
  50. }
  51. #else
  52. if (parser.seenval('Z') || parser.seenval('S')) {
  53. const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
  54. thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
  55. #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
  56. if (parser.boolval('P', true)) mod_zprobe_zoffset(offs);
  57. #endif
  58. }
  59. #endif
  60. }
  61. #endif // BABYSTEPPING