Dimming Power Leds Using A Sepic Converter and Mcp1631 Pic Attach PWM Controller
Dimming Power Leds Using A Sepic Converter and Mcp1631 Pic Attach PWM Controller
400
White & Blue
350
Forward Current (mA)
Green
300 Amber
250
200
150
100
50
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Forward Voltage (V) FIGURE 2: Topology of an LED String
(Series and Parallel Connection).
FIGURE 1: Typical Forward Current vs.
Forward Voltage for a White, Blue, Green, and The LED string can be driven by a Constant Current
driver without series resistors. The sum of the forward
Amber Power LEDs (P3 series) at +25°C.
voltage of each diode in a series string must not exceed
the maximum voltage capability of the current source.
The Direct Relation between Forward
Due to LED tolerances, parallel connections using a
Voltage and the Color of the LED,
single current sense may not be able to maintain a
Maximum Reverse Voltage uniform intensity and color. Better control is done using
Different color LEDs have different forward voltage (Vf) separate current sensing for each LED rung in a
drops based upon the diode chemistry. A red LED parallel system.
dissipates less energy than a white LED when The advantage of paralleling LEDs is that more LEDs
operated at the same current level. That is because the can be supplied at lower output voltage levels on
red LED has a lower Forward Voltage drop than the constant current supplies. If slight variations in
white LED. LED manufacturers datasheets will provide luminous intensity are tolerable, a single current sense
the maximum forward voltage drop (Vfmax) at a given can be used to control the current loop. However, if one
maximum forward current (Ifmax). The higher Vfmax rung of the parallel LED string fails, the current through
values are typically for white and blue LEDs and the the other LEDs will increase and possibly cause
lower are typically for red LEDs. undesirable consequences. Therefore, it is
recommended to monitor current through each rung
and drive each rung as if the string was a series string.
The red and amber LEDs are affected the most by Thermal resistances RtJC (Thermal Resistance from
heating. The white LED is least affected by heating. junction to case) and RtCA (Thermal Resistance from
case to air) should be optimized for each application.
Temperature (°C)
33 Metal PCB
32
• thermal resistance which is modeled as a resistor 31
Chip
(Equation 1) 30
• the difference between ambient temperature and 29
28
junction temperature which is modeled as a 27
voltage source (Equation 3) 26
25
These are solved by Ohm's law following the model in
1 2 3 4 5 6 7 8
Figure 3. The working junction temperature, TJ, must
Base Thickness (mm)
be kept lower than the TJmax of the LED.
0.9
SEPIC powertrain switch to regulate the output of the
0.8
0.7 converter. Voltage or current may be regulated
0.6 depending on what is being sensed. For the SEPIC
0.5 LED driver application, the MCP1631HV is always
0.4
0.3 regulating current. A PIC microcontroller is providing
0.2 the oscillator and current references required to obtain
0.1 the desired output current.
0
0 10 20 30 40 50 60 70 80 90 100 The PWM signal starts with the PIC generated
Duty Cycle, D (%) oscillator input. When the oscillator input is low, the
VEXT driver output pin is pulled high, turning on the
FIGURE 6: Linearity of Brightness vs. external N-Channel MOSFET switch.
Duty Cycle in PWM LED drive. The current begins to ramp up in the primary coil
current sense resistor until the voltage exceeds 1/3 of
MCP1631 PWM CONTROLLER the VREF reference value supplied by the
microcontroller. The VREF voltage is internally limited to
The MCP1631/MCP1631V is a high-speed pulse width 0.9V. The 0.9V limit is used as an overcurrent limit. A
modulator (PWM) used to develop intelligent power passive filter is used on the current sense input (CS) to
systems. When combined with a microcontroller, the remove the leading edge turn-on spike associated with
MCP1631/MCP1631V will control the powertrain duty the turn-on of the external power MOSFET. The
cycle to provide output voltage or current regulation. A MCP1631/MCP1631V internal P-Channel MOSFET
functional block diagram of the PWM controller is output driver is powered using a separate PVDD pin to
shown in Figure 7. keep switching noise off of the analog AVDD pin and
The MCP1631/MCP1631V inputs were developed to sensitive current sense circuitry.
be attached to the I/O pins of a microcontroller. By The error amplifier (A1 on datasheet diagram) is used
combining the MCP1631/MCP1631V with a low cost to compare the switch current with the programmed
microcontroller, intelligent LED lighting designs can be reference current. When the switch current is less than
easily developed. the programmed current, the PWM switch driver duty
The microcontroller is used to adjust the output current, cycle increases. When the switch current is greater
switching frequency and maximum duty cycle. It than the programmed current, the PWM switch driver
provides additional features that make the power duty cycle decreases. The PWM duty cycle will track
system more intelligent, robust and adaptable. changes in output current and adjust the duty cycle
accordingly. The external feedback (FB) and
Additional features integrated into the MCP1631HV/ compensation (COMP) pins are used to control the
MCP1631VHV provide signal conditioning and speed of the error amplifiers output response.
protection features for constant current source
applications. The MCP1631HV contains a 10V/V inverting gain
amplifier (A2) for general purpose use. The A2 current
The MCP1631 is available in a 20-Lead 4x4 mm QFN, sense amplifier may be used to amplify the sense
20-Lead TSSOP, or SSOP packages. current in the secondary side of the SEPIC converter or
freewheeling current in a Buck converter.
Powering the MCP1631
For applications that operate from a high voltage input, Sensing Battery Voltage
the MCP1631HV and MCP1631VHV device options Using the microcontroller A/D converter to sense load
may be used. They will operate directly from a +3.5V to voltage requires a low source impedance to perform
+16V input. For these applications, an additional low accurate readings. Low source impedance requires
drop out +5V or +3.3V regulated output is available on low resistance values that would draw excessive
chip and can provide up to 250 mA of current to power current at the converter output, decreasing the
a microcontroller and auxiliary circuits. efficiency. The MCP1631HV integrates another
amplifier (A3) configured as a unity gain buffer. The
buffer provides a high impedance input to the voltage
sense divider while also providing a low impedance
source for the microcontroller A/D converter input.
OVIN PVDD
VDD OSCDIS
100 kΩ
0.1 µA OT
OSCIN VEXT
UVLO
S PGND
VDD Q
VDD
100 kΩ
CS/VRAMP 10R
+ Q
R
COMP C1
- VDD
- R ISIN
VDD
A2 R
+
FB
-
VREF A1
+ 2R ISOUT
Remove for MCP1631V
R
and MCP1631VHV Options VDD
AGND
2.7V Clamp + VSIN
A3
-
SEPIC TOPOLOGY
We shall examine the SEPIC topology and
demonstrate the capability of the MCP1631 family in
current control applications using the SEPIC topology.
The SEPIC Topology (Single Ended Primary Inductive FIGURE 8: SEPIC Topology.
Converter) follows the flyback design, adding a When Q1 turns off, the stored energy in L1 forces the
coupling capacitor between the two windings of a current to continue flowing through the coupling cap
transformer. (Cc) and the rectifier (D1) to the output. A second
The output voltage may be lower or higher than the current flow exists due to L2 releasing it’s stored
input voltage, resulting in buck or boost operation. energy. Current flows from L2 through the rectifier (D1)
to the output. The total rectifier current is the sum of the
This topology can use two separate inductors or a currents flowing through L1 and L2. During the
single transformer with two coupled windings. The switch-off time, current flowing through the rectifier to
coupled inductor solution saves PCB space and the output must also replenish the output capacitor
reduces radiated EMI. Another big advantage of using (COUT). Looking at the output capacitor current
coupled inductors is the fact that only half of the calcu- waveform (ICc), it can be seen that the output current of
lated inductance needs to be used if the inductors are the SEPIC converter is supplied by the output capacitor
coupled. A capacitor connected between the primary when the switch is on and supplied by the inductors
inductor and secondary inductor offers DC isolation when the switch is off.
and protection against a shorted load. The capacitor
clamps the winding leakage inductance energy and The transfer function for the SEPIC converter is derived
eliminates the need for a snubber circuit. The inductor in a similar fashion as other switching power
input smooths the current draw and reduces the topologies. The volt-time product of the magnetics
required input filtering. must be balanced and the charge-time product on all
capacitors must be balanced for each switch period.
A single low-side switch reduces MOSFET drive
voltage requirements and current limit protection The input block components L1 and Q1 act like a
complexity. The switch current can be sensed using a standard boost converter input stage. The output block
ground referenced sense resistor connected to the components L2, D and COUT act like an inverted
MOSFET source pin. buck-boost converter. The goal is to determine the
volt-time product on the magnetics during the switch on
A typical SEPIC converter design that is used with the time and set that equal to the volt-time product on the
MCP1631HV PWM controller is shown in Figure 8. magnetics during the switch off time.
Basic definitions for design are:
• TSW = Switching Period
EQUATION 8:
V IN × t ON = ( V Cc + V OUT – V IN ) × t OFF
ΔI L2 V OUT
----------
- = ------------- The first step in calculating the inductor current is to
t OFF L2
know the maximum output power required. An
As above, we’ll solve Equation 11 and Equation 12 for efficiency estimate of 85% for a SEPIC converter can
VCc. be used to approximate the input current. The average
input current is equal to the input power divided by the
Inductor slope's must be equal for volt-time balance,
input voltage.
so:
EQUATION 19:
EQUATION 13:
P OUT = V OUT × I OUT
t ON × V Cc = t OFF × V OUT
EQUATION 14:
EQUATION 21:
V Cc = V OUT × ⎛⎝ -------------⎞⎠
1–D
D
I IN ( AVG ) = P IN ⁄ V IN
Setting Equation 10 equal to Equation 14 yields:
The inductor value is calculated by:
EQUATION 15:
EQUATION 22:
V Cc = V IN × ⎛ -------------⎞ – V OUT = V OUT × ⎛ -------------⎞
1 1–D
⎝ 1 – D⎠ ⎝ D ⎠
L1 = L2 = ( V INmin × D max ) ⁄ ( ΔI L × f SW )
The solution for VOUT/VIN is the transfer function of the
SEPIC converter in continuous mode:
ΔIL is the desired inductor peak to peak ripple current.
A good ΔIL approximation is 20% of the output current.
EQUATION 16: The approximate ripple current for a 1A output current
would be 200 mA.
V OUT
------------- = ⎛ -------------⎞
D
⎝ 1 – D⎠ If L1 and L2 are wound on the same core, which is the
V IN
case of this SEPIC design, the value of inductance in
By rearranging Equation 16 we get VIN = VOUT x (1-D)/ the equation above is replaced by (1/2)L due to mutual
D. Substituting that result into Equation 14 results in: inductance.
L
V Cc = V IN --- = ( V INmin × D max ) ⁄ ( 2 ( ΔI L × f SW ) )
2
The voltage across the coupling capacitor (Cc) is equal The maximum inductor current (ripple and peaks for L1
to VIN. This occurs as long as the capacitance of COUT and L2) can be calculated to avoid saturating the
is adequate to supply the output current during the inductor.
switch ON time and the system operates in continuous
current mode. EQUATION 24:
Until now, the diode forward voltage drop (VD) has
been ignored at the output because of its low value. If ΔI L1ON = ( V IN × t ON ) ⁄ ( L ⁄ 2 )
the output voltage is low, the forward voltage drop of
the diode may be significant. When the diode drop is
considered, the maximum duty cycle will be:
EQUATION 27: 2 2
I CcRMS = I CcRMS – ON + I CcRMS – OFF
Δt
I switch ( Q1 ) = I L1 + I L2 C = I C × -------
ΔV
The peak Q1 switch voltage is equal to VIN + VOUT for For the SEPIC converter, the coupling capacitor
the SEPIC converter. Any leakage inductance voltage voltage is approximated as a DC value when deriving
spike is clamped through the output diode by the output the duty cycle. The ripple voltage should be no more
capacitor. A switch voltage rating for applications than a few percent (5% in practice) of the voltage
should be at least: across the capacitor or the input voltage. The SEPIC
capacitor must be rated for a large RMS current in
EQUATION 29: relation to the output power. As the output power
increases, the capacitor ripple current will increase as
well. This makes the SEPIC converter better suited for
V switch ( Q1 ) = V INmax + V OUTmax
lower power applications where the RMS current
through the capacitor is relatively small. The worst case
The maximum reverse voltage across the SEPIC diode RMS current in the coupling capacitor will occur at
occurs during the switch ON time. The cathode of the maximum output power and minimum input voltage.
schottky diode is connected to VOUT, the anode of the
schottky diode is connected to the SEPIC coupling EQUATION 34:
capacitor. The voltage across the coupling capacitor
voltage is equal to VIN. When Q1 is ON, the voltage I OUT D max
C c = ⎛ -------------⎞ × ⎛ -------------⎞
across the diode is: ⎝ ΔV Cc⎠ ⎝ f SW ⎠
M
8 3
7 2
6 1
5
4
2
3
1
FIGURE 11: MCP1631HV Programmable LED Current Source Reference Design Schematic.
FIGURE 12: Top Silk and Pads of /* Enable support for LED Driver */
#define LED_DRIVER_SUPPORT ENABLED
Reference Design.
The charging/driving current profile parameters are set
in separate sections of the header file for the project.
The LED driver overvoltage value is set to 9V by
parameter LED_DRIVER_OVER_VOLTAGE. The LED
driver starting current value is set to 70 mA by
parameter LED_DRIVER_CONDITION_CURRENT.
The LED maximum current value is set to 700 mA by
parameter LED_DRIVER_CURRENT. To evaluate the
board, a Cree XREWHT-L1-0000-009E7 with warm
white LEDs that can be driven at 700 mA maximum
should be used. The overtemperature setpoint is
enabled by setting OVERTEMPERATURE_SUPPORT to
ENABLED. The default overtemperature set point is
FIGURE 13: Top Layer of Reference
+40°C.
Design.
A 10k NTC thermistor must be connected between
J2-4 and J2-5 of the J2 connector when
overtemperature support is enabled. The thermistor
should be placed as close as possible to the LED
mounting area. The number of LEDs value is set to 1
by parameter NUMBER_OF_CELLS_DEFAULT. These
default values are for a typical 3W power LED.
#if (LED_DRIVER_SUPPORT == ENABLED)
// define the LED Driver characteristics in millivolts and
// milliamps). Default values are for one 3W/750mA Power LED
// with max forward voltage 4.5V
/* LED overvoltage */
#define LED_DRIVER_OVER_VOLTAGE ((int)(9000.0/BATTERY_MV_PER_BIT))
The reference board PIC16F616 microcontroller has /* LED overtemperature limit = 40 deg C (40 / 0.1447) = 311 */
been pre-programmed with the LED driver option. The #define LED_DRIVER_OVTEMP_SETPOINT ((float)(THERMISTOR_OHMS_40C))
reference board may also be operated as a battery /* ENABLE or DISABLE the overtemperture detection */
charger. The user may re-configure and compile the #define OVERTEMPERATURE_SUPPORT DISABLED
START
No
S1 Pressed?
Yes
ILEDmin
No
Shutdown
No
S1 Pressed?
Yes
No
No > 2s?
OVP S1 pressed =
time retries
>5
Yes Increment IREF(70 mA)
Yes
Shutdown
Fault
END
FIGURE 15: Firmware Flow Diagram for LED Driver With Dimming.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
03/26/09