My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

stepper.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors
  3. Part of Grbl
  4. Copyright (c) 2009-2011 Simen Svale Skogsrud
  5. Grbl is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. Grbl is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Grbl. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef stepper_h
  17. #define stepper_h
  18. #include "planner.h"
  19. #include "stepper_indirection.h"
  20. #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  21. extern bool abort_on_endstop_hit;
  22. #endif
  23. // Initialize and start the stepper motor subsystem
  24. void st_init();
  25. // Block until all buffered steps are executed
  26. void st_synchronize();
  27. // Set current position in steps
  28. void st_set_position(const long& x, const long& y, const long& z, const long& e);
  29. void st_set_e_position(const long& e);
  30. // Get current position in steps
  31. long st_get_position(uint8_t axis);
  32. // Get current axis position in mm
  33. float st_get_axis_position_mm(AxisEnum axis);
  34. // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
  35. // to notify the subsystem that it is time to go to work.
  36. void st_wake_up();
  37. void checkHitEndstops(); //call from somewhere to create an serial error message with the locations the endstops where hit, in case they were triggered
  38. void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after homing and before a routine call of checkHitEndstops();
  39. void enable_endstops(bool check); // Enable/disable endstop checking
  40. void checkStepperErrors(); //Print errors detected by the stepper
  41. void finishAndDisableSteppers();
  42. extern block_t* current_block; // A pointer to the block currently being traced
  43. void quickStop();
  44. void digitalPotWrite(int address, int value);
  45. void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2);
  46. void microstep_mode(uint8_t driver, uint8_t stepping);
  47. void digipot_init();
  48. void digipot_current(uint8_t driver, int current);
  49. void microstep_init();
  50. void microstep_readings();
  51. #if ENABLED(Z_DUAL_ENDSTOPS)
  52. void In_Homing_Process(bool state);
  53. void Lock_z_motor(bool state);
  54. void Lock_z2_motor(bool state);
  55. #endif
  56. #if ENABLED(BABYSTEPPING)
  57. void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
  58. #endif
  59. #endif