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

Update Measuring_Resonances.md #6509

Merged
merged 6 commits into from
Apr 29, 2024
Merged

Conversation

charminULTRA
Copy link
Contributor

@charminULTRA charminULTRA commented Feb 25, 2024

Current commands in the documentation, using the *, results in bad chart output when more than one .csv file exists in the tmp folder. This isn't obvious for people who may not know that the * is a wildcard character.

I was pulling out my hair trying to understand my results until I realized my multiple runs of data were all being used in the same graph! I think this simple pitfall should be fixed.

Current command, using the *, results in bad chart output when more than one .csv file exists in the tmp folder. This isn't obvious for people who may not know that the * is a wildcard character.

I was pulling out my hair trying to understand my results until I realized my multiple runs of data were all being used in the same graph!
@freakydude
Copy link
Contributor

I used this as a feature - so you can measure multiple times (e.g. with a full and empty spool on top) and the results will be merged.

If that was the intention, I would comment the script line with - "be aware, all matching csv will be merged" or something like that.

Kind regards

@JamesH1978
Copy link
Collaborator

Thank you for submitting a PR, pleas refer to point 3 in "What to expect in a review" in https://github.com/Klipper3d/klipper/blob/master/docs/CONTRIBUTING.md and provide a signed off by line.

Thanks
James

Copy link

Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html

There are some steps that you can take now:

  1. Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review
    If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
  2. Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
  3. Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.

Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@dewi-ny-je
Copy link

@charminULTRA can you apply the corrections I suggested? then we can hopefully have the changes approved

@charminULTRA
Copy link
Contributor Author

@charminULTRA can you apply the corrections I suggested? then we can hopefully have the changes approved

I don't see any suggested corrections, where can I view that? @dewi-ny-je

@charminULTRA
Copy link
Contributor Author

Thank you for submitting a PR, pleas refer to point 3 in "What to expect in a review" in https://github.com/Klipper3d/klipper/blob/master/docs/CONTRIBUTING.md and provide a signed off by line.

Thanks James

@JamesH1978 How do I add a sign off if I already submitted the commit?

Not entirely so sure why this is so rigorous considering the Klipper documentation still assumes use of OctoPrint lol

Copy link
Contributor Author

@charminULTRA charminULTRA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign-off by Jonathan Williams [email protected]

@@ -450,7 +450,7 @@ TEST_RESONANCES AXIS=Y
```
This will generate 2 CSV files (`/tmp/resonances_x_*.csv` and
`/tmp/resonances_y_*.csv`). These files can be processed with the stand-alone
script on a Raspberry Pi. To do that, run the following commands:
script on a Raspberry Pi. To do that, run the following commands (WARNING: Do not run these commands when there is more than one .csv file in your tmp folder. This will result in ALL files being used for the charted results):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change this line: grammatically brackets are NOT meant to include whole sentences. If it's more than few words, it's not for brackets.

Add a line before line 458, after the code, as suggested:

457bis Keep in mind that these commands (written with the "*") will merge all available CSV files
from the specified folder to generate a single calibration graph. It may be useful if you tested the
machine in various conditions and you want a single result which takes all of them into account.

Remember to split at column 80, as the file originally was, don't add long lines which make the code difficult to read. Lines are free of charge :)

Copy link
Contributor Author

@charminULTRA charminULTRA Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change this line: grammatically brackets are NOT meant to include whole sentences. If it's more than few words, it's not for brackets.

Add a line before line 458, after the code, as suggested:

457bis Keep in mind that these commands (written with the "*") will merge all available CSV files
from the specified folder to generate a single calibration graph. It may be useful if you tested the
machine in various conditions and you want a single result which takes all of them into account.

Remember to split at column 80, as the file originally was, don't add long lines which make the code difficult to read. Lines are free of charge :)

I don't fully agree with this edit. There's no part of the documentation that already tells or assumes the user should or could use multiple CSV files, so the inherent assumption here is that the user is creating a single CSV for each axis. Given that, I don't think we should say things like "keep in mind" down below, but more of an upfront warning like "do not run this with multiple CSVs in your folder, unless you intend to blend the results". You want to alert the user before they perform an action, not after.

I assume the original intent of using a wildcard was to save the user time from writing out the file name, but again it's not clear from the documentation.

Will submit a modified commit.

@dewi-ny-je
Copy link

@KevinOConnor for as much as it can be worth, I now support and I checked the changes. I think they are ready to be merged.

@KevinOConnor
Copy link
Collaborator

Thanks. Looks fine to me. I'll wait a few days to see if @dmbutyugin has any comments.

-Kevin

Copy link
Collaborator

@dmbutyugin dmbutyugin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I agree that the documentation is not obvious in this regard. I think it may be valuable to provide some additional context, so I wrote some suggestion on how to expand the text without suggesting that multiple files are not supported, but highlighting the typical usecases and that most users would use it after a single test run per axis.

@@ -450,7 +450,10 @@ TEST_RESONANCES AXIS=Y
```
This will generate 2 CSV files (`/tmp/resonances_x_*.csv` and
`/tmp/resonances_y_*.csv`). These files can be processed with the stand-alone
script on a Raspberry Pi. To do that, run the following commands:
script on a Raspberry Pi. This script is intended to be run with a single CSV
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for jumping late into the conversation. But I'd rephrase and expand that sentence to have a note after the commands, something like this:

...
script on a Raspberry Pi. To do that, run the following commands:

~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png

Note that '*' in the above commands acts as a wildcard for matching files, thus these commands
should usually be executed after one measurement per axis, with a single CSV file created for each
axis measured. If multiple CSV files were generated, then the script will process them all and
average the results. This can be useful, for example, if a resonance test was done at multiple test
points. On the other hand, if a user was, say, adjusting the belt tension between the test runs,
it is not valid to use the above commands as-is, and the user should either delete all but the latest
measurements, or specify the exact file names of the CSV files for the appropriate test run.
Following the commands above, the script will generate the charts ....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your suggestion is too verbose and you also moved the commentary AFTER the commands, rather than before. I think it's critical to have this information before the user is presented commands, because users tend to run commands when they are presented, rather than reading the information provided after.

Copy link
Contributor Author

@charminULTRA charminULTRA Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this combination of your comment and my existing PR (placed before commands)

...
script on a Raspberry Pi. This script is intended to be run with a single CSV file for each axis measured, although it can be used with multiple CSV files if you desire to average the results. Averaging results can be useful, for example, if resonance tests were done at multiple test points. Delete the extra CSV files if you do not desire to average them.

To run the processing script, execute the following commands:
...

@KevinOConnor KevinOConnor added the pending feedback Topic is pending feedback from submitter label Apr 3, 2024
@charminULTRA
Copy link
Contributor Author

Bump

@charminULTRA charminULTRA requested a review from dmbutyugin April 24, 2024 13:19
@charminULTRA charminULTRA requested a review from dewi-ny-je April 26, 2024 00:11
Copy link

@dewi-ny-je dewi-ny-je left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the final version proposed. I also think the suggestion by @dmbutyugin was too verbose.

@KevinOConnor
Copy link
Collaborator

Okay, thanks. If there are no further comments I'll look to commit in a few days.

-Kevin

@dmbutyugin
Copy link
Collaborator

OK, thanks, I'm also fine with the current version of the notice.

@KevinOConnor KevinOConnor merged commit af149b4 into Klipper3d:master Apr 29, 2024
1 check passed
@KevinOConnor
Copy link
Collaborator

Thanks.

-Kevin

richfelker pushed a commit to richfelker/klipper that referenced this pull request Jun 11, 2024
Current command, using the *, results in bad chart output when more than one .csv file exists in the tmp folder. This isn't obvious for people who may not know that the * is a wildcard character.

Signed-off-by: Jonathan Williams <[email protected]>
Co-authored-by: charminULTRA <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending feedback Topic is pending feedback from submitter reviewer needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants