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

Fan speed saturates at 75% #19

Closed
stoklund opened this issue Oct 29, 2021 · 1 comment
Closed

Fan speed saturates at 75% #19

stoklund opened this issue Oct 29, 2021 · 1 comment

Comments

@stoklund
Copy link
Contributor

I was testing a Noctua NF-A4x20 PWM fan with Adafruit's EMC2101 breakout board and noticed that the fan speed maxes out at 5000 rpm already at a 75% manual fan speed setting:

pwm_rpm.pdf

I first thought this was a property of my fan, but reading the EMC2101 data sheet, I noticed:

  1. The PWM Frequency Register PWM_F defaults to 0x17 after reset, not the maximum and recommended 0x1f.
  2. The PWM duty cycle is determined by both the Fan Setting Register and the PWM_F register. From Appendix A: DUTY_CYCLE = FAN_SETTING / (PWM_F * 2) * 100%.

The manual_fan_speed property is using MAX_LUT_SPEED as a divisor instead of PWM_F * 2. This means that the actual PWM duty cycle reaches 100% at emc.fan_speed = PWM_F * 2 / MAX_LUT_SPEED which is about 73%, matching my graph.

The divisor in the manual_fan_speed functions should be PWM_F * 2 when running in PWM mode and 64 in DAC mode. This should also cause more trouble when setting the pwm_frequency property, although I haven't tried that yet.

I'll put together a PR for this.

stoklund added a commit to stoklund/Adafruit_CircuitPython_EMC2101 that referenced this issue Oct 30, 2021
- Add a `_full_speed_lsb` member variable which represents the (smallest) LSB
  value corresponding to a 100% fan setting.
- Add a `_calculate_full_speed()` method that computes it.
- Use `_full_speed_lsb` when converting percentages to fan speed settings and back.

Fixes adafruit#19.
stoklund added a commit to stoklund/Adafruit_CircuitPython_EMC2101 that referenced this issue Oct 30, 2021
- Add a `_full_speed_lsb` member variable which represents the (smallest) LSB
  value corresponding to a 100% fan setting.
- Add a `_calculate_full_speed()` method that computes it.
- Use `_full_speed_lsb` when converting percentages to fan speed settings and back.

Fixes adafruit#19.
@ladyada
Copy link
Member

ladyada commented Oct 30, 2021

ok! this chip is surprisingly complex - thanks for any PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants