Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
pulley.h
Go to the documentation of this file.
1 #pragma once
3 #include "../config/config.h"
4 #include "movable_base.h"
5 #include "motion.h"
6 
7 namespace modules {
8 
10 namespace pulley {
11 
12 namespace mm = modules::motion;
13 
18 class Pulley : public motion::MovableBase {
19 public:
20  inline constexpr Pulley()
21  : MovableBase(mm::Pulley) {}
22 
25  bool Step();
26 
27  void PlanMove(mm::P_pos_t delta, mm::P_speed_t feed_rate, mm::P_speed_t end_rate = { 0 });
28 
29  // NOTE: always_inline is required here to force gcc <= 7.x to evaluate each call at compile time
30  void __attribute__((always_inline)) PlanMove(unit::U_mm delta, unit::U_mm_s feed_rate, unit::U_mm_s end_rate = { 0 }) {
31  PlanMove(mm::unitToAxisUnit<mm::P_pos_t>(delta),
32  mm::unitToAxisUnit<mm::P_speed_t>(feed_rate),
33  mm::unitToAxisUnit<mm::P_speed_t>(end_rate));
34  }
35 
38  int32_t CurrentPosition_mm();
39 
40  void InitAxis();
41  void Disable();
42 
43 protected:
44  virtual void PrepareMoveToPlannedSlot() override {}
45  virtual void PlanHomingMoveForward() override {}
46  virtual void PlanHomingMoveBack() override {}
47  virtual bool FinishHomingAndPlanMoveToParkPos() override;
48  virtual void FinishMove() override {}
49 };
50 
52 extern Pulley pulley;
53 
54 } // namespace pulley
55 } // namespace modules
56 
57 namespace mpu = modules::pulley;
Base class for movable modules - modules::idler::Idler and modules::selector::Selector contains the c...
Definition: movable_base.h:11
Definition: pulley.h:18
int32_t CurrentPosition_mm()
Definition: pulley.cpp:48
virtual bool FinishHomingAndPlanMoveToParkPos() override
bool Step()
Definition: pulley.cpp:19
static constexpr AxisConfig pulley
Begin: Pulley axis configuration.
Definition: config.h:111
Definition: command_base.h:9
The pulley namespace provides all necessary facilities related to the logical model of the pulley dev...
Definition: pulley.cpp:10
Pulley pulley
The one and only instance of Pulley in the FW.
Definition: pulley.cpp:12
The modules namespace contains models of MMU's components.
Definition: command_base.h:8
Definition: axisunit.h:68
Generic unit type for compile-time conformability testing.
Definition: unit.h:42