XMC42_800WPSU_LLC
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Control Interrupts

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 int16_t VDC_bus_diff = 0
 
static volatile bool first_reception = false
 
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 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
 

Detailed Description

Function Documentation

__STATIC_INLINE void burst_mode ( )
void control_loop_ISR ( void  )

Main control interrupt.

Returns
None

Trigger is end of conversion of ADC queue, which is triggered by a 100kHz counter (CCU41.CC42) Functions:

  • Time counting base.
  • Vout sensing and OVP.
  • Iout sensing and OCP.
  • Receive bulk voltage information.
  • State machine.
  • Voltage controller.
  • Burst mode detection.
  • Send Iout to primary controller.

Definition at line 1045 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.

Returns
Freeze converter operation. Resume of operation requires microcontroller reset.

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, LED_OFF_DCNOTOK(), ORING_OFF(), oring_status, ST_OCP, status_reg, and sync_OFF().

void start_sequence_ISR ( void  )

Timing modification for start-up sequence.

Returns
None

Trigger is CR2 comparison of the main timer in the first operation cycles (CCU80.CC82).

Definition at line 1099 of file interrupts_control.c.

References START_FREQ, and start_sequence_count.

__STATIC_INLINE void state_control ( )
__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.

Returns
None

Definition at line 220 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.
Returns
None

Definition at line 1007 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.
Returns
None
LLC_controller.png
800W server power supply LLC control loop


LLC_timers.png
800W server power supply LLC timer configuration

Definition at line 659 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_SLOPE, DELAY_SR_OFF_ABOVE, DELAY_SR_OFF_BELOW_1, DELAY_SR_OFF_BELOW_2, DELAY_SR_ON, 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().

Variable Documentation

volatile uint32_t* ADCResult_12V

Output voltage 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().

volatile uint16_t burst = 0
static

Definition at line 169 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().

volatile uint16_t charge_HS_drive
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().

volatile uint16_t comp_time_counting
static

control the number of ISR cycles with comparator configuration during start-up.

Definition at line 153 of file interrupts_control.c.

uint16_t counter_fifo = 0
static

Debugging the FIFO to secondary controller

Definition at line 197 of file interrupts_control.c.

Referenced by uart_send().

volatile uint16_t debug_burst = 0
static

Definition at line 168 of file interrupts_control.c.

Referenced by state_control().

volatile bool first_reception = false
static

Input voltage, received from primary side

Definition at line 109 of file interrupts_control.c.

volatile uint8_t i_send = 0
static

Counter to select the type of data sent to the secondary controller

Definition at line 199 of file interrupts_control.c.

Referenced by uart_send().

volatile uint8_t in_high_count = 0
static

Time filter for remote ON/OFF signal reading

Definition at line 128 of file interrupts_control.c.

Referenced by state_control().

volatile uint16_t iOut_OCP_count = 0
static

Definition at line 146 of file interrupts_control.c.

volatile uint16_t linear_fsw_count = 0
static

Count of the frequency steps for linear frequency variation

Definition at line 183 of file interrupts_control.c.

Referenced by state_control(), and voltage_loop().

const uint16_t linear_fsw_step[]
static
Initial value:
= {1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 14, 15, 17, 20, 24, 28,
29, 31, 33, 35, 37, 41, 43, 47, 51, 56}

Variable period step during start-up for linear frequency variation: 1.5ms@10us

Definition at line 178 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().

volatile bool oring_status = false
static

Save the status of the oring: false = open; true = closed.

Definition at line 187 of file interrupts_control.c.

Referenced by CSG_rise_ISR(), and state_control().

volatile uint16_t pwm_out_status = 0
static

Over current based on resonant current comparison, status of the PWM outputs

Definition at line 190 of file interrupts_control.c.

volatile uint8_t reception_n = 0
static

Reception counter for reception cycling waiting

Definition at line 124 of file interrupts_control.c.

Referenced by state_control(), and uart_receive().

volatile uint16_t retval
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().

volatile uint8_t start_ok = 0
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().

volatile uint8_t start_reception_n = 0
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 counter for asymmetric PWM modification

Definition at line 137 of file interrupts_control.c.

Referenced by start_sequence_ISR(), and state_control().

volatile state_t status_reg = ST_INIT
volatile uint8_t stop_ok = 0
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().

volatile uint8_t stop_reception_n = 0
static

Flag for new reception for reception cycling waiting

Definition at line 122 of file interrupts_control.c.

Referenced by state_control().

volatile uint16_t Temp[] = {0, 0, 0}
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().

volatile uint16_t test = 0
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().

volatile uint16_t timer_status[32]
static

Definition at line 167 of file interrupts_control.c.

volatile uint16_t timer_value1 = LLC_PERIOD_MIN
static

Definition at line 165 of file interrupts_control.c.

volatile uint16_t timer_value2 = 0
static

Definition at line 166 of file interrupts_control.c.

volatile uint16_t VDC_bus[] = {0, 0}
static

Input voltage, received from primary side

Definition at line 95 of file interrupts_control.c.

Referenced by state_control(), and uart_receive().

volatile int16_t VDC_bus_diff = 0
static

Input voltage, difference between two received data

Definition at line 106 of file interrupts_control.c.

volatile controller_t voltage_int_ctr

Voltage controller instance.

Definition at line 68 of file interrupts_control.c.

Referenced by control_loop_init().