1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-02 10:53:01 +02:00
This commit is contained in:
bdring
2020-10-04 10:20:50 -05:00
parent 56591b53db
commit ca0eb8fd92
3 changed files with 9 additions and 6 deletions

View File

@@ -131,7 +131,6 @@ void inverse_kinematics(float* target, plan_line_data_t* pl_data, float* positio
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Start %3.3f %3.3f %3.3f", position[0], position[1], position[2]);
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Target %3.3f %3.3f %3.3f", target[0], target[1], target[2]);
status = delta_calcInverse(position, motor_angles);
if (status == KinematicError::OUT_OF_RANGE) {
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Start position error %3.3f %3.3f %3.3f", position[0], position[1], position[2]);
@@ -198,6 +197,13 @@ void inverse_kinematics(float* target, plan_line_data_t* pl_data, float* positio
}
}
// this is used used by soft limits to see if the range of the machine is exceeded.
uint8_t kinematic_limits_check(float* target) {
float motor_angles[3];
return (delta_calcInverse(target, motor_angles) == KinematicError::NONE);
}
// inverse kinematics: cartesian -> angles
// returned status: 0=OK, -1=non-existing position
KinematicError delta_calcInverse(float* cartesian, float* angles) {

View File

@@ -103,6 +103,7 @@ bool user_defined_homing();
void inverse_kinematics(float* target, plan_line_data_t* pl_data, float* position);
bool kinematics_pre_homing(uint8_t cycle_mask);
void kinematics_post_homing();
uint8_t kinematic_limits_check(float* target);
// Called if USE_FWD_KINEMATICS is defined
void inverse_kinematics(float* position); // used to return a converted value

View File

@@ -219,11 +219,7 @@ void mc_arc(float* target,
}
}
// Ensure last segment arrives at target location.
#ifdef USE_KINEMATICS
mc_line_kins(target, pl_data, previous_position);
#else
mc_line(target, pl_data);
#endif
}
// Execute dwell in seconds.