My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 "../gcode.h"
  23. #include "../../module/planner.h"
  24. /**
  25. * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E.
  26. * (Follows the same syntax as G92)
  27. *
  28. * With multiple extruders use T to specify which one.
  29. */
  30. void GcodeSuite::M92() {
  31. GET_TARGET_EXTRUDER();
  32. LOOP_XYZE(i) {
  33. if (parser.seen(axis_codes[i])) {
  34. if (i == E_AXIS) {
  35. const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER));
  36. if (value < 20.0) {
  37. float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab.
  38. #if DISABLED(JUNCTION_DEVIATION)
  39. planner.max_jerk[E_AXIS] *= factor;
  40. #endif
  41. planner.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor;
  42. planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor;
  43. }
  44. planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value;
  45. }
  46. else {
  47. planner.axis_steps_per_mm[i] = parser.value_per_axis_unit((AxisEnum)i);
  48. }
  49. }
  50. }
  51. planner.refresh_positioning();
  52. }