1/*
2 * File: PMSM_Controller_data.c
3 *
4 * Code generated for Simulink model 'PMSM_Controller'.
5 *
6 * Model version : 1.1460
7 * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
8 * C/C++ source code generated on : Sat May 28 14:25:47 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
18#include "PMSM_Controller.h"
19
20/* Block parameters (default storage) */
21P rtP = {
22 /* Variable: n_hall_count_ps
23 * Referenced by:
24 * '<S14>/z_maxCntRst'
25 * '<S20>/z_counter'
26 * '<S20>/UnitDelay2'
27 */
28 1000000U,
29
30 /* Variable: n_polePairs
31 * Referenced by: '<S20>/cf_speedCoef1'
32 */
33 4U,
34
35 /* Variable: cf_Fw_Kb
36 * Referenced by: '<S74>/Constant5'
37 */
38 102,
39
40 /* Variable: cf_Fw_Ki
41 * Referenced by: '<S74>/Constant2'
42 */
43 512,
44
45 /* Variable: cf_TrqLimKb
46 * Referenced by: '<S88>/Constant2'
47 */
48 1024,
49
50 /* Variable: cf_TrqLimKi
51 * Referenced by: '<S88>/Constant1'
52 */
53 9,
54
55 /* Variable: cf_TrqLimKp
56 * Referenced by: '<S88>/Constant4'
57 */
58 154,
59
60 /* Variable: cf_idKp
61 * Referenced by: '<S95>/Constant3'
62 */
63 17877,
64
65 /* Variable: cf_iqKp
66 * Referenced by: '<S95>/Constant7'
67 */
68 19765,
69
70 /* Variable: cf_nKp
71 * Referenced by: '<S87>/Constant4'
72 */
73 154,
74
75 /* Variable: V_modulation
76 * Referenced by:
77 * '<S51>/Constant'
78 * '<S95>/Constant2'
79 * '<S74>/Constant3'
80 */
81 15565,
82
83 /* Variable: cf_idKb
84 * Referenced by: '<S95>/Constant6'
85 */
86 81,
87
88 /* Variable: cf_idKi
89 * Referenced by: '<S95>/Constant4'
90 */
91 81,
92
93 /* Variable: cf_iqKb
94 * Referenced by: '<S95>/Constant1'
95 */
96 73,
97
98 /* Variable: cf_iqKi
99 * Referenced by: '<S95>/Constant8'
100 */
101 73,
102
103 /* Variable: cf_nKb
104 * Referenced by: '<S87>/Constant11'
105 */
106 147,
107
108 /* Variable: cf_nKi
109 * Referenced by: '<S87>/Constant1'
110 */
111 147,
112
113 /* Variable: f_adc_curr_ceof
114 * Referenced by: '<S52>/Constant'
115 */
116 1543,
117
118 /* Variable: cf_lastIqGain
119 * Referenced by: '<S70>/Gain'
120 */
121 16384,
122
123 /* Variable: i_hall_offset
124 * Referenced by: '<S15>/Constant2'
125 */
126 -480,
127
128 /* Variable: i_dqMax
129 * Referenced by:
130 * '<S76>/Constant1'
131 * '<S76>/Constant2'
132 * '<S76>/Constant3'
133 * '<S76>/Constant5'
134 * '<S87>/Constant6'
135 */
136 4800,
137
138 /* Variable: id_fieldWeakMax
139 * Referenced by: '<S74>/Constant6'
140 */
141 -1600,
142
143 /* Variable: dz_OpenStepVol
144 * Referenced by: '<S29>/Constant5'
145 */
146 1280,
147
148 /* Variable: f_lpf_idq
149 * Referenced by: '<S48>/Constant'
150 */
151 26214U,
152
153 /* Variable: f_lpf_vdq
154 * Referenced by: '<S76>/Constant'
155 */
156 655U,
157
158 /* Variable: i_pwm_count
159 * Referenced by: '<S61>/Constant1'
160 */
161 3000U
162};
163
164/* Constant parameters (default storage) */
165const ConstP rtConstP = {
166 /* Pooled Parameter (Expression: r_sin_M1)
167 * Referenced by:
168 * '<S58>/r_sin_M1'
169 * '<S82>/r_sin_M1'
170 */
171 { 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406, 3686,
172 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924, 7182,
173 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860, 10087,
174 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176, 12365,
175 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044, 14189,
176 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396, 15491,
177 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182, 16225,
178 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384, 16382, 16374, 16362,
179 16344, 16322, 16294, 16262, 16225, 16182, 16135, 16083, 16026, 15964, 15897,
180 15826, 15749, 15668, 15582, 15491, 15396, 15296, 15191, 15082, 14968, 14849,
181 14726, 14598, 14466, 14330, 14189, 14044, 13894, 13741, 13583, 13421, 13255,
182 13085, 12911, 12733, 12551, 12365, 12176, 11982, 11786, 11585, 11381, 11174,
183 10963, 10749, 10531, 10311, 10087, 9860, 9630, 9397, 9162, 8923, 8682, 8438,
184 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402, 6138, 5872, 5604, 5334, 5063,
185 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845, 2563, 2280, 1997, 1713, 1428,
186 1143, 857, 572, 286, 0, -286, -572, -857, -1143, -1428, -1713, -1997, -2280,
187 -2563, -2845, -3126, -3406, -3686, -3964, -4240, -4516, -4790, -5063, -5334,
188 -5604, -5872, -6138, -6402, -6664, -6924, -7182, -7438, -7692, -7943, -8192,
189 -8438, -8682, -8923, -9162, -9397, -9630, -9860, -10087, -10311, -10531,
190 -10749, -10963, -11174, -11381, -11585, -11786, -11982, -12176, -12365,
191 -12551, -12733, -12911, -13085, -13255, -13421, -13583, -13741, -13894,
192 -14044, -14189, -14330, -14466, -14598, -14726, -14849, -14968, -15082,
193 -15191, -15296, -15396, -15491, -15582, -15668, -15749, -15826, -15897,
194 -15964, -16026, -16083, -16135, -16182, -16225, -16262, -16294, -16322,
195 -16344, -16362, -16374, -16382, -16384, -16382, -16374, -16362, -16344,
196 -16322, -16294, -16262, -16225, -16182, -16135, -16083, -16026, -15964,
197 -15897, -15826, -15749, -15668, -15582, -15491, -15396, -15296, -15191,
198 -15082, -14968, -14849, -14726, -14598, -14466, -14330, -14189, -14044,
199 -13894, -13741, -13583, -13421, -13255, -13085, -12911, -12733, -12551,
200 -12365, -12176, -11982, -11786, -11585, -11381, -11174, -10963, -10749,
201 -10531, -10311, -10087, -9860, -9630, -9397, -9162, -8923, -8682, -8438,
202 -8192, -7943, -7692, -7438, -7182, -6924, -6664, -6402, -6138, -5872, -5604,
203 -5334, -5063, -4790, -4516, -4240, -3964, -3686, -3406, -3126, -2845, -2563,
204 -2280, -1997, -1713, -1428, -1143, -857, -572, -286, 0 },
205
206 /* Pooled Parameter (Expression: r_cos_M1)
207 * Referenced by:
208 * '<S58>/r_cos_M1'
209 * '<S82>/r_cos_M1'
210 */
211 { 16384, 16382, 16374, 16362, 16344, 16322, 16294, 16262, 16225, 16182, 16135,
212 16083, 16026, 15964, 15897, 15826, 15749, 15668, 15582, 15491, 15396, 15296,
213 15191, 15082, 14968, 14849, 14726, 14598, 14466, 14330, 14189, 14044, 13894,
214 13741, 13583, 13421, 13255, 13085, 12911, 12733, 12551, 12365, 12176, 11982,
215 11786, 11585, 11381, 11174, 10963, 10749, 10531, 10311, 10087, 9860, 9630,
216 9397, 9162, 8923, 8682, 8438, 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402,
217 6138, 5872, 5604, 5334, 5063, 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845,
218 2563, 2280, 1997, 1713, 1428, 1143, 857, 572, 286, 0, -286, -572, -857,
219 -1143, -1428, -1713, -1997, -2280, -2563, -2845, -3126, -3406, -3686, -3964,
220 -4240, -4516, -4790, -5063, -5334, -5604, -5872, -6138, -6402, -6664, -6924,
221 -7182, -7438, -7692, -7943, -8192, -8438, -8682, -8923, -9162, -9397, -9630,
222 -9860, -10087, -10311, -10531, -10749, -10963, -11174, -11381, -11585,
223 -11786, -11982, -12176, -12365, -12551, -12733, -12911, -13085, -13255,
224 -13421, -13583, -13741, -13894, -14044, -14189, -14330, -14466, -14598,
225 -14726, -14849, -14968, -15082, -15191, -15296, -15396, -15491, -15582,
226 -15668, -15749, -15826, -15897, -15964, -16026, -16083, -16135, -16182,
227 -16225, -16262, -16294, -16322, -16344, -16362, -16374, -16382, -16384,
228 -16382, -16374, -16362, -16344, -16322, -16294, -16262, -16225, -16182,
229 -16135, -16083, -16026, -15964, -15897, -15826, -15749, -15668, -15582,
230 -15491, -15396, -15296, -15191, -15082, -14968, -14849, -14726, -14598,
231 -14466, -14330, -14189, -14044, -13894, -13741, -13583, -13421, -13255,
232 -13085, -12911, -12733, -12551, -12365, -12176, -11982, -11786, -11585,
233 -11381, -11174, -10963, -10749, -10531, -10311, -10087, -9860, -9630, -9397,
234 -9162, -8923, -8682, -8438, -8192, -7943, -7692, -7438, -7182, -6924, -6664,
235 -6402, -6138, -5872, -5604, -5334, -5063, -4790, -4516, -4240, -3964, -3686,
236 -3406, -3126, -2845, -2563, -2280, -1997, -1713, -1428, -1143, -857, -572,
237 -286, 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406,
238 3686, 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924,
239 7182, 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860,
240 10087, 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176,
241 12365, 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044,
242 14189, 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396,
243 15491, 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182,
244 16225, 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384 },
245
246 /* Computed Parameter: vec_hallToPos_Value
247 * Referenced by: '<S11>/vec_hallToPos'
248 */
249 { 7, 5, 1, 0, 3, 4, 2, 7 }
250};
251
252/*
253 * File trailer for generated code.
254 *
255 * [EOF]
256 */
257