Bar Logo Dual Active Bridge Development Board (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
config.h
1
2#ifndef CONFIG_H
3#define CONFIG_H
4
5#include <xc.h> // include processor files - each processor file is guarded.
6#include <stdint.h> // include standard integer data types
7#include <stdbool.h> // include standard boolean data types
8#include <stddef.h> // include standard definition data types
9
10
14#define PERIOD_MODULATION_DEMO false
15#define DCDC400V_SYSTEM true
16#define DCDC800V_SYSTEM false
17
// end of group ~~~~~~~~~~~~~~~~~~~~
19
20
24#define MAXIMUM_SWITCHING_FREQUENCY (float)170.0e+3//230.0e+3 ///< Maximum Switching frequency in [Hz]
25#define MINIMUM_SWITCHING_FREQUENCY (float) 65.0e+3
26
27#define MINIMUM_DEADTIME (float)150e-9
28#define MAXIMUM_DEADTIME (float)500e-9
29#define MINIMUM_PHASESHIFTED_PULSE (float)300e-9//(float) 80e-9 ///< Minimum phase shifted pulse in seconds [sec]
30
31#define PRI_TO_SEC_PHASE_DEGREES_LIMIT 90u
32
33#if defined(PERIOD_MODULATION_DEMO) && (PERIOD_MODULATION_DEMO == true)
34#define PRI_TO_SEC_PHASE_TARGET 830u
35#define PERIODSTEP (2<<3)
36#define PHASETIMESTEP (1<<3)
37#endif
// end of group pwm-fundamentals ~~~~~~~~~~~~~~~~~~~~
39
40
44#define VPLOOP_ILOOP_EXE_RATIO (uint16_t)(10 / 2)
45#define AGC_MINIMUM_VIN_THRESHOLD 160u
46#define AGC_MINIMUM_ISEC_THRESHOLD 7
47#define AGC_MINIMUM_VIN_THRESHOLD_SEC 160u
// end of group ~~~~~~~~~~~~~~~~~~~~
49
50//------------------------------------------------------------------------------
51// fault related parameters
52//------------------------------------------------------------------------------
53// #defines for fault thresholds in human readable form (SI or derived SI units)
54
55// all fault parameters follow the same convention
56// for example, for ISEC_CT over current protection
57// if fault clear:
58// if ISEC_CT > ISEC_OC_THRES_TRIG_AMPS for longer than ISEC_OC_T_BLANK_TRIG_SEC
59// then set fault
60// if fault set:
61// if ISEC_CT <= ISEC_OC_THRES_CLEAR_AMPS for longer than ISEC_OC_T_BLANK_CLEAR_SEC
62// then clear fault
63// ISEC_OC_TICK_SEC is the rate at which the fault handler is invoked
64// it is required for the firmware to measure trigger and clear blanking times
65
66
70#define T_ADC_SAMPLE_SECS (float) (10.0e-6)
71
72#define IPRI_OC_THRES_TRIG_AMPS (float) (39.0)
73#define IPRI_OC_THRES_CLEAR_AMPS (float) (2.0)
74#define IPRI_OC_T_BLANK_TRIG_SEC (float) (50.0e-6)
75#define IPRI_OC_T_BLANK_CLEAR_SEC (float) (0.0)
76#define IPRI_OC_TICK_SEC (T_ADC_SAMPLE_SECS)
77
78#define IPRI_SC_THRES_TRIG_AMPS (float) (39.0)
// end of group ~~~~~~~~~~~~~~~~~~~~
80
81
85#define ISEC_OC_THRES_TRIG_AMPS (float) (49.0)
86#define ISEC_OC_THRES_CLEAR_AMPS (float) (2.0)
87#define ISEC_OC_T_BLANK_TRIG_SEC (float) (50.0e-6)
88#define ISEC_OC_T_BLANK_CLEAR_SEC (float) (0.0)
89#define ISEC_OC_TICK_SEC (T_ADC_SAMPLE_SECS)
90
91#define ISEC_SC_THRES_TRIG_AMPS (float) (49.0)
92#define ISEC_LOAD_STEP_CLAMPING_AMPS (float) (1.5)
// end of group ~~~~~~~~~~~~~~~~~~~~
94
95
99#if(DCDC400V_SYSTEM)
100 #define VPRI_OV_THRES_TRIG_VOLTS (float)(700.0)
101 #define VPRI_OV_THRES_CLEAR_VOLTS (float)(600.0)
102#elif(DCDC800V_SYSTEM)
103 #define VPRI_OV_THRES_TRIG_VOLTS (float)900.0
104 #define VPRI_OV_THRES_CLEAR_VOLTS (float)800.0
105#endif
106#define VPRI_OV_T_BLANK_TRIG_SEC (float) (0.0)
107#define VPRI_OV_T_BLANK_CLEAR_SEC (float) (0.0)
108#define VPRI_OV_TICK_SEC (T_ADC_SAMPLE_SECS)
109
110#if(DCDC400V_SYSTEM)
111 #define VPRI_UV_THRES_TRIG_VOLTS (float)(300.0)
112 #define VPRI_UV_THRES_CLEAR_VOLTS (float)(200.0)
113#elif(DCDC800V_SYSTEM)
114 #define VPRI_UV_THRES_TRIG_VOLTS (float)450.0
115 #define VPRI_UV_THRES_CLEAR_VOLTS (float)300.0
116#endif
117#define VPRI_UV_T_BLANK_TRIG_SEC (float) (0.0)
118#define VPRI_UV_T_BLANK_CLEAR_SEC (float) (0.0)
119#define VPRI_UV_TICK_SEC (T_ADC_SAMPLE_SECS)
// end of group ~~~~~~~~~~~~~~~~~~~~
121
122
126#if(DCDC400V_SYSTEM)
127#define VSEC_OV_THRES_TRIG_VOLTS (float)(500.0)
128#define VSEC_OV_THRES_CLEAR_VOLTS (float) (20.0)
129#elif(DCDC800V_SYSTEM)
130#define VSEC_OV_THRES_TRIG_VOLTS (float)950.0
131#define VSEC_OV_THRES_CLEAR_VOLTS (float) 20.0
132#endif
133#define VSEC_OV_T_BLANK_TRIG_SEC (float) (1.0e-3)
134#define VSEC_OV_T_BLANK_CLEAR_SEC (float) (10.0e-3)
135#define VSEC_OV_TICK_SEC (T_ADC_SAMPLE_SECS)
136
137#if(DCDC400V_SYSTEM)
138#define VSEC_UV_THRES_TRIG_VOLTS (float)(100.0)
139#define VSEC_UV_THRES_CLEAR_VOLTS (float) (50.0)
140#elif(DCDC800V_SYSTEM)
141#define VSEC_UV_THRES_TRIG_VOLTS (float)550.0
142#define VSEC_UV_THRES_CLEAR_VOLTS (float) 50.0
143#endif
144#define VSEC_UV_T_BLANK_TRIG_SEC (float) (0.0)
145#define VSEC_UV_T_BLANK_CLEAR_SEC (float) (0.0)
146#define VSEC_UV_TICK_SEC (T_ADC_SAMPLE_SECS)
147
148#define VSEC_LOAD_STEP_CLAMPING_VOLTS (float) (16)
149#define VPRIM_LOAD_STEP_CLAMPING_VOLTS (float) (16)
// end of group ~~~~~~~~~~~~~~~~~~~~
151
152
156#define VRAIL_5V_UV_THRES_TRIG_VOLTS (float) (3.5)
157#define VRAIL_5V_UV_THRES_CLEAR_VOLTS (float) (3.8)
158#define VRAIL_5V_UV_T_BLANK_TRIG_SEC (float) (50.0e-6)
159#define VRAIL_5V_UV_T_BLANK_CLEAR_SEC (float) (0.0)
160#define VRAIL_5V_UV_TICK_SEC (T_ADC_SAMPLE_SECS)
// end of group ~~~~~~~~~~~~~~~~~~~~
162
163
167#define TEMPERATURE_PBV_OFFSET_CELSIUS (40u)
168#define OTP_THRES_TRIG_CELCIUS (80u)
169#define OTP_THRES_CLEAR_CELCIUS (70u)
170#define FAULT_PERSISTENCE_COUNT_TEMP (4u)
171
172// Stabilize the temperature around 40 degrees C by varying
173// the fan speed
174#define NOMINAL_TEMPERATURE_THRESHOLD (float) (40.0) //< Degrees Celcius
175#define TEMPERATURE_HYSTERESIS (float) (1.0)
176
// end of group ~~~~~~~~~~~~~~~~~~~~
178
179
180//------------------------------------------------------------------------------
181// control (for debug only)
182//------------------------------------------------------------------------------
183
187#define DAC_DEBUG false
188#define OPEN_LOOP_POTI false
189#define OPEN_LOOP_PBV false
190
191#if((OPEN_LOOP_POTI == true) || (OPEN_LOOP_PBV == true))
192#define CURRENT_CALIBRATION false
193#else
194#define CURRENT_CALIBRATION true
195#endif
196#define VPRI_OPTOCOUPLER_POLARITY false
197
// end of group ~~~~~~~~~~~~~~~~~~~~
199
200//------------------------------------------------------------------------------
201// fault disables (for debug only)
202// during debug mode, Current calibration needs to be set to false
203//------------------------------------------------------------------------------
204#define FAULT_VPRI_OV true
205#define FAULT_VPRI_UV false
206#define FAULT_ISEC_OC true
207#define FAULT_IPRI_OC true
208#define FAULT_VSEC_OV true
209#define FAULT_PS_OTP true
210#define FAULT_SHORT_CCT true
211#define FAULT_VRAIL_5V true
212#define LOAD_DISCONNECT true
213//------------------------------------------------------------------------------
214
215#endif /* CONFIG_H */
216