Support fan PWM settings #73
|
@ -18,8 +18,8 @@ const MAX_TEC_I: f64 = 3.0;
|
||||||
const MAX_USER_FAN_PWM: f64 = 100.0;
|
const MAX_USER_FAN_PWM: f64 = 100.0;
|
||||||
const MIN_USER_FAN_PWM: f64 = 1.0;
|
const MIN_USER_FAN_PWM: f64 = 1.0;
|
||||||
const MAX_FAN_PWM: f64 = 1.0;
|
const MAX_FAN_PWM: f64 = 1.0;
|
||||||
|
|||||||
// below this value motor circuit assumes there is no signal and runs full speed
|
// below this value motor's autostart feature may fail
|
||||||
sb10q
commented
According to ? According to ?
esavkin
commented
Internal experiments Internal experiments
sb10q
commented
Please say so in the code comments. Please say so in the code comments.
sb10q
commented
Also we can probably expect this to be hardware revision dependent. When the fan has proper PWM support this shouldn't be an issue I guess. Also we can probably expect this to be hardware revision dependent. When the fan has proper PWM support this shouldn't be an issue I guess.
esavkin
commented
Made this (and others) value coming from hwrev Made this (and others) value coming from hwrev
|
|||||||
const MIN_FAN_PWM: f64 = 0.02;
|
const MIN_FAN_PWM: f64 = 0.04;
|
||||||
|
|
||||||
const DEFAULT_K_A: f64 = 1.0;
|
const DEFAULT_K_A: f64 = 1.0;
|
||||||
const DEFAULT_K_B: f64 = 0.0;
|
const DEFAULT_K_B: f64 = 0.0;
|
||||||
|
|
|
@ -226,11 +226,9 @@ impl Pins {
|
||||||
hclk: clocks.hclk(),
|
hclk: clocks.hclk(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Though there is not enough evidence available for concrete fan model,
|
// According to `SUNON DC Brushless Fan & Blower(255-E)` catalogue p.36-37
|
||||||
// it is generally advised to have higher PWM frequencies for brushless motors,
|
// Model name: MF35101V1-1000U-G99
|
||||||
sb10q
commented
G99 is not a PWM fan. G99 is not a PWM fan.
|
|||||||
// so that it would produce less audible noise.
|
let fan = Timer::new(tim8, &clocks).pwm(gpioc.pc9.into_alternate(), 25u32.khz());
|
||||||
sb10q
commented
Advised where? All the SUNON docs say PWM on this fan model isn't supported at all. Advised where? All the SUNON docs say PWM on this fan model isn't supported at all.
sb10q
commented
And what "higher frequency" are you talking about? And what "higher frequency" are you talking about?
|
|||||||
// Source: https://www.controleng.com/articles/understanding-the-effect-of-pwm-when-controlling-a-brushless-dc-motor/
|
|
||||||
let fan = Timer::new(tim8, &clocks).pwm(gpioc.pc9.into_alternate(), 80u32.khz());
|
|
||||||
|
|
||||||
(pins, leds, eeprom, eth_pins, usb, fan)
|
(pins, leds, eeprom, eth_pins, usb, fan)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
"weak" suggests amplitude, which is incorrect.
-> "frequency is too low"
no, not the frequency. The near-zero freq is the consequence of weak signal.
Do you have an oscilloscope picture demonstrating this, and how was it measured?
We used pulse counter to measure the tacho values, for PWM 0.04-1.0 it was ok, but for lower the tacho signal disappears