Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Home Offset Here for a specific Axis #27011

Open
Elias-Ta opened this issue Apr 24, 2024 · 2 comments
Open

[FR] Home Offset Here for a specific Axis #27011

Elias-Ta opened this issue Apr 24, 2024 · 2 comments
Labels
F: Calibration Fix Included A fix is included in the description T: Feature Request Features requested by users.

Comments

@Elias-Ta
Copy link

Elias-Ta commented Apr 24, 2024

Is your feature request related to a problem? Please describe.

No response

Are you looking for hardware support?

No response

Describe the feature you want

I need to set Homing offset for a single axis in the current position, this can be usefull in cnc mode if I want to set the zero position for Z_axis based on thikness of the work area (usualy I use the milling head to make the work area or the bed flat)

Additional context

In M206_M428.cpp I changed the function void GcodeSuite::M428() to make it as following, and I think it's working as I need, now by sending G428 Z the machine will set homing offset at the current position only for Z axis.
Maybe this feature can be added to the original code as well if others need it.

void GcodeSuite::M428() {
  if (homing_needed_error()) return;

  xyz_float_t diff;
  LOOP_NUM_AXES(i) {
    if (parser.seen_test(AXIS_CHAR(i))){
      diff[i] = base_home_pos((AxisEnum)i) - current_position[i];
      if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0)
        diff[i] = -current_position[i];
      if (!WITHIN(diff[i], -20, 20)) {
        SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);
        LCD_ALERTMESSAGE(MSG_ERR_M428_TOO_FAR);
        ERR_BUZZ();
        return;
      }
    }
    else {diff[i] = 0;}
    
  }

  LOOP_NUM_AXES(i) set_home_offset((AxisEnum)i, diff[i]);
  report_current_position();
  LCD_MESSAGE(MSG_HOME_OFFSETS_APPLIED);
  OKAY_BUZZ();
}
@Elias-Ta Elias-Ta added the T: Feature Request Features requested by users. label Apr 24, 2024
@thisiskeithb thisiskeithb added F: Calibration Fix Included A fix is included in the description labels Apr 24, 2024
@thisiskeithb
Copy link
Member

Maybe this feature can be added to the original code as well if others need it.

It would be useful if you could submit a Pull Request so it could be reviewed.

@Elias-Ta
Copy link
Author

Alright, I made a pull request #27015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: Calibration Fix Included A fix is included in the description T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

2 participants