Pmp23126 Software Guide
Pmp23126 Software Guide
Important Notice
Texas Instruments and its subsidiaries (TI) reserve the right to make changes to their products or to
discontinue any product or service without notice, and advise customers to obtain the latest version of
relevant information to verify, before placing orders, that information being relied on is current and
complete. All products are sold subject to the terms and conditions of sale supplied at the time of order
acknowledgment, including those pertaining to warranty, patent infringement, and limitation of liability.
TI warrants performance of its semiconductor products to the specifications applicable at the time of sale in
accordance with TI’s standard warranty. Testing and other quality control techniques are utilized to the
extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not
necessarily performed, except those mandated by government requirements.
Customers are responsible for their applications using TI components.
In order to minimize risks associated with the customer’s applications, adequate design and operating
safeguards must be provided by the customer to minimize inherent or procedural hazards.
TI assumes no liability for applications assistance or customer product design. TI does not warrant or
represent that any license, either express or implied, is granted under any patent right, copyright, mask
work right, or other intellectual property right of TI covering or relating to any combination, machine, or
process in which such semiconductor products or services might be or are used. TI’s publication of
information regarding any third party’s products or services does not constitute TI’s approval, warranty or
endorsement thereof.
A PSFB DC/DC converter system can be controlled in various modes like voltage mode control
(VMC), average current mode control (ACMC) or peak current mode control (PCMC). In this
design PCMC control schemes (Figure 1) is used to implement control of a PSFB DC/DC.
PCMC is a highly desired control scheme for power converters because of its inherent voltage
feed forward, automatic cycle-by-cycle current limiting, flux balancing and other advantages. For
such a PCMC PSFB DC/DC converter, MOSFETs output capacitance Coss oscillates with Lo
and Lr causing ringing across the output rectifiers. This requires MOSFETs with higher VDS
rating and, therefore, results in higher Rds,on and higher power losses. Therefore, active
clamping circuits (ACLs) across the secondary rectifiers are required to limit the ringing across
the output rectifiers allowing the use of lower voltage devices for best possible efficiency. In
Figure 1 each ACL circuit is placed across the output rectifiers and consists of a clamp capacitor
in series with a MOSFET. This ACL circuit across the output rectifiers, in turn, causes primary
peak current distortion and poses additional challenges in peak current mode control
implementation. This issue is addressed and discussed in detail in this design.
Implementing PCMC for such a PSFB system requires complicated pulse width modulated
(PWM) waveform generation with precise timing control. A C2000 microcontroller (MCU) is used
to generate all the necessary PWM waveforms without requiring any additional support circuitry.
The MCU provides programmable on-chip slope compensation hardware that is used for
appropriate slope compensation to guarantees open loop stability and to eliminate any sub-
harmonic oscillations.
In this implementation the complete system is controlled using Texas Instruments a 32-bit
microcontroller, either the TMS320F280049 or TMS320F2800157 or TMS320F280039C, which
is placed on the secondary side of the main isolation transformer. This system implements
advanced control strategies to optimally control the power stage under different conditions and
also provide system level intelligence to make safe and seamless transitions between operation
modes and PWM switching patterns.
This document presents the details of this microcontroller-based implementation of peak current
mode controlled (PCMC) phase shifted full-bridge (PSFB) DC-DC converter.
PWM1A PWM2A
Q1 Q3
ORINGFET
Vin
NS1 LO
NP
NS2 PWM4A PWM4B
(ACL PWM) (ACL PWM) Vout
Q7
PWM1B PWM2B Q6
Q5 Load
CO
PWM3A Q8
Q2 Q4
PWM3B
GND_P
GND_S
PWM1A PWM2A
Q1 Q3
Current
ORINGFET
sensing
Vin
NS1 LO
NP
NS2 PWM4A PWM4B
(ACL PWM) (ACL PWM)
Q7
PWM1B PWM2B Q6 Vout
Q5
CO
Load
PWM3A Q8
Q2 Q4
PWM3B
GND_P
GND_S
Isolated
SR Gate ACL Gate Vout
FB Gate Drive
Drive Drive sense
TFMR
CMPSS1 PWM3A & 3B PWM4A & 4B ADC
Iprimary sense
PWM2A & 2B
ePWM1
Blanking
time base
window
FED +
ePWM1A FED +
invert RED DBM
output RED DBM invert
DBM
DBM
ePWM1B
output
ePWM2
time base
T1U PRD T1D
ACL
ePWM4A
Output
ACL
ePWM4B
Output
EPWM5 Sync signal resets Ramp DAC RAMP DAC Initial DAC out
Transformer
primary peak
current sense
signall PWM1A & PWM1B &
PWM2B ON CMPC PWM2A ON
ePWM5
time base
(synched to
ePWM1)
CMPC used to
generate Sync Signal
EPWM5 SYNC O utp ut
(Internal
Sync Signal)
Figure 3 - PCMC PSFB DC/DC Primary Side PWM, ACL PWM and Transformer Current
ePWM1A out
FED +
invert
ePWM1B out DBM RED DBM
ePWM2A AQ ZRO
ePWM2B AQ ZRO
RED
inserted in
DBM TZAD
ePWM2A out
TZBU
FED + invert DBM
ePWM2B out
Blanking
window
PRD T1D
T1U
ZRO
ePWM3B AQ
RED
inserted in
DBM
ePWM3A out
FED
inserted in
DBM
ePWM3B out
PSFB_SR_mode == 2
Figure 4 - PCMC PSFB DC/DC Primary and Secondary Side PWM Signals for SR Mode 2
ePWM1A out
FED +
invert
ePWM1B out DBM RED DBM
ePWM2A AQ ZRO
ePWM2B AQ ZRO
RED
inserted in
DBM TZAD
ePWM2A out
TZBU
FED + invert DBM
ePWM2B out
Blanking
window
PRD T1D
ZRO
ePWM3A AQ T1U
T1U
PRD T1D
ePWM3B AQ ZRO
RED
inserted in
DBM
ePWM3A out
FED
inserted in
DBM
ePWM3B out
PSFB_SR_mode == 1
Figure 5 - PCMC PSFB DC/DC Primary and Secondary Side PWM Signals for SR Mode 1
Implementing PCMC for an isolated PSFB DC/DC converter requires complex PWM waveform
generation with precise timing control. The F28004x/F280015x/F28003x family of devices from
Texas Instruments feature advanced on-chip control peripherals that make this implementation
possible without any external support circuitry. These peripherals include on-chip analog
comparators (CMPSS) with blanking window and integrated digital to analog converters (DAC),
advanced PWM modules and unique programmable on-chip slope compensation hardware.
Figure 6 shows the software control block diagram for such a PCMC PSFB DC/DC converter
using the C2000 MCU. The dark blue blocks represent functionality implemented by MCU on-
chip hardware. Transformer primary current sense signal (IHV_FB) is compared with the peak
current reference using the on-chip comparator 1. The peak current reference is calculated by
the voltage loop controller and applied to the comparator through the DAC. As shown in Figure
3, in every half PWM period when the transformer primary current reaches the commanded
peak reference value, one of the primary PWM signals PWM2A or PWM2B, driving the switches
Q3 or Q4 respectively, is ‘Reset’ immediately ending the power transfer phase. Following this
the PWM signals driving the other switch in the same leg is ‘Set’ after a programmable dead-
time (dead-band) window. Appropriate slope compensation is also applied in the DAC that adds
a ramp with a programmable negative slope to the peak reference current signal calculated by
the voltage loop controller. This is also shown in Figure 3 and indicated as RAMP DAC signal.
The ‘Resetting’ and ‘Setting’ action of the PWMs in one leg results in a phase shift between
PWM signals driving the two legs. The amount of this phase shift, and hence the overlap
between diagonal switches (Q1/Q4 pair or Q2/Q3 pair), is dependent on the commanded peak
current reference. Higher the peak reference current, longer the overlap between diagonal
switches, and higher the energy transferred to the secondary. The voltage loop controller
regulates the output voltage by controlling this energy transfer by way of commanding the
appropriate peak reference current and, thereby, controlling the actual peak current in the
transformer primary.
An important feature of this implementation is that the same peak reference current command is
used for both halves of the PWM switching cycle under all operating conditions. This provides
optimal flux balancing for the transformer.
100kHz
ADC Reading
ADC
PSFB_vLVBus_sensed_pu ADC_PU _SCALING vLV_FB
H/W
100kHz
ADC Reading
ADC
PSFB_ILV_sensed_pu ADC_PU _SCALING H/W
iLV_ FB
100kHz
ADC Reading
ADC
PSFB_vLVBus_1_sensed_pu ADC_PU _SCALING H/W
vLV1_FB
Figure 6 - Software Control Diagram for PSFB PCMC DC/DC Using C2000 MCU
Note: The CMPSS on the F280015x/F28003x family of devices includes dual decrementing /
incrementing ramp generators. On these devices some CMPSS registers have been renamed
and new registers have been added to support this additional functionality. Differences between
F28004x and F280015x/F28003x CMPSS will be noted where needed in this document.
For the C2000 MCU the internal DAC is 12 bits. The actual DAC input register
(RAMPMAXREFA/RAMPHREFA) is 16 bits. The max input value for the DAC is 0xFFFF =
65535. This corresponds to 3.3V at the DAC output. For a CPU clock frequency (fCPU) of
100MHz and a slope value of m, the DAC output voltage will drop at a rate of R, where R is
given by,
For a specific load power if the ON time (power transfer time) is Td (in uS) in every half of the
primary side PWM cycle (fPWM), then assuming the sampling cycle the same as the PWM cycle,
the DAC value will decrease from its initial written value by an amount of ΔV = (R)*(Td)
If the measured peak current sense voltage is Vcs, then the commanded DAC value (from the
voltage controller output written into the DAC input) represents a voltage of:
U = Vcs + ΔV
Because of slope compensation this value decreases by ΔV during the ON time Td and the final
DAC output matches the peak feedback current sense voltage Vcs.
Solution-specific and device-independent files that consist of the core algorithmic code are in
the files psfbpcmc.c and psfbpcmc.h. Board-specific and device-specific files are in
psfbpcmc_hal.c and psfbpcmc_hal.h. These files consist of device-specific drivers (specific to
MCU used in this project) to run the solution. If the user wants to use a different modulation
scheme (board specific) or a different MCU (device specific), the user is required only to make
changes to these files, besides changing the device support files in the project. The
psfbpcmc_main.c file consists of the main framework of the project. This file consists of calls to
the board and solution files that help in creating the system framework, along with the interrupt
service routines (ISRs) and slow background tasks. Two settings files psfbpcmc_settings.h and
psfbpcmc_user_settings.h are used in compiling the project. The file psfbpcmc_user_settings.h
is included and can be used to keep any settings related to ADC/PWM channel mapping,
GPIOs etc. The file psfbpcmc_settings.h is used as the module name for all the variables and
defines used in the solution. Hence, all variables and function calls are prepended by the label
PSFB (for example, PSFB_vLVBus_sensed_pu). This naming convention lets the user combine
different solutions while avoiding naming conflicts.
CPU
Main
ISR1 fs1
Initialization
Read ADC data
Setup device ISR2 fs2
Setup PWM
Setup ADC Read T2 CNTR value
Global var init Startup control
Setup board protection
Setup interrupt
EXIT
DF22 Voltage loop control
Background Loop
Over-voltage protection
Background Loop
SR mode control
Dead-band
CPUTimer 0 – Tasks A: CPUTimer 1 - Tasks B: adjustment
Status Reporting Slope compensation update
SFRA Background OCP threshold update
PWM Enable/disable EXIT
For a closed-loop system under steady-state, the peak current will only have minor changes
from one control ISR cycle to the other and hence the ISR2 will be triggered repeatedly.
Additionally, CPU timers are used to trigger slow background tasks. These tasks are not
interrupt-driven but polled. Background tasks includes other functions such as doing SFRA,
updating board status, adjusting protection threshold and slope compensation etc.
CPU Timer0 is used for "A" tasks, triggered at TASKA_FREQ of 2000 Hz. CPU Timer1 is used
for task "B" triggered at TASKB_FREQ of 20 Hz. CPU Timer2 is used for task "C" triggered at
TASKC_FREQ of 2000 Hz. These task frequency parameters are defined in the file
psfbpcmc_user_settings.h file. The function calls corresponding to all of these tasks can be
found inside the file psfbpcmc_main.c.
The software in Lab1 has been configured so that the user can quickly evaluate how the on-chip
comparator and the on-chip DAC with integrated slope compensation ramp work together to
implement PCMC. This lab allows the user adjust the peak current reference command and the
slope compensation (two inputs to the CMPSS DAC) from CCS real-time (RT) watch window
and then view various waveforms on an oscilloscope and observe the effect of this change on
the output voltage. Additionally, the user can evaluate the ADC software driver module by
viewing the ADC sampled data in the watch window.
The on-chip analog comparator (CMPSS) compares the transformer primary current sense
voltage signal with the slope compensated peak current reference from the CMPSS DAC
output. Comparator output is connected to the trip zone logic of the ePWM modules. ePWM1
module acts as the master time-base for the system. It operates in up-down count mode.
ePWM1A and ePWM1B drive Q1 and Q2 full-bridge switches, while ePWM2A and ePWM2B
drive Q3 and Q4 full-bridge switches. ePWM3A and ePWM3B drive Q5 and Q6 synchronous
rectifier (SR) switches respectively. Whenever the comparator output goes high in a PWM half
cycle, the ePWM2 module output (ePWM2A or ePWM2B), which was high at that instant, is
immediately pulled low (turned OFF) while the other PWM2 module output is pulled high (turned
ON) after an appropriate dead-time defined by the dead-band (DB) register values. The initial
dead-time values for PWM2 module outputs are defined by the constants
PSFB_FB_DB_PWM_HS_COUNT_BASE2 and PSFB_FB_DB_PWM_LS_COUNT_BASE2 in
the psfbpcmc_user_settings.h file. ePWM1A and ePWM1B also maintain some dead-time
between them and their initial values are defined by PSFB_FB_DB_PWM_HS_COUNT_BASE1
and PSFB_FB_DB_PWM_LS_COUNT_BASE1 in the psfbpcmc_user_settings.h file as shown
below.
ePWM3A and ePWM3B outputs are also controlled by the analog comparator output and driven
in a similar fashion just like the ePWM2 module outputs. The initial dead-time values for these
SR PWM outputs are defined by the constants PSFB_SR_DEADBAND_RED_INITIAL and
PSFB_SR_DEADBAND_FED_INITIAL in the psfbpcmc_user_settings.h file. The dead-time
values for the ePWM1 and ePWM2 modules are adjusted with load to optimize the efficiency
while the corresponding values for ePWM3 module outputs (the SR PWM outputs) remains
The output voltage sensing circuit is made up of simple voltage dividers. A current sensing
circuit consisting of a current transformer, diodes, termination resistor and a sense resistor are
used to sense the full-bridge transformer primary current.
To quickly run and verify the functionalities for this Lab1 software (s/w), follow the steps listed
below:
1. Verify the hardware (h/w) set-up: Insert the C2000 controlCARD in the 120-pin HSEC
connector. Follow the PSFB hardware user-guide and connect the required low voltage bench
power supplies to provide bias power for this h/w. Connect a variable output isolated high
voltage DC power source (0 - 600V, 4kW power rating) across the high voltage input connector
on the board. Then connect an electronic load (60V, 4kW power rating) across the 12VB output
connector on the board. Set the electronic load in constant resistor (CR) mode for this Lab1
functionality verification and apply an initial load of 1.84 ohms. Connect an USB cable between
the PC and controlCARD. Do not turn ON any of the power supplies at this time.
2. Open Code Composer Studio.
3. Locate the solution package and import the project “psfbpcmc_F28004x” or
“psfbpcmc_F280015x” or “psfbpcmc_F28003x” in CCS. In the Project Explorer window on the
left, click on the “<” sign to the left of Project. Your project window view will look like the
following in Figure 11.
Figure 12 – CCS Watch Window View with Zero Input Voltage and Code Running – Lab 1
12. The variable PSFB_gui_icommand_Set_Amps is used to set the peak current reference.
This current reference is applied to the on-chip comparator input through the internal DAC.
Choose an initial low current reference value of 5A. The RT watch window in Figure 13 below
shows that this is set to 5A. The variable PSFB_icommand_Set_pu represents the per unit
value of the peak current reference with respect to the max peak current. In this design the max
peak current reference is chosen to be 16A and is initialized by the parameter
PSFB_IHV_FB_MAX_SENSE_AMPS in psfbpcmc_settings.h file.
13. Now apply 380 V DC input from the high voltage DC source. The output will rise to around
12V. Observe the watch window variable corresponding to the final output voltage. This is
shown as PSFB_vLVbus_Volts. This should display a value of about 12. The variable
PSFB_vLVbus_sensed_pu represents the per unit value of the output voltage with respect to
the max output voltage. In this design the max output voltage is chosen to be 16.13V and is
initialized by the parameter PSFB_VLVBUS_MAX_SENSE_VOLTS in psfbpcmc_settings.h file.
The variable PSFB_vLVbus_1_sensed_pu represents the per unit value of the output voltage
before the ORing FET with respect to the same max output voltage of 16.13V.
Use an oscilloscope to verify the output voltage, the primary side Leg 1 upper and lower PWMs,
and the transformer primary current. Appropriate safety precautions should be taken while
probing any high voltages and high currents for this isolated DC-DC converter. The scope
capture Figure 14 below shows the output voltage (Ch 3), the primary transformer current
(CH2), and the primary bridge PWM waveforms for PWM1A (Ch 1) and PWM1B (Ch 4)
14. This completes most of the functionalities test under Lab 1. For completely halting the MCU
when in real-time mode follow the following steps. First reduce the DC input voltage to 0V and
wait a few seconds. Then, halt the processor by using the Halt button on the toolbar, or by using
Target > Halt. Finally click the button again to take the MCU out of real-time mode and then
reset the MCU.
5.2 Lab 2
The objective of Lab 2 is to verify the operation of the complete PCMC based PSFB project from
the CCS environment. Both the over-voltage protection (OVP) and the over-current protection
(OCP) are also enabled in Lab 2. In addition to the functionalities described in Lab 1, Lab2
further implements closed voltage loop control, soft-start function, automatic SR mode
switching, automatic frequency folding under light load and automatic reverse current protection.
Figure 6 shows the C2000 software and on-chip h/w blocks used in this Lab 2. A two pole two
zero controller is used for the voltage loop. As shown in Figure 6, the voltage loop controller is
executed at a frequency of fs where, fs = 100 KHz. The DCL_runClamp_C1 function is used to
avoid controller wind-up condition. The DCL_runDF22_C2 computes the immediate part of the
pre-computed DF22 controller. If this value is larger than the max or less than min threshold, a
flag will be set with DCL_runClamp_C1 function. This stops the further controller saturation.
Once the flag is off, DCL_runDF22_C3 will compute the partial result of the pre-computed DF22
controller. More information on how the DCL function works could be found inside DCL user's
guide in C2000ware.
To quickly run and verify the functionalities for this Lab2 software (s/w), follow the steps listed
below:
1. Set the project for Lab 2 by changing the PSFB_INCR_BUILD to 2. This is defined in the
psfbpcmc_settings.h file. All the other options in the psfbpcmc_user_settings.h file can be left at
their default settings for now. Click Save.
2. Turn ON the bench power supplies to provide bias power to the board as explained in Lab 1.
Click on the Debug button. The Lab 2 code should compile and load to the internal flash
memory.
Per Modular Hardware System - Common Redundant Power Supply (M-CRPS) Base
Specification Version 0.70, the power supply should meet zero load stability and voltage
regulation requirement under dynamic load testing.
Definition of zero load stability in M-CRPS: When the power subsystem operates in a no-load
condition, it does not need to meet the output regulation specification, but it must operate
without any tripping of over-voltage or other fault circuitry. When the power subsystem is
subsequently loaded, it must begin to regulate and source current without fault.
Frequency reduction method is adopted in this design to achieve zero load stability. Namely, the
switching frequency will be reduced as the load decrease. The PSFB converter will start to
Dynamic loading per M-CRPS: The output voltages shall remain within limits specified for the
step loading and capacitive loading specified in the table below. The load transient repetition
rate shall be tested between 50Hz and 5kHz at duty cycles ranging from 10%-90%.
The test condition 4 from the table where output voltage is measured at board edge and a
2.2mF cap is connected at the edge of the board. The load step is from 5A to 170A (60% load),
where the slew rate is 2.5A/us and the cycling frequency is 100Hz. In this test, the max voltage
deviation measured is +2.3%/-4.1%, which is within the required limit of +/-6%. The waveform is
given below, where CH1 is Vds on the SR card, CH2 is the output current, CH3 is the output
voltage, and CH4 is the transformer current.
10. This completes the test of all functionalities under Lab 2. For completely halting the MCU
when in real-time mode follow the following steps. First shut off the DC input voltage and wait a
few seconds. Then, halt the processor by using the Halt button on the toolbar, or by using
Target > Halt. Finally click the button again to take the MCU out of real-time mode and then
reset the MCU.