|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
pwrctrl_isr_extension.c
Go to the documentation of this file.
1
9#include <xc.h>
10#include <math.h>
11#include <stdbool.h>
12#include <stdlib.h>
13
14// MCC header files
15#include "adc/adc_types.h"
16#include "adc/adc1.h"
17#include "system/pins.h"
18
19// DAB header files
20#include "config/macros.h"
21#include "config/config.h"
22#include "pwrctrl.h"
23#include "fault/fault.h"
24#include "dcdt/pwrctrl_dcdt.h"
25
26
27
34 AVERAGING_t vPrimAveraging;
35
42 AVERAGING_t vSecAveraging;
43
50 AVERAGING_t iSecAveraging;
51
52// STATIC VARIABLES and FUNCTIONS
53static void PwrCtrl_AdaptiveGainUpdate(void);
54 static bool VLoopInterleaveExec = true;
55
56
65 void PwrCtrl_UpdateADConverterData (void)
66{
67 // Enable the ADC sampling
68 ADC1_SoftwareTriggerEnable();
69
70 if(ADC1_IsConversionComplete(ISEC_CT))
71 dab.Data.ISenseSecondary = ADC1_ConversionResultGet(ISEC_CT);
72
73 if(ADC1_IsConversionComplete(IPRI_CT))
74 dab.Data.ISensePrimary = ADC1_ConversionResultGet(IPRI_CT);
75
76 if(ADC1_IsConversionComplete(VRAIL_5V))
77 dab.Data.VRail_5V = ADC1_ConversionResultGet(VRAIL_5V);
78
79 if(ADC1_IsConversionComplete(TEMP))
80 dab.Data.Temperature = ADC1_ConversionResultGet(TEMP);
81
82 if(ADC1_IsConversionComplete(VPRI)){
83 dab.Data.VPriVoltage = ADC1_ConversionResultGet(VPRI);
84 vPrimAveraging.Accumulator += dab.Data.VPriVoltage;
85 vPrimAveraging.Counter = vPrimAveraging.Counter + 1;
86 }
87
88 if(ADC1_IsConversionComplete(VSEC)){
89 dab.Data.VSecVoltage = ADC1_ConversionResultGet(VSEC);
90 vSecAveraging.Accumulator += dab.Data.VSecVoltage;
91 vSecAveraging.Counter = vSecAveraging.Counter + 1;
92 }
93
94 if(ADC1_IsConversionComplete(ISEC_AVG)){
95 dab.Data.ISecAverage = ADC1_ConversionResultGet(ISEC_AVG);
96 dab.Data.ISecAverageRectified = abs(dab.Data.ISecAverage - dab.Data.ISecSensorOffset);
97 iSecAveraging.Accumulator += dab.Data.ISecAverageRectified;
98 iSecAveraging.Counter = iSecAveraging.Counter + 1;
99 }
100}
101
102
112 void PwrCtrl_10KHzVPLoopPrepareData(void)
113{
114 static uint16_t cnt = 0;
115
116 //Interleave the execution of VLoop and PLoop control for 10KHz execution
117 if(++cnt == (VPLOOP_ILOOP_EXE_RATIO))
118 {
119 // Averaging of Secondary Voltage
120 vSecAveraging.AverageValue = (uint16_t)(__builtin_divud(vSecAveraging.Accumulator, vSecAveraging.Counter));
121 vSecAveraging.Accumulator = 0;
122 vSecAveraging.Counter = 0;
123
124 #if(OPEN_LOOP_PBV == false)
125 //Condition for control loop execution controlling the loop enable bit
126 if((dab.VLoop.Enable == false) && (VLoopInterleaveExec == true) && (dab.Status.bits.Running == 1))
127 #endif
128 {
129 // Enable Vloop control
130 dab.VLoop.Enable = true;
131 dab.PLoop.Enable = false;
132
133 // Averaging of Primary Voltage
134 vPrimAveraging.AverageValue = (uint16_t)(__builtin_divud(vPrimAveraging.Accumulator, vPrimAveraging.Counter));
135 vPrimAveraging.Accumulator = 0;
136 vPrimAveraging.Counter = 0;
137
138 // Compute the Adaptive Gain
139 PwrCtrl_AdaptiveGainUpdate();
140 }
141
142 #if(OPEN_LOOP_PBV == false)
143 else if((dab.PLoop.Enable == false) && (VLoopInterleaveExec == false) && (dab.Status.bits.Running == 1))
144 #endif
145 {
146 // Enable PLoop control
147 dab.VLoop.Enable = false;
148 dab.PLoop.Enable = true;
149
150 // Averaging of Secondary Current
151 iSecAveraging.AverageValue = (uint16_t)(__builtin_divud(iSecAveraging.Accumulator, iSecAveraging.Counter));
152 iSecAveraging.Accumulator = 0;
153 iSecAveraging.Counter = 0;
154
155 // Bit-shift value used to perform input value normalization
156 // Scaled the feedback to Power (Watts in units)
157 uint32_t buf = (uint32_t)iSecAveraging.AverageValue *
158 (uint32_t)vSecAveraging.AverageValue * POWER_FACTOR;
159
160 // scale back the 14 bit from the POWER_RESOLUTION calculation
161 // to get the Watts value for Power Loop
162 buf >>= POWER_SCALER;
163
164 // Transfer to SecPower data member the power computation in [Watts]
165 dab.Data.SecPower = buf;
166
167 }
168
169 // If Power supply is not yet running, the averaging of
170 // primary voltage and secondary voltage continues to display in PBV
171 if(!dab.Status.bits.Running){
172 // Averaging of Primary Voltage
173 vPrimAveraging.AverageValue = (uint16_t)(__builtin_divud(vPrimAveraging.Accumulator, vPrimAveraging.Counter));
174 vPrimAveraging.Accumulator = 0;
175 vPrimAveraging.Counter = 0;
176
177 // Averaging of Secondary Current
178 iSecAveraging.AverageValue = (uint16_t)(__builtin_divud(iSecAveraging.Accumulator, iSecAveraging.Counter));
179 iSecAveraging.Accumulator = 0;
180 iSecAveraging.Counter = 0;
181
182 // Bit-shift value used to perform input value normalization
183 // Scaled the feedback to Power (Watts in units)
184 uint32_t buf = (uint32_t)iSecAveraging.AverageValue *
185 (uint32_t)vSecAveraging.AverageValue * POWER_FACTOR;
186
187 // scale back the 14 bit from the POWER_RESOLUTION calculation
188 // to get the Watts value for Power Loop
189 buf >>= POWER_SCALER;
190
191 // Transfer to SecPower data member the power computation in [Watts]
192 dab.Data.SecPower = buf;
193 }
194
195 cnt = 0;
196 }
197}
198
199
210 void PwrCtrl_ControlLoopExecute(void)
211{
212 // Execute the Voltage Loop Control
213 if((dab.VLoop.Enable == true) && (VLoopInterleaveExec == true))
214 {
215 VLoopInterleaveExec = false;
216
217 if(dab.PowerDirection == PWR_CTRL_CHARGING)
218 {
219 VMC_2p2z.KfactorCoeffsB = 0x7FFF;
220 VMC_2p2z.maxOutput = 0x7FFF;
221
222 // Bit-shift value used to perform input value normalization
223 dab.VLoop.Feedback = vSecAveraging.AverageValue << 3;
224 dab.VLoop.Reference = (dab.VLoop.Reference << 3);
225
226 // Execute the Voltage Loop Control
227 XFT_SMPS_Controller2P2ZUpdate(&VMC_2p2z, &dab.VLoop.Feedback,
228 dab.VLoop.Reference, &dab.VLoop.Output);
229
230 // Reset the Vloop reference to its original scaling
231 dab.VLoop.Reference = (dab.VLoop.Reference >> 3);
232 }
233 }
234
235 // Execute the Power Loop Control
236 if((dab.PLoop.Enable == true) && (VLoopInterleaveExec == false))
237 {
238 VLoopInterleaveExec = true;
239
240 dab.PLoop.Feedback = dab.Data.SecPower;
241 dab.PLoop.Reference = dab.PLoop.Reference;
242
243 // Execute the Power Loop Control
244 SMPS_Controller2P2ZUpdate(&PMC_2p2z, &dab.PLoop.Feedback,
245 dab.PLoop.Reference, &dab.PLoop.Output);
246
247 }
248
249 // Execute the Current Loop Control
250 if(dab.ILoop.Enable == true)
251 {
252 DPD_TP31_SetHigh();
253 //Bit-shift value used to perform input value normalization
254 dab.ILoop.Feedback = dab.Data.ISecAverageRectified << 3;
255 //adaptive gain factor
256 IMC_2p2z.KfactorCoeffsB = dab.ILoop.AgcFactor;
257 //refresh limits
258 IMC_2p2z.maxOutput = 0x7FFF;
259
260 // Mixing stage from voltage loop 10KHz
261 uint32_t RefBuf = (uint32_t)(dab.ILoop.Reference) *
262 (uint32_t)(dab.VLoop.Output & 0x7FFF);
263 uint16_t ILoopReference = (uint16_t)(RefBuf >> 12);
264
265 // Mixing stage from power loop 10KHz
266 RefBuf = (uint32_t)ILoopReference * (uint32_t)(dab.PLoop.Output & 0x7FFF);
267 ILoopReference = (int16_t)(RefBuf >> 15);
268
269 // Basic clamping in rising direction, in case of Iloop or Vloop overshoot during large load step.
270 if( dab.Data.ISecAverageRectified > (dab.ILoop.Reference + ISEC_LOAD_STEP_CLAMP))
271 {
272 XFT_SMPS_Controller2P2ZUpdate(&IMC_2p2z, &dab.ILoop.Feedback, 0, &dab.ILoop.Output); //force I ref to 0
273 }
274 else
275 if(vSecAveraging.AverageValue > (dab.VLoop.Reference + VSEC_LOAD_STEP_CLAMP))
276 {
277 XFT_SMPS_Controller2P2ZUpdate(&IMC_2p2z, &dab.ILoop.Feedback, 0, &dab.ILoop.Output);//force I ref to 0
278 }
279 else
280 {
281 XFT_SMPS_Controller2P2ZUpdate(&IMC_2p2z, &dab.ILoop.Feedback, ILoopReference, &dab.ILoop.Output);
282 }
283
284
285 // Control loop output copied to control phase
286 dab.Pwm.ControlPhase = (((uint32_t)(dab.Pwm.ControlDutyCycle) *
287 (uint32_t)dab.ILoop.Output) >> 15); //range 0..180
288 dab.Pwm.ControlPhase += dab.Pwm.DeadTimeLow;
289
290 // Clamping value of control phase
291 if(dab.Pwm.ControlPhase > (dab.Pwm.ControlDutyCycle - MIN_PHASE_SHIFTED_PULSE))
292 dab.Pwm.ControlPhase = dab.Pwm.ControlDutyCycle - MIN_PHASE_SHIFTED_PULSE;
293 // Clamping value of control phase
294 else if(dab.Pwm.ControlPhase < dab.Pwm.DeadTimeLow)
295 dab.Pwm.ControlPhase = dab.Pwm.DeadTimeLow;
296
297 DPD_TP31_SetLow();
298 }
299}
300
301
310 static void PwrCtrl_AdaptiveGainUpdate(void)
311{
312
313 // Calculate the primary voltage in terms of Volts
314 uint16_t DAB_PrimaryVoltage = __builtin_divud((vPrimAveraging.AverageValue * VPRI_SCALER), VPRI_FACTOR);
315
316 if(dab.PowerDirection == PWR_CTRL_CHARGING)
317 {
318 // Apply AGC when primary voltage is greater than the minimum VIN AGC threshold
319 if(DAB_PrimaryVoltage > AGC_MINIMUM_VIN_THRESHOLD)
320 dab.ILoop.AgcFactor = (int16_t) (0x7FFF &
321 __builtin_divud(AGC_VOLTAGE_FACTOR, DAB_PrimaryVoltage));
322 else // AGC is not active
323 dab.ILoop.AgcFactor = 0x7FFF;
324
325
326 #if(ENABLE_VLOOP_AGC == true)
327 if(dab.ILoop.Reference > AGC_MINIMUM_CURRENT_THRESHOLD)
328 dab.VLoop.AgcFactor = (int16_t) (0x7FFF &
329 __builtin_divud(AGC_CURRENT_FACTOR, dab.ILoop.Reference));
330 else // AGC is not active
331 dab.VLoop.AgcFactor = 0x7FFF;
332 #endif
333 }
334
335 // Reserved for future Development
336 if(dab.PowerDirection == PWR_CTRL_DISCHARGING)
337 {
338 }
339}
340
341
342
351 void PwrCtrl_PrimToSecPHDegree(void)
352{
353 // Calculation of Primary and Secondary degrees phase
354 // Normalize phase to 0..90.
355 uint32_t buff = ((unsigned long)dab.Pwm.ControlPhase) << DEGREES_PHASE_SCALER;
356 uint16_t buf = __builtin_divud( buff ,dab.Pwm.ControlDutyCycle);
357 buff = __builtin_muluu(buf, PRI_TO_SEC_PHASE_DEGREES_LIMIT);
358 buf = __builtin_divud( buff ,DEGREES_PHASE_SCALING_10);
359
360 // Calculation result for phase value scaled by 10x
361 dab.Pwm.ControlPhase_P2S_Degreex10 = buf;
362
363 // Clamping value for degrees phase when it exceeds the 90.0 degrees
364 if(dab.Pwm.ControlPhase_P2S_Degreex10 >= 900)
365 {
366 // Override the calculated control phase value
367 dab.Pwm.ControlPhase_P2S_Degreex10 = 899;
368 }
369}
370
371
379 void PwrCtrl_DeadTimeAdjust(void)
380{
381 uint16_t NewDT = 0;
382
383 // Deadtime values adjusted on rough phase range. experimentally measured values.
384 // If the control phase is less than 29.0 degrees phase
385 if (dab.Pwm.ControlPhase_P2S_Degreex10 < 290)
386 {NewDT = 2000;} // Equivalent to 500ns DeadTime
387 // If the control phase is within the range of 33.0 and 80.0 degrees phase
388 else if ((dab.Pwm.ControlPhase_P2S_Degreex10 > 330)&&(dab.Pwm.ControlPhase_P2S_Degreex10 < 800))
389 {NewDT = 1500;} // Equivalent to 375ns DeadTime
390 // If the control phase is within the range of 80.5 and 87.5 degrees phase
391 else if ((dab.Pwm.ControlPhase_P2S_Degreex10 > 805)&&(dab.Pwm.ControlPhase_P2S_Degreex10 < 875))
392 {NewDT = 700;} // Equivalent to 175ns DeadTime
393 // If the control phase is greater than 88.0 degrees phase
394 else if (dab.Pwm.ControlPhase_P2S_Degreex10 > 880)
395 {NewDT = 600;} // Equivalent to 150ns DeadTime
396
397 // When new dead-time did not satisfy any condition in degrees phase
398 //retain the previous dead-time value
399 if(NewDT)
400 {
401 // Minimum clamping value of dead-time
402 if (NewDT < MINIMUM_DEADTIME)
403 NewDT = MINIMUM_DEADTIME;
404
405 // Write the new dead-time to the PWM
406 dab.Pwm.DeadTimeLow = NewDT;
407 dab.Pwm.DeadTimeHigh = NewDT;
408
409 // Clear NewDT variable
410 NewDT=0;
411 }
412}
413
414#if defined (PERIOD_MODULATION_DEMO) && (PERIOD_MODULATION_DEMO == true)
415
422void PwrCtrl_PeriodModulator(void)
423{
424 static uint16_t decimPM;
425 decimPM++;
426
427 if(dab.Pwm.ControlPhase_P2S_Target > PRI_TO_SEC_PHASE_TARGET)
428 dab.Pwm.ControlPhase_P2S_Target = PRI_TO_SEC_PHASE_TARGET;//clamp cutoff while modulating period
429 if(dab.Pwm.ControlPhase_P2S_Target == 0)
430 dab.Pwm.ControlPhase_P2S_Target = PRI_TO_SEC_PHASE_TARGET;
431
432 if(decimPM>=8)
433 {
434 if (dab.Pwm.ControlPhase_P2S_Degreex10 < (dab.Pwm.ControlPhase_P2S_Target-5))
435 {
436 if((dab.Pwm.ControlPeriod > MIN_PWM_PERIOD) && (dab.Pwm.LowPowerSlowMode == 0))
437 {
438 dab.Pwm.ControlPeriod-= PERIODSTEP;
439 }
440 else
441 {
442 // When phase shift between primary to secondary is 68 degrees,
443 // DAB runs in low power mode
444 if (dab.Pwm.ControlPhase_P2S_Degreex10 < 680)
445 {
446 dab.Pwm.LowPowerSlowMode =1;
447 }
448 }
449 }
450
451 if (dab.Pwm.ControlPhase_P2S_Degreex10 > (dab.Pwm.ControlPhase_P2S_Target + 5))
452 {
453 if((dab.Pwm.ControlPeriod < MAX_PWM_PERIOD) && (dab.Pwm.ControlPhase_P2S_Degreex10 > 20))
454 {
455 dab.Pwm.ControlPeriod+= PERIODSTEP;
456 }
457 }
458
459 if(dab.Pwm.LowPowerSlowMode == 1)
460 {
461 if (dab.Pwm.ControlPhase_P2S_Degreex10 > 600)
462 {
463 dab.Pwm.LowPowerSlowMode = 0;
464 }
465 else
466 {
467 if(dab.Pwm.ControlPeriod < MAX_PWM_PERIOD)
468 {
469 dab.Pwm.ControlPeriod += PERIODSTEP;
470 }
471 else
472 if (dab.Pwm.ControlPhase_P2S_Degreex10 > 330 )//snap out
473 {
474 dab.Pwm.LowPowerSlowMode = 0;
475 }
476 }
477 }
478 decimPM=0;
479 }
480}
481
482#endif
adc1.h
This is the generated driver header file for the ADC1 driver.
adc_types.h
This is the generated driver types header file for the ADC driver.
ISEC_CT
@ ISEC_CT
Definition adc_types.h:62
VSEC
@ VSEC
Definition adc_types.h:57
IPRI_CT
@ IPRI_CT
Definition adc_types.h:58
TEMP
@ TEMP
Definition adc_types.h:60
VPRI
@ VPRI
Definition adc_types.h:59
VRAIL_5V
@ VRAIL_5V
Definition adc_types.h:61
ISEC_AVG
@ ISEC_AVG
Definition adc_types.h:63
fault.h
Contains public fault functions.
pwrctrl_dcdt.h
Contains public functions and data types relevant for DCDT file interface.
XFT_SMPS_Controller2P2ZUpdate
void XFT_SMPS_Controller2P2ZUpdate(SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
SMPS_Controller2P2ZUpdate
void SMPS_Controller2P2ZUpdate(SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
PwrCtrl_PeriodModulator
void PwrCtrl_PeriodModulator(void)
VLoopInterleaveExec
static bool VLoopInterleaveExec
Definition pwrctrl_isr_extension.c:54
PRI_TO_SEC_PHASE_DEGREES_LIMIT
#define PRI_TO_SEC_PHASE_DEGREES_LIMIT
Maximum Limit for primary to secondary phase in degrees [deg].
Definition config.h:31
PERIODSTEP
#define PERIODSTEP
period increment with 3LSBs needs to be 0 based from PWM FRM with cascaded PWM
Definition config.h:35
MINIMUM_DEADTIME
#define MINIMUM_DEADTIME
Minimum Deadtime in seconds [sec].
Definition config.h:27
PRI_TO_SEC_PHASE_TARGET
#define PRI_TO_SEC_PHASE_TARGET
Primary to Secondary phase target before switching to period modulation.
Definition config.h:34
MAX_PWM_PERIOD
#define MAX_PWM_PERIOD
This sets the switching period of the converter.
Definition macros.h:40
DEGREES_PHASE_SCALING_10
#define DEGREES_PHASE_SCALING_10
Definition macros.h:56
DEGREES_PHASE_SCALER
#define DEGREES_PHASE_SCALER
Definition macros.h:55
MIN_PWM_PERIOD
#define MIN_PWM_PERIOD
This sets the switching period of the converter.
Definition macros.h:41
MIN_PHASE_SHIFTED_PULSE
#define MIN_PHASE_SHIFTED_PULSE
Maximum dead time [tick = 250ps].
Definition macros.h:52
VPRI_FACTOR
#define VPRI_FACTOR
Definition macros.h:135
VPRI_SCALER
#define VPRI_SCALER
Definition macros.h:134
VSEC_LOAD_STEP_CLAMP
#define VSEC_LOAD_STEP_CLAMP
Definition macros.h:115
ISEC_LOAD_STEP_CLAMP
#define ISEC_LOAD_STEP_CLAMP
Definition macros.h:77
VPLOOP_ILOOP_EXE_RATIO
#define VPLOOP_ILOOP_EXE_RATIO
ratio of ILOOP /VPLOOP execution [100KHz / 10KHz], the divide 2 is for interleaved VLoop and PLoop
Definition config.h:44
AGC_MINIMUM_VIN_THRESHOLD
#define AGC_MINIMUM_VIN_THRESHOLD
Minimum VIN threshold to activate AGC in [V]
Definition config.h:45
AGC_CURRENT_FACTOR
#define AGC_CURRENT_FACTOR
Definition macros.h:170
AGC_MINIMUM_CURRENT_THRESHOLD
#define AGC_MINIMUM_CURRENT_THRESHOLD
Definition macros.h:169
POWER_FACTOR
#define POWER_FACTOR
Definition macros.h:166
POWER_SCALER
#define POWER_SCALER
Definition macros.h:165
AGC_VOLTAGE_FACTOR
#define AGC_VOLTAGE_FACTOR
Definition macros.h:168
dab
POWER_CONTROL_t dab
Global data object for a DAB Converter.
Definition pwrctrl.c:28
PwrCtrl_ControlLoopExecute
void PwrCtrl_ControlLoopExecute(void)
Executes the power converter control loop.
Definition pwrctrl_isr_extension.c:210
iSecAveraging
AVERAGING_t iSecAveraging
Data Object of secondary current averaging.
Definition pwrctrl_isr_extension.c:50
PwrCtrl_DeadTimeAdjust
void PwrCtrl_DeadTimeAdjust(void)
This function updates the DAB data members dead time based on load.
Definition pwrctrl_isr_extension.c:379
PwrCtrl_AdaptiveGainUpdate
static void PwrCtrl_AdaptiveGainUpdate(void)
Updates the Adaptive gain for the power converter control loop.
Definition pwrctrl_isr_extension.c:310
vPrimAveraging
AVERAGING_t vPrimAveraging
Data Object of primary voltage averaging.
Definition pwrctrl_isr_extension.c:34
PwrCtrl_UpdateADConverterData
void PwrCtrl_UpdateADConverterData(void)
This function updates the DAB data members with ADC raw values.
Definition pwrctrl_isr_extension.c:65
PwrCtrl_10KHzVPLoopPrepareData
void PwrCtrl_10KHzVPLoopPrepareData(void)
This function prepares the data for control loop and selects which control loop will be executed.
Definition pwrctrl_isr_extension.c:112
PwrCtrl_PrimToSecPHDegree
void PwrCtrl_PrimToSecPHDegree(void)
This function updates the DAB data members with phase values normalized in degree.
Definition pwrctrl_isr_extension.c:351
vSecAveraging
AVERAGING_t vSecAveraging
Data Object of secondary voltage averaging.
Definition pwrctrl_isr_extension.c:42
PMC_2p2z
SMPS_2P2Z_T PMC_2p2z
Data Object of power mode control.
Definition pwrctrl_dcdt.c:57
VMC_2p2z
SMPS_2P2Z_T VMC_2p2z
Data Object of voltage mode control generated by DCDT.
Definition pwrctrl_dcdt.c:41
IMC_2p2z
SMPS_2P2Z_T IMC_2p2z
Data Object of current mode control.
Definition pwrctrl_dcdt.c:49
PWR_CTRL_CHARGING
@ PWR_CTRL_CHARGING
power converter is in charging mode
Definition pwrctrl_typedef.h:136
PWR_CTRL_DISCHARGING
@ PWR_CTRL_DISCHARGING
power converter is in discharging mode
Definition pwrctrl_typedef.h:137
ADC1_IsConversionComplete
static bool ADC1_IsConversionComplete(enum ADC_CHANNEL channel)
This inline function returns the status of conversion.This function is used to determine if conversio...
Definition adc1.h:223
ADC1_SoftwareTriggerEnable
static void ADC1_SoftwareTriggerEnable(void)
This inline function sets software common trigger.
Definition adc1.h:134
ADC1_ConversionResultGet
static uint16_t ADC1_ConversionResultGet(enum ADC_CHANNEL channel)
Returns the conversion value for the channel selected.
Definition adc1.h:178
DPD_TP31_SetHigh
#define DPD_TP31_SetHigh()
Sets the RC14 GPIO Pin which has a custom name of DPD_TP31 to High.
Definition pins.h:155
DPD_TP31_SetLow
#define DPD_TP31_SetLow()
Sets the RC14 GPIO Pin which has a custom name of DPD_TP31 to Low.
Definition pins.h:164
SMPS_2P2Z_T::maxOutput
uint16_t maxOutput
Definition smps_control.h:174
SMPS_2P2Z_T::KfactorCoeffsB
uint16_t KfactorCoeffsB
Definition smps_control.h:176
AVERAGING_s
Definition pwrctrl_common.h:18
AVERAGING_s::Accumulator
uint32_t Accumulator
Definition pwrctrl_common.h:19
AVERAGING_s::AverageValue
uint16_t AverageValue
Definition pwrctrl_common.h:22
AVERAGING_s::Counter
uint16_t Counter
Definition pwrctrl_common.h:20
SWITCH_NODE_s::ControlPhase_P2S_Target
uint16_t ControlPhase_P2S_Target
Control phase value from control loop in degrees.
Definition pwrctrl_typedef.h:41
SWITCH_NODE_s::ControlPeriod
uint16_t ControlPeriod
Control period value from control loop.
Definition pwrctrl_typedef.h:37
SWITCH_NODE_s::ControlPhase_P2S_Degreex10
uint16_t ControlPhase_P2S_Degreex10
Control phase value from control loop in 10 x degree, integer.
Definition pwrctrl_typedef.h:40
SWITCH_NODE_s::DeadTimeHigh
uint16_t DeadTimeHigh
Deadtime High settings for PWM.
Definition pwrctrl_typedef.h:42
SWITCH_NODE_s::ControlDutyCycle
uint16_t ControlDutyCycle
Control Duty Cycle calculation based on Control Period.
Definition pwrctrl_typedef.h:38
SWITCH_NODE_s::DeadTimeLow
uint16_t DeadTimeLow
Deadtime High settings for PWM.
Definition pwrctrl_typedef.h:43
SWITCH_NODE_s::LowPowerSlowMode
uint16_t LowPowerSlowMode
future development
Definition pwrctrl_typedef.h:46
SWITCH_NODE_s::ControlPhase
uint16_t ControlPhase
Control phase value from control loop.
Definition pwrctrl_typedef.h:39
FEEDBACK_SETTINGS_s::VPriVoltage
uint16_t VPriVoltage
Data value for input voltage.
Definition pwrctrl_typedef.h:59
FEEDBACK_SETTINGS_s::ISecAverageRectified
uint16_t ISecAverageRectified
Data value for average secondary current rectified.
Definition pwrctrl_typedef.h:64
FEEDBACK_SETTINGS_s::ISensePrimary
uint16_t ISensePrimary
Data value for primary current as measured with CT.
Definition pwrctrl_typedef.h:61
FEEDBACK_SETTINGS_s::VSecVoltage
uint16_t VSecVoltage
Data value for output voltage.
Definition pwrctrl_typedef.h:60
FEEDBACK_SETTINGS_s::SecPower
int16_t SecPower
Data value for Secondary power (Watt)
Definition pwrctrl_typedef.h:65
FEEDBACK_SETTINGS_s::ISecAverage
uint16_t ISecAverage
Data value for average secondary current as measured with isolated current sensor.
Definition pwrctrl_typedef.h:63
FEEDBACK_SETTINGS_s::ISecSensorOffset
uint16_t ISecSensorOffset
Offset of the secondary current sensor.
Definition pwrctrl_typedef.h:68
FEEDBACK_SETTINGS_s::ISenseSecondary
uint16_t ISenseSecondary
Data value for secondary current as measured with CT.
Definition pwrctrl_typedef.h:62
FEEDBACK_SETTINGS_s::VRail_5V
uint16_t VRail_5V
Data value for 5V auxiliary rail.
Definition pwrctrl_typedef.h:67
FEEDBACK_SETTINGS_s::Temperature
uint16_t Temperature
Data value for temperature.
Definition pwrctrl_typedef.h:66
STATUS_FLAGS_s::Running
unsigned Running
Bit 0: Power converter is running.
Definition pwrctrl_typedef.h:82
CONTROLLER_s::Output
uint16_t Output
controller output
Definition pwrctrl_typedef.h:122
CONTROLLER_s::Enable
bool Enable
Enable control loop.
Definition pwrctrl_typedef.h:124
CONTROLLER_s::Reference
int16_t Reference
actual reference
Definition pwrctrl_typedef.h:120
CONTROLLER_s::Feedback
uint16_t Feedback
coming
Definition pwrctrl_typedef.h:121
CONTROLLER_s::AgcFactor
int16_t AgcFactor
Adaptive gain control.
Definition pwrctrl_typedef.h:123
POWER_CONTROL_s::ILoop
CONTROLLER_t ILoop
structure for current controller data
Definition pwrctrl_typedef.h:177
POWER_CONTROL_s::Pwm
SWITCH_NODE_t Pwm
Switch node settings.
Definition pwrctrl_typedef.h:171
POWER_CONTROL_s::PLoop
CONTROLLER_t PLoop
structure for power controller data
Definition pwrctrl_typedef.h:179
POWER_CONTROL_s::VLoop
CONTROLLER_t VLoop
structure for voltage controller data
Definition pwrctrl_typedef.h:178
POWER_CONTROL_s::Data
FEEDBACK_SETTINGS_t Data
Feedback channel settings.
Definition pwrctrl_typedef.h:172
POWER_CONTROL_s::PowerDirection
PWR_CTRL_CHARGE_STATE_t PowerDirection
defines if the power converter is in charging or discharging mode
Definition pwrctrl_typedef.h:180
POWER_CONTROL_s::Status
STATUS_FLAGS_t Status
Power Supply status flags.
Definition pwrctrl_typedef.h:168