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

[FeatureRequest]: Achieve quieter motors by setting current scaler and hyteresis directly #1037

Open
AndyEveritt opened this issue Aug 30, 2024 · 2 comments
Assignees
Labels
enhancement Additional functionality, performance or other feature request
Milestone

Comments

@AndyEveritt
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

The existing implementation to set the motor current is as per the TMC datasheet.

  • CS (current scaler, IRUN_IHOLD) is set to 31 (max value)
  • globalscaler is calculated
  • CS is adjusted if needed

This sets the current accurately, but for some motors (specifically low inductance) or when using higher voltage power supplies (eg 48/60V) it produces optimal hysteresis values that are outside the recommended range. By reducing CS, you can reduce the required hysteresis values which can produce a quieter motor.

In testing this seems to have the biggest impact on noise at low speed. When using a LDO2804AC motor at 48V I was able to get the following noise reductions by tuning CS, HSTRT, and HEND
20mm/s: 72 dB -> 65 dB (noise floor of my office)
100 mm/s: 68 -> 69 dB
200 mm/s: 72 dB -> 71 dB

Describe the solution you propose.

  • It can not be expected that people will set CS & hysteresis directly so if CS is not provided, set current the existing way
  • If CS is provided, check that globalscaler can be calculated to within the allowed range, error if it can't
    • Could reduce CS but that might produce unexpected tuning results so imo better to throw an error
    • Also CS is not recommended to reduce below 16 anyway
  • Need to handle IHOLD current reduction in the calculation too
    • Probably ok for this to go below 16 as should only be used when holding position

Describe alternatives you've considered

No response

Provide any additional context or information.

No response

@AndyEveritt AndyEveritt added the enhancement Additional functionality, performance or other feature request label Aug 30, 2024
@dc42
Copy link
Collaborator

dc42 commented Aug 30, 2024

Wouldn't it be better to set CS automatically, to the extent possible, if the user doesn't provide a value for CS? We know what values of hysteresis are used (either the default values or the values set by the user), and we can read the VIN voltage. There's a possible issue if we read the VIN voltage too early while it is still rising.

@dc42
Copy link
Collaborator

dc42 commented Aug 30, 2024

It's also occurred to me that we could perhaps provide an option to calculate good values for CS and hysteresis in RRF when setting the motor current. We would need to measure the voltage, and we'd need the user to provide the phase inductance and resistance values via M569.

@T3P3 T3P3 added this to the After 3.6 milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional functionality, performance or other feature request
Projects
None yet
Development

No branches or pull requests

4 participants