Skip to content

Commit

Permalink
remove conflicting _U
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndere1 committed Oct 16, 2023
1 parent 6500fbe commit f7bce46
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 31 deletions.
12 changes: 6 additions & 6 deletions Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class AxisBits {
typedef bits_t(NUM_AXIS_ENUMS) el;
union {
el bits;
// x, y, z ... e0, e1, e2 ... hx, hy, hz
// Axes x, y, z ... e0, e1, e2 ... hx, hy, hz
struct {
#if NUM_AXES
bool NUM_AXIS_LIST(x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1);
Expand All @@ -951,7 +951,7 @@ class AxisBits {
bool hx:1, hy:1, hz:1;
#endif
};
// X, Y, Z ... E0, E1, E2 ... HX, HY, HZ
// Axes X, Y, Z ... E0, E1, E2 ... HX, HY, HZ
struct {
#if NUM_AXES
bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1);
Expand All @@ -963,9 +963,9 @@ class AxisBits {
bool HX:1, HY:1, HZ:1;
#endif
};
// a, b, c, e ... ha, hb, hc
// Joints ja, jb, jc, je ... ha, hb, hc
struct {
bool LOGICAL_AXIS_LIST(e:1, a:1, b:1, c:1, _i:1, _j:1, _k:1, _u:1, _v:1, _w:1);
bool LOGICAL_AXIS_LIST(je:1, ja:1, jb:1, jc:1, ji:1, jj:1, jk:1, ju:1, jv:1, jw:1);
#if EXTRUDERS > 1
#define _EN_ITEM(N) bool _e##N:1;
REPEAT_S(1,EXTRUDERS,_EN_ITEM)
Expand All @@ -975,9 +975,9 @@ class AxisBits {
bool ha:1, hb:1, hc:1;
#endif
};
// A, B, C, E ... HA, HB, HC
// Joints JA, JB, JC, JE ... HA, HB, HC
struct {
bool LOGICAL_AXIS_LIST(E:1, A:1, B:1, C:1, _I:1, _J:1, _K:1, _U:1, _V:1, _W:1);
bool LOGICAL_AXIS_LIST(JE:1, JA:1, JB:1, JC:1, JI:1, JJ:1, JK:1, JU:1, JV:1, JW:1);
#if EXTRUDERS > 1
#define _EN_ITEM(N) bool _E##N:1;
REPEAT_S(1,EXTRUDERS,_EN_ITEM)
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,6 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool
float cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, cartes_move));

// If the move is very short, check the E move distance
// No E move either? Game over.
TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e));
// No E move either? Game over.
if (UNEAR_ZERO(cartesian_mm)) return;
Expand Down
30 changes: 15 additions & 15 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,27 +1968,27 @@ bool Planner::_populate_block(
#endif
#if IS_CORE
#if CORE_IS_XY
dm.a = (dist.a + dist.b > 0); // Motor A direction
dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction
dm.ja = (dist.a + dist.b > 0); // Motor A direction
dm.jb = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction
#elif CORE_IS_XZ
dm.hx = (dist.a > 0); // Save the toolhead's true direction in X
dm.y = (dist.b > 0);
dm.hz = (dist.c > 0); // ...and Z
dm.a = (dist.a + dist.c > 0); // Motor A direction
dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction
dm.ja = (dist.a + dist.c > 0); // Motor A direction
dm.jc = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction
#elif CORE_IS_YZ
dm.x = (dist.a > 0);
dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y
dm.hz = (dist.c > 0); // ...and Z
dm.b = (dist.b + dist.c > 0); // Motor B direction
dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
dm.jb = (dist.b + dist.c > 0); // Motor B direction
dm.jc = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction
#endif
#elif ENABLED(MARKFORGED_XY)
dm.a = (dist.a + dist.b > 0); // Motor A direction
dm.b = (dist.b > 0); // Motor B direction
dm.ja = (dist.a + dist.b > 0); // Motor A direction
dm.jb = (dist.b > 0); // Motor B direction
#elif ENABLED(MARKFORGED_YX)
dm.a = (dist.a > 0); // Motor A direction
dm.b = (dist.b + dist.a > 0); // Motor B direction
dm.ja = (dist.a > 0); // Motor A direction
dm.jb = (dist.b + dist.a > 0); // Motor B direction
#else
XYZ_CODE(
dm.x = (dist.a > 0),
Expand Down Expand Up @@ -2069,11 +2069,11 @@ bool Planner::_populate_block(

/**
* This part of the code calculates the total length of the movement.
* For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS.
* But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS
* and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y.
* So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
* For cartesian bots, the distance along the X axis equals the X_AXIS joint displacement and same holds true for Y_AXIS.
* But for geometries like CORE_XY that is not true. For these machines we need to create 2 additional variables, named X_HEAD and Y_HEAD, to store the displacent of the head along the X and Y axes in a cartesian coordinate system.
* The displacement of the head along the axes of the cartesian coordinate system has to be calculated from "X_AXIS" and "Y_AXIS" (should be renamed to A_JOINT and B_JOINT)
* displacements in joints space using forward kinematics (A=X+Y and B=X-Y in the case of CORE_XY).
* Next we can calculate the total movement length and apply the desired speed.
*/
struct DistanceMM : abce_float_t {
#if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2616,15 +2616,15 @@ hal_timer_t Stepper::block_phase_isr() {

AxisBits didmove;
NUM_AXIS_CODE(
if (X_MOVE_TEST) didmove.a = true,
if (Y_MOVE_TEST) didmove.b = true,
if (Z_MOVE_TEST) didmove.c = true,
if (current_block->steps.i) didmove.i = true,
if (current_block->steps.j) didmove.j = true,
if (current_block->steps.k) didmove.k = true,
if (current_block->steps.u) didmove.u = true,
if (current_block->steps.v) didmove.v = true,
if (current_block->steps.w) didmove.w = true
if (X_MOVE_TEST) didmove.ja = true,
if (Y_MOVE_TEST) didmove.jb = true,
if (Z_MOVE_TEST) didmove.jc = true,
if (current_block->steps.i) didmove.ji = true,
if (current_block->steps.j) didmove.jj = true,
if (current_block->steps.k) didmove.jk = true,
if (current_block->steps.u) didmove.ju = true,
if (current_block->steps.v) didmove.jv = true,
if (current_block->steps.w) didmove.jw = true
);
//if (current_block->steps.e) didmove.e = true;
//if (current_block->steps.a) didmove.x = true;
Expand Down

0 comments on commit f7bce46

Please sign in to comment.