17#include "system/pins.h"
20#include "config/macros.h"
21#include "config/config.h"
114 static uint16_t cnt = 0;
129 #if(OPEN_LOOP_PBV == false)
141 #if(OPEN_LOOP_PBV == false)
213#define MIN_REFERENCE_THRESHOLD_IV (10)
214#define MIN_REFERENCE_THRESHOLD_P (15)
215#define PIRM_MIN_VOLTAGE_55V (250)
216#define PRIMARY_VOLTAGE_MODE_SENSOR_SAFE_CHECK() do { \
217 if (dab.Properties.IReference > MIN_REFERENCE_THRESHOLD_IV) \
218 if (dab.Properties.VPriReference > MIN_REFERENCE_THRESHOLD_IV) \
219 if (dab.Properties.PwrReference > MIN_REFERENCE_THRESHOLD_P) \
220 if (vPrimAveraging.AverageValue < PIRM_MIN_VOLTAGE_55V) { \
221 dab.Properties.IReference = MIN_REFERENCE_THRESHOLD_IV; \
222 dab.ILoop.Reference = MIN_REFERENCE_THRESHOLD_IV; \
223 dab.Properties.PwrReference = MIN_REFERENCE_THRESHOLD_P; \
224 dab.PLoop.Reference = MIN_REFERENCE_THRESHOLD_P; \
315 uint16_t ILoopReference = (uint16_t)(RefBuf >> 12);
318 RefBuf = (uint32_t)ILoopReference * (uint32_t)(
dab.
PLoop.
Output & 0x7FFF);
319 ILoopReference = (int16_t)(RefBuf >> 15);
343 uint16_t ILoopReference = (uint16_t)(RefBuf >> 12);
346 RefBuf = (uint32_t)ILoopReference * (uint32_t)(
dab.
PLoop.
Output & 0x7FFF);
347 ILoopReference = (int16_t)(RefBuf >> 15);
495#if defined (PERIOD_MODULATION_DEMO) && (PERIOD_MODULATION_DEMO == true)
505 static uint16_t decimPM;
This is the generated driver header file for the ADC1 driver.
This is the generated driver types header file for the ADC driver.
Contains public fault functions.
Contains public functions and data types relevant for DCDT file interface.
void XFT_SMPS_Controller2P2ZUpdate(SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
void SMPS_Controller2P2ZUpdate(SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
void PwrCtrl_PeriodModulator(void)
#define PRIMARY_VOLTAGE_MODE_SENSOR_SAFE_CHECK()
void PwrCtrl_ControlLoopExecute(void)
static bool VLoopInterleaveExec
#define PRI_TO_SEC_PHASE_DEGREES_LIMIT
Maximum Limit for primary to secondary phase in degrees [deg].
#define PERIODSTEP
period increment with 3LSBs needs to be 0 based from PWM FRM with cascaded PWM
#define MAXIMUM_DEADTIME
Maximum Deadtime in seconds [sec].
#define MINIMUM_DEADTIME
Minimum Deadtime in seconds [sec].
#define PRI_TO_SEC_PHASE_TARGET
Primary to Secondary phase target before switching to period modulation.
#define MAX_PWM_PERIOD
This sets the switching period of the converter.
#define DEGREES_PHASE_SCALING_10
#define DEGREES_PHASE_SCALER
#define MIN_PWM_PERIOD
This sets the switching period of the converter.
#define MIN_PHASE_SHIFTED_PULSE
Maximum dead time [tick = 250ps].
#define VPRIM_LOAD_STEP_CLAMP
#define VSEC_LOAD_STEP_CLAMP
#define ISEC_LOAD_STEP_CLAMP
#define VPLOOP_ILOOP_EXE_RATIO
ratio of ILOOP /VPLOOP execution [100KHz / 10KHz], the divide 2 is for interleaved VLoop and PLoop
#define AGC_MINIMUM_VIN_THRESHOLD_SEC
Minimum VIN secondary threshold to activate AGC reverse mode in [V]
#define AGC_MINIMUM_VIN_THRESHOLD
Minimum VIN threshold to activate AGC in [V]
#define AGC_VOLTAGE_FACTOR
#define AGC_VOLTAGE_FACTOR_SEC
POWER_CONTROL_t dab
Global data object for a DAB Converter.
AVERAGING_t iSecAveraging
Data Object of secondary current averaging.
void PwrCtrl_DeadTimeAdjust(void)
This function updates the DAB data members dead time based on load.
static void PwrCtrl_AdaptiveGainUpdate(void)
Updates the Adaptive gain for the power converter control loop.
AVERAGING_t vPrimAveraging
Data Object of primary voltage averaging.
void PwrCtrl_UpdateADConverterData(void)
This function updates the DAB data members with ADC raw values.
void PwrCtrl_10KHzVPLoopPrepareData(void)
This function prepares the data for control loop and selects which control loop will be executed.
void PwrCtrl_PrimToSecPHDegree(void)
This function updates the DAB data members with phase values normalized in degree.
AVERAGING_t vSecAveraging
Data Object of secondary voltage averaging.
SMPS_2P2Z_T VMC_2p2z_Rev
Data Object of voltage mode control generated by DCDT.
SMPS_2P2Z_T PMC_2p2z
Data Object of power mode control.
SMPS_2P2Z_T VMC_2p2z
Data Object of voltage mode control generated by DCDT.
SMPS_2P2Z_T PMC_2p2z_Rev
Data Object of power mode control.
SMPS_2P2Z_T IMC_2p2z_Rev
Data Object of current mode control.
SMPS_2P2Z_T IMC_2p2z
Data Object of current mode control.
@ PWR_CTRL_CHARGING
power converter is in charging mode
@ PWR_CTRL_DISCHARGING
power converter is in discharging mode
static bool ADC1_IsConversionComplete(enum ADC_CHANNEL channel)
This inline function returns the status of conversion.This function is used to determine if conversio...
static void ADC1_SoftwareTriggerEnable(void)
This inline function sets software common trigger.
static uint16_t ADC1_ConversionResultGet(enum ADC_CHANNEL channel)
Returns the conversion value for the channel selected.
#define DPD_TP31_SetHigh()
Sets the RC14 GPIO Pin which has a custom name of DPD_TP31 to High.
#define DPD_TP31_SetLow()
Sets the RC14 GPIO Pin which has a custom name of DPD_TP31 to Low.
uint16_t ControlPhase_P2S_Target
Control phase value from control loop in degrees.
uint16_t ControlPeriod
Control period value from control loop.
uint16_t ControlPhase_P2S_Degreex10
Control phase value from control loop in 10 x degree, integer.
uint16_t DeadTimeHigh
Deadtime High settings for PWM.
uint16_t ControlDutyCycle
Control Duty Cycle calculation based on Control Period.
uint16_t DeadTimeLow
Deadtime High settings for PWM.
uint16_t LowPowerSlowMode
future development
uint16_t ControlPhase
Control phase value from control loop.
uint16_t VPriVoltage
Data value for input voltage.
uint16_t ISecAverageRectified
Data value for average secondary current rectified.
uint16_t ISensePrimary
Data value for primary current as measured with CT.
uint16_t VSecVoltage
Data value for output voltage.
int16_t SecPower
Data value for Secondary power (Watt)
uint16_t ISecAverage
Data value for average secondary current as measured with isolated current sensor.
uint16_t ISecSensorOffset
Offset of the secondary current sensor.
uint16_t ISenseSecondary
Data value for secondary current as measured with CT.
uint16_t VRail_5V
Data value for 5V auxiliary rail.
uint16_t Temperature
Data value for temperature.
unsigned Running
Bit 0: Power converter is running.
uint16_t Output
controller output
bool Enable
Enable control loop.
int16_t Reference
actual reference
int16_t AgcFactor
Adaptive gain control.
CONTROLLER_t ILoop
structure for current controller data
SWITCH_NODE_t Pwm
Switch node settings.
CONTROLLER_t PLoop
structure for power controller data
CONTROLLER_t VLoop
structure for voltage controller data
FEEDBACK_SETTINGS_t Data
Feedback channel settings.
PWR_CTRL_CHARGE_STATE_t PowerDirection
defines if the power converter is in charging or discharging mode
STATUS_FLAGS_t Status
Power Supply status flags, running or fault.