My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

G5.cpp 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../../inc/MarlinConfig.h"
  23. #if ENABLED(BEZIER_CURVE_SUPPORT)
  24. #if AXIS_COLLISION('I') || AXIS_COLLISION('J')
  25. #error "G5 parameter 'I' or 'J' collision with axis name."
  26. #endif
  27. #include "../../module/motion.h"
  28. #include "../../module/planner_bezier.h"
  29. /**
  30. * Parameters interpreted according to:
  31. * https://linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g5
  32. * However I, J omission is not supported at this point; all
  33. * parameters can be omitted and default to zero.
  34. */
  35. #include "../gcode.h"
  36. #include "../../MarlinCore.h" // for IsRunning()
  37. /**
  38. * G5: Cubic B-spline
  39. */
  40. void GcodeSuite::G5() {
  41. if (MOTION_CONDITIONS) {
  42. #if ENABLED(CNC_WORKSPACE_PLANES)
  43. if (workspace_plane != PLANE_XY) {
  44. SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
  45. return;
  46. }
  47. #endif
  48. get_destination_from_command();
  49. const xy_pos_t offsets[2] = {
  50. { parser.linearval('I'), parser.linearval('J') },
  51. { parser.linearval('P'), parser.linearval('Q') }
  52. };
  53. cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
  54. current_position = destination;
  55. }
  56. }
  57. #endif // BEZIER_CURVE_SUPPORT