PFC:800WPSUC7-4pin
 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.CC41 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
 
__I uint32_t * DCM_capture
 
static uint16_t counter_fifo = 0
 
static uint8_t acok_counter = 0
 
static bool acok = false
 
static volatile int32_t debug_filter = 7
 

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 check.

Variables that can be used for frequency detection before starting phase. Not used in the current implementation

volatile uint16_t freq_in_count = 0
 
volatile uint8_t freq_in_OK = 0
 

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

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
 

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

PFC_control_concept.png
800W server power supply PFC control strategy
void voltage_loop_ISR ( void  )

Voltage control interrupt.
Timer CCU40.CC41 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
800W server power supply PFC state machine
 <BR><BR>
PFC_Vloop_schedule.png

Variable Documentation

bool acok = false
static

AC lost detection

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.

volatile uint8_t DC_start = 0
static

Counter for relay management during DC start-up

volatile uint8_t DCfilt_index = 0
static

Filter input vector index

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

Filter input vector

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

Filter output

__I uint32_t* DCM_capture

Pointer to the captured time to detect DCM operation

volatile int32_t debug_filter = 7
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

volatile uint8_t freq_in_OK = 0

After some AC cycles with correct count, input frequency is in range

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 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, debugging variable

volatile uint16_t offset_duty_openloop = 376
static

Duty cycle offset to be modified during soft-start in "open-loop" operation.

volatile int16_t offset_pos_neg = 1
static

Negative error detected, debugging variable

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.

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 delaying 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

Absolute value of error is saved in Vout_offset, debugging variable

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.