Klipper compatible

Klipper freq & damp test

Klipper guide separation from the Marlin guide

Co-Authored-By: Shane Delmore <shane@delmore.io>
This commit is contained in:
Ian Bassi 2025-04-03 11:40:56 -03:00
parent 4376f8ba3c
commit a66bc06b2d
4 changed files with 90 additions and 43 deletions

View file

@ -9,9 +9,12 @@
- [Advanced Calibration](#advanced-calibration)
- [Max Volumetric speed](#max-volumetric-speed)
- [Input Shaping](#input-shaping)
- [ZV Input Shaping](#zv-input-shaping)
- [Fixed-Time Motion](#fixed-time-motion)
- [Junction Deviation](#junction-deviation)
- [Klipper](#klipper)
- [Resonance Compensation](#resonance-compensation)
- [Marlin](#marlin)
- [ZV Input Shaping](#zv-input-shaping)
- [Fixed-Time Motion](#fixed-time-motion)
- [Junction Deviation](#junction-deviation)
- [VFA](#vfa)
> [!IMPORTANT]
@ -160,7 +163,43 @@ You can also return to OrcaSlicer in the "Preview" tab, make sure the color sche
During high-speed movements, vibrations can cause a phenomenon called "ringing," where periodic ripples appear on the print surface. Input Shaping provides an effective solution by counteracting these vibrations, improving print quality and reducing wear on components without needing to significantly lower print speeds.
### ZV Input Shaping
### Klipper
### Resonance Compensation
The Klipper Resonance Compensation is a set of Input Shaping modes that can be used to reduce ringing and improve print quality.
Ussualy the recommended values modes are ``MZV`` or ``EI`` for Delta printers.
1. Pre-requisites:
1. In OrcaSlicer, set:
1. Acceleration high enough to trigger ringing (e.g., 2000 mm/s²).
2. Speed high enough to trigger ringing (e.g., 100 mm/s).
3. Jerk [Klipper Square Corner Velocity](https://www.klipper3d.org/Kinematics.html?h=square+corner+velocity#look-ahead) to 5 or a high value (e.g., 20).
2. In printer settigs:
1. Set the Shaper Type to ``MZV`` or ``EI``.
```
SET_INPUT_SHAPER SHAPER_TYPE=MZV
```
2. Disable [Minimun Cruise Ratio](https://www.klipper3d.org/Kinematics.html#minimum-cruise-ratio) with:
```
SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0
```
3. Use a high gloss filament to make the ringing more visible.
2. Print the Input Shaping Frequency test with a range of frequencies.
1. Measure the X and Y heights and read the frequency set at that point in Orca Slicer.
2. If not a clear result, you can measure a X and Y min and max acceptable heights and repeat the test with that min and max value.
**Note**: There is a chance you will need to set higher than 60Hz frequencies. Some printers with very rigid frames and excellent mechanics may exhibit frequencies exceeding 100Hz.
3. Print the Damping test setting your X and Y frequency to the value you found in the previous step.
1. Measure the X and Y heights and read the damping set at that point in Orca Slicer.
**Note**: Not all Resonance Compensation modes support damping
1. Restore your 3D Printer settings to avoid keep using high acceleration and jerk values.
2. Save the settings
1. You need to go to the printer settings and set the X and Y frequency and damp to the value you found in the previous step.
### Marlin
#### ZV Input Shaping
ZV Input Shaping introduces an anti-vibration signal into the stepper motion for the X and Y axes. It works by splitting the step count into two halves: the first at half the frequency and the second as an "echo," delayed by half the ringing interval. This simple approach effectively reduces vibrations, improving print quality and allowing for higher speeds.
@ -169,19 +208,16 @@ ZV Input Shaping introduces an anti-vibration signal into the stepper motion for
1. Acceleration high enough to trigger ringing (e.g., 2000 mm/s²).
2. Speed high enough to trigger ringing (e.g., 100 mm/s).
3. Jerk
1. If using a [Classic Jerk](https://marlinfw.org/docs/configuration/configuration.html#jerk-) or [Klipper Square Corner Velocity](https://www.klipper3d.org/Kinematics.html?h=square+corner+velocity#look-ahead) use a high value (e.g., 20).
2. If using [Junction Deviation](https://marlinfw.org/docs/features/junction_deviation.html) this test will use 0.25 (high enough to most printers).
1. If using [Classic Jerk](https://marlinfw.org/docs/configuration/configuration.html#jerk-) use a high value (e.g., 20).
2. If using [Junction Deviation](https://marlinfw.org/docs/features/junction_deviation.html) (new Marlin default mode) this test will use 0.25 (high enough to most printers).
2. Use a high gloss filament to make the ringing more visible.
3. In printer settigs:
1. Klipper:
1. Disable [Minimun Cruise Ratio](https://www.klipper3d.org/Kinematics.html#minimum-cruise-ratio) with:
```gcode
SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0
```
2. You need to print the Input SHaping Frequency test.
2. Print the Input Shaping Frequency test with a range of frequencies.
1. Measure the X and Y heights and read the frequency set at that point in Orca Slicer.
2. If not a clear result, you can measure a X and Y min and max acceptable heights and repeat the test with that min and max value.
3. When you find the best X and Y frequency, its time to Damp test setting your X and Y frequency to the value you found in the previous step.
**Note**: There is a chance you will need to set higher than 60Hz frequencies. Some printers with very rigid frames and excellent mechanics may exhibit frequencies exceeding 100Hz.
3. Print the Damping test setting your X and Y frequency to the value you found in the previous step.
1. Measure the X and Y heights and read the damping set at that point in Orca Slicer.
4. Restore your 3D Printer settings to avoid keep using high acceleration and jerk values.
1. Reboot your printer.
2. Use the following G-code to restore your printer settings:
@ -203,11 +239,11 @@ ZV Input Shaping introduces an anti-vibration signal into the stepper motion for
M500
```
### Fixed-Time Motion
#### Fixed-Time Motion
TODO This calibration test is currently under development.
## Junction Deviation
### Junction Deviation
Junction Deviation is the default method for controlling cornering speed in MarlinFW printers.
Higher values result in more aggressive cornering speeds, while lower values produce smoother, more controlled cornering.

View file

@ -345,27 +345,43 @@ std::string GCodeWriter::set_pressure_advance(double pa) const
std::string GCodeWriter::set_input_shaping(char axis, float damp, float freq) const
{
std::ostringstream gcode;
if (FLAVOR_IS(gcfKlipper))
{
throw std::runtime_error("M593 - ZV Input Shaping is NOT supported by Klipper");
}
if (freq < 0.0f || damp < 0.f || damp > 1.0f || (axis != 'X' && axis != 'Y' && axis != 'Z' && axis != 'A'))// A = all axis
{
throw std::runtime_error("Invalid input shaping parameters: freq=" + std::to_string(freq) + ", damp=" + std::to_string(damp));
}
gcode << "M593";
if (axis != 'A')
{
gcode << " " << axis;
}
if (freq > 0.0f)
{
gcode << " F" << std::fixed << std::setprecision(2) << freq;
}
if (damp > 0.0f)
{
gcode << " D" << std::fixed << std::setprecision(2) << damp;
std::ostringstream gcode;
if (FLAVOR_IS(gcfKlipper)) {
gcode << "SET_INPUT_SHAPER";
if (axis != 'A')
{
if (freq > 0.0f) {
gcode << " SHAPER_FREQ_" << axis << "=" << std::fixed << std::setprecision(2) << freq;
}
if (damp > 0.0f){
gcode << " DAMPING_RATIO_" << axis << "=" << damp;
}
} else {
if (freq > 0.0f) {
gcode << " SHAPER_FREQ_X=" << std::fixed << std::setprecision(2) << freq << " SHAPER_FREQ_Y=" << std::fixed << std::setprecision(2) << freq;
}
if (damp > 0.0f) {
gcode << " DAMPING_RATIO_X=" << damp << " DAMPING_RATIO_Y=" << damp;
}
}
} else {
gcode << "M593";
if (axis != 'A')
{
gcode << " " << axis;
}
if (freq > 0.0f)
{
gcode << " F" << std::fixed << std::setprecision(2) << freq;
}
if (damp > 0.0f)
{
gcode << " D" << std::fixed << std::setprecision(2) << damp;
}
}
gcode << "; Override input shaping value\n";
return gcode.str();

View file

@ -10167,8 +10167,6 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats { 200 });
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools {false });
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats { 0.0 });
print_config->set_key_value("default_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("outer_wall_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool { false });
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
@ -10208,8 +10206,6 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats { 200 });
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools{false});
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats{0.0});
print_config->set_key_value("default_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("outer_wall_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
@ -10249,8 +10245,6 @@ void Plater::calib_junction_deviation(const Calib_Params& params)
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats{200});
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools{false});
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats{0.0});
print_config->set_key_value("default_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("outer_wall_jerk", new ConfigOptionFloat { 20.0 });
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));

View file

@ -863,8 +863,7 @@ Input_Shaping_Freq_Test_Dlg::Input_Shaping_Freq_Test_Dlg(wxWindow* parent, wxWin
settings_sizer->Add(damping_factor_sizer);
// Add a note explaining that 0 means use default value
auto note_text = new wxStaticText(this, wxID_ANY, _L("Note: 0 Damp = Printer default"),
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
auto note_text = new wxStaticText(this, wxID_ANY, _L("Note: 0 Damp = Printer default."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
note_text->SetForegroundColour(wxColour(128, 128, 128));
settings_sizer->Add(note_text, 0, wxALL, 5);
@ -997,8 +996,10 @@ Input_Shaping_Damp_Test_Dlg::Input_Shaping_Damp_Test_Dlg(wxWindow* parent, wxWin
settings_sizer->Add(damp_sizer);
// Add a note to explain users to use their previously calculated frequency
auto note_text = new wxStaticText(this, wxID_ANY, _L("Note: Set frequencies to the previously calculated values"),
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
auto note_text = new wxStaticText(this, wxID_ANY, _L("Note: Use previously calculated frequencies."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
note_text->SetForegroundColour(wxColour(128, 128, 128));
settings_sizer->Add(note_text, 0, wxALL, 5);
note_text->SetForegroundColour(wxColour(128, 128, 128));
settings_sizer->Add(note_text, 0, wxALL, 5);