3.3kW Totem-pole PFC with SiC and XMC1404
 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.CC81 (PWM-PFC) triggers the ADC queue.
A result event of the queue triggers this interrupt.
Prio 1. More...
 
void current_ref_ISR (void)
 Current reference interrupt.
pwm_count counts number of PWM cycles.
PR event of pwm_count triggers the current_fed_ISR() at a defined number of switching cycles.
Prio 2. More...
 
void voltage_loop_ISR (void)
 Voltage control interrupt.
Timer CCU40.CC42 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.
State machine for start-up and event management.
Prio 3. More...
 

Variables

static volatile uint8_t i_filter = 0
 
volatile PFC_var_t PFC
 
volatile uint16_t time_count_5kHz = 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
 

Control and Fault status registers

volatile state_t status_reg = ST_INIT
 
volatile fault_t fault_reg = F_INIT
 

Detailed Description

Function Documentation

void current_loop_ISR ( void  )

Current loop interrupt.
CR2 while counting up in CCU80.CC81 (PWM-PFC) triggers the ADC queue.
A result event of the queue triggers this interrupt.
Prio 1.

Returns
None

Link to function documentation:
iL_modif()
iL_loop()
iL_coeff()
pseudo_pll()

TPPFC_Iloop_flow.png
3300W Bidirectional Totem-pole current loop ISR flow diagram



void current_ref_ISR ( void  )

Current reference interrupt.
pwm_count counts number of PWM cycles.
PR event of pwm_count triggers the current_fed_ISR() at a defined number of switching cycles.
Prio 2.

Returns
None

Link to function documentation:
iL_offset_calc()
iL_ref()
iL_deadtime()

TPPFC_Iref_flow.png
3300W Bidirectional Totem-pole current reference ISR flow diagram



void voltage_loop_ISR ( void  )

Voltage control interrupt.
Timer CCU40.CC42 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.
State machine for start-up and event management.
Prio 3.

Returns
None

Link to function documentation:
state_machine()
bulk_monitoring()

TPPFC_Vloop_schedule.png
3300W Bidirectional Totem-pole CCM voltage loop ISR flow diagram.



PFC_INV_statemachine.png
3300W Bidirectional Totem-pole CCM state machine for PFC (left) and Inverter (right) operation.

Variable Documentation

volatile uint32_t* ADCResult_BOP

ADC result. NOT USED.

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. NOT USED.

volatile uint32_t* ADCResult_VAC

AC Voltage ADC result.

volatile fault_t fault_reg = F_INIT

Variable that holds the possible faults of the PFC

volatile uint8_t i_filter = 0
static

Counter for reducing sampling frequency of the filter

volatile PFC_var_t PFC

Instance of the PFC needed variables.

volatile state_t status_reg = ST_INIT

Variable that holds the operation state of the PFC

volatile uint16_t time_count_5kHz = 0

Time counting based on PWM interrupt