PMSM_Controller_data.c 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. * File: PMSM_Controller_data.c
  3. *
  4. * Code generated for Simulink model 'PMSM_Controller'.
  5. *
  6. * Model version : 1.1529
  7. * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
  8. * C/C++ source code generated on : Tue Aug 2 19:43:20 2022
  9. *
  10. * Target selection: ert.tlc
  11. * Embedded hardware selection: ARM Compatible->ARM Cortex-M
  12. * Code generation objectives:
  13. * 1. Execution efficiency
  14. * 2. RAM efficiency
  15. * Validation result: Not run
  16. */
  17. #include "PMSM_Controller.h"
  18. /* Block parameters (default storage) */
  19. P rtP = {
  20. /* Variable: cf_Fw_Kb
  21. * Referenced by: '<S66>/Constant5'
  22. */
  23. 102,
  24. /* Variable: cf_Fw_Ki
  25. * Referenced by: '<S66>/Constant2'
  26. */
  27. 512,
  28. /* Variable: cf_idKp
  29. * Referenced by: '<S85>/Constant3'
  30. */
  31. 17877,
  32. /* Variable: cf_iqKp
  33. * Referenced by: '<S85>/Constant7'
  34. */
  35. 19765,
  36. /* Variable: cf_nKp
  37. * Referenced by: '<S79>/Constant4'
  38. */
  39. 154,
  40. /* Variable: V_modulation
  41. * Referenced by:
  42. * '<S42>/Constant'
  43. * '<S85>/Constant2'
  44. * '<S66>/Constant3'
  45. */
  46. 15565,
  47. /* Variable: cf_idKb
  48. * Referenced by: '<S85>/Constant6'
  49. */
  50. 81,
  51. /* Variable: cf_idKi
  52. * Referenced by: '<S85>/Constant4'
  53. */
  54. 81,
  55. /* Variable: cf_iqKb
  56. * Referenced by: '<S85>/Constant1'
  57. */
  58. 73,
  59. /* Variable: cf_iqKi
  60. * Referenced by: '<S85>/Constant8'
  61. */
  62. 73,
  63. /* Variable: cf_nKb
  64. * Referenced by: '<S79>/Constant11'
  65. */
  66. 147,
  67. /* Variable: cf_nKi
  68. * Referenced by: '<S79>/Constant1'
  69. */
  70. 147,
  71. /* Variable: f_adc_curr_ceof
  72. * Referenced by: '<S43>/Constant'
  73. */
  74. 1543,
  75. /* Variable: cf_lastIqGain
  76. * Referenced by: '<S62>/Gain'
  77. */
  78. 16384,
  79. /* Variable: i_hall_offset
  80. * Referenced by: '<S22>/Constant2'
  81. */
  82. -480,
  83. /* Variable: i_dqMax
  84. * Referenced by:
  85. * '<S68>/Constant1'
  86. * '<S68>/Constant2'
  87. * '<S68>/Constant3'
  88. * '<S68>/Constant5'
  89. * '<S79>/Constant6'
  90. */
  91. 4800,
  92. /* Variable: id_fieldWeakMax
  93. * Referenced by: '<S66>/Constant6'
  94. */
  95. -1600,
  96. /* Variable: dz_OpenStepVol
  97. * Referenced by:
  98. * '<S111>/Constant1'
  99. * '<S111>/Constant5'
  100. */
  101. 1280,
  102. /* Variable: f_lpf_idq
  103. * Referenced by: '<S39>/Constant'
  104. */
  105. 26214U,
  106. /* Variable: f_lpf_vdq
  107. * Referenced by: '<S68>/Constant'
  108. */
  109. 655U,
  110. /* Variable: i_pwm_count
  111. * Referenced by: '<S53>/Constant1'
  112. */
  113. 3000U,
  114. /* Variable: n_polePairs
  115. * Referenced by: '<S29>/polePairs'
  116. */
  117. 4U
  118. };
  119. /* Constant parameters (default storage) */
  120. const ConstP rtConstP = {
  121. /* Pooled Parameter (Expression: r_sin_M1)
  122. * Referenced by:
  123. * '<S49>/r_sin_M1'
  124. * '<S74>/r_sin_M1'
  125. */
  126. { 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406, 3686,
  127. 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924, 7182,
  128. 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860, 10087,
  129. 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176, 12365,
  130. 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044, 14189,
  131. 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396, 15491,
  132. 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182, 16225,
  133. 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384, 16382, 16374, 16362,
  134. 16344, 16322, 16294, 16262, 16225, 16182, 16135, 16083, 16026, 15964, 15897,
  135. 15826, 15749, 15668, 15582, 15491, 15396, 15296, 15191, 15082, 14968, 14849,
  136. 14726, 14598, 14466, 14330, 14189, 14044, 13894, 13741, 13583, 13421, 13255,
  137. 13085, 12911, 12733, 12551, 12365, 12176, 11982, 11786, 11585, 11381, 11174,
  138. 10963, 10749, 10531, 10311, 10087, 9860, 9630, 9397, 9162, 8923, 8682, 8438,
  139. 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402, 6138, 5872, 5604, 5334, 5063,
  140. 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845, 2563, 2280, 1997, 1713, 1428,
  141. 1143, 857, 572, 286, 0, -286, -572, -857, -1143, -1428, -1713, -1997, -2280,
  142. -2563, -2845, -3126, -3406, -3686, -3964, -4240, -4516, -4790, -5063, -5334,
  143. -5604, -5872, -6138, -6402, -6664, -6924, -7182, -7438, -7692, -7943, -8192,
  144. -8438, -8682, -8923, -9162, -9397, -9630, -9860, -10087, -10311, -10531,
  145. -10749, -10963, -11174, -11381, -11585, -11786, -11982, -12176, -12365,
  146. -12551, -12733, -12911, -13085, -13255, -13421, -13583, -13741, -13894,
  147. -14044, -14189, -14330, -14466, -14598, -14726, -14849, -14968, -15082,
  148. -15191, -15296, -15396, -15491, -15582, -15668, -15749, -15826, -15897,
  149. -15964, -16026, -16083, -16135, -16182, -16225, -16262, -16294, -16322,
  150. -16344, -16362, -16374, -16382, -16384, -16382, -16374, -16362, -16344,
  151. -16322, -16294, -16262, -16225, -16182, -16135, -16083, -16026, -15964,
  152. -15897, -15826, -15749, -15668, -15582, -15491, -15396, -15296, -15191,
  153. -15082, -14968, -14849, -14726, -14598, -14466, -14330, -14189, -14044,
  154. -13894, -13741, -13583, -13421, -13255, -13085, -12911, -12733, -12551,
  155. -12365, -12176, -11982, -11786, -11585, -11381, -11174, -10963, -10749,
  156. -10531, -10311, -10087, -9860, -9630, -9397, -9162, -8923, -8682, -8438,
  157. -8192, -7943, -7692, -7438, -7182, -6924, -6664, -6402, -6138, -5872, -5604,
  158. -5334, -5063, -4790, -4516, -4240, -3964, -3686, -3406, -3126, -2845, -2563,
  159. -2280, -1997, -1713, -1428, -1143, -857, -572, -286, 0 },
  160. /* Pooled Parameter (Expression: r_cos_M1)
  161. * Referenced by:
  162. * '<S49>/r_cos_M1'
  163. * '<S74>/r_cos_M1'
  164. */
  165. { 16384, 16382, 16374, 16362, 16344, 16322, 16294, 16262, 16225, 16182, 16135,
  166. 16083, 16026, 15964, 15897, 15826, 15749, 15668, 15582, 15491, 15396, 15296,
  167. 15191, 15082, 14968, 14849, 14726, 14598, 14466, 14330, 14189, 14044, 13894,
  168. 13741, 13583, 13421, 13255, 13085, 12911, 12733, 12551, 12365, 12176, 11982,
  169. 11786, 11585, 11381, 11174, 10963, 10749, 10531, 10311, 10087, 9860, 9630,
  170. 9397, 9162, 8923, 8682, 8438, 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402,
  171. 6138, 5872, 5604, 5334, 5063, 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845,
  172. 2563, 2280, 1997, 1713, 1428, 1143, 857, 572, 286, 0, -286, -572, -857,
  173. -1143, -1428, -1713, -1997, -2280, -2563, -2845, -3126, -3406, -3686, -3964,
  174. -4240, -4516, -4790, -5063, -5334, -5604, -5872, -6138, -6402, -6664, -6924,
  175. -7182, -7438, -7692, -7943, -8192, -8438, -8682, -8923, -9162, -9397, -9630,
  176. -9860, -10087, -10311, -10531, -10749, -10963, -11174, -11381, -11585,
  177. -11786, -11982, -12176, -12365, -12551, -12733, -12911, -13085, -13255,
  178. -13421, -13583, -13741, -13894, -14044, -14189, -14330, -14466, -14598,
  179. -14726, -14849, -14968, -15082, -15191, -15296, -15396, -15491, -15582,
  180. -15668, -15749, -15826, -15897, -15964, -16026, -16083, -16135, -16182,
  181. -16225, -16262, -16294, -16322, -16344, -16362, -16374, -16382, -16384,
  182. -16382, -16374, -16362, -16344, -16322, -16294, -16262, -16225, -16182,
  183. -16135, -16083, -16026, -15964, -15897, -15826, -15749, -15668, -15582,
  184. -15491, -15396, -15296, -15191, -15082, -14968, -14849, -14726, -14598,
  185. -14466, -14330, -14189, -14044, -13894, -13741, -13583, -13421, -13255,
  186. -13085, -12911, -12733, -12551, -12365, -12176, -11982, -11786, -11585,
  187. -11381, -11174, -10963, -10749, -10531, -10311, -10087, -9860, -9630, -9397,
  188. -9162, -8923, -8682, -8438, -8192, -7943, -7692, -7438, -7182, -6924, -6664,
  189. -6402, -6138, -5872, -5604, -5334, -5063, -4790, -4516, -4240, -3964, -3686,
  190. -3406, -3126, -2845, -2563, -2280, -1997, -1713, -1428, -1143, -857, -572,
  191. -286, 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406,
  192. 3686, 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924,
  193. 7182, 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860,
  194. 10087, 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176,
  195. 12365, 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044,
  196. 14189, 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396,
  197. 15491, 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182,
  198. 16225, 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384 },
  199. /* Computed Parameter: vec_hallToPos_Value
  200. * Referenced by: '<S19>/vec_hallToPos'
  201. */
  202. { 7, 5, 1, 0, 3, 4, 2, 7 }
  203. };
  204. /*
  205. * File trailer for generated code.
  206. *
  207. * [EOF]
  208. */