My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

M360-M364.cpp 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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(MORGAN_SCARA)
  24. #include "../gcode.h"
  25. #include "../../module/scara.h"
  26. #include "../../module/motion.h"
  27. #include "../../Marlin.h" // for IsRunning()
  28. inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) {
  29. if (IsRunning()) {
  30. forward_kinematics_SCARA(delta_a, delta_b);
  31. destination[X_AXIS] = cartes[X_AXIS];
  32. destination[Y_AXIS] = cartes[Y_AXIS];
  33. destination[Z_AXIS] = current_position[Z_AXIS];
  34. prepare_move_to_destination();
  35. return true;
  36. }
  37. return false;
  38. }
  39. /**
  40. * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
  41. */
  42. bool GcodeSuite::M360() {
  43. SERIAL_ECHOLNPGM(" Cal: Theta 0");
  44. return SCARA_move_to_cal(0, 120);
  45. }
  46. /**
  47. * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
  48. */
  49. bool GcodeSuite::M361() {
  50. SERIAL_ECHOLNPGM(" Cal: Theta 90");
  51. return SCARA_move_to_cal(90, 130);
  52. }
  53. /**
  54. * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
  55. */
  56. bool GcodeSuite::M362() {
  57. SERIAL_ECHOLNPGM(" Cal: Psi 0");
  58. return SCARA_move_to_cal(60, 180);
  59. }
  60. /**
  61. * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
  62. */
  63. bool GcodeSuite::M363() {
  64. SERIAL_ECHOLNPGM(" Cal: Psi 90");
  65. return SCARA_move_to_cal(50, 90);
  66. }
  67. /**
  68. * M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position)
  69. */
  70. bool GcodeSuite::M364() {
  71. SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
  72. return SCARA_move_to_cal(45, 135);
  73. }
  74. #endif // MORGAN_SCARA