MarkForged kinematics (#19235)

This commit is contained in:
Victor Sokolov
2020-09-04 05:12:53 +04:00
committed by GitHub
parent 55dcff746b
commit e97e6865c3
9 changed files with 100 additions and 34 deletions

View File

@@ -2041,6 +2041,8 @@ uint32_t Stepper::block_phase_isr() {
#define X_CMP(A,B) ((A)!=(B))
#endif
#define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && X_CMP(D_(1),D_(2))) )
#elif ENABLED(MARKFORGED_XY)
#define X_MOVE_TEST (current_block->steps.a != current_block->steps.b)
#else
#define X_MOVE_TEST !!current_block->steps.a
#endif
@@ -2614,6 +2616,8 @@ void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c
#elif CORE_IS_YZ
// coreyz planning
count_position.set(a, b + c, CORESIGN(b - c));
#elif ENABLED(MARKFORGED_XY)
count_position.set(a - b, b, c);
#else
// default non-h-bot planning
count_position.set(a, b, c);
@@ -2680,6 +2684,10 @@ void Stepper::endstop_triggered(const AxisEnum axis) {
? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2])
: count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2]
) * double(0.5)
#elif ENABLED(MARKFORGED_XY)
axis == CORE_AXIS_1
? count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]
: count_position[CORE_AXIS_2]
#else // !IS_CORE
count_position[axis]
#endif
@@ -2709,12 +2717,12 @@ int32_t Stepper::triggered_position(const AxisEnum axis) {
}
void Stepper::report_a_position(const xyz_long_t &pos) {
#if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA
#if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, DELTA, IS_SCARA)
SERIAL_ECHOPAIR(STR_COUNT_A, pos.x, " B:", pos.y);
#else
SERIAL_ECHOPAIR_P(PSTR(STR_COUNT_X), pos.x, SP_Y_LBL, pos.y);
#endif
#if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA)
#if ANY(CORE_IS_XZ, CORE_IS_YZ, DELTA)
SERIAL_ECHOLNPAIR(" C:", pos.z);
#else
SERIAL_ECHOLNPAIR_P(SP_Z_LBL, pos.z);