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