MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

[FR] Input Shaping LCD menu added #24945

Closed classicrocker883 closed 11 months ago

classicrocker883 commented 2 years ago

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

Input Shaping Menu

for editing the values through the LCD.

in file --> lcd/e3v3/proui/dwin.cpp

under void Draw_Prepare_Menu() add

if ENABLED(SHAPING_MENU)

MENU_ITEM(ICON_Language, MSG_INPUT_SHAPING, onDrawSubMenu, Draw_InputShaping_Menu);

endif

this following was below #endif // HAS_TOOLBAR added above // Special Menuitem Drawing functions ===========

// M593 - Acceleration items (Input Shaping)

#if ENABLED(SHAPING_MENU)

void ApplyFreq() { stepper.set_shaping_frequency(HMI_value.axis, *MenuData.P_Float ); }
void ApplyZeta() { stepper.set_shaping_damping_ratio(HMI_value.axis, *MenuData.P_Float ); }

void SetXFreq() { HMI_value.axis = X_AXIS, SetPFloatOnClick(1.0f, 200.0f, 2, ApplyFreq); }

void SetYFreq() { HMI_value.axis = Y_AXIS, SetPFloatOnClick(1.0f, 200.0f, 2, ApplyFreq); }

void SetXZeta() { HMI_value.axis = X_AXIS, SetPFloatOnClick(0.0f, 1.0f, 2, ApplyZeta); }

void SetYZeta() { HMI_value.axis = Y_AXIS, SetPFloatOnClick(0.0f, 1.0f, 2, ApplyZeta); }

  void Draw_InputShaping_Menu() {
    checkkey = Menu;
    if (SET_MENU(InputShapingMenu, MSG_INPUT_SHAPING, 8)) {
      BACK_ITEM(Draw_Prepare_Menu);
    // M593 F Frequency
    #if HAS_SHAPING_X
      static float xfreq = stepper.get_shaping_frequency(X_AXIS);
      EDIT_ITEM(ICON_MoveX, MSG_SHAPING_X_FREQ, onDrawPFloat2Menu, SetXFreq, &xfreq);

    #endif
    #if HAS_SHAPING_Y
      static float yfreq = stepper.get_shaping_frequency(Y_AXIS);
      EDIT_ITEM(ICON_MoveY, MSG_SHAPING_Y_FREQ, onDrawPFloat2Menu, SetYFreq, &yfreq);
    #endif
    // M593 D Damping ratio
    #if HAS_SHAPING_X
      static float xzeta = stepper.get_shaping_damping_ratio(X_AXIS);
      EDIT_ITEM(ICON_MoveX, MSG_SHAPING_X_ZETA, onDrawPFloat2Menu, SetXZeta, &xzeta);

    #endif
    #if HAS_SHAPING_Y
      static float yzeta = stepper.get_shaping_damping_ratio(Y_AXIS);
      EDIT_ITEM(ICON_MoveY, MSG_SHAPING_Y_ZETA, onDrawPFloat2Menu, SetYZeta, &yzeta);
    #endif
    }
  UpdateMenu(InputShapingMenu);
  }
#endif

Additional context

this is how I was able to get the Input Shaping Menu to work in the ProUI for Ender3v2 / Voxelab Aquila lcd.

if any changes can be made, let me know. but i tested and it does work.

thisiskeithb commented 2 years ago

Please submit a PR with these changes so it can be reviewed.

Sonicboom247 commented 1 year ago

How would this work for something like the Artillery Sidewinder? I can never define a TFT and just tried to add a Custom Menu item and it says no TFT is defined, sort of a catch 22

thisiskeithb commented 1 year ago

How would this work for something like the Artillery Sidewinder?

This Sidewinder’s TFT is a standalone computer / G-code sender and runs separate firmware.

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.