| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- /*
- * File: PMSM_Controller_data.c
- *
- * Code generated for Simulink model 'PMSM_Controller'.
- *
- * Model version : 1.1529
- * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
- * C/C++ source code generated on : Tue Aug 2 19:43:20 2022
- *
- * Target selection: ert.tlc
- * Embedded hardware selection: ARM Compatible->ARM Cortex-M
- * Code generation objectives:
- * 1. Execution efficiency
- * 2. RAM efficiency
- * Validation result: Not run
- */
- #include "PMSM_Controller.h"
- /* Block parameters (default storage) */
- P rtP = {
- /* Variable: cf_Fw_Kb
- * Referenced by: '<S66>/Constant5'
- */
- 102,
- /* Variable: cf_Fw_Ki
- * Referenced by: '<S66>/Constant2'
- */
- 512,
- /* Variable: cf_idKp
- * Referenced by: '<S85>/Constant3'
- */
- 17877,
- /* Variable: cf_iqKp
- * Referenced by: '<S85>/Constant7'
- */
- 19765,
- /* Variable: cf_nKp
- * Referenced by: '<S79>/Constant4'
- */
- 154,
- /* Variable: V_modulation
- * Referenced by:
- * '<S42>/Constant'
- * '<S85>/Constant2'
- * '<S66>/Constant3'
- */
- 15565,
- /* Variable: cf_idKb
- * Referenced by: '<S85>/Constant6'
- */
- 81,
- /* Variable: cf_idKi
- * Referenced by: '<S85>/Constant4'
- */
- 81,
- /* Variable: cf_iqKb
- * Referenced by: '<S85>/Constant1'
- */
- 73,
- /* Variable: cf_iqKi
- * Referenced by: '<S85>/Constant8'
- */
- 73,
- /* Variable: cf_nKb
- * Referenced by: '<S79>/Constant11'
- */
- 147,
- /* Variable: cf_nKi
- * Referenced by: '<S79>/Constant1'
- */
- 147,
- /* Variable: f_adc_curr_ceof
- * Referenced by: '<S43>/Constant'
- */
- 1543,
- /* Variable: cf_lastIqGain
- * Referenced by: '<S62>/Gain'
- */
- 16384,
- /* Variable: i_hall_offset
- * Referenced by: '<S22>/Constant2'
- */
- -480,
- /* Variable: i_dqMax
- * Referenced by:
- * '<S68>/Constant1'
- * '<S68>/Constant2'
- * '<S68>/Constant3'
- * '<S68>/Constant5'
- * '<S79>/Constant6'
- */
- 4800,
- /* Variable: id_fieldWeakMax
- * Referenced by: '<S66>/Constant6'
- */
- -1600,
- /* Variable: dz_OpenStepVol
- * Referenced by:
- * '<S111>/Constant1'
- * '<S111>/Constant5'
- */
- 1280,
- /* Variable: f_lpf_idq
- * Referenced by: '<S39>/Constant'
- */
- 26214U,
- /* Variable: f_lpf_vdq
- * Referenced by: '<S68>/Constant'
- */
- 655U,
- /* Variable: i_pwm_count
- * Referenced by: '<S53>/Constant1'
- */
- 3000U,
- /* Variable: n_polePairs
- * Referenced by: '<S29>/polePairs'
- */
- 4U
- };
- /* Constant parameters (default storage) */
- const ConstP rtConstP = {
- /* Pooled Parameter (Expression: r_sin_M1)
- * Referenced by:
- * '<S49>/r_sin_M1'
- * '<S74>/r_sin_M1'
- */
- { 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406, 3686,
- 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924, 7182,
- 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860, 10087,
- 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176, 12365,
- 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044, 14189,
- 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396, 15491,
- 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182, 16225,
- 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384, 16382, 16374, 16362,
- 16344, 16322, 16294, 16262, 16225, 16182, 16135, 16083, 16026, 15964, 15897,
- 15826, 15749, 15668, 15582, 15491, 15396, 15296, 15191, 15082, 14968, 14849,
- 14726, 14598, 14466, 14330, 14189, 14044, 13894, 13741, 13583, 13421, 13255,
- 13085, 12911, 12733, 12551, 12365, 12176, 11982, 11786, 11585, 11381, 11174,
- 10963, 10749, 10531, 10311, 10087, 9860, 9630, 9397, 9162, 8923, 8682, 8438,
- 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402, 6138, 5872, 5604, 5334, 5063,
- 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845, 2563, 2280, 1997, 1713, 1428,
- 1143, 857, 572, 286, 0, -286, -572, -857, -1143, -1428, -1713, -1997, -2280,
- -2563, -2845, -3126, -3406, -3686, -3964, -4240, -4516, -4790, -5063, -5334,
- -5604, -5872, -6138, -6402, -6664, -6924, -7182, -7438, -7692, -7943, -8192,
- -8438, -8682, -8923, -9162, -9397, -9630, -9860, -10087, -10311, -10531,
- -10749, -10963, -11174, -11381, -11585, -11786, -11982, -12176, -12365,
- -12551, -12733, -12911, -13085, -13255, -13421, -13583, -13741, -13894,
- -14044, -14189, -14330, -14466, -14598, -14726, -14849, -14968, -15082,
- -15191, -15296, -15396, -15491, -15582, -15668, -15749, -15826, -15897,
- -15964, -16026, -16083, -16135, -16182, -16225, -16262, -16294, -16322,
- -16344, -16362, -16374, -16382, -16384, -16382, -16374, -16362, -16344,
- -16322, -16294, -16262, -16225, -16182, -16135, -16083, -16026, -15964,
- -15897, -15826, -15749, -15668, -15582, -15491, -15396, -15296, -15191,
- -15082, -14968, -14849, -14726, -14598, -14466, -14330, -14189, -14044,
- -13894, -13741, -13583, -13421, -13255, -13085, -12911, -12733, -12551,
- -12365, -12176, -11982, -11786, -11585, -11381, -11174, -10963, -10749,
- -10531, -10311, -10087, -9860, -9630, -9397, -9162, -8923, -8682, -8438,
- -8192, -7943, -7692, -7438, -7182, -6924, -6664, -6402, -6138, -5872, -5604,
- -5334, -5063, -4790, -4516, -4240, -3964, -3686, -3406, -3126, -2845, -2563,
- -2280, -1997, -1713, -1428, -1143, -857, -572, -286, 0 },
- /* Pooled Parameter (Expression: r_cos_M1)
- * Referenced by:
- * '<S49>/r_cos_M1'
- * '<S74>/r_cos_M1'
- */
- { 16384, 16382, 16374, 16362, 16344, 16322, 16294, 16262, 16225, 16182, 16135,
- 16083, 16026, 15964, 15897, 15826, 15749, 15668, 15582, 15491, 15396, 15296,
- 15191, 15082, 14968, 14849, 14726, 14598, 14466, 14330, 14189, 14044, 13894,
- 13741, 13583, 13421, 13255, 13085, 12911, 12733, 12551, 12365, 12176, 11982,
- 11786, 11585, 11381, 11174, 10963, 10749, 10531, 10311, 10087, 9860, 9630,
- 9397, 9162, 8923, 8682, 8438, 8192, 7943, 7692, 7438, 7182, 6924, 6664, 6402,
- 6138, 5872, 5604, 5334, 5063, 4790, 4516, 4240, 3964, 3686, 3406, 3126, 2845,
- 2563, 2280, 1997, 1713, 1428, 1143, 857, 572, 286, 0, -286, -572, -857,
- -1143, -1428, -1713, -1997, -2280, -2563, -2845, -3126, -3406, -3686, -3964,
- -4240, -4516, -4790, -5063, -5334, -5604, -5872, -6138, -6402, -6664, -6924,
- -7182, -7438, -7692, -7943, -8192, -8438, -8682, -8923, -9162, -9397, -9630,
- -9860, -10087, -10311, -10531, -10749, -10963, -11174, -11381, -11585,
- -11786, -11982, -12176, -12365, -12551, -12733, -12911, -13085, -13255,
- -13421, -13583, -13741, -13894, -14044, -14189, -14330, -14466, -14598,
- -14726, -14849, -14968, -15082, -15191, -15296, -15396, -15491, -15582,
- -15668, -15749, -15826, -15897, -15964, -16026, -16083, -16135, -16182,
- -16225, -16262, -16294, -16322, -16344, -16362, -16374, -16382, -16384,
- -16382, -16374, -16362, -16344, -16322, -16294, -16262, -16225, -16182,
- -16135, -16083, -16026, -15964, -15897, -15826, -15749, -15668, -15582,
- -15491, -15396, -15296, -15191, -15082, -14968, -14849, -14726, -14598,
- -14466, -14330, -14189, -14044, -13894, -13741, -13583, -13421, -13255,
- -13085, -12911, -12733, -12551, -12365, -12176, -11982, -11786, -11585,
- -11381, -11174, -10963, -10749, -10531, -10311, -10087, -9860, -9630, -9397,
- -9162, -8923, -8682, -8438, -8192, -7943, -7692, -7438, -7182, -6924, -6664,
- -6402, -6138, -5872, -5604, -5334, -5063, -4790, -4516, -4240, -3964, -3686,
- -3406, -3126, -2845, -2563, -2280, -1997, -1713, -1428, -1143, -857, -572,
- -286, 0, 286, 572, 857, 1143, 1428, 1713, 1997, 2280, 2563, 2845, 3126, 3406,
- 3686, 3964, 4240, 4516, 4790, 5063, 5334, 5604, 5872, 6138, 6402, 6664, 6924,
- 7182, 7438, 7692, 7943, 8192, 8438, 8682, 8923, 9162, 9397, 9630, 9860,
- 10087, 10311, 10531, 10749, 10963, 11174, 11381, 11585, 11786, 11982, 12176,
- 12365, 12551, 12733, 12911, 13085, 13255, 13421, 13583, 13741, 13894, 14044,
- 14189, 14330, 14466, 14598, 14726, 14849, 14968, 15082, 15191, 15296, 15396,
- 15491, 15582, 15668, 15749, 15826, 15897, 15964, 16026, 16083, 16135, 16182,
- 16225, 16262, 16294, 16322, 16344, 16362, 16374, 16382, 16384 },
- /* Computed Parameter: vec_hallToPos_Value
- * Referenced by: '<S19>/vec_hallToPos'
- */
- { 7, 5, 1, 0, 3, 4, 2, 7 }
- };
- /*
- * File trailer for generated code.
- *
- * [EOF]
- */
|