Welcome! Log In Create A New Profile

Advanced

Marlin PWM frequency questions

Posted by dexter 
Marlin PWM frequency questions
March 27, 2019 11:53AM
Hi,

can somebody here explain to me how heater PWM frequency is scaled by SOFT_PWM_SCALE? In the code, I found this:

    // SOFT_PWM_SCALE to frequency:
    //
    // 0: 16000000/64/256/128 =   7.6294 Hz
    // 1:                / 64 =  15.2588 Hz
    // 2:                / 32 =  30.5176 Hz
    // 3:                / 16 =  61.0352 Hz
    // 4:                /  8 = 122.0703 Hz
    // 5:                /  4 = 244.1406 Hz

Is this frequency also used for the hotend heater? Because on here, I read that the default hotend frequency is 488.28Hz (although also scalable via SOFT_PWM_SCALE, though described as the base value). Or did this change by now?

Thank you.
Re: Marlin PWM frequency questions
March 27, 2019 04:08PM
By default on an AVR such as RAMPS with Arduino Mega the heatbed/hotend PWM frequency is the 7.6294 Hz from the table above. You can easily see the heatbed and hotend MOSFET LEDs flashing at that rate. This makes sense since SOFT_PWM_SCALE defaults to 0.
Re: Marlin PWM frequency questions
March 31, 2019 01:50PM
Quote
MMcLure
By default on an AVR such as RAMPS with Arduino Mega the heatbed/hotend PWM frequency is the 7.6294 Hz from the table above. You can easily see the heatbed and hotend MOSFET LEDs flashing at that rate. This makes sense since SOFT_PWM_SCALE defaults to 0.

Indeed, I totally forgot there were LEDs that I can use to check the frequency. Just as a follow-up question, can I use different frequencies for the bed and for the hotend? I suppose there would be some changes necessary in temperature.cpp. Or is it not possible at all?
Re: Marlin PWM frequency questions
March 31, 2019 06:15PM
I don't think you can use different settings for the bed and hotend.
Sorry, only registered users may post in this forum.

Click here to login