H4-PFC Infineon 1600W Server PSU
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Control Interrupts

Files

file  control_interrupts.c
 Control related interrupts code.
 
file  control_interrupts.h
 Interrupts code.
 

Functions

void current_loop_ISR (void)
 Current loop interrupt.
CR2 while counting up in CCU80 (Boost PWM) triggers the ADC queue.
A result event of the queue triggers this interrupt. More...
 
void voltage_loop_ISR (void)
 Voltage control interrupt.
Timer CCU40.CC40 triggers this interrupt in the period match event.
IIR low-pass filter of the AC voltage to obtain the RMS value.
IIR notch filter of the DC voltage to remove 100/120 Hz component.
Voltage loop and voltage monitoring. More...
 

Variables

volatile PFC_coefs_t PFC
 
static volatile uint32_t Vrms2 = 0
 
volatile uint16_t time_count_65kHz = 0
 
static volatile bool current_loop = false
 
static volatile uint8_t DC_start = 0
 
static volatile uint16_t offset_duty_openloop = 376
 
static volatile uint32_t softstart_closeloop = 0
 
static volatile int16_t Vout_offset = 0
 
static volatile int16_t offset_pos_neg = 1
 
static volatile int16_t offset_detected = 0
 
static uint16_t counter_fifo = 0
 
static volatile int32_t debug_filter = 0
 

ADC results

volatile uint32_t * ADCResult_iL
 
volatile uint32_t * ADCResult_DCBus
 
volatile uint32_t * ADCResult_VAC
 
volatile uint32_t * ADCResult_Temp
 
volatile uint32_t * ADCResult_BOP
 
static volatile uint32_t k_iL_DCM = 32767
 

Bus voltage filter variables

static volatile uint8_t i_filter = 0
 
static volatile int32_t DCfilt_output [] = {0,0}
 
static volatile int32_t DCfilt_input [] = {0,0,0,0,0,0,0,0}
 
static volatile uint8_t DCfilt_index = 0
 

Control and Fault status registers

volatile state_t status_reg = ST_INIT
 
volatile fault_t fault_reg = F_INIT
 

Soft start.

static volatile uint8_t stb_bop_count = 0
 
static volatile uint8_t xtra_step_sftstrt = 0
 

Input frequency and polarity check.

Variables that can be used for frequency detection before starting phase.

volatile uint16_t freq_in_count = 0
 
volatile uint8_t freq_in_OK = 0
 
static volatile grid_voltage_t input_polarity
 
static volatile uint8_t input_polarity_count
 

UART variables

static volatile bool UART_power_off = false
 
static volatile uint8_t i_send = 0
 
static volatile uint16_t UART_rx_type = 0xFF
 
static volatile uint8_t UART_rx_index = 0xFF
 
static volatile uint16_t retval
 
static volatile uint16_t Iout_received [] = {0,0}
 

DCM variables

Variables used during the debugging phase for DCM detection by duty calculation. Not used in the current implementation.

static volatile int32_t dccm = 0
 
static volatile int32_t Vin_calc = 0
 
static volatile int32_t Vin_dccm = 0
 
static volatile int32_t Lf_iL = 0
 
static volatile int32_t Vbulk_shift = 0
 
static volatile int32_t Vdiff = 0
 
static volatile int32_t Vbulk_Vdiff = 0
 
static volatile int32_t PR_pu = 0
 
static volatile int32_t dcm_time = 0
 

OVP variables

static volatile uint8_t count_Vout_OVP_stop = 0
 
static volatile uint8_t count_Vout_OVP_resume = 0
 

DCM detection

__I uint32_t * DCM_capture_p
 
__I uint32_t * DCM_capture_n
 

AC lost detection (LCDO)

static volatile uint8_t acok_counter = 0
 
static volatile bool acok = false
 

Detailed Description

Function Documentation

void current_loop_ISR ( void  )

Current loop interrupt.
CR2 while counting up in CCU80 (Boost PWM) triggers the ADC queue.
A result event of the queue triggers this interrupt.

Returns
None

H4PFC_Iloop_flow.png
1600W server power supply H4-PFC current loop ISR flow diagram
void voltage_loop_ISR ( void  )

Voltage control interrupt.
Timer CCU40.CC40 triggers this interrupt in the period match event.
IIR low-pass filter of the AC voltage to obtain the RMS value.
IIR notch filter of the DC voltage to remove 100/120 Hz component.
Voltage loop and voltage monitoring.

Returns
None

PFC_state_machine.png
1600W server power supply H4-PFC state machine
PFC_Vloop_schedule.png
1600W server power supply H4-PFC State machine, Vloop, digital filter and bulk monitoring schedule

Variable Documentation

volatile bool acok = false
static

AC lost detection variable

volatile uint8_t acok_counter = 0
static

Check if AC is valid

volatile uint32_t* ADCResult_BOP

ADC result

volatile uint32_t* ADCResult_DCBus

DC bus Voltage ADC result

volatile uint32_t* ADCResult_iL

Inductor current ADC result

volatile uint32_t* ADCResult_Temp

ADC result

volatile uint32_t* ADCResult_VAC

AC Voltage ADC result

volatile uint8_t count_Vout_OVP_resume = 0
static

Counter for time filtering of bulk voltage OVP operation resume

volatile uint8_t count_Vout_OVP_stop = 0
static

Counter for time filtering of bulk voltage OVP detection

uint16_t counter_fifo = 0
static

Debugging the FIFO to secondary controller

volatile bool current_loop = false
static

current_loop is a flag to calculate the loop in alternative switching cycles. Not used in the current implementation.

volatile uint8_t DC_start = 0
static

Counter for relay management during DC start-up. Debugging variable Not used in the current implementation.

volatile uint8_t DCfilt_index = 0
static

Filter input vector index, substituted by IIR filter.

volatile int32_t DCfilt_input[] = {0,0,0,0,0,0,0,0}
static

Filter input vector, substituted by IIR filter.

volatile int32_t DCfilt_output[] = {0,0}
static

Filter output, substituted by IIR filter.

__I uint32_t* DCM_capture_n

Pointer to the captured time for DCM operation detection. Negative input voltage.

__I uint32_t* DCM_capture_p

Pointer to the captured time for DCM operation detection. Positive input voltage.

volatile int32_t debug_filter = 0
static

Debugging variable for FIR/IIR filter implementation

volatile fault_t fault_reg = F_INIT

Variable that holds the possible faults of the PFC

volatile uint16_t freq_in_count = 0

It saves the value of the 65kHz counter in the first start to check if input frequency is in range. Not used in the current implementation.

volatile uint8_t freq_in_OK = 0

After some AC cycles with correct count, input frequency is in range. Not used in the current implementation.

volatile uint8_t i_filter = 0
static

Counter for reducing sampling frequency of the filter

volatile uint8_t i_send = 0
static

Counter to select the type of data sent to the secondary controller

volatile grid_voltage_t input_polarity
static

Check the polarity to differentiate the AC zero edge and detect positive or negative input voltage.

volatile uint8_t input_polarity_count
static

Time filter for polarity change detection.

volatile uint16_t Iout_received[] = {0,0}
static

Current received from secondary controller

volatile uint32_t k_iL_DCM = 32767
static

Modification of the measured AVG value in DCM (Q15), initialize to 1

volatile int16_t offset_detected = 0
static

Error outside the defined slot is detected (LCDO)

volatile uint16_t offset_duty_openloop = 376
static

Duty cycle offset to be modified during soft-start in "open-loop" operation. Debugging variable Not used in the current implementation.

volatile int16_t offset_pos_neg = 1
static

Sensed voltage out of range in LCDO or dynamic situations. Debugging variable Not used in the current implementation.

volatile PFC_coefs_t PFC

PFC feedback and control values.

volatile uint16_t retval
static

Temporal received message from primary side

volatile uint32_t softstart_closeloop = 0
static

Soft-start in closed-loop operation. Debugging variable Not used in the current implementation.

volatile state_t status_reg = ST_INIT

Variable that holds the operation state of the PFC

volatile uint8_t stb_bop_count = 0
static

Counter for managing soft-start in state machine after input voltage is in range.

volatile uint16_t time_count_65kHz = 0

Time counting based on PWM interrupt

volatile bool UART_power_off = false
static

Flag to send information in alternative switching cycles in case the converter is off

volatile uint8_t UART_rx_index = 0xFF
static

UART reception buffer index

volatile uint16_t UART_rx_type = 0xFF
static

Type of information received

volatile int16_t Vout_offset = 0
static

Compensate the sensing offset due to resistor and reference tolerances Not used in the current implementation.

volatile uint32_t Vrms2 = 0
static

Vrms^2 calculation.

volatile uint8_t xtra_step_sftstrt = 0
static

Counter for soft-start in current loop operation. NOT USED