mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 02:42:36 +02:00
Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings
This commit is contained in:
@@ -123,7 +123,7 @@ bool user_defined_homing(uint8_t cycle_mask) {
|
|||||||
// setup for the homing of this axis
|
// setup for the homing of this axis
|
||||||
bool approach = true;
|
bool approach = true;
|
||||||
float homing_rate = homing_seek_rate->get();
|
float homing_rate = homing_seek_rate->get();
|
||||||
max_travel = HOMING_AXIS_SEARCH_SCALAR * axis_settings[axis]->max_travel->get();
|
max_travel = HOMING_AXIS_SEARCH_SCALAR * MachineConfig::instance()->_axes->_axis[axis]->_maxTravel;
|
||||||
sys.homing_axis_lock = 0xFF; // we don't need to lock any motors in CoreXY
|
sys.homing_axis_lock = 0xFF; // we don't need to lock any motors in CoreXY
|
||||||
n_cycle = (2 * NHomingLocateCycle + 1); // approach + ((pulloff + approach) * Cycles)
|
n_cycle = (2 * NHomingLocateCycle + 1); // approach + ((pulloff + approach) * Cycles)
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ bool user_defined_homing(uint8_t cycle_mask) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int axis = Z_AXIS; axis < n_axis; axis++) {
|
for (int axis = Z_AXIS; axis < n_axis; axis++) {
|
||||||
target[axis] = sys_position[axis] / axis_settings[axis]->steps_per_mm->get();
|
target[axis] = sys_position[axis] / MachineConfig::instance()->_axes->_axis[axis]->_stepsPerMm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert back to motor steps
|
// convert back to motor steps
|
||||||
@@ -234,14 +234,14 @@ bool user_defined_homing(uint8_t cycle_mask) {
|
|||||||
last_cartesian[Y_AXIS] = target[Y_AXIS];
|
last_cartesian[Y_AXIS] = target[Y_AXIS];
|
||||||
|
|
||||||
for (int axis = Z_AXIS; axis < n_axis; axis++) {
|
for (int axis = Z_AXIS; axis < n_axis; axis++) {
|
||||||
last_cartesian[axis] = sys_position[axis] / axis_settings[axis]->steps_per_mm->get();
|
last_cartesian[axis] = sys_position[axis] / MachineConfig::instance()->_axes->_axis[axis]->_stepsPerMm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert to motors
|
// convert to motors
|
||||||
cartesian_to_motors(target);
|
cartesian_to_motors(target);
|
||||||
// convert to steps
|
// convert to steps
|
||||||
for (axis = X_AXIS; axis <= Y_AXIS; axis++) {
|
for (axis = X_AXIS; axis <= Y_AXIS; axis++) {
|
||||||
sys_position[axis] = target[axis] * axis_settings[axis]->steps_per_mm->get();
|
sys_position[axis] = target[axis] * MachineConfig::instance()->_axes->_axis[axis]->_stepsPerMm;
|
||||||
}
|
}
|
||||||
|
|
||||||
sys.step_control = {}; // Return step control to normal operation.
|
sys.step_control = {}; // Return step control to normal operation.
|
||||||
|
@@ -133,10 +133,10 @@ void atari_home_task(void* pvParameters) {
|
|||||||
case HOMING_PHASE_CHECK: // check the limits switch
|
case HOMING_PHASE_CHECK: // check the limits switch
|
||||||
if (digitalRead(REED_SW_PIN) == 0) {
|
if (digitalRead(REED_SW_PIN) == 0) {
|
||||||
// see if reed switch is grounded
|
// see if reed switch is grounded
|
||||||
WebUI::inputBuffer.push("G4P0.1\n"); // dramtic pause
|
WebUI::inputBuffer.push("G4P0.1\n"); // dramatic pause
|
||||||
sys_position[X_AXIS] = ATARI_HOME_POS * axis_settings[X_AXIS]->steps_per_mm->get();
|
sys_position[X_AXIS] = ATARI_HOME_POS * MachineConfig::instance()->_axes->_axis[X_AXIS]->_stepsPerMm;
|
||||||
sys_position[Y_AXIS] = 0.0;
|
sys_position[Y_AXIS] = 0.0;
|
||||||
sys_position[Z_AXIS] = 1.0 * axis_settings[Y_AXIS]->steps_per_mm->get();
|
sys_position[Z_AXIS] = 1.0 * MachineConfig::instance()->_axes->_axis[Z_AXIS]->_stepsPerMm;
|
||||||
gc_sync_position();
|
gc_sync_position();
|
||||||
plan_sync_position();
|
plan_sync_position();
|
||||||
sprintf(gcode_line, "G90G0X%3.2f\r", ATARI_PAPER_WIDTH); // alway return to right side to reduce home travel stalls
|
sprintf(gcode_line, "G90G0X%3.2f\r", ATARI_PAPER_WIDTH); // alway return to right side to reduce home travel stalls
|
||||||
|
@@ -368,9 +368,9 @@ void kinematics_post_homing() {
|
|||||||
#ifdef USE_CUSTOM_HOMING
|
#ifdef USE_CUSTOM_HOMING
|
||||||
|
|
||||||
#else
|
#else
|
||||||
last_angle[X_AXIS] = sys_position[X_AXIS] / axis_settings[X_AXIS]->steps_per_mm->get();
|
last_angle[X_AXIS] = sys_position[X_AXIS] / MachineConfig::instance()->_axes->_axis[X_AXIS]->_stepsPerMm;
|
||||||
last_angle[Y_AXIS] = sys_position[Y_AXIS] / axis_settings[Y_AXIS]->steps_per_mm->get();
|
last_angle[Y_AXIS] = sys_position[Y_AXIS] / MachineConfig::instance()->_axes->_axis[Y_AXIS]->_stepsPerMm;
|
||||||
last_angle[Z_AXIS] = sys_position[Z_AXIS] / axis_settings[Z_AXIS]->steps_per_mm->get();
|
last_angle[Z_AXIS] = sys_position[Z_AXIS] / MachineConfig::instance()->_axes->_axis[Z_AXIS]->_stepsPerMm;
|
||||||
|
|
||||||
motors_to_cartesian(last_cartesian, last_angle, 3);
|
motors_to_cartesian(last_cartesian, last_angle, 3);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user