forked from MarlinFirmware/Marlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 6b4d7b9 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Tue Oct 25 00:37:23 2022 +0000 [cron] Bump distribution date (2022-10-25) commit 6e1f0be Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Mon Oct 24 17:04:55 2022 -0500 🩹 Allow for last non-servo extruder commit f4dc9d5 Author: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue Oct 25 10:47:23 2022 +1300 🐛 Fix move_extruder_servo (MarlinFirmware#24908) commit 81f88fe Author: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon Oct 24 17:44:52 2022 -0400 🐛 Fix FTDUI Status Screen Timeout (MarlinFirmware#24899) commit cf2311f Author: Manuel McLure <manuel@mclure.org> Date: Mon Oct 24 14:25:47 2022 -0700 🩹 Fix spurious "bad command" (MarlinFirmware#24923) commit 248236b Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Mon Oct 24 00:36:39 2022 +0000 [cron] Bump distribution date (2022-10-24) commit aaf34fa Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Sat Oct 22 23:35:31 2022 -0500 🩹 Fix M593 report commit 2cad442 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sun Oct 23 00:34:38 2022 +0000 [cron] Bump distribution date (2022-10-23) commit 1b31a7c Author: kurtis-potier-geofabrica <77456752+kurtis-potier-geofabrica@users.noreply.github.com> Date: Sat Oct 22 00:13:56 2022 -0400 🚸 Up to 3 MAX Thermocouples (MarlinFirmware#24898) commit fd0c6fa Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Fri Oct 21 19:45:20 2022 -0500 🔧 Clean up unused ESP_WIFI pins commit ed12526 Author: thinkyhead <thinkyhead@users.noreply.github.com> Date: Sat Oct 22 00:33:26 2022 +0000 [cron] Bump distribution date (2022-10-22) commit a460b01 Author: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri Oct 21 22:34:22 2022 +0100 🚀 ZV Input Shaping (MarlinFirmware#24797) commit f8d7090 Author: Scott Lahteine <thinkyhead@users.noreply.github.com> Date: Fri Oct 21 15:41:51 2022 -0500 🔨 gcc-12 for macOS native
- Loading branch information
Showing
28 changed files
with
965 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Marlin 3D Printer Firmware | ||
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | ||
* | ||
* Based on Sprinter and grbl. | ||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#include "../../../inc/MarlinConfig.h" | ||
|
||
#if ENABLED(INPUT_SHAPING) | ||
|
||
#include "../../gcode.h" | ||
#include "../../../module/stepper.h" | ||
|
||
void GcodeSuite::M593_report(const bool forReplay/*=true*/) { | ||
report_heading_etc(forReplay, F("Input Shaping")); | ||
#if HAS_SHAPING_X | ||
SERIAL_ECHOLNPGM(" M593 X" | ||
" F", stepper.get_shaping_frequency(X_AXIS), | ||
" D", stepper.get_shaping_damping_ratio(X_AXIS) | ||
); | ||
#endif | ||
#if HAS_SHAPING_Y | ||
TERN_(HAS_SHAPING_X, report_echo_start(forReplay)); | ||
SERIAL_ECHOLNPGM(" M593 Y" | ||
" F", stepper.get_shaping_frequency(Y_AXIS), | ||
" D", stepper.get_shaping_damping_ratio(Y_AXIS) | ||
); | ||
#endif | ||
} | ||
|
||
/** | ||
* M593: Get or Set Input Shaping Parameters | ||
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes. | ||
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes. | ||
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet) | ||
* X<1> Set the given parameters only for the X axis. | ||
* Y<1> Set the given parameters only for the Y axis. | ||
*/ | ||
void GcodeSuite::M593() { | ||
if (!parser.seen_any()) return M593_report(); | ||
|
||
const bool seen_X = TERN0(HAS_SHAPING_X, parser.seen_test('X')), | ||
seen_Y = TERN0(HAS_SHAPING_Y, parser.seen_test('Y')), | ||
for_X = seen_X || TERN0(HAS_SHAPING_X, (!seen_X && !seen_Y)), | ||
for_Y = seen_Y || TERN0(HAS_SHAPING_Y, (!seen_X && !seen_Y)); | ||
|
||
if (parser.seen('D')) { | ||
const float zeta = parser.value_float(); | ||
if (WITHIN(zeta, 0, 1)) { | ||
if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta); | ||
if (for_Y) stepper.set_shaping_damping_ratio(Y_AXIS, zeta); | ||
} | ||
else | ||
SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)"); | ||
} | ||
|
||
if (parser.seen('F')) { | ||
const float freq = parser.value_float(); | ||
if (freq > 0) { | ||
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq); | ||
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq); | ||
} | ||
else | ||
SERIAL_ECHO_MSG("?Frequency (F) must be greater than 0"); | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.