SOC.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /*
  2. * File: SOC.h
  3. *
  4. * Code generated for Simulink model 'SOC'.
  5. *
  6. * Model version : 1.24
  7. * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
  8. * C/C++ source code generated on : Thu Aug 12 17:54:23 2021
  9. *
  10. * Target selection: ert.tlc
  11. * Embedded hardware selection: Intel->x86-64 (Windows64)
  12. * Code generation objectives: Unspecified
  13. * Validation result: Not run
  14. */
  15. #ifndef RTW_HEADER_SOC_h_
  16. #define RTW_HEADER_SOC_h_
  17. #include <math.h>
  18. #ifndef SOC_COMMON_INCLUDES_
  19. #define SOC_COMMON_INCLUDES_
  20. #include "rtwtypes.h"
  21. #endif /* SOC_COMMON_INCLUDES_ */
  22. #include "SOC_types.h"
  23. /* Block signals for model 'SOC' */
  24. typedef struct {
  25. uint16_T Switch; /* '<S5>/Switch' */
  26. uint16_T Divide; /* '<S5>/Divide' */
  27. uint16_T Merge; /* '<S2>/Merge' */
  28. uint16_T Merge1; /* '<S2>/Merge1' */
  29. } B_SOC_c_T;
  30. /* Block states (default storage) for model 'SOC' */
  31. typedef struct {
  32. real_T UnitDelay_DSTATE; /* '<S11>/Unit Delay' */
  33. real_T UnitDelay_DSTATE_c; /* '<S14>/Unit Delay' */
  34. real_T UnitDelay1_DSTATE[4]; /* '<S11>/Unit Delay1' */
  35. real_T UnitDelay_DSTATE_o; /* '<S12>/Unit Delay' */
  36. real_T UnitDelay_DSTATE_e; /* '<S23>/Unit Delay' */
  37. real_T UnitDelay1_DSTATE_j[4]; /* '<S12>/Unit Delay1' */
  38. real_T UnitDelay2_DSTATE; /* '<S12>/Unit Delay2' */
  39. real_T UnitDelay1_DSTATE_h; /* '<S23>/Unit Delay1' */
  40. real_T UnitDelay3_DSTATE[2]; /* '<S12>/Unit Delay3' */
  41. real_T UnitDelay2_DSTATE_k; /* '<S11>/Unit Delay2' */
  42. real_T UnitDelay1_DSTATE_l; /* '<S14>/Unit Delay1' */
  43. real_T UnitDelay3_DSTATE_g[2]; /* '<S11>/Unit Delay3' */
  44. real_T Divide_DWORK4; /* '<S17>/Divide' */
  45. real_T Divide_DWORK4_c; /* '<S26>/Divide' */
  46. int32_T UnitDelay1_DSTATE_b; /* '<S4>/Unit Delay1' */
  47. uint16_T UnitDelay_DSTATE_i; /* '<S33>/Unit Delay' */
  48. uint16_T UnitDelay_DSTATE_l; /* '<S45>/Unit Delay' */
  49. uint16_T UnitDelay_DSTATE_h; /* '<S43>/Unit Delay' */
  50. uint16_T UnitDelay7_DSTATE; /* '<S6>/Unit Delay7' */
  51. uint16_T UnitDelay3_DSTATE_l; /* '<S6>/Unit Delay3' */
  52. uint16_T UnitDelay6_DSTATE; /* '<S6>/Unit Delay6' */
  53. uint16_T UnitDelay4_DSTATE; /* '<S6>/Unit Delay4' */
  54. uint16_T UnitDelay3_DSTATE_p; /* '<S32>/Unit Delay3' */
  55. uint16_T UnitDelay1_DSTATE_o; /* '<S44>/Unit Delay1' */
  56. uint16_T UnitDelay1_DSTATE_i; /* '<S42>/Unit Delay1' */
  57. uint16_T UnitDelay_DSTATE_b; /* '<S41>/Unit Delay' */
  58. uint8_T UnitDelay_DSTATE_m; /* '<S38>/Unit Delay' */
  59. uint8_T UnitDelay1_DSTATE_a; /* '<S6>/Unit Delay1' */
  60. uint8_T UnitDelay2_DSTATE_d; /* '<S6>/Unit Delay2' */
  61. boolean_T UnitDelay_DSTATE_et; /* '<S1>/Unit Delay' */
  62. boolean_T UnitDelay1_DSTATE_c; /* '<S1>/Unit Delay1' */
  63. boolean_T UnitDelay_DSTATE_j; /* '<S6>/Unit Delay' */
  64. boolean_T UnitDelay5_DSTATE; /* '<S6>/Unit Delay5' */
  65. boolean_T UnitDelay_DSTATE_cu; /* '<S44>/Unit Delay' */
  66. boolean_T UnitDelay_DSTATE_iz; /* '<S42>/Unit Delay' */
  67. } DW_SOC_f_T;
  68. /* Real-time Model Data Structure */
  69. struct tag_RTM_SOC_T {
  70. const char_T **errorStatus;
  71. };
  72. typedef struct {
  73. B_SOC_c_T rtb;
  74. DW_SOC_f_T rtdw;
  75. RT_MODEL_SOC_T rtm;
  76. } MdlrefDW_SOC_T;
  77. /* Model reference registration function */
  78. extern void SOC_initialize(const char_T **rt_errorStatus, RT_MODEL_SOC_T *const
  79. SOC_M);
  80. extern void SOC_MATLABFunction(real_T rtu_x, real_T *rty_y);
  81. extern void SOC_Init(DW_SOC_f_T *localDW);
  82. extern void SOC(B_SOC_c_T *localB, DW_SOC_f_T *localDW);
  83. /* Exported data declaration */
  84. /* Declaration for custom storage class: ExportToFile */
  85. extern int16_T ihd_I_curr;
  86. /* 电池包电流; */
  87. extern uint16_T ihd_V_cellUAvrg;
  88. /* 电池单体电压平均; */
  89. extern uint16_T ihd_V_cellUMax;
  90. /* 电池单体电压最大; */
  91. extern uint16_T ihd_V_cellUMin;
  92. /* 电池单体电压最小; */
  93. extern uint8_T ihd_st_workStat;
  94. /* 电池工作状态; */
  95. extern uint32_T ihd_tm_parkTime;
  96. /* 驻车时间; */
  97. extern uint16_T socd_pct_ahSoc; /* '<S4>/Saturation' */
  98. /* 安时SOC; */
  99. extern uint16_T socd_pct_battSoc; /* '<S6>/Signal Conversion' */
  100. /* 电池真实SOC; */
  101. extern uint16_T socd_pct_battSocEi;
  102. /* 电池真实SOC 读取量; */
  103. extern uint16_T socd_pct_battSocEo; /* '<S6>/Signal Conversion1' */
  104. /* 电池真实SOC 写入量; */
  105. extern uint16_T socd_pct_bcuSoc; /* '<S6>/Signal Conversion2' */
  106. /* 电池显示SOC; */
  107. extern uint16_T socd_pct_bcuSocEi;
  108. /* 电池显示SOC读取量; */
  109. extern uint16_T socd_pct_bcuSocEo; /* '<S6>/Signal Conversion3' */
  110. /* 电池显示SOC写入量; */
  111. extern uint16_T sohd_pct_bcuSoh;
  112. /* 电池SOH; */
  113. /*-
  114. * These blocks were eliminated from the model due to optimizations:
  115. *
  116. * Block '<S18>/Display' : Unused code path elimination
  117. * Block '<S27>/Display' : Unused code path elimination
  118. * Block '<S4>/Scope' : Unused code path elimination
  119. */
  120. /*-
  121. * The generated code includes comments that allow you to trace directly
  122. * back to the appropriate location in the model. The basic format
  123. * is <system>/block_name, where system is the system number (uniquely
  124. * assigned by Simulink) and block_name is the name of the block.
  125. *
  126. * Use the MATLAB hilite_system command to trace the generated code back
  127. * to the model. For example,
  128. *
  129. * hilite_system('<S3>') - opens system 3
  130. * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
  131. *
  132. * Here is the system hierarchy for this model
  133. *
  134. * '<Root>' : 'SOC'
  135. * '<S1>' : 'SOC/SOC'
  136. * '<S2>' : 'SOC/SOC/EEcheck'
  137. * '<S3>' : 'SOC/SOC/EKF'
  138. * '<S4>' : 'SOC/SOC/EKF1'
  139. * '<S5>' : 'SOC/SOC/Inti_correct'
  140. * '<S6>' : 'SOC/SOC/bcusoc'
  141. * '<S7>' : 'SOC/SOC/estSOC'
  142. * '<S8>' : 'SOC/SOC/EEcheck/If Action Subsystem'
  143. * '<S9>' : 'SOC/SOC/EEcheck/If Action Subsystem1'
  144. * '<S10>' : 'SOC/SOC/EEcheck/Subsystem'
  145. * '<S11>' : 'SOC/SOC/EKF/EFKmax'
  146. * '<S12>' : 'SOC/SOC/EKF/EFKmin'
  147. * '<S13>' : 'SOC/SOC/EKF/EKF'
  148. * '<S14>' : 'SOC/SOC/EKF/EFKmax/初始'
  149. * '<S15>' : 'SOC/SOC/EKF/EFKmax/协方差更新'
  150. * '<S16>' : 'SOC/SOC/EKF/EFKmax/协方差计算'
  151. * '<S17>' : 'SOC/SOC/EKF/EFKmax/卡尔曼增益'
  152. * '<S18>' : 'SOC/SOC/EKF/EFKmax/状态修正'
  153. * '<S19>' : 'SOC/SOC/EKF/EFKmax/状态更新'
  154. * '<S20>' : 'SOC/SOC/EKF/EFKmax/电池参数'
  155. * '<S21>' : 'SOC/SOC/EKF/EFKmax/矩阵计算'
  156. * '<S22>' : 'SOC/SOC/EKF/EFKmax/矩阵计算/MATLAB Function'
  157. * '<S23>' : 'SOC/SOC/EKF/EFKmin/初始'
  158. * '<S24>' : 'SOC/SOC/EKF/EFKmin/协方差更新'
  159. * '<S25>' : 'SOC/SOC/EKF/EFKmin/协方差计算'
  160. * '<S26>' : 'SOC/SOC/EKF/EFKmin/卡尔曼增益'
  161. * '<S27>' : 'SOC/SOC/EKF/EFKmin/状态修正'
  162. * '<S28>' : 'SOC/SOC/EKF/EFKmin/状态更新'
  163. * '<S29>' : 'SOC/SOC/EKF/EFKmin/电池参数'
  164. * '<S30>' : 'SOC/SOC/EKF/EFKmin/矩阵计算'
  165. * '<S31>' : 'SOC/SOC/EKF/EFKmin/矩阵计算/MATLAB Function'
  166. * '<S32>' : 'SOC/SOC/bcusoc/SOCfit'
  167. * '<S33>' : 'SOC/SOC/bcusoc/keep'
  168. * '<S34>' : 'SOC/SOC/bcusoc/SOCfit/If Action Subsystem'
  169. * '<S35>' : 'SOC/SOC/bcusoc/SOCfit/If Action Subsystem1'
  170. * '<S36>' : 'SOC/SOC/bcusoc/SOCfit/If Action Subsystem2'
  171. * '<S37>' : 'SOC/SOC/estSOC/If Action Subsystem2'
  172. * '<S38>' : 'SOC/SOC/estSOC/Time++'
  173. * '<S39>' : 'SOC/SOC/estSOC/chrgCCV'
  174. * '<S40>' : 'SOC/SOC/estSOC/disChrgCCV'
  175. * '<S41>' : 'SOC/SOC/estSOC/chrgCCV/Subsystem'
  176. * '<S42>' : 'SOC/SOC/estSOC/chrgCCV/Subsystem2'
  177. * '<S43>' : 'SOC/SOC/estSOC/chrgCCV/keep'
  178. * '<S44>' : 'SOC/SOC/estSOC/disChrgCCV/Subsystem2'
  179. * '<S45>' : 'SOC/SOC/estSOC/disChrgCCV/keep'
  180. */
  181. #endif /* RTW_HEADER_SOC_h_ */
  182. /*
  183. * File trailer for generated code.
  184. *
  185. * [EOF]
  186. */