|
XMC42_800WPSU_LLC
|
Files | |
| file | interrupts_control.c |
| Control related interrupts code. | |
| file | interrupts_control.h |
| Control interrupts header file. | |
Functions | |
| __STATIC_INLINE void | uart_receive () |
| UART receive data. Non blocking function. No interrupts involved. Receive data from primary side controller. Parity bit used to accept or decline received data. More... | |
| __STATIC_INLINE void | state_control () |
| State machine to control LLC operation. More... | |
| __STATIC_INLINE void | voltage_loop () |
| Voltage control loop implementation and linear frequency start sequence. More... | |
| __STATIC_INLINE void | burst_mode () |
| Burst mode management according to burst mode flag (max. frequency) and Vout over a defined threshold. More... | |
| __STATIC_INLINE void | uart_send () |
| Send information to primary controller. More... | |
| void | control_loop_ISR (void) |
| Main control interrupt. More... | |
| void | start_sequence_ISR (void) |
| Timing modification for start-up sequence. More... | |
| void | CSG_rise_ISR (void) |
| Short circuit protection, based on resonant current comparison. More... | |
Variables | |
| volatile LLC_t | LLC |
| static volatile uint16_t | test = 0 |
| volatile uint16_t | Temp_fan = 0 |
| static volatile uint8_t | in_high_count = 0 |
| volatile uint16_t | time_count_100kHz = 0 |
| volatile uint16_t | time_IMON_100kHz = 0 |
| volatile uint8_t | start_sequence_count = 0 |
| static volatile uint16_t | charge_HS_drive |
| static volatile uint16_t | comp_time_counting |
| static volatile bool | oring_status = false |
| static volatile uint16_t | pwm_out_status = 0 |
ADC results | |
| volatile uint32_t * | ADCResult_iR |
| volatile uint32_t * | ADCResult_12V |
| volatile uint32_t * | ADCResult_12VOr |
| volatile uint32_t * | ADCResult_iOut |
Controller structure | |
| volatile controller_t | voltage_int_ctr |
UART related variables | |
| static volatile uint16_t | retval |
| static volatile uint16_t | VDC_bus [] = {0, 0} |
| static volatile uint16_t | Temp [] = {0, 0, 0} |
Input voltage reception variables | |
| static volatile int16_t | VDC_bus_diff = 0 |
| static volatile bool | first_reception = false |
| static volatile uint8_t | start_ok = 0 |
| static volatile uint8_t | start_reception_n = 0 |
| static volatile uint8_t | stop_ok = 0 |
| static volatile uint8_t | stop_reception_n = 0 |
| static volatile uint8_t | reception_n = 0 |
Control and Fault related variables | |
| volatile state_t | status_reg = ST_INIT |
| volatile fault_t | fault_reg = F_INIT |
| volatile burst_mode_t | burst_status = FREQ_OPERATION |
| static volatile uint16_t | iOut_OCP_count = 0 |
Debug variables | |
| static volatile uint16_t | timer_value1 = LLC_PERIOD_MIN |
| static volatile uint16_t | timer_value2 = 0 |
| static volatile uint16_t | timer_status [32] |
| static volatile uint16_t | debug_burst = 0 |
| static volatile uint16_t | burst = 0 |
Linear frequency variation in start-up | |
| static const uint16_t | linear_fsw_step [] |
| static volatile uint16_t | linear_fsw_count = 0 |
UART transmission to primary controller | |
| static uint16_t | counter_fifo = 0 |
| static volatile uint8_t | i_send = 0 |
| __STATIC_INLINE void burst_mode | ( | ) |
Burst mode management according to burst mode flag (max. frequency) and Vout over a defined threshold.
Definition at line 945 of file interrupts_control.c.
References burst, BURST_ON, burst_status, LLC_t::deadtime, DEADTIME_0Hz, DEADTIME_F_COMP, DEADTIME_R_COMP, DEADTIME_SLOPE, DELAY_SR1_OFF_BURST, DELAY_SR1_ON_BURST, DELAY_SR2_OFF_BURST, DELAY_SR2_ON_BURST, DRIVER_DELAY_COMP, LLC_PERIOD_MIN, controller_t::output_int, controller_t::output_int_limit, Q15_PRODUCT_SHIFT, LLC_t::qVout, SHADOW_TRANSFER_LLC_SR, ST_BURST, ST_RUNNING, controller_t::state, status_reg, and VOUT_BURST.
| void control_loop_ISR | ( | void | ) |
Main control interrupt.
Trigger is end of conversion of ADC queue, which is triggered by a 100kHz counter (CCU41.CC42) Functions:
Definition at line 1048 of file interrupts_control.c.
References ADC_TO_Q15, ADCResult_12V, ADCResult_12VOr, ADCResult_iOut, over_current_protection(), over_voltage_protection(), LLC_t::q12V, LLC_t::q12V_oring, LLC_t::qIout, state_control(), time_count_100kHz, time_IMON_100kHz, uart_receive(), uart_send(), and voltage_loop().
| void CSG_rise_ISR | ( | void | ) |
Short circuit protection, based on resonant current comparison.
Trigger is resonant current comparison with a fixed defined level, which provides short-circuit protection.
Definition at line 1151 of file interrupts_control.c.
References F_SC, fault_reg, ORING_OFF(), oring_status, ST_OCP, status_reg, and sync_OFF().
| void start_sequence_ISR | ( | void | ) |
Timing modification for start-up sequence.
Trigger is end of conversion of ADC queue, which is triggered by a 50kHz counter (CCU41.CC42)
Definition at line 1102 of file interrupts_control.c.
References ADC_START, DRIVER_DELAY_COMP, PR_START_SEQ, START_FREQ, and start_sequence_count.
| __STATIC_INLINE void state_control | ( | ) |
State machine to control LLC operation.
- Remote ON/OFF.
- Fault management.
- Bulk reception start and stop state machine, based on received data.
- State machine for start-up sequence and BURST management.
Definition at line 273 of file interrupts_control.c.
References ADC_START, ADC_TO_Q15, ADCResult_12VOr, burst, charge_HS_drive, CHARGE_HS_LOW, control_loop_init(), DEADTIME_F_START, DEADTIME_R_START, debug_burst, DUTY_START, F_INIT, F_OCP_H, F_OVP, F_UVP, fault_reg, controller_t::first_iter, in_high_count, controller_t::int_ref, controller_t::int_ref_steady, LED_OFF_DCNOTOK(), linear_fsw_count, LLC_PERIOD_MAX, LLC_PERIOD_MIN, MIN_DEADTIME, ORING_OFF(), ORING_ON(), oring_status, controller_t::output_int, controller_t::output_int_limit, PR_START, PWM_OFF(), PWM_ON(), LLC_t::q12V, LLC_t::q12V_oring, LLC_t::qVout, ramp, controller_t::ramp_loop, reception_n, SHADOW_TRANSFER_LLC_SR, SHADOW_TRANSFER_LLC_SR_CLEAR, controller_t::soft_start, ST_BURST, ST_CHARGE, ST_INIT, ST_LATCH, ST_RUNNING, ST_SOFT_START, ST_SOFT_START_SR, ST_STB, START_FREQ, start_ok, start_reception_n, start_sequence_count, controller_t::state, status_reg, stop_ok, stop_reception_n, sync_OFF(), sync_ON(), time_BOP, time_INIT, VDC_bus, VDC_BUS_START, VDC_BUS_START_HYST, VDC_BUS_STOP, VOUT_ORING_ON, VOUT_SR_ON, and VOUT_TARGET.
Referenced by control_loop_ISR().
| __STATIC_INLINE void uart_receive | ( | ) |
UART receive data. Non blocking function. No interrupts involved.
Receive data from primary side controller.
Parity bit used to accept or decline received data.
Definition at line 218 of file interrupts_control.c.
References reception_n, retval, Temp, Temp_fan, and VDC_bus.
Referenced by control_loop_ISR().
| __STATIC_INLINE void uart_send | ( | ) |
Send information to primary controller.
- Output current information for bulk voltage modulation.
Definition at line 1009 of file interrupts_control.c.
References counter_fifo, fault_reg, i_send, LLC_t::qIout, ST_RUNNING, status_reg, and time_send_UART.
Referenced by control_loop_ISR().
| __STATIC_INLINE void voltage_loop | ( | ) |
Voltage control loop implementation and linear frequency start sequence.
- Linear frequency variation during start in open-loop operation.
- Close-loop operation after linear frequency start, based on switching frequency or voltage error.
- Voltage controller
- Frequency limitation and burst flag (maximum frequency).
- Dead-time calculation.
- HB and SR timing.
Definition at line 653 of file interrupts_control.c.
References controller_t::a, BELOW_FREQ, BURST_ON, burst_status, COMP_SHIFT, control_loop_init(), LLC_t::deadtime, DEADTIME_0Hz, DEADTIME_F_COMP, DEADTIME_R_COMP, DEADTIME_SLOPE, DELAY_SR1_OFF_ABOVE, DELAY_SR1_OFF_BELOW_1, DELAY_SR1_OFF_BELOW_2, DELAY_SR1_ON, DELAY_SR2_OFF_ABOVE, DELAY_SR2_OFF_BELOW_1, DELAY_SR2_OFF_BELOW_2, DELAY_SR2_ON, DRIVER_DELAY_COMP, controller_t::error, controller_t::first_iter, FREQ_OPERATION, controller_t::int_calc, controller_t::int_ref, LED_ON_DCOK(), linear_fsw_count, linear_fsw_step, LLC_PERIOD_MAX, LLC_PERIOD_MIN, loop, MIN_DEADTIME, controller_t::output, controller_t::output_int, controller_t::output_int_limit, Q15_PRODUCT_SHIFT, LLC_t::qVout, controller_t::ramp_loop, RES_FREQ, SHADOW_TRANSFER_LLC_SR, controller_t::soft_start, LLC_t::SR1_off_timing, LLC_t::SR2_off_timing, ST_RUNNING, ST_SOFT_START, ST_SOFT_START_SR, controller_t::state, and status_reg.
Referenced by control_loop_ISR().
| volatile uint32_t* ADCResult_12V |
Output voltage after Oring ADC result
Definition at line 59 of file interrupts_control.c.
Referenced by control_loop_ISR(), and VADC_Init().
| volatile uint32_t* ADCResult_12VOr |
Output voltage before Oring ADC result
Definition at line 60 of file interrupts_control.c.
Referenced by control_loop_ISR(), state_control(), and VADC_Init().
| volatile uint32_t* ADCResult_iOut |
Output current ADC result
Definition at line 61 of file interrupts_control.c.
Referenced by control_loop_ISR(), and VADC_Init().
| volatile uint32_t* ADCResult_iR |
Resonant current ADC result
Definition at line 58 of file interrupts_control.c.
Referenced by VADC_Init().
|
static |
Definition at line 168 of file interrupts_control.c.
Referenced by burst_mode(), and state_control().
| volatile burst_mode_t burst_status = FREQ_OPERATION |
Definition at line 145 of file interrupts_control.c.
Referenced by burst_mode(), control_loop_init(), and voltage_loop().
|
static |
control number of cycles with closed LS to charge driver bootstrap cap.
Definition at line 150 of file interrupts_control.c.
Referenced by state_control().
|
static |
control the number of ISR cycles with comparator configuration during start-up.
Definition at line 153 of file interrupts_control.c.
|
static |
Debugging the FIFO to secondary controller
Definition at line 195 of file interrupts_control.c.
Referenced by uart_send().
|
static |
Definition at line 167 of file interrupts_control.c.
Referenced by state_control().
Definition at line 144 of file interrupts_control.c.
Referenced by CSG_rise_ISR(), over_current_protection(), over_voltage_protection(), state_control(), and uart_send().
|
static |
Input voltage, received from primary side
Definition at line 113 of file interrupts_control.c.
|
static |
Counter to select the type of data sent to the secondary controller
Definition at line 197 of file interrupts_control.c.
Referenced by uart_send().
|
static |
Time filter for remote ON/OFF signal reading
Definition at line 128 of file interrupts_control.c.
Referenced by state_control().
|
static |
Definition at line 146 of file interrupts_control.c.
|
static |
Count of the frequency steps for linear frequency variation
Definition at line 181 of file interrupts_control.c.
Referenced by state_control(), and voltage_loop().
|
static |
Variable period step during start-up for linear frequency variation: 1.5ms@10us
Definition at line 176 of file interrupts_control.c.
Referenced by voltage_loop().
| volatile LLC_t LLC |
Structure for LLC measured values
Definition at line 72 of file interrupts_control.c.
Referenced by control_loop_init(), and I_MON_update().
|
static |
Save the status of the oring: false = open; true = closed.
Definition at line 185 of file interrupts_control.c.
Referenced by CSG_rise_ISR(), and state_control().
|
static |
Over current based on resonant current comparison, status of the PWM outputs
Definition at line 188 of file interrupts_control.c.
|
static |
Reception counter for reception cycling waiting
Definition at line 124 of file interrupts_control.c.
Referenced by state_control(), and uart_receive().
|
static |
Type of information received UART reception buffer index Temporal received message from primary side
Definition at line 92 of file interrupts_control.c.
Referenced by uart_receive().
|
static |
Received input voltage from primary side considered consistent to start operation
Definition at line 116 of file interrupts_control.c.
Referenced by state_control().
|
static |
Flag for new reception for reception cycling waiting
Definition at line 118 of file interrupts_control.c.
Referenced by state_control().
| volatile uint8_t start_sequence_count = 0 |
Starting sequence control
Definition at line 137 of file interrupts_control.c.
Referenced by start_sequence_ISR(), and state_control().
Definition at line 143 of file interrupts_control.c.
Referenced by burst_mode(), CSG_rise_ISR(), over_current_protection(), over_voltage_protection(), state_control(), time_counter(), uart_send(), and voltage_loop().
|
static |
Received input voltage from primary side considered consistent to stop operation
Definition at line 120 of file interrupts_control.c.
Referenced by state_control().
|
static |
Flag for new reception for reception cycling waiting
Definition at line 122 of file interrupts_control.c.
Referenced by state_control().
|
static |
Temperature, received from primary side
Definition at line 98 of file interrupts_control.c.
Referenced by uart_receive().
| volatile uint16_t Temp_fan = 0 |
Variable to modify the fan PWM
Definition at line 102 of file interrupts_control.c.
Referenced by fan_temp_control(), and uart_receive().
|
static |
UART reception buffer dummy variable for testing
Definition at line 79 of file interrupts_control.c.
| volatile uint16_t time_count_100kHz = 0 |
Time counting based on control interrupt
Definition at line 131 of file interrupts_control.c.
Referenced by control_loop_ISR(), and time_counter().
| volatile uint16_t time_IMON_100kHz = 0 |
Time counting for current monitoring update, ISR based
Definition at line 134 of file interrupts_control.c.
Referenced by control_loop_ISR(), and time_counter().
|
static |
Definition at line 166 of file interrupts_control.c.
|
static |
Definition at line 164 of file interrupts_control.c.
|
static |
Definition at line 165 of file interrupts_control.c.
|
static |
Input voltage, received from primary side
Definition at line 95 of file interrupts_control.c.
Referenced by state_control(), and uart_receive().
|
static |
Input voltage, difference between two received data
Definition at line 110 of file interrupts_control.c.
| volatile controller_t voltage_int_ctr |
Voltage controller.
Definition at line 68 of file interrupts_control.c.
Referenced by control_loop_init().