|
3.3kW Totem-pole PFC with SiC and XMC1404
|
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 |
| 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.
Link to function documentation:
iL_modif()
iL_loop()
iL_coeff()
pseudo_pll()
| 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.
Link to function documentation:
iL_offset_calc()
iL_ref()
iL_deadtime()
| 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.
Link to function documentation:
state_machine()
bulk_monitoring()
| 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.
|
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