Search code examples
algorithmcontrolspwm

Efficient algorithm to reduce peak power from multiple pwm output?


I have multiple power mosfet pwm controlled and connected to a single main power supply. Thee pwm signals operate all at the same frequency and their duty factor is determined otherwise and can change frequently. It can can vary between 0 and 100%. My PWM controller allows me to choose On time and off time independently for each signal.

I am looking for an efficient algorithm to determine the on time of each channel in order to minimize the peak power drawn from the power supply.

A trivial example: With 10 mosfet each one with a 10% duty factor the optimal solution will be to turn on each mosfet one at a time in sequence.

Any ideas out there on how to address this problem? Thanks


Solution

  • Let the pulse width fractions (between 0 and 1) be p1, ..., pn. Let s0 = 0 and sn = sn−1 + pn be the prefix sums. Signal i should turn on at times si−1 mod 1 and end at times si mod 1.

    This algorithm does what you want on the trivial example, since s0, s1, ..., sn−1, sn = 0, 1/10, ..., 9/10, 0.

    For a less trivial example, suppose that we have signals at 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%. Then the pulses look like

    1---------1---------
    -22--------22-------
    ---333-------333----
    ------4444------4444
    55555-----55555-----
    6----666666----66666
    -7777777---7777777--
    888888--88888888--88
    99999-999999999-9999