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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 <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 "../../MarlinCore.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. do_blocking_move_to_xy(cartes);
  32. return true;
  33. }
  34. return false;
  35. }
  36. /**
  37. * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
  38. */
  39. bool GcodeSuite::M360() {
  40. SERIAL_ECHOLNPGM(" Cal: Theta 0");
  41. return SCARA_move_to_cal(0, 120);
  42. }
  43. /**
  44. * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
  45. */
  46. bool GcodeSuite::M361() {
  47. SERIAL_ECHOLNPGM(" Cal: Theta 90");
  48. return SCARA_move_to_cal(90, 130);
  49. }
  50. /**
  51. * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
  52. */
  53. bool GcodeSuite::M362() {
  54. SERIAL_ECHOLNPGM(" Cal: Psi 0");
  55. return SCARA_move_to_cal(60, 180);
  56. }
  57. /**
  58. * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
  59. */
  60. bool GcodeSuite::M363() {
  61. SERIAL_ECHOLNPGM(" Cal: Psi 90");
  62. return SCARA_move_to_cal(50, 90);
  63. }
  64. /**
  65. * M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position)
  66. */
  67. bool GcodeSuite::M364() {
  68. SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
  69. return SCARA_move_to_cal(45, 135);
  70. }
  71. #endif // MORGAN_SCARA