diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index 2e2375f2..19b745d2 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -6,6 +6,11 @@ All dates in this document are approximate. # Changes +20210201: The `TEST_RESONANCES` command will now disable input shaping +if it was previously enabled (and re-enable it after the test). In order +to override this behavior and keep the input shaping enabled, one can +pass an additional parameter `INPUT_SHAPING=1` to the command. + 20210201: The `ACCELEROMETER_MEASURE` command will now append the name of the accelerometer chip to the output file name if the chip was given a name in the corresponding adxl345 section of the printer.cfg. diff --git a/docs/G-Codes.md b/docs/G-Codes.md index c6f99658..c656c416 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -728,12 +728,15 @@ is enabled (also see the all enabled accelerometer chips. - `TEST_RESONANCES AXIS= OUTPUT= [NAME=] [FREQ_START=] [FREQ_END=] - [HZ_PER_SEC=]`: Runs the resonance test in all - configured probe points for the requested axis (X or Y) and measures - the acceleration using the accelerometer chips configured for the - respective axis. `OUTPUT` parameter is a comma-separated list of - which outputs will be written. If `raw_data` is requested, then the - raw accelerometer data is written into a file or a series of files + [HZ_PER_SEC=] [INPUT_SHAPING=[<0:1>]]`: Runs the resonance + test in all configured probe points for the requested axis (X or Y) + and measures the acceleration using the accelerometer chips configured + for the respective axis. If `INPUT_SHAPING=0` or not set (default), + disables input shaping for the resonance testing, because it is not valid + to run the resonance testing with the input shaper enabled. + `OUTPUT` parameter is a comma-separated list of which outputs will be + written. If `raw_data` is requested, then the raw accelerometer data + is written into a file or a series of files `/tmp/raw_data__[_].csv` with (`_` part of the name generated only if more than 1 probe point is configured). If `resonances` is specified, the frequency response is calculated diff --git a/docs/Measuring_Resonances.md b/docs/Measuring_Resonances.md index cf11d46e..ec1cbbfe 100644 --- a/docs/Measuring_Resonances.md +++ b/docs/Measuring_Resonances.md @@ -130,18 +130,15 @@ max_accel: 7000 max_accel_to_decel: 7000 ``` (after you are done with the measurements, revert these values to their old, -or the newly suggested values). Also, if you have enabled input shaper already, -you will need to disable it prior to this test as follows: -``` -SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 -``` -as it is not valid to run the resonance testing with the input shaper enabled. +or the newly suggested values). Run the following command: ``` TEST_RESONANCES AXIS=X ``` -Note that it will create vibrations on X axis. +Note that it will create vibrations on X axis. It will also disable input +shaping if it was enabled previously, as it is not valid to run the resonance +testing with the input shaper enabled. **Attention!** Be sure to observe the printer for the first time, to make sure the vibrations do not become too violent (`M112` command can be used to abort diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py index 045527c8..f4b0fa76 100644 --- a/klippy/extras/resonance_tester.py +++ b/klippy/extras/resonance_tester.py @@ -127,6 +127,13 @@ class ResonanceTester: if csv_output: helper = shaper_calibrate.ShaperCalibrate(self.printer) + input_shaper = self.printer.lookup_object('input_shaper', None) + if input_shaper is not None and not gcmd.get_int('INPUT_SHAPING', 0): + input_shaper.disable_shaping() + gcmd.respond_info("Disabled [input_shaper] for resonance testing") + else: + input_shaper = None + currentPos = toolhead.get_position() Z = currentPos[2] E = currentPos[3] @@ -176,6 +183,10 @@ class ResonanceTester: helper, axis, data) gcmd.respond_info( "Resonances data written to %s file" % (csv_name,)) + if input_shaper is not None: + input_shaper.enable_shaping() + gcmd.respond_info( + "Re-enabled [input_shaper] after resonance testing") def cmd_SHAPER_CALIBRATE(self, gcmd): toolhead = self.printer.lookup_object('toolhead')