|
PFC:800WPSUC7-4pin
|
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} |
OVP variables | |
| static volatile uint8_t | count_Vout_OVP_stop = 0 |
| static volatile uint8_t | count_Vout_OVP_resume = 0 |
| 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.
| 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.
<BR><BR>
|
static |
AC lost detection
|
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
|
static |
Counter for time filtering of bulk voltage OVP operation resume
|
static |
Counter for time filtering of bulk voltage OVP detection
|
static |
Debugging the FIFO to secondary controller
|
static |
current_loop is a flag to calculate the loop in alternative switching cycles.
|
static |
Counter for relay management during DC start-up
|
static |
Filter input vector index
|
static |
Filter input vector
|
static |
Filter output
| __I uint32_t* DCM_capture |
Pointer to the captured time to detect DCM operation
|
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
|
static |
Counter for reducing sampling frequency of the filter
|
static |
Counter to select the type of data sent to the secondary controller
|
static |
Current received from secondary controller
|
static |
Modification of the measured AVG value in DCM (Q15), initialize to 1
|
static |
Error outside the defined slot is detected, debugging variable
|
static |
Duty cycle offset to be modified during soft-start in "open-loop" operation.
|
static |
Negative error detected, debugging variable
| volatile PFC_coefs_t PFC |
PFC feedback and control values.
|
static |
Temporal received message from primary side
|
static |
Soft-start in closed-loop operation.
| volatile state_t status_reg = ST_INIT |
Variable that holds the operation state of the PFC
|
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
|
static |
Flag to send information in alternative switching cycles in case the converter is off
|
static |
UART reception buffer index
|
static |
Type of information received
|
static |
Absolute value of error is saved in Vout_offset, debugging variable
|
static |
Vrms^2 calculation.
|
static |
Counter for soft-start in current loop operation.