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?

  • Hi Sigurd,

    Thank you for the suggestion. I am getting the fan speed as per my desired value but voltage and frequency is varying.

    1. Yes, we need to have 50Hz PWM signal with varying duty cycle, at the same time the voltage at the output should be constant with respect to the set (desired value) duty cycle.

    For example, if duty cycle is 50, output voltage at the load should be say 120V. similarly, if duty cycle is 75, o/p voltage should be 170V(approx.) and for the max duty cycle voltage should be 230V. But, the frequency should be 50Hz fixed as of the input AC supply frequency i.e.,50Hz only.

    To be more specific, I want to control the AC fan using Nordic (nrf52840)instead of fan voltage regulators we generally use.

     2. Yes, if the input from ZCD (pin 30) is high PWM signal should stop as per the circuit the TRIAC will drive the previous value continuously until the next zero crossing is detected.

  • So what is the issue now? You need to set the duty cycle to 3 different values, based on some user input?

Reply Children
Related