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

Loading...
Searching...
No Matches
pwrctrl_typedef.h
1
7#ifndef DEV_PWRCTRL_TYPEDEF_H
8#define DEV_PWRCTRL_TYPEDEF_H
9
10#include "fault/fault_typedef.h"
11
12
18 enum PWR_CTRL_STATES_e
19{
20 PWRCTRL_STATE_INITIALIZE,
21 PWRCTRL_STATE_FAULT_DETECTION,
22 PWRCTRL_STATE_STANDBY,
23 PWRCTRL_STATE_SOFT_START,
24 PWRCTRL_STATE_ONLINE
25};
26typedef enum PWR_CTRL_STATES_e PWR_CTRL_STATE_t;
27
28
35 struct SWITCH_NODE_s
36{
37 uint16_t ControlPeriod;
38 uint16_t ControlDutyCycle;
39 uint16_t ControlPhase;
40 uint16_t ControlPhase_P2S_Degreex10;
41 uint16_t ControlPhase_P2S_Target;
42 uint16_t DeadTimeHigh;
43 uint16_t DeadTimeLow;
44 uint16_t PBVPeriodTarget;
45 uint16_t PBVControlPhaseTarget;
46 uint16_t LowPowerSlowMode;
47};
48typedef struct SWITCH_NODE_s SWITCH_NODE_t;
49
50
57 struct FEEDBACK_SETTINGS_s
58{
59 uint16_t VPriVoltage;
60 uint16_t VSecVoltage;
61 uint16_t ISensePrimary;
62 uint16_t ISenseSecondary;
63 uint16_t ISecAverage;
64 uint16_t ISecAverageRectified;
65 int16_t SecPower;
66 uint16_t Temperature;
67 uint16_t VRail_5V;
68 uint16_t ISecSensorOffset;
69};
70typedef struct FEEDBACK_SETTINGS_s FEEDBACK_SETTINGS_t;
71
72
79 struct STATUS_FLAGS_s {
80 union {
81 struct {
82 unsigned Running : 1;
83 unsigned FaultActive : 1;
84 unsigned notUsed : 13;
85 } __attribute__((packed)) bits;
86 uint16_t value;
87 };
88};
89typedef struct STATUS_FLAGS_s STATUS_FLAGS_t;
90
91
98 struct START_UP_RAMP_s
99{
100 uint16_t Counter;
101 uint16_t Delay;
102 uint16_t StepSize;
103 uint16_t* ptrReference;
104 uint16_t* ptrReferenceTarget;
105 bool RampComplete;
106};
107typedef struct START_UP_RAMP_s START_UP_RAMP_t;
108
109
110
118 struct CONTROLLER_s
119{
120 int16_t Reference;
121 uint16_t Feedback;
122 uint16_t Output;
123 int16_t AgcFactor;
124 bool Enable;
125};
126typedef struct CONTROLLER_s CONTROLLER_t;
127
128
134 enum PWR_CTRL_CHARGE_STATE_e
135{
136 PWR_CTRL_CHARGING,
137 PWR_CTRL_DISCHARGING
138};
139typedef enum PWR_CTRL_CHARGE_STATE_e PWR_CTRL_CHARGE_STATE_t;
140
141
148 struct PWR_CTRL_PROPERTIES_s
149{
150 uint16_t VSecReference;
151 uint16_t VPriReference;
152 int16_t IReference;
153 uint16_t PwrReference;
154
155 bool ChargingState;
156 bool Enable;
157
158};
159typedef struct PWR_CTRL_PROPERTIES_s PWR_CTRL_PROPERTIES_t;
160
161
166 struct POWER_CONTROL_s
167{
168 STATUS_FLAGS_t Status;
169 PWR_CTRL_STATE_t State;
170 PWR_CTRL_PROPERTIES_t Properties;
171 SWITCH_NODE_t Pwm;
172 FEEDBACK_SETTINGS_t Data;
173 FAULT_SETTINGS_t Fault;
174 START_UP_RAMP_t VRamp;
175 START_UP_RAMP_t IRamp;
176 START_UP_RAMP_t PRamp;
177 CONTROLLER_t ILoop;
178 CONTROLLER_t VLoop;
179 CONTROLLER_t PLoop;
180 PWR_CTRL_CHARGE_STATE_t PowerDirection;
181};
182typedef struct POWER_CONTROL_s POWER_CONTROL_t;
183
184#endif /* DEV_PWRCTRL_TYPEDEF_H */
185
__attribute__
void __attribute__((weak))
Definition adc1.c:569
fault_typedef.h
Contains fault data types.
PWR_CTRL_STATES_e
PWR_CTRL_STATES_e
Enumeration of power controller state machine states.
Definition pwrctrl_typedef.h:19
PWR_CTRL_CHARGE_STATE_e
PWR_CTRL_CHARGE_STATE_e
Enumeration of power controller charging state.
Definition pwrctrl_typedef.h:135
PWRCTRL_STATE_ONLINE
@ PWRCTRL_STATE_ONLINE
power converter control state #4: output is in regulation and power is OK (normal continuous operatio...
Definition pwrctrl_typedef.h:24
PWRCTRL_STATE_STANDBY
@ PWRCTRL_STATE_STANDBY
power converter control state #2: waiting for status bits allowing power supply to run
Definition pwrctrl_typedef.h:22
PWRCTRL_STATE_INITIALIZE
@ PWRCTRL_STATE_INITIALIZE
power converter control state #0: initializes object properties and clears status bits
Definition pwrctrl_typedef.h:20
PWRCTRL_STATE_SOFT_START
@ PWRCTRL_STATE_SOFT_START
power converter control state #3: performs soft-start sequence
Definition pwrctrl_typedef.h:23
PWRCTRL_STATE_FAULT_DETECTION
@ PWRCTRL_STATE_FAULT_DETECTION
power converter control state #1: checks if a fault occurs
Definition pwrctrl_typedef.h:21
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
FAULT_SETTINGS_s
Contains Fault settings.
Definition fault_typedef.h:40
SWITCH_NODE_s
Power converter switch-node specifications.
Definition pwrctrl_typedef.h:36
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::PBVPeriodTarget
uint16_t PBVPeriodTarget
Power Board Visualizer Set Control target.
Definition pwrctrl_typedef.h:44
SWITCH_NODE_s::ControlPhase
uint16_t ControlPhase
Control phase value from control loop.
Definition pwrctrl_typedef.h:39
SWITCH_NODE_s::PBVControlPhaseTarget
uint16_t PBVControlPhaseTarget
Power Board Visualizer Set Control phase.
Definition pwrctrl_typedef.h:45
FEEDBACK_SETTINGS_s
Publicly accessible data buffer of most recent runtime data values.
Definition pwrctrl_typedef.h:58
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
Power converter status flags.
Definition pwrctrl_typedef.h:79
STATUS_FLAGS_s::notUsed
unsigned notUsed
Bit 2 - 15: Not used.
Definition pwrctrl_typedef.h:84
STATUS_FLAGS_s::value
uint16_t value
Definition pwrctrl_typedef.h:86
STATUS_FLAGS_s::Running
unsigned Running
Bit 0: Power converter is running.
Definition pwrctrl_typedef.h:82
STATUS_FLAGS_s::FaultActive
unsigned FaultActive
Bit 1: Power converter fault is active.
Definition pwrctrl_typedef.h:83
START_UP_RAMP_s
Stores data related to the ramping up/down of the reference.
Definition pwrctrl_typedef.h:99
START_UP_RAMP_s::RampComplete
bool RampComplete
indicates when ramp-up is complete
Definition pwrctrl_typedef.h:105
START_UP_RAMP_s::Delay
uint16_t Delay
Soft-Start Period (POD, RAMP PERIOD, PGD, etc.)
Definition pwrctrl_typedef.h:101
START_UP_RAMP_s::ptrReferenceTarget
uint16_t * ptrReferenceTarget
pointer to the ramp-up reference target
Definition pwrctrl_typedef.h:104
START_UP_RAMP_s::ptrReference
uint16_t * ptrReference
pointer the reference variable
Definition pwrctrl_typedef.h:103
START_UP_RAMP_s::Counter
uint16_t Counter
Soft-Start Execution Counter. This setting is set/cleared by the device driver and is 'read only'.
Definition pwrctrl_typedef.h:100
START_UP_RAMP_s::StepSize
uint16_t StepSize
Size/value of one reference increment/decrement or this period.
Definition pwrctrl_typedef.h:102
CONTROLLER_s
Stores data related to the control loop properties.
Definition pwrctrl_typedef.h:119
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
PWR_CTRL_PROPERTIES_s
Collection of power control properties.
Definition pwrctrl_typedef.h:149
PWR_CTRL_PROPERTIES_s::PwrReference
uint16_t PwrReference
User power reference setting used to control the converter controller.
Definition pwrctrl_typedef.h:153
PWR_CTRL_PROPERTIES_s::Enable
bool Enable
Control Flag: When set, enables the converter triggering a startup sequence; When cleared,...
Definition pwrctrl_typedef.h:156
PWR_CTRL_PROPERTIES_s::IReference
int16_t IReference
User current reference setting used to control the converter controller.
Definition pwrctrl_typedef.h:152
PWR_CTRL_PROPERTIES_s::VPriReference
uint16_t VPriReference
User primary-voltage port reference setting used to control the power converter output voltage in boo...
Definition pwrctrl_typedef.h:151
PWR_CTRL_PROPERTIES_s::VSecReference
uint16_t VSecReference
User secondary-voltage port reference setting used to control the power converter output voltage in b...
Definition pwrctrl_typedef.h:150
PWR_CTRL_PROPERTIES_s::ChargingState
bool ChargingState
Control Flag: When set, enables PWM output while keeping control loop disabled; Skips closed loop ram...
Definition pwrctrl_typedef.h:155
POWER_CONTROL_s
Power control API structure.
Definition pwrctrl_typedef.h:167
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::Properties
PWR_CTRL_PROPERTIES_t Properties
Power Control properties
Definition pwrctrl_typedef.h:170
POWER_CONTROL_s::VLoop
CONTROLLER_t VLoop
structure for voltage controller data
Definition pwrctrl_typedef.h:178
POWER_CONTROL_s::PRamp
START_UP_RAMP_t PRamp
Power ramp-up settings.
Definition pwrctrl_typedef.h:176
POWER_CONTROL_s::State
PWR_CTRL_STATE_t State
Power Control State ID.
Definition pwrctrl_typedef.h:169
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
POWER_CONTROL_s::Fault
FAULT_SETTINGS_t Fault
Fault flags and settings.
Definition pwrctrl_typedef.h:173
POWER_CONTROL_s::VRamp
START_UP_RAMP_t VRamp
Voltage ramp-up settings.
Definition pwrctrl_typedef.h:174
POWER_CONTROL_s::IRamp
START_UP_RAMP_t IRamp
Current ramp-up settings.
Definition pwrctrl_typedef.h:175