kopia lustrzana https://github.com/Schildkroet/GRBL-Advanced
Bugfix corexy #80
rodzic
26bdac77bc
commit
51a3cae056
|
@ -174,7 +174,7 @@ void Limits_GoHome(uint8_t cycle_mask)
|
|||
step_pin[idx] = Settings_GetStepPinMask(idx);
|
||||
|
||||
#ifdef COREXY
|
||||
if((idx == A_AXIS) || (idx == B_AXIS))
|
||||
if((idx == A_MOTOR) || (idx == B_MOTOR))
|
||||
{
|
||||
step_pin[idx] = (Settings_GetStepPinMask(X_AXIS) | Settings_GetStepPinMask(Y_AXIS));
|
||||
}
|
||||
|
@ -210,13 +210,13 @@ void Limits_GoHome(uint8_t cycle_mask)
|
|||
if(idx == X_AXIS)
|
||||
{
|
||||
int32_t axis_position = system_convert_corexy_to_y_axis_steps(sys_position);
|
||||
sys_position[A_AXIS] = axis_position;
|
||||
sys_position[B_AXIS] = -axis_position;
|
||||
sys_position[A_MOTOR] = axis_position;
|
||||
sys_position[B_MOTOR] = -axis_position;
|
||||
}
|
||||
else if (idx == Y_AXIS)
|
||||
{
|
||||
int32_t axis_position = system_convert_corexy_to_x_axis_steps(sys_position);
|
||||
sys_position[A_AXIS] = sys_position[B_AXIS] = axis_position;
|
||||
sys_position[A_MOTOR] = sys_position[B_MOTOR] = axis_position;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ void Limits_GoHome(uint8_t cycle_mask)
|
|||
}
|
||||
else
|
||||
{
|
||||
axislock &= ~(step_pin[A_AXIS]|step_pin[B_AXIS]);
|
||||
axislock &= ~(step_pin[A_MOTOR]|step_pin[B_MOTOR]);
|
||||
}
|
||||
#else
|
||||
axislock &= ~(step_pin[idx]);
|
||||
|
@ -393,14 +393,14 @@ void Limits_GoHome(uint8_t cycle_mask)
|
|||
if(idx == X_AXIS)
|
||||
{
|
||||
int32_t off_axis_position = system_convert_corexy_to_y_axis_steps(sys_position);
|
||||
sys_position[A_AXIS] = set_axis_position + off_axis_position;
|
||||
sys_position[B_AXIS] = set_axis_position - off_axis_position;
|
||||
sys_position[A_MOTOR] = set_axis_position + off_axis_position;
|
||||
sys_position[B_MOTOR] = set_axis_position - off_axis_position;
|
||||
}
|
||||
else if(idx == Y_AXIS)
|
||||
{
|
||||
int32_t off_axis_position = system_convert_corexy_to_x_axis_steps(sys_position);
|
||||
sys_position[A_AXIS] = off_axis_position + set_axis_position;
|
||||
sys_position[B_AXIS] = off_axis_position - set_axis_position;
|
||||
sys_position[A_MOTOR] = off_axis_position + set_axis_position;
|
||||
sys_position[B_MOTOR] = off_axis_position - set_axis_position;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -124,10 +124,10 @@ uint8_t Planner_BufferLine(float *target, Planner_LineData_t *pl_data)
|
|||
}
|
||||
|
||||
#ifdef COREXY
|
||||
target_steps[A_AXIS] = lround(target[A_AXIS]*settings.steps_per_mm[A_AXIS]);
|
||||
target_steps[B_AXIS] = lround(target[B_AXIS]*settings.steps_per_mm[B_AXIS]);
|
||||
block->steps[A_AXIS] = labs((target_steps[X_AXIS]-position_steps[X_AXIS]) + (target_steps[Y_AXIS]-position_steps[Y_AXIS]));
|
||||
block->steps[B_AXIS] = labs((target_steps[X_AXIS]-position_steps[X_AXIS]) - (target_steps[Y_AXIS]-position_steps[Y_AXIS]));
|
||||
target_steps[A_MOTOR] = lround(target[A_MOTOR]*settings.steps_per_mm[A_MOTOR]);
|
||||
target_steps[B_MOTOR] = lround(target[B_MOTOR]*settings.steps_per_mm[B_MOTOR]);
|
||||
block->steps[A_MOTOR] = labs((target_steps[X_AXIS]-position_steps[X_AXIS]) + (target_steps[Y_AXIS]-position_steps[Y_AXIS]));
|
||||
block->steps[B_MOTOR] = labs((target_steps[X_AXIS]-position_steps[X_AXIS]) - (target_steps[Y_AXIS]-position_steps[Y_AXIS]));
|
||||
#endif
|
||||
|
||||
for(idx = 0; idx < N_AXIS; idx++)
|
||||
|
@ -136,7 +136,7 @@ uint8_t Planner_BufferLine(float *target, Planner_LineData_t *pl_data)
|
|||
// Also, compute individual axes distance for move and prep unit vector calculations.
|
||||
// NOTE: Computes true distance from converted step values.
|
||||
#ifdef COREXY
|
||||
if(!(idx == A_AXIS) && !(idx == B_AXIS))
|
||||
if(!(idx == A_MOTOR) && !(idx == B_MOTOR))
|
||||
{
|
||||
target_steps[idx] = lround(target[idx]*settings.steps_per_mm[idx]);
|
||||
block->steps[idx] = labs(target_steps[idx]-position_steps[idx]);
|
||||
|
@ -144,11 +144,11 @@ uint8_t Planner_BufferLine(float *target, Planner_LineData_t *pl_data)
|
|||
|
||||
block->step_event_count = max(block->step_event_count, block->steps[idx]);
|
||||
|
||||
if(idx == A_AXIS)
|
||||
if(idx == A_MOTOR)
|
||||
{
|
||||
delta_mm = (target_steps[X_AXIS]-position_steps[X_AXIS] + target_steps[Y_AXIS]-position_steps[Y_AXIS])/settings.steps_per_mm[idx];
|
||||
}
|
||||
else if(idx == B_AXIS)
|
||||
else if(idx == B_MOTOR)
|
||||
{
|
||||
delta_mm = (target_steps[X_AXIS]-position_steps[X_AXIS] - target_steps[Y_AXIS]+position_steps[Y_AXIS])/settings.steps_per_mm[idx];
|
||||
}
|
||||
|
|
|
@ -90,10 +90,8 @@
|
|||
|
||||
// CoreXY motor assignments. DO NOT ALTER.
|
||||
// NOTE: If the A and B motor axis bindings are changed, this effects the CoreXY equations.
|
||||
#ifdef COREXY
|
||||
#define A_MOTOR X_AXIS // Must be X_AXIS
|
||||
#define B_MOTOR Y_AXIS // Must be Y_AXIS
|
||||
#endif
|
||||
|
||||
|
||||
// Conversions
|
||||
|
|
Ładowanie…
Reference in New Issue