This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

controlling AC fan with pwm library

Hi Sigurd,

Thank you for your reply. I have executed the code given by you (below link) in Segger studio(V 3.50) I observed that the output or load (pin 31)  which is connected to ac fan is running at the set duty cycle for a while(few seconds) and it is going to high value automatically. But, i want to run it at a constant speed. 

The final goal is that i have an input ac input voltage of 230v/50Hz, I want to control the AC fan with same frequency (how to set 50Hz) at different speeds (say 4 different speeds proportionally) voltage should vary according to the speed at output. Please find the circuit I am using below. How do i achieve the above goal?  Please give necessary suggestions.

Thank you.

https://devzone.nordicsemi.com/f/nordic-q-a/40634/controlling-ac-fan-using-pwm-library

Parents
  • Hi,

    duty cycle for a while(few seconds)

    The PWM signal will be generated as long as pin 30 is low.

    and it is going to high value automatically.

    If you want it to be low instead, you can change this by setting the pin polarity to active high.

    Snippet:

    static void pwm_init()
    {
        uint32_t err_code;
        app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(20000L,DATA);
        /* Initialize and enable PWM. */
        pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH;
        err_code = app_pwm_init(&PWM1,&pwm1_cfg,pwm_ready_callback);
        APP_ERROR_CHECK(err_code);
        app_pwm_enable(&PWM1);   
    }

    with same frequency (how to set 50Hz) at different speeds (say 4 different speeds proportionally)

    1) So you need a 50Hz PWM signal, with varying duty cycle?

    2) Should the PWM signal stop when pin 30 is high?

Reply
  • Hi,

    duty cycle for a while(few seconds)

    The PWM signal will be generated as long as pin 30 is low.

    and it is going to high value automatically.

    If you want it to be low instead, you can change this by setting the pin polarity to active high.

    Snippet:

    static void pwm_init()
    {
        uint32_t err_code;
        app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(20000L,DATA);
        /* Initialize and enable PWM. */
        pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH;
        err_code = app_pwm_init(&PWM1,&pwm1_cfg,pwm_ready_callback);
        APP_ERROR_CHECK(err_code);
        app_pwm_enable(&PWM1);   
    }

    with same frequency (how to set 50Hz) at different speeds (say 4 different speeds proportionally)

    1) So you need a 50Hz PWM signal, with varying duty cycle?

    2) Should the PWM signal stop when pin 30 is high?

Children
Related