diff --git a/01_Matlab/01_Libraries/01_Controller/BLDC_controller_Lib.slx b/01_Matlab/01_Libraries/01_Controller/BLDC_controller_Lib.slx
index ebfbe60..44acdce 100644
Binary files a/01_Matlab/01_Libraries/01_Controller/BLDC_controller_Lib.slx and b/01_Matlab/01_Libraries/01_Controller/BLDC_controller_Lib.slx differ
diff --git a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.c b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.c
index 14c361c..b0095fc 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.c
+++ b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.c
@@ -7,9 +7,9 @@
*
* Code generated for Simulink model 'BLDC_controller'.
*
- * Model version : 1.879
+ * Model version : 1.883
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -273,7 +273,7 @@ void BLDC_controller_step(RT_MODEL *const rtM)
/* End of Outputs for SubSystem: '/Counter_Hold_and_Error_Calculation' */
} else {
- if (rtDW->UnitDelay1_DSTATE < 1500) {
+ if (rtDW->UnitDelay1_DSTATE < rtP->z_maxCntRst) {
/* Switch: '/Switch2' incorporates:
* UnitDelay: '/UnitDelay1'
*/
@@ -282,7 +282,7 @@ void BLDC_controller_step(RT_MODEL *const rtM)
/* Switch: '/Switch2' incorporates:
* Constant: '/Constant1'
*/
- rtb_Abs2 = 1500;
+ rtb_Abs2 = rtP->z_maxCntRst;
}
rtb_Abs2++;
@@ -303,7 +303,7 @@ void BLDC_controller_step(RT_MODEL *const rtM)
* RelationalOperator: '/Relational Operator5'
* Sum: '/Sum1'
*/
- if ((rtb_Abs2 > 1500) || (rtDW->Switch2 != rtDW->UnitDelay1)) {
+ if ((rtb_Abs2 > rtP->z_maxCntRst) || (rtDW->Switch2 != rtDW->UnitDelay1)) {
rtb_Sum2 = 0;
} else {
rtb_Sum2 = rtP->cf_speedCoef * rtDW->Switch2 / rtDW->z_counterRawPrev;
@@ -324,14 +324,14 @@ void BLDC_controller_step(RT_MODEL *const rtM)
rtb_Sum2 = ((100 - rtP->cf_speedFilt) * rtDW->UnitDelay2_DSTATE + rtb_Sum2 *
rtP->cf_speedFilt) / 100;
- /* Abs: '/Abs5' */
+ /* Abs: '/Abs5' */
if (rtb_Sum2 < 0) {
rtb_Abs5 = -rtb_Sum2;
} else {
rtb_Abs5 = rtb_Sum2;
}
- /* End of Abs: '/Abs5' */
+ /* End of Abs: '/Abs5' */
/* Relay: '/n_commDeacv' */
if (rtb_Abs5 >= rtP->n_commDeacvHi) {
@@ -419,9 +419,12 @@ void BLDC_controller_step(RT_MODEL *const rtM)
/* Switch: '/Switch_PhaAdv' incorporates:
* Constant: '/a_elecPeriod1'
+ * Constant: '/n_motPhaAdvEna'
+ * Logic: '/Logical Operator2'
* Outport: '/a_elecAngle'
+ * RelationalOperator: '/Relational Operator4'
*/
- if (rtP->b_phaAdvEna) {
+ if (rtP->b_phaAdvEna && (rtb_Abs5 > rtP->n_motPhaAdvEna)) {
/* PreLookup: '/r_phaAdvDC_XA' */
rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtb_Abs1,
rtP->r_phaAdvDC_XA[0], (uint32_T)rtP->r_phaAdvDC_XA[1] -
@@ -662,6 +665,7 @@ void BLDC_controller_step(RT_MODEL *const rtM)
/* Model initialize function */
void BLDC_controller_initialize(RT_MODEL *const rtM)
{
+ P *rtP = ((P *) rtM->defaultParam);
DW *rtDW = ((DW *) rtM->dwork);
/* Start for Atomic SubSystem: '/BLDC_controller' */
@@ -672,14 +676,14 @@ void BLDC_controller_initialize(RT_MODEL *const rtM)
/* SystemInitialize for Atomic SubSystem: '/BLDC_controller' */
/* InitializeConditions for UnitDelay: '/UnitDelay1' */
- rtDW->UnitDelay1_DSTATE = 1500;
+ rtDW->UnitDelay1_DSTATE = rtP->z_maxCntRst;
/* SystemInitialize for IfAction SubSystem: '/Counter_Hold_and_Error_Calculation' */
/* InitializeConditions for UnitDelay: '/z_counter2' */
- rtDW->z_counter2_DSTATE = 1500;
+ rtDW->z_counter2_DSTATE = rtP->z_maxCntRst;
/* SystemInitialize for Outport: '/z_counter' */
- rtDW->z_counterRawPrev = 1500;
+ rtDW->z_counterRawPrev = rtP->z_maxCntRst;
/* End of SystemInitialize for SubSystem: '/Counter_Hold_and_Error_Calculation' */
/* End of SystemInitialize for SubSystem: '/BLDC_controller' */
diff --git a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.h b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.h
index 6e0c616..bb52673 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.h
+++ b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller.h
@@ -7,9 +7,9 @@
*
* Code generated for Simulink model 'BLDC_controller'.
*
- * Model version : 1.879
+ * Model version : 1.883
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -146,6 +146,9 @@ struct P_ {
int32_T n_commDeacvHi; /* Variable: n_commDeacvHi
* Referenced by: '/n_commDeacv'
*/
+ int32_T n_motPhaAdvEna; /* Variable: n_motPhaAdvEna
+ * Referenced by: '/n_motPhaAdvEna'
+ */
int32_T r_commDCDeacv; /* Variable: r_commDCDeacv
* Referenced by: '/r_commDCDeacv'
*/
@@ -161,6 +164,14 @@ struct P_ {
int16_T dz_counterLo; /* Variable: dz_counterLo
* Referenced by: '/dz_counter'
*/
+ int16_T z_maxCntRst; /* Variable: z_maxCntRst
+ * Referenced by:
+ * '/z_counter'
+ * '/z_counter2'
+ * '/z_maxCntRst'
+ * '/Constant1'
+ * '/UnitDelay1'
+ */
uint8_T z_ctrlTypSel; /* Variable: z_ctrlTypSel
* Referenced by: '/z_ctrlTypSel1'
*/
diff --git a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller_data.c b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller_data.c
index ecb95dc..a740573 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller_data.c
+++ b/01_Matlab/BLDC_controller_ert_rtw/BLDC_controller_data.c
@@ -7,9 +7,9 @@
*
* Code generated for Simulink model 'BLDC_controller'.
*
- * Model version : 1.879
+ * Model version : 1.883
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
diff --git a/01_Matlab/BLDC_controller_ert_rtw/buildInfo.mat b/01_Matlab/BLDC_controller_ert_rtw/buildInfo.mat
index 902c929..9d57764 100644
Binary files a/01_Matlab/BLDC_controller_ert_rtw/buildInfo.mat and b/01_Matlab/BLDC_controller_ert_rtw/buildInfo.mat differ
diff --git a/01_Matlab/BLDC_controller_ert_rtw/codeInfo.mat b/01_Matlab/BLDC_controller_ert_rtw/codeInfo.mat
index 1a6f103..f5baec5 100644
Binary files a/01_Matlab/BLDC_controller_ert_rtw/codeInfo.mat and b/01_Matlab/BLDC_controller_ert_rtw/codeInfo.mat differ
diff --git a/01_Matlab/BLDC_controller_ert_rtw/codedescriptor.dmr b/01_Matlab/BLDC_controller_ert_rtw/codedescriptor.dmr
index 10b9402..df1c910 100644
Binary files a/01_Matlab/BLDC_controller_ert_rtw/codedescriptor.dmr and b/01_Matlab/BLDC_controller_ert_rtw/codedescriptor.dmr differ
diff --git a/01_Matlab/BLDC_controller_ert_rtw/ert_main.c b/01_Matlab/BLDC_controller_ert_rtw/ert_main.c
index 56553ed..53be1bf 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/ert_main.c
+++ b/01_Matlab/BLDC_controller_ert_rtw/ert_main.c
@@ -7,9 +7,9 @@
*
* Code generated for Simulink model 'BLDC_controller'.
*
- * Model version : 1.879
+ * Model version : 1.883
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -49,6 +49,11 @@ static P rtP = {
*/
30,
+ /* Variable: n_motPhaAdvEna
+ * Referenced by: '/n_motPhaAdvEna'
+ */
+ 400,
+
/* Variable: r_commDCDeacv
* Referenced by: '/r_commDCDeacv'
*/
@@ -74,6 +79,16 @@ static P rtP = {
*/
20,
+ /* Variable: z_maxCntRst
+ * Referenced by:
+ * '/z_counter'
+ * '/z_counter2'
+ * '/z_maxCntRst'
+ * '/Constant1'
+ * '/UnitDelay1'
+ */
+ 1500,
+
/* Variable: z_ctrlTypSel
* Referenced by: '/z_ctrlTypSel1'
*/
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_c.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_c.html
index 7f7a71b..0caaeb3 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_c.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_c.html
@@ -21,9 +21,9 @@
7 *
8 * Code generated for Simulink model 'BLDC_controller'.
9 *
- 10 * Model version : 1.879
+ 10 * Model version : 1.883
11 * Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- 12 * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ 12 * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
13 *
14 * Target selection: ert.tlc
15 * Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -287,7 +287,7 @@
273
274 /* End of Outputs for SubSystem: '<S14>/Counter_Hold_and_Error_Calculation' */
275 } else {
- 276 if (rtDW->UnitDelay1_DSTATE < 1500) {
+ 276 if (rtDW->UnitDelay1_DSTATE < rtP->z_maxCntRst) {
277 /* Switch: '<S17>/Switch2' incorporates:
278 * UnitDelay: '<S17>/UnitDelay1'
279 */
@@ -296,7 +296,7 @@
282 /* Switch: '<S17>/Switch2' incorporates:
283 * Constant: '<S17>/Constant1'
284 */
- 285 rtb_Abs2 = 1500;
+ 285 rtb_Abs2 = rtP->z_maxCntRst;
286 }
287
288 rtb_Abs2++;
@@ -317,7 +317,7 @@
303 * RelationalOperator: '<S16>/Relational Operator5'
304 * Sum: '<S14>/Sum1'
305 */
- 306 if ((rtb_Abs2 > 1500) || (rtDW->Switch2 != rtDW->UnitDelay1)) {
+ 306 if ((rtb_Abs2 > rtP->z_maxCntRst) || (rtDW->Switch2 != rtDW->UnitDelay1)) {
307 rtb_Sum2 = 0;
308 } else {
309 rtb_Sum2 = rtP->cf_speedCoef * rtDW->Switch2 / rtDW->z_counterRawPrev;
@@ -338,14 +338,14 @@
324 rtb_Sum2 = ((100 - rtP->cf_speedFilt) * rtDW->UnitDelay2_DSTATE + rtb_Sum2 *
325 rtP->cf_speedFilt) / 100;
326
- 327 /* Abs: '<S14>/Abs5' */
+ 327 /* Abs: '<S16>/Abs5' */
328 if (rtb_Sum2 < 0) {
329 rtb_Abs5 = -rtb_Sum2;
330 } else {
331 rtb_Abs5 = rtb_Sum2;
332 }
333
- 334 /* End of Abs: '<S14>/Abs5' */
+ 334 /* End of Abs: '<S16>/Abs5' */
335
336 /* Relay: '<S14>/n_commDeacv' */
337 if (rtb_Abs5 >= rtP->n_commDeacvHi) {
@@ -433,278 +433,282 @@
419
420 /* Switch: '<S8>/Switch_PhaAdv' incorporates:
421 * Constant: '<S8>/a_elecPeriod1'
- 422 * Outport: '<Root>/a_elecAngle'
- 423 */
- 424 if (rtP->b_phaAdvEna) {
- 425 /* PreLookup: '<S8>/r_phaAdvDC_XA' */
- 426 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtb_Abs1,
- 427 rtP->r_phaAdvDC_XA[0], (uint32_T)rtP->r_phaAdvDC_XA[1] -
- 428 rtP->r_phaAdvDC_XA[0], 10U, &rtb_r_phaAdvDC_XA_o2);
- 429
- 430 /* Interpolation_n-D: '<S8>/a_phaAdv_M2' */
- 431 rtb_Abs2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 432 rtb_r_phaAdvDC_XA_o2, rtP->a_phaAdv_M1);
- 433
- 434 /* Sum: '<S8>/Sum3' incorporates:
- 435 * Outport: '<Root>/a_elecAngle'
- 436 * Product: '<S8>/Product2'
- 437 */
- 438 rtb_Abs5 = (int16_T)(rtb_Abs2 * rtDW->Switch2) + rtY->a_elecAngle;
- 439
- 440 /* Math: '<S8>/Math Function' */
- 441 rtDW->Switch_PhaAdv = rtb_Abs5 - div_nde_s32_floor(rtb_Abs5, 360) * 360;
- 442 } else {
- 443 rtDW->Switch_PhaAdv = rtY->a_elecAngle;
- 444 }
- 445
- 446 /* End of Switch: '<S8>/Switch_PhaAdv' */
- 447 /* End of Outputs for SubSystem: '<S2>/F02_Electrical_Angle_Calculation' */
- 448 }
- 449
- 450 /* End of If: '<S2>/If1' */
- 451
- 452 /* SwitchCase: '<S9>/Switch Case' incorporates:
- 453 * Constant: '<S7>/z_ctrlTypSel1'
- 454 */
- 455 switch (rtP->z_ctrlTypSel) {
- 456 case 1:
- 457 /* Outputs for IfAction SubSystem: '<S9>/F03_01_Pure_Trapezoidal_Method' incorporates:
- 458 * ActionPort: '<S18>/Action Port'
- 459 */
- 460 /* PreLookup: '<S18>/a_trapElecAngle_XA' */
- 461 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 60U,
- 462 6U, &rtb_r_phaAdvDC_XA_o2);
- 463
- 464 /* Interpolation_n-D: '<S18>/r_trapPhaA_M1' */
- 465 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 466 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaA_M1_Table);
- 467
- 468 /* Interpolation_n-D: '<S18>/r_trapPhaB_M1' */
- 469 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 470 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaB_M1_Table);
- 471
- 472 /* Interpolation_n-D: '<S18>/r_trapPhaC_M1' */
- 473 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 474 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaC_M1_Table);
- 475
- 476 /* End of Outputs for SubSystem: '<S9>/F03_01_Pure_Trapezoidal_Method' */
- 477 break;
+ 422 * Constant: '<S8>/n_motPhaAdvEna'
+ 423 * Logic: '<S8>/Logical Operator2'
+ 424 * Outport: '<Root>/a_elecAngle'
+ 425 * RelationalOperator: '<S8>/Relational Operator4'
+ 426 */
+ 427 if (rtP->b_phaAdvEna && (rtb_Abs5 > rtP->n_motPhaAdvEna)) {
+ 428 /* PreLookup: '<S8>/r_phaAdvDC_XA' */
+ 429 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtb_Abs1,
+ 430 rtP->r_phaAdvDC_XA[0], (uint32_T)rtP->r_phaAdvDC_XA[1] -
+ 431 rtP->r_phaAdvDC_XA[0], 10U, &rtb_r_phaAdvDC_XA_o2);
+ 432
+ 433 /* Interpolation_n-D: '<S8>/a_phaAdv_M2' */
+ 434 rtb_Abs2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 435 rtb_r_phaAdvDC_XA_o2, rtP->a_phaAdv_M1);
+ 436
+ 437 /* Sum: '<S8>/Sum3' incorporates:
+ 438 * Outport: '<Root>/a_elecAngle'
+ 439 * Product: '<S8>/Product2'
+ 440 */
+ 441 rtb_Abs5 = (int16_T)(rtb_Abs2 * rtDW->Switch2) + rtY->a_elecAngle;
+ 442
+ 443 /* Math: '<S8>/Math Function' */
+ 444 rtDW->Switch_PhaAdv = rtb_Abs5 - div_nde_s32_floor(rtb_Abs5, 360) * 360;
+ 445 } else {
+ 446 rtDW->Switch_PhaAdv = rtY->a_elecAngle;
+ 447 }
+ 448
+ 449 /* End of Switch: '<S8>/Switch_PhaAdv' */
+ 450 /* End of Outputs for SubSystem: '<S2>/F02_Electrical_Angle_Calculation' */
+ 451 }
+ 452
+ 453 /* End of If: '<S2>/If1' */
+ 454
+ 455 /* SwitchCase: '<S9>/Switch Case' incorporates:
+ 456 * Constant: '<S7>/z_ctrlTypSel1'
+ 457 */
+ 458 switch (rtP->z_ctrlTypSel) {
+ 459 case 1:
+ 460 /* Outputs for IfAction SubSystem: '<S9>/F03_01_Pure_Trapezoidal_Method' incorporates:
+ 461 * ActionPort: '<S18>/Action Port'
+ 462 */
+ 463 /* PreLookup: '<S18>/a_trapElecAngle_XA' */
+ 464 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 60U,
+ 465 6U, &rtb_r_phaAdvDC_XA_o2);
+ 466
+ 467 /* Interpolation_n-D: '<S18>/r_trapPhaA_M1' */
+ 468 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 469 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaA_M1_Table);
+ 470
+ 471 /* Interpolation_n-D: '<S18>/r_trapPhaB_M1' */
+ 472 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 473 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaB_M1_Table);
+ 474
+ 475 /* Interpolation_n-D: '<S18>/r_trapPhaC_M1' */
+ 476 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 477 rtb_r_phaAdvDC_XA_o2, rtConstP.r_trapPhaC_M1_Table);
478
- 479 case 2:
- 480 /* Outputs for IfAction SubSystem: '<S9>/F03_02_Sinusoidal_Method' incorporates:
- 481 * ActionPort: '<S19>/Action Port'
- 482 */
- 483 /* PreLookup: '<S19>/a_sinElecAngle_XA' */
- 484 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 10U,
- 485 36U, &rtb_r_phaAdvDC_XA_o2);
- 486
- 487 /* Interpolation_n-D: '<S19>/r_sinPhaA_M1' */
- 488 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 489 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaA_M1_Table);
- 490
- 491 /* Interpolation_n-D: '<S19>/r_sinPhaB_M1' */
- 492 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 493 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaB_M1_Table);
- 494
- 495 /* Interpolation_n-D: '<S19>/r_sinPhaC_M1' */
- 496 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 497 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaC_M1_Table);
- 498
- 499 /* End of Outputs for SubSystem: '<S9>/F03_02_Sinusoidal_Method' */
- 500 break;
+ 479 /* End of Outputs for SubSystem: '<S9>/F03_01_Pure_Trapezoidal_Method' */
+ 480 break;
+ 481
+ 482 case 2:
+ 483 /* Outputs for IfAction SubSystem: '<S9>/F03_02_Sinusoidal_Method' incorporates:
+ 484 * ActionPort: '<S19>/Action Port'
+ 485 */
+ 486 /* PreLookup: '<S19>/a_sinElecAngle_XA' */
+ 487 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 10U,
+ 488 36U, &rtb_r_phaAdvDC_XA_o2);
+ 489
+ 490 /* Interpolation_n-D: '<S19>/r_sinPhaA_M1' */
+ 491 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 492 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaA_M1_Table);
+ 493
+ 494 /* Interpolation_n-D: '<S19>/r_sinPhaB_M1' */
+ 495 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 496 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaB_M1_Table);
+ 497
+ 498 /* Interpolation_n-D: '<S19>/r_sinPhaC_M1' */
+ 499 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 500 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sinPhaC_M1_Table);
501
- 502 case 3:
- 503 /* Outputs for IfAction SubSystem: '<S9>/F03_03_Sinusoidal3rd_Method' incorporates:
- 504 * ActionPort: '<S20>/Action Port'
- 505 */
- 506 /* PreLookup: '<S20>/a_sinElecAngle_XA' */
- 507 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 10U,
- 508 36U, &rtb_r_phaAdvDC_XA_o2);
- 509
- 510 /* Interpolation_n-D: '<S20>/r_sin3PhaA_M1' */
- 511 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 512 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaA_M1_Table);
- 513
- 514 /* Interpolation_n-D: '<S20>/r_sin3PhaB_M1' */
- 515 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 516 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaB_M1_Table);
- 517
- 518 /* Interpolation_n-D: '<S20>/r_sin3PhaC_M1' */
- 519 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
- 520 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaC_M1_Table);
- 521
- 522 /* End of Outputs for SubSystem: '<S9>/F03_03_Sinusoidal3rd_Method' */
- 523 break;
- 524 }
- 525
- 526 /* End of SwitchCase: '<S9>/Switch Case' */
- 527
- 528 /* Signum: '<S14>/Sign' */
- 529 if (rtDW->Switch2 < 0) {
- 530 rtb_Sum2_h = -1;
- 531 } else {
- 532 rtb_Sum2_h = (int8_T)(rtDW->Switch2 > 0);
- 533 }
- 534
- 535 /* End of Signum: '<S14>/Sign' */
- 536
- 537 /* Signum: '<S14>/Sign1' incorporates:
- 538 * Inport: '<Root>/r_DC'
- 539 */
- 540 if (rtU->r_DC < 0) {
- 541 rtb_Abs5 = -1;
- 542 } else {
- 543 rtb_Abs5 = (rtU->r_DC > 0);
- 544 }
- 545
- 546 /* End of Signum: '<S14>/Sign1' */
- 547
- 548 /* Switch: '<S10>/Switch1' incorporates:
- 549 * Constant: '<S12>/vec_hallToPos'
- 550 * Constant: '<S14>/CTRL_COMM'
- 551 * Constant: '<S14>/r_commDCDeacv'
- 552 * Constant: '<S7>/z_ctrlTypSel1'
- 553 * Inport: '<Root>/r_DC'
- 554 * Logic: '<S14>/Logical Operator2'
- 555 * LookupNDDirect: '<S10>/z_commutMap_M1'
- 556 * Product: '<S10>/Divide2'
- 557 * Product: '<S10>/Divide4'
- 558 * RelationalOperator: '<S14>/Relational Operator1'
- 559 * RelationalOperator: '<S14>/Relational Operator3'
- 560 * RelationalOperator: '<S14>/Relational Operator4'
- 561 * Relay: '<S14>/dz_counter'
- 562 * Relay: '<S14>/n_commDeacv'
- 563 * Selector: '<S12>/Selector'
- 564 *
- 565 * About '<S10>/z_commutMap_M1':
- 566 * 2-dimensional Direct Look-Up returning a Column
- 567 */
- 568 if ((rtP->z_ctrlTypSel != 0) && (rtb_Abs1 > rtP->r_commDCDeacv) && (rtb_Sum2_h
- 569 == rtb_Abs5) && rtDW->n_commDeacv_Mode && (!rtDW->dz_counter_Mode)) {
- 570 rtb_Abs5 = rtU->r_DC * rtDW->Merge;
- 571 rtb_Switch1_idx_1 = rtU->r_DC * rtDW->Merge1;
- 572 rtb_Abs1 = rtU->r_DC * rtDW->Merge2;
- 573 } else {
- 574 if (rtConstP.vec_hallToPos_Value[rtb_Sum] > 5) {
- 575 /* LookupNDDirect: '<S10>/z_commutMap_M1'
- 576 *
- 577 * About '<S10>/z_commutMap_M1':
- 578 * 2-dimensional Direct Look-Up returning a Column
- 579 */
- 580 rtb_Sum2_h = 5;
- 581 } else if (rtConstP.vec_hallToPos_Value[rtb_Sum] < 0) {
- 582 /* LookupNDDirect: '<S10>/z_commutMap_M1'
- 583 *
- 584 * About '<S10>/z_commutMap_M1':
- 585 * 2-dimensional Direct Look-Up returning a Column
- 586 */
- 587 rtb_Sum2_h = 0;
- 588 } else {
- 589 /* LookupNDDirect: '<S10>/z_commutMap_M1' incorporates:
- 590 * Constant: '<S12>/vec_hallToPos'
- 591 * Selector: '<S12>/Selector'
- 592 *
- 593 * About '<S10>/z_commutMap_M1':
- 594 * 2-dimensional Direct Look-Up returning a Column
- 595 */
- 596 rtb_Sum2_h = rtConstP.vec_hallToPos_Value[rtb_Sum];
- 597 }
- 598
- 599 /* LookupNDDirect: '<S10>/z_commutMap_M1' incorporates:
- 600 * Constant: '<S12>/vec_hallToPos'
- 601 * Selector: '<S12>/Selector'
- 602 *
- 603 * About '<S10>/z_commutMap_M1':
- 604 * 2-dimensional Direct Look-Up returning a Column
- 605 */
- 606 rtb_Abs1 = rtb_Sum2_h * 3;
- 607 rtb_Abs5 = rtU->r_DC * rtConstP.z_commutMap_M1_table[rtb_Abs1];
- 608 rtb_Switch1_idx_1 = rtConstP.z_commutMap_M1_table[1 + rtb_Abs1] * rtU->r_DC;
- 609 rtb_Abs1 = rtConstP.z_commutMap_M1_table[2 + rtb_Abs1] * rtU->r_DC;
- 610 }
- 611
- 612 /* End of Switch: '<S10>/Switch1' */
- 613
- 614 /* Outport: '<Root>/DC_phaA' incorporates:
- 615 * Constant: '<S10>/Constant1'
- 616 * Product: '<S10>/Divide1'
- 617 */
- 618 rtY->DC_phaA = rtb_Abs5 / 1000;
- 619
- 620 /* Outport: '<Root>/DC_phaB' incorporates:
- 621 * Constant: '<S10>/Constant1'
- 622 * Product: '<S10>/Divide1'
- 623 */
- 624 rtY->DC_phaB = rtb_Switch1_idx_1 / 1000;
- 625
- 626 /* Update for UnitDelay: '<S11>/UnitDelay' incorporates:
- 627 * Inport: '<Root>/b_hallA '
- 628 */
- 629 rtDW->UnitDelay_DSTATE = rtU->b_hallA;
- 630
- 631 /* Update for UnitDelay: '<S11>/UnitDelay1' incorporates:
- 632 * Inport: '<Root>/b_hallB'
- 633 */
- 634 rtDW->UnitDelay1_DSTATE_i = rtU->b_hallB;
- 635
- 636 /* Update for UnitDelay: '<S11>/UnitDelay2' incorporates:
- 637 * Inport: '<Root>/b_hallC'
- 638 */
- 639 rtDW->UnitDelay2_DSTATE_h = rtU->b_hallC;
- 640
- 641 /* Update for UnitDelay: '<S17>/UnitDelay1' */
- 642 rtDW->UnitDelay1_DSTATE = rtb_Sum1_a;
+ 502 /* End of Outputs for SubSystem: '<S9>/F03_02_Sinusoidal_Method' */
+ 503 break;
+ 504
+ 505 case 3:
+ 506 /* Outputs for IfAction SubSystem: '<S9>/F03_03_Sinusoidal3rd_Method' incorporates:
+ 507 * ActionPort: '<S20>/Action Port'
+ 508 */
+ 509 /* PreLookup: '<S20>/a_sinElecAngle_XA' */
+ 510 rtb_BitwiseOperator = plook_u8s32u32n31_evenc_s(rtDW->Switch_PhaAdv, 0, 10U,
+ 511 36U, &rtb_r_phaAdvDC_XA_o2);
+ 512
+ 513 /* Interpolation_n-D: '<S20>/r_sin3PhaA_M1' */
+ 514 rtDW->Merge = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 515 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaA_M1_Table);
+ 516
+ 517 /* Interpolation_n-D: '<S20>/r_sin3PhaB_M1' */
+ 518 rtDW->Merge1 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 519 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaB_M1_Table);
+ 520
+ 521 /* Interpolation_n-D: '<S20>/r_sin3PhaC_M1' */
+ 522 rtDW->Merge2 = intrp1d_s16s32s32u8u32n31l_s(rtb_BitwiseOperator,
+ 523 rtb_r_phaAdvDC_XA_o2, rtConstP.r_sin3PhaC_M1_Table);
+ 524
+ 525 /* End of Outputs for SubSystem: '<S9>/F03_03_Sinusoidal3rd_Method' */
+ 526 break;
+ 527 }
+ 528
+ 529 /* End of SwitchCase: '<S9>/Switch Case' */
+ 530
+ 531 /* Signum: '<S14>/Sign' */
+ 532 if (rtDW->Switch2 < 0) {
+ 533 rtb_Sum2_h = -1;
+ 534 } else {
+ 535 rtb_Sum2_h = (int8_T)(rtDW->Switch2 > 0);
+ 536 }
+ 537
+ 538 /* End of Signum: '<S14>/Sign' */
+ 539
+ 540 /* Signum: '<S14>/Sign1' incorporates:
+ 541 * Inport: '<Root>/r_DC'
+ 542 */
+ 543 if (rtU->r_DC < 0) {
+ 544 rtb_Abs5 = -1;
+ 545 } else {
+ 546 rtb_Abs5 = (rtU->r_DC > 0);
+ 547 }
+ 548
+ 549 /* End of Signum: '<S14>/Sign1' */
+ 550
+ 551 /* Switch: '<S10>/Switch1' incorporates:
+ 552 * Constant: '<S12>/vec_hallToPos'
+ 553 * Constant: '<S14>/CTRL_COMM'
+ 554 * Constant: '<S14>/r_commDCDeacv'
+ 555 * Constant: '<S7>/z_ctrlTypSel1'
+ 556 * Inport: '<Root>/r_DC'
+ 557 * Logic: '<S14>/Logical Operator2'
+ 558 * LookupNDDirect: '<S10>/z_commutMap_M1'
+ 559 * Product: '<S10>/Divide2'
+ 560 * Product: '<S10>/Divide4'
+ 561 * RelationalOperator: '<S14>/Relational Operator1'
+ 562 * RelationalOperator: '<S14>/Relational Operator3'
+ 563 * RelationalOperator: '<S14>/Relational Operator4'
+ 564 * Relay: '<S14>/dz_counter'
+ 565 * Relay: '<S14>/n_commDeacv'
+ 566 * Selector: '<S12>/Selector'
+ 567 *
+ 568 * About '<S10>/z_commutMap_M1':
+ 569 * 2-dimensional Direct Look-Up returning a Column
+ 570 */
+ 571 if ((rtP->z_ctrlTypSel != 0) && (rtb_Abs1 > rtP->r_commDCDeacv) && (rtb_Sum2_h
+ 572 == rtb_Abs5) && rtDW->n_commDeacv_Mode && (!rtDW->dz_counter_Mode)) {
+ 573 rtb_Abs5 = rtU->r_DC * rtDW->Merge;
+ 574 rtb_Switch1_idx_1 = rtU->r_DC * rtDW->Merge1;
+ 575 rtb_Abs1 = rtU->r_DC * rtDW->Merge2;
+ 576 } else {
+ 577 if (rtConstP.vec_hallToPos_Value[rtb_Sum] > 5) {
+ 578 /* LookupNDDirect: '<S10>/z_commutMap_M1'
+ 579 *
+ 580 * About '<S10>/z_commutMap_M1':
+ 581 * 2-dimensional Direct Look-Up returning a Column
+ 582 */
+ 583 rtb_Sum2_h = 5;
+ 584 } else if (rtConstP.vec_hallToPos_Value[rtb_Sum] < 0) {
+ 585 /* LookupNDDirect: '<S10>/z_commutMap_M1'
+ 586 *
+ 587 * About '<S10>/z_commutMap_M1':
+ 588 * 2-dimensional Direct Look-Up returning a Column
+ 589 */
+ 590 rtb_Sum2_h = 0;
+ 591 } else {
+ 592 /* LookupNDDirect: '<S10>/z_commutMap_M1' incorporates:
+ 593 * Constant: '<S12>/vec_hallToPos'
+ 594 * Selector: '<S12>/Selector'
+ 595 *
+ 596 * About '<S10>/z_commutMap_M1':
+ 597 * 2-dimensional Direct Look-Up returning a Column
+ 598 */
+ 599 rtb_Sum2_h = rtConstP.vec_hallToPos_Value[rtb_Sum];
+ 600 }
+ 601
+ 602 /* LookupNDDirect: '<S10>/z_commutMap_M1' incorporates:
+ 603 * Constant: '<S12>/vec_hallToPos'
+ 604 * Selector: '<S12>/Selector'
+ 605 *
+ 606 * About '<S10>/z_commutMap_M1':
+ 607 * 2-dimensional Direct Look-Up returning a Column
+ 608 */
+ 609 rtb_Abs1 = rtb_Sum2_h * 3;
+ 610 rtb_Abs5 = rtU->r_DC * rtConstP.z_commutMap_M1_table[rtb_Abs1];
+ 611 rtb_Switch1_idx_1 = rtConstP.z_commutMap_M1_table[1 + rtb_Abs1] * rtU->r_DC;
+ 612 rtb_Abs1 = rtConstP.z_commutMap_M1_table[2 + rtb_Abs1] * rtU->r_DC;
+ 613 }
+ 614
+ 615 /* End of Switch: '<S10>/Switch1' */
+ 616
+ 617 /* Outport: '<Root>/DC_phaA' incorporates:
+ 618 * Constant: '<S10>/Constant1'
+ 619 * Product: '<S10>/Divide1'
+ 620 */
+ 621 rtY->DC_phaA = rtb_Abs5 / 1000;
+ 622
+ 623 /* Outport: '<Root>/DC_phaB' incorporates:
+ 624 * Constant: '<S10>/Constant1'
+ 625 * Product: '<S10>/Divide1'
+ 626 */
+ 627 rtY->DC_phaB = rtb_Switch1_idx_1 / 1000;
+ 628
+ 629 /* Update for UnitDelay: '<S11>/UnitDelay' incorporates:
+ 630 * Inport: '<Root>/b_hallA '
+ 631 */
+ 632 rtDW->UnitDelay_DSTATE = rtU->b_hallA;
+ 633
+ 634 /* Update for UnitDelay: '<S11>/UnitDelay1' incorporates:
+ 635 * Inport: '<Root>/b_hallB'
+ 636 */
+ 637 rtDW->UnitDelay1_DSTATE_i = rtU->b_hallB;
+ 638
+ 639 /* Update for UnitDelay: '<S11>/UnitDelay2' incorporates:
+ 640 * Inport: '<Root>/b_hallC'
+ 641 */
+ 642 rtDW->UnitDelay2_DSTATE_h = rtU->b_hallC;
643
- 644 /* Update for UnitDelay: '<S14>/UnitDelay1' */
- 645 rtDW->UnitDelay1_DSTATE_c = rtb_Sum1_a;
+ 644 /* Update for UnitDelay: '<S17>/UnitDelay1' */
+ 645 rtDW->UnitDelay1_DSTATE = rtb_Sum1_a;
646
- 647 /* Update for UnitDelay: '<S16>/UnitDelay2' */
- 648 rtDW->UnitDelay2_DSTATE = rtb_Sum2;
+ 647 /* Update for UnitDelay: '<S14>/UnitDelay1' */
+ 648 rtDW->UnitDelay1_DSTATE_c = rtb_Sum1_a;
649
- 650 /* Outport: '<Root>/DC_phaC' incorporates:
- 651 * Constant: '<S10>/Constant1'
- 652 * Product: '<S10>/Divide1'
- 653 */
- 654 rtY->DC_phaC = rtb_Abs1 / 1000;
- 655
- 656 /* End of Outputs for SubSystem: '<Root>/BLDC_controller' */
- 657
- 658 /* Outport: '<Root>/n_mot' */
- 659 rtY->n_mot = rtb_Sum2;
- 660 }
- 661
- 662 /* Model initialize function */
- 663 void BLDC_controller_initialize(RT_MODEL *const rtM)
- 664 {
- 665 DW *rtDW = ((DW *) rtM->dwork);
- 666
- 667 /* Start for Atomic SubSystem: '<Root>/BLDC_controller' */
- 668 /* Start for If: '<S2>/If1' */
- 669 rtDW->If1_ActiveSubsystem = -1;
+ 650 /* Update for UnitDelay: '<S16>/UnitDelay2' */
+ 651 rtDW->UnitDelay2_DSTATE = rtb_Sum2;
+ 652
+ 653 /* Outport: '<Root>/DC_phaC' incorporates:
+ 654 * Constant: '<S10>/Constant1'
+ 655 * Product: '<S10>/Divide1'
+ 656 */
+ 657 rtY->DC_phaC = rtb_Abs1 / 1000;
+ 658
+ 659 /* End of Outputs for SubSystem: '<Root>/BLDC_controller' */
+ 660
+ 661 /* Outport: '<Root>/n_mot' */
+ 662 rtY->n_mot = rtb_Sum2;
+ 663 }
+ 664
+ 665 /* Model initialize function */
+ 666 void BLDC_controller_initialize(RT_MODEL *const rtM)
+ 667 {
+ 668 P *rtP = ((P *) rtM->defaultParam);
+ 669 DW *rtDW = ((DW *) rtM->dwork);
670
- 671 /* End of Start for SubSystem: '<Root>/BLDC_controller' */
- 672
- 673 /* SystemInitialize for Atomic SubSystem: '<Root>/BLDC_controller' */
- 674 /* InitializeConditions for UnitDelay: '<S17>/UnitDelay1' */
- 675 rtDW->UnitDelay1_DSTATE = 1500;
+ 671 /* Start for Atomic SubSystem: '<Root>/BLDC_controller' */
+ 672 /* Start for If: '<S2>/If1' */
+ 673 rtDW->If1_ActiveSubsystem = -1;
+ 674
+ 675 /* End of Start for SubSystem: '<Root>/BLDC_controller' */
676
- 677 /* SystemInitialize for IfAction SubSystem: '<S14>/Counter_Hold_and_Error_Calculation' */
- 678 /* InitializeConditions for UnitDelay: '<S15>/z_counter2' */
- 679 rtDW->z_counter2_DSTATE = 1500;
+ 677 /* SystemInitialize for Atomic SubSystem: '<Root>/BLDC_controller' */
+ 678 /* InitializeConditions for UnitDelay: '<S17>/UnitDelay1' */
+ 679 rtDW->UnitDelay1_DSTATE = rtP->z_maxCntRst;
680
- 681 /* SystemInitialize for Outport: '<S15>/z_counter' */
- 682 rtDW->z_counterRawPrev = 1500;
- 683
- 684 /* End of SystemInitialize for SubSystem: '<S14>/Counter_Hold_and_Error_Calculation' */
- 685 /* End of SystemInitialize for SubSystem: '<Root>/BLDC_controller' */
- 686 }
+ 681 /* SystemInitialize for IfAction SubSystem: '<S14>/Counter_Hold_and_Error_Calculation' */
+ 682 /* InitializeConditions for UnitDelay: '<S15>/z_counter2' */
+ 683 rtDW->z_counter2_DSTATE = rtP->z_maxCntRst;
+ 684
+ 685 /* SystemInitialize for Outport: '<S15>/z_counter' */
+ 686 rtDW->z_counterRawPrev = rtP->z_maxCntRst;
687
- 688 /*
- 689 * File trailer for generated code.
- 690 *
- 691 * [EOF]
- 692 */
- 693
+ 688 /* End of SystemInitialize for SubSystem: '<S14>/Counter_Hold_and_Error_Calculation' */
+ 689 /* End of SystemInitialize for SubSystem: '<Root>/BLDC_controller' */
+ 690 }
+ 691
+ 692 /*
+ 693 * File trailer for generated code.
+ 694 *
+ 695 * [EOF]
+ 696 */
+ 697
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_data_c.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_data_c.html
index fb19588..68a2d09 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_data_c.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_data_c.html
@@ -21,9 +21,9 @@
7 *
8 * Code generated for Simulink model 'BLDC_controller'.
9 *
- 10 * Model version : 1.879
+ 10 * Model version : 1.883
11 * Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- 12 * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ 12 * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
13 *
14 * Target selection: ert.tlc
15 * Embedded hardware selection: ARM Compatible->ARM Cortex
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_h.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_h.html
index ead75bf..2a7cbfc 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_h.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_h.html
@@ -21,9 +21,9 @@
7 *
8 * Code generated for Simulink model 'BLDC_controller'.
9 *
- 10 * Model version : 1.879
+ 10 * Model version : 1.883
11 * Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- 12 * C/C++ source code generated on : Thu Jun 6 22:50:24 2019
+ 12 * C/C++ source code generated on : Tue Jun 11 21:14:57 2019
13 *
14 * Target selection: ert.tlc
15 * Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -160,104 +160,115 @@
146 int32_T n_commDeacvHi; /* Variable: n_commDeacvHi
147 * Referenced by: '<S14>/n_commDeacv'
148 */
- 149 int32_T r_commDCDeacv; /* Variable: r_commDCDeacv
- 150 * Referenced by: '<S14>/r_commDCDeacv'
+ 149 int32_T n_motPhaAdvEna; /* Variable: n_motPhaAdvEna
+ 150 * Referenced by: '<S8>/n_motPhaAdvEna'
151 */
- 152 int32_T r_phaAdvDC_XA[11]; /* Variable: r_phaAdvDC_XA
- 153 * Referenced by: '<S8>/r_phaAdvDC_XA'
+ 152 int32_T r_commDCDeacv; /* Variable: r_commDCDeacv
+ 153 * Referenced by: '<S14>/r_commDCDeacv'
154 */
- 155 int16_T a_phaAdv_M1[11]; /* Variable: a_phaAdv_M1
- 156 * Referenced by: '<S8>/a_phaAdv_M2'
+ 155 int32_T r_phaAdvDC_XA[11]; /* Variable: r_phaAdvDC_XA
+ 156 * Referenced by: '<S8>/r_phaAdvDC_XA'
157 */
- 158 int16_T dz_counterHi; /* Variable: dz_counterHi
- 159 * Referenced by: '<S14>/dz_counter'
+ 158 int16_T a_phaAdv_M1[11]; /* Variable: a_phaAdv_M1
+ 159 * Referenced by: '<S8>/a_phaAdv_M2'
160 */
- 161 int16_T dz_counterLo; /* Variable: dz_counterLo
+ 161 int16_T dz_counterHi; /* Variable: dz_counterHi
162 * Referenced by: '<S14>/dz_counter'
163 */
- 164 uint8_T z_ctrlTypSel; /* Variable: z_ctrlTypSel
- 165 * Referenced by: '<S7>/z_ctrlTypSel1'
+ 164 int16_T dz_counterLo; /* Variable: dz_counterLo
+ 165 * Referenced by: '<S14>/dz_counter'
166 */
- 167 boolean_T b_phaAdvEna; /* Variable: b_phaAdvEna
- 168 * Referenced by: '<S8>/a_elecPeriod1'
- 169 */
- 170 };
- 171
- 172 /* Parameters (auto storage) */
- 173 typedef struct P_ P;
- 174
- 175 /* Real-time Model Data Structure */
- 176 struct tag_RTM {
- 177 P *defaultParam;
- 178 ExtU *inputs;
- 179 ExtY *outputs;
- 180 DW *dwork;
+ 167 int16_T z_maxCntRst; /* Variable: z_maxCntRst
+ 168 * Referenced by:
+ 169 * '<S15>/z_counter'
+ 170 * '<S15>/z_counter2'
+ 171 * '<S16>/z_maxCntRst'
+ 172 * '<S17>/Constant1'
+ 173 * '<S17>/UnitDelay1'
+ 174 */
+ 175 uint8_T z_ctrlTypSel; /* Variable: z_ctrlTypSel
+ 176 * Referenced by: '<S7>/z_ctrlTypSel1'
+ 177 */
+ 178 boolean_T b_phaAdvEna; /* Variable: b_phaAdvEna
+ 179 * Referenced by: '<S8>/a_elecPeriod1'
+ 180 */
181 };
182
- 183 /* Constant parameters (auto storage) */
- 184 extern const ConstP rtConstP;
+ 183 /* Parameters (auto storage) */
+ 184 typedef struct P_ P;
185
- 186 /* Model entry point functions */
- 187 extern void BLDC_controller_initialize(RT_MODEL *const rtM);
- 188 extern void BLDC_controller_step(RT_MODEL *const rtM);
- 189
- 190 /*-
- 191 * These blocks were eliminated from the model due to optimizations:
- 192 *
- 193 * Block '<S14>/Scope2' : Unused code path elimination
- 194 * Block '<S8>/Scope' : Unused code path elimination
- 195 */
+ 186 /* Real-time Model Data Structure */
+ 187 struct tag_RTM {
+ 188 P *defaultParam;
+ 189 ExtU *inputs;
+ 190 ExtY *outputs;
+ 191 DW *dwork;
+ 192 };
+ 193
+ 194 /* Constant parameters (auto storage) */
+ 195 extern const ConstP rtConstP;
196
- 197 /*-
- 198 * The generated code includes comments that allow you to trace directly
- 199 * back to the appropriate location in the model. The basic format
- 200 * is <system>/block_name, where system is the system number (uniquely
- 201 * assigned by Simulink) and block_name is the name of the block.
- 202 *
- 203 * Note that this particular code originates from a subsystem build,
- 204 * and has its own system numbers different from the parent model.
- 205 * Refer to the system hierarchy for this subsystem below, and use the
- 206 * MATLAB hilite_system command to trace the generated code back
- 207 * to the parent model. For example,
- 208 *
- 209 * hilite_system('BLDCmotorControl_R2017b/BLDC_controller') - opens subsystem BLDCmotorControl_R2017b/BLDC_controller
- 210 * hilite_system('BLDCmotorControl_R2017b/BLDC_controller/Kp') - opens and selects block Kp
- 211 *
- 212 * Here is the system hierarchy for this model
+ 197 /* Model entry point functions */
+ 198 extern void BLDC_controller_initialize(RT_MODEL *const rtM);
+ 199 extern void BLDC_controller_step(RT_MODEL *const rtM);
+ 200
+ 201 /*-
+ 202 * These blocks were eliminated from the model due to optimizations:
+ 203 *
+ 204 * Block '<S14>/Scope2' : Unused code path elimination
+ 205 * Block '<S8>/Scope' : Unused code path elimination
+ 206 */
+ 207
+ 208 /*-
+ 209 * The generated code includes comments that allow you to trace directly
+ 210 * back to the appropriate location in the model. The basic format
+ 211 * is <system>/block_name, where system is the system number (uniquely
+ 212 * assigned by Simulink) and block_name is the name of the block.
213 *
- 214 * '<Root>' : 'BLDCmotorControl_R2017b'
- 215 * '<S1>' : 'BLDCmotorControl_R2017b/BLDC_controller'
- 216 * '<S2>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller'
- 217 * '<S3>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log1'
- 218 * '<S4>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log2'
- 219 * '<S5>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log3'
- 220 * '<S6>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log6'
- 221 * '<S7>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations'
- 222 * '<S8>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F02_Electrical_Angle_Calculation'
- 223 * '<S9>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection'
- 224 * '<S10>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F04_Control_Type_Management'
- 225 * '<S11>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_01_Edge_Detector'
- 226 * '<S12>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_02_Position_Calculation'
- 227 * '<S13>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_03_Direction_Detection'
- 228 * '<S14>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation'
- 229 * '<S15>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/Counter_Hold_and_Error_Calculation'
- 230 * '<S16>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/Motor_Speed_Calculation'
- 231 * '<S17>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/rst_DelayLim'
- 232 * '<S18>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_01_Pure_Trapezoidal_Method'
- 233 * '<S19>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_02_Sinusoidal_Method'
- 234 * '<S20>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_03_Sinusoidal3rd_Method'
- 235 * '<S21>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log1'
- 236 * '<S22>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log2'
- 237 * '<S23>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log6'
- 238 */
- 239 #endif /* RTW_HEADER_BLDC_controller_h_ */
- 240
- 241 /*
- 242 * File trailer for generated code.
- 243 *
- 244 * [EOF]
- 245 */
- 246
+ 214 * Note that this particular code originates from a subsystem build,
+ 215 * and has its own system numbers different from the parent model.
+ 216 * Refer to the system hierarchy for this subsystem below, and use the
+ 217 * MATLAB hilite_system command to trace the generated code back
+ 218 * to the parent model. For example,
+ 219 *
+ 220 * hilite_system('BLDCmotorControl_R2017b/BLDC_controller') - opens subsystem BLDCmotorControl_R2017b/BLDC_controller
+ 221 * hilite_system('BLDCmotorControl_R2017b/BLDC_controller/Kp') - opens and selects block Kp
+ 222 *
+ 223 * Here is the system hierarchy for this model
+ 224 *
+ 225 * '<Root>' : 'BLDCmotorControl_R2017b'
+ 226 * '<S1>' : 'BLDCmotorControl_R2017b/BLDC_controller'
+ 227 * '<S2>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller'
+ 228 * '<S3>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log1'
+ 229 * '<S4>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log2'
+ 230 * '<S5>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log3'
+ 231 * '<S6>' : 'BLDCmotorControl_R2017b/BLDC_controller/signal_log6'
+ 232 * '<S7>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations'
+ 233 * '<S8>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F02_Electrical_Angle_Calculation'
+ 234 * '<S9>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection'
+ 235 * '<S10>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F04_Control_Type_Management'
+ 236 * '<S11>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_01_Edge_Detector'
+ 237 * '<S12>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_02_Position_Calculation'
+ 238 * '<S13>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_03_Direction_Detection'
+ 239 * '<S14>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation'
+ 240 * '<S15>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/Counter_Hold_and_Error_Calculation'
+ 241 * '<S16>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/Motor_Speed_Calculation'
+ 242 * '<S17>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F01_Preliminary_Calculations/F01_04_Speed_Calculation/rst_DelayLim'
+ 243 * '<S18>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_01_Pure_Trapezoidal_Method'
+ 244 * '<S19>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_02_Sinusoidal_Method'
+ 245 * '<S20>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/F03_03_Sinusoidal3rd_Method'
+ 246 * '<S21>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log1'
+ 247 * '<S22>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log2'
+ 248 * '<S23>' : 'BLDCmotorControl_R2017b/BLDC_controller/BLDC_controller/F03_Control_Method_Selection/signal_log6'
+ 249 */
+ 250 #endif /* RTW_HEADER_BLDC_controller_h_ */
+ 251
+ 252 /*
+ 253 * File trailer for generated code.
+ 254 *
+ 255 * [EOF]
+ 256 */
+ 257
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_interface.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_interface.html
index 6360cbe..cab4ddf 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_interface.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_interface.html
@@ -611,7 +611,7 @@ int32_T
-r_commDCDeacv
+n_motPhaAdvEna
|
@@ -629,6 +629,24 @@ int32_T
|
+r_commDCDeacv
+ |
+
+
+Defined externally
+
+
+ |
+
+int32_T
+ |
+
+1
+ |
+
+
+
+
r_phaAdvDC_XA
|
@@ -645,7 +663,7 @@ int32_T
|
-
+
a_phaAdv_M1
|
@@ -663,7 +681,7 @@ int16_T
-
+
dz_counterHi
|
@@ -681,7 +699,7 @@ int16_T
-
+
dz_counterLo
|
@@ -698,6 +716,24 @@ int16_T
1
+
+
+
+z_maxCntRst
+ |
+
+
+Defined externally
+
+
+ |
+
+int16_T
+ |
+
+1
+ |
+
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_metrics.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_metrics.html
index b39b53c..2795264 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_metrics.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_metrics.html
@@ -100,7 +100,7 @@ Function Information
:
|
-404
+407
|
@@ -115,7 +115,7 @@ Function Information
:
|
-1,150
+1,165
|
@@ -169,13 +169,13 @@ BLDC_controller.c
|
-254
+255
|
-693
+697
|
-06/06/2019 10:50 PM
+06/11/2019 9:15 PM
|
@@ -187,13 +187,13 @@ BLDC_controller.h
-79
+81
|
-246
+257
|
-06/06/2019 10:50 PM
+06/11/2019 9:15 PM
|
@@ -211,7 +211,7 @@ rtwtypes.h
109
-06/06/2019 10:50 PM
+06/11/2019 9:15 PM
|
@@ -229,7 +229,7 @@ BLDC_controller_data.c
102
-06/06/2019 10:50 PM
+06/11/2019 9:15 PM
|
@@ -451,7 +451,7 @@ BLDC_controller_step
181
-511
+514
|
24
@@ -610,16 +610,16 @@ BLDC_controller_initialize
|
-8
+16
|
-8
+16
|
-5
+6
|
-24
+25
|
1
@@ -727,16 +727,16 @@ BLDC_controller_initialize
|
-8
+16
|
-8
+16
|
-5
+6
|
-24
+25
|
1
@@ -763,7 +763,7 @@ BLDC_controller_step
181
|
-511
+514
|
24
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_sid_map.js b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_sid_map.js
index 0b0d719..d530b3c 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_sid_map.js
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_sid_map.js
@@ -99,6 +99,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1482"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1666"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1382"] = "BLDCmotorControl_R2017b:2687:6";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1678"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:186"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:187"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:188"] = "BLDCmotorControl_R2017b:2687:6";
@@ -112,6 +113,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:196"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:197"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1662"] = "BLDCmotorControl_R2017b:2687:6";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1677"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:198"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1376"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:199"] = "BLDCmotorControl_R2017b:2687:6";
@@ -130,6 +132,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:211"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1483"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1484"] = "BLDCmotorControl_R2017b:2687:6";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1679"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1383"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:212"] = "BLDCmotorControl_R2017b:2687:6";
this.sidParentMap["BLDCmotorControl_R2017b:2687:535"] = "BLDCmotorControl_R2017b:2687:215";
@@ -137,11 +140,13 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:217"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1460"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1461"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1680"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:221"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1464"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1465"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1466"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1467"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1669"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:231"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:518"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:534"] = "BLDCmotorControl_R2017b:2687:215";
@@ -160,14 +165,17 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:243"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1462"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1463"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1681"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:578"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1473"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:536"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:538"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1668"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:623"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:258"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:545"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1474"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1670"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1475"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:262"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1476"] = "BLDCmotorControl_R2017b:2687:215";
@@ -179,6 +187,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:512"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:547"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:521"] = "BLDCmotorControl_R2017b:2687:215";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1671"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:522"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:278"] = "BLDCmotorControl_R2017b:2687:215";
this.sidParentMap["BLDCmotorControl_R2017b:2687:279"] = "BLDCmotorControl_R2017b:2687:215";
@@ -302,7 +311,6 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:61"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1629"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1366"] = "BLDCmotorControl_R2017b:2687:59";
- this.sidParentMap["BLDCmotorControl_R2017b:2687:1320"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1321"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:64"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1340"] = "BLDCmotorControl_R2017b:2687:59";
@@ -319,6 +327,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1380"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1455"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1361"] = "BLDCmotorControl_R2017b:2687:59";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1675"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1323"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1517"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1324"] = "BLDCmotorControl_R2017b:2687:59";
@@ -338,6 +347,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1374"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1630"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:106"] = "BLDCmotorControl_R2017b:2687:59";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1674"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:786"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1400"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:108"] = "BLDCmotorControl_R2017b:2687:59";
@@ -360,6 +370,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1329"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1651"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:173"] = "BLDCmotorControl_R2017b:2687:59";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1676"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1381"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1487"] = "BLDCmotorControl_R2017b:2687:59";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1488"] = "BLDCmotorControl_R2017b:2687:59";
@@ -373,6 +384,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1640"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1430"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1639"] = "BLDCmotorControl_R2017b:2687:1401";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1672"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1637"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1433"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1434"] = "BLDCmotorControl_R2017b:2687:1401";
@@ -403,6 +415,7 @@ function RTW_SidParentMap() {
this.sidParentMap["BLDCmotorControl_R2017b:2687:1625"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1450"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1451"] = "BLDCmotorControl_R2017b:2687:1401";
+ this.sidParentMap["BLDCmotorControl_R2017b:2687:1673"] = "BLDCmotorControl_R2017b:2687:1401";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1651:1614"] = "BLDCmotorControl_R2017b:2687:1651";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1651:1615"] = "BLDCmotorControl_R2017b:2687:1651";
this.sidParentMap["BLDCmotorControl_R2017b:2687:1651:1616"] = "BLDCmotorControl_R2017b:2687:1651";
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_survey.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_survey.html
index ac1194b..82b1d69 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_survey.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_survey.html
@@ -40,7 +40,7 @@ MathWorks
Model Version
|
-1.879
+1.883
|
@@ -109,7 +109,7 @@ Simulink Coder Version
Timestamp of Generated Source Code
-Thu Jun 6 22:50:24 2019
+Tue Jun 11 21:14:57 2019
|
diff --git a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_trace.html b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_trace.html
index b989a7b..76b0a2f 100644
--- a/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_trace.html
+++ b/01_Matlab/BLDC_controller_ert_rtw/html/BLDC_controller_trace.html
@@ -20,18 +20,20 @@ function rtwTraceHilite(file,ext,ln) {
//-->
Traceability Report for BLDC_controller
No traceable objects in this Subsystem.
Object Name | Code Location |
---|
<S2>/Abs1 | BLDC_controller.c:179, 182, 183, 185, 188 |
<S2>/F02_Electrical_Angle_Calculation | BLDC_controller.c:384, 447 |
<S2>/If1 | BLDC_controller.c:363, 366, 367, 368, 369, 372, 373, 383, 450, 668, 669 BLDC_controller.h:52 |
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
Object Name | Code Location |
---|
<S8>/Action Port | BLDC_controller.c:385 |
<S8>/Constant16 | BLDC_controller.c:389, 400 |
<S8>/Divide4 | BLDC_controller.c:412, 417 |
<S8>/Divide5 | BLDC_controller.c:413, 418 |
<S8>/Math
-Function | BLDC_controller.c:440, 441 |
<S8>/Product2 | BLDC_controller.c:436, 438 |
<S8>/Product6 | BLDC_controller.c:414, 417 |
<S8>/Relational
-Operator7 | BLDC_controller.c:395, 400 |
<S8>/Sum1 | BLDC_controller.c:398, 403, 405 |
<S8>/Sum2 | BLDC_controller.c:415, 417, 418 |
<S8>/Sum3 | BLDC_controller.c:434, 438 |
<S8>/Switch3 | BLDC_controller.c:387, 400, 401, 403, 408 |
<S8>/Switch_PhaAdv | BLDC_controller.c:420, 424, 441, 443, 446 BLDC_controller.h:39 |
<S8>/a_elecAngle1 | BLDC_controller.c:411, 417, 418 |
<S8>/a_elecPeriod1 | BLDC_controller.c:421, 424 BLDC_controller.h:168 ert_main.c:83 |
<S8>/a_phaAdv_M2 | BLDC_controller.c:430, 431, 432 BLDC_controller.h:156 ert_main.c:63 |
<S8>/r_phaAdvDC_XA | BLDC_controller.c:425, 426, 427, 428 BLDC_controller.h:153 ert_main.c:58 |
<S8>/a_elecAngleAdv | BLDC_controller.c:374, 375 |
<S8>/a_elecAngle | BLDC_controller.c:378, 380 |
Object Name | Code Location |
---|
<S10>/Constant1 | BLDC_controller.c:615, 618, 621, 624, 651, 654 |
<S10>/Divide1 | BLDC_controller.c:616, 618, 622, 624, 652, 654 |
<S10>/Divide2 | BLDC_controller.c:556, 607, 608, 609 |
<S10>/Divide4 | BLDC_controller.c:557, 570, 571, 572 |
<S10>/Switch1 | BLDC_controller.c:548, 568, 570, 571, 572, 607, 608, 609, 612 |
<S10>/z_commutMap_M1 | BLDC_controller.c:555, 565, 574, 575, 577, 580, 581, 582, 584, 587, 589, 593, 596, 599, 603, 606, 607, 608, 609 BLDC_controller.h:108 BLDC_controller_data.c:86 |
Object Name | Code Location |
---|
<S11>/Bitwise
-Operator | BLDC_controller.c:190, 198, 199 |
<S11>/UnitDelay | BLDC_controller.c:194, 199, 626, 629 BLDC_controller.h:53 |
<S11>/UnitDelay1 | BLDC_controller.c:195, 199, 631, 634 BLDC_controller.h:54 |
<S11>/UnitDelay2 | BLDC_controller.c:196, 200, 636, 639 BLDC_controller.h:55 |
Object Name | Code Location |
---|
<S12>/Selector | BLDC_controller.c:224, 227, 249, 251, 396, 401, 403, 404, 405, 563, 574, 581, 591, 596, 601 |
<S12>/Sum | BLDC_controller.c:169, 176, 177, 397, 403, 404, 405 |
<S12>/g_Ha | BLDC_controller.c:170, 176, 390, 404 |
<S12>/g_Hb | BLDC_controller.c:171, 177, 391, 404, 405 |
<S12>/vec_hallToPos | BLDC_controller.c:223, 227, 248, 251, 388, 401, 403, 549, 574, 581, 590, 596, 600 BLDC_controller.h:113 BLDC_controller_data.c:92 |
No traceable objects in this Subsystem.
Object Name | Code Location |
---|
<S2>/Abs1 | BLDC_controller.c:179, 182, 183, 185, 188 |
<S2>/F02_Electrical_Angle_Calculation | BLDC_controller.c:384, 450 |
<S2>/If1 | BLDC_controller.c:363, 366, 367, 368, 369, 372, 373, 383, 453, 672, 673 BLDC_controller.h:52 |
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
Object Name | Code Location |
---|
<S8>/Action Port | BLDC_controller.c:385 |
<S8>/Constant16 | BLDC_controller.c:389, 400 |
<S8>/Divide4 | BLDC_controller.c:412, 417 |
<S8>/Divide5 | BLDC_controller.c:413, 418 |
<S8>/Logical
+Operator2 | BLDC_controller.c:423, 427 |
<S8>/Math
+Function | BLDC_controller.c:443, 444 |
<S8>/Product2 | BLDC_controller.c:439, 441 |
<S8>/Product6 | BLDC_controller.c:414, 417 |
<S8>/Relational
+Operator4 | BLDC_controller.c:425, 427 |
<S8>/Relational
+Operator7 | BLDC_controller.c:395, 400 |
<S8>/Sum1 | BLDC_controller.c:398, 403, 405 |
<S8>/Sum2 | BLDC_controller.c:415, 417, 418 |
<S8>/Sum3 | BLDC_controller.c:437, 441 |
<S8>/Switch3 | BLDC_controller.c:387, 400, 401, 403, 408 |
<S8>/Switch_PhaAdv | BLDC_controller.c:420, 427, 444, 446, 449 BLDC_controller.h:39 |
<S8>/a_elecAngle1 | BLDC_controller.c:411, 417, 418 |
<S8>/a_elecPeriod1 | BLDC_controller.c:421, 427 BLDC_controller.h:179 ert_main.c:98 |
<S8>/a_phaAdv_M2 | BLDC_controller.c:433, 434, 435 BLDC_controller.h:159 ert_main.c:68 |
<S8>/n_motPhaAdvEna | BLDC_controller.c:422, 427 BLDC_controller.h:150 ert_main.c:53 |
<S8>/r_phaAdvDC_XA | BLDC_controller.c:428, 429, 430, 431 BLDC_controller.h:156 ert_main.c:63 |
<S8>/a_elecAngleAdv | BLDC_controller.c:374, 375 |
<S8>/a_elecAngle | BLDC_controller.c:378, 380 |
Object Name | Code Location |
---|
<S10>/Constant1 | BLDC_controller.c:618, 621, 624, 627, 654, 657 |
<S10>/Divide1 | BLDC_controller.c:619, 621, 625, 627, 655, 657 |
<S10>/Divide2 | BLDC_controller.c:559, 610, 611, 612 |
<S10>/Divide4 | BLDC_controller.c:560, 573, 574, 575 |
<S10>/Switch1 | BLDC_controller.c:551, 571, 573, 574, 575, 610, 611, 612, 615 |
<S10>/z_commutMap_M1 | BLDC_controller.c:558, 568, 577, 578, 580, 583, 584, 585, 587, 590, 592, 596, 599, 602, 606, 609, 610, 611, 612 BLDC_controller.h:108 BLDC_controller_data.c:86 |
Object Name | Code Location |
---|
<S11>/Bitwise
+Operator | BLDC_controller.c:190, 198, 199 |
<S11>/UnitDelay | BLDC_controller.c:194, 199, 629, 632 BLDC_controller.h:53 |
<S11>/UnitDelay1 | BLDC_controller.c:195, 199, 634, 637 BLDC_controller.h:54 |
<S11>/UnitDelay2 | BLDC_controller.c:196, 200, 639, 642 BLDC_controller.h:55 |
Object Name | Code Location |
---|
<S12>/Selector | BLDC_controller.c:224, 227, 249, 251, 396, 401, 403, 404, 405, 566, 577, 584, 594, 599, 604 |
<S12>/Sum | BLDC_controller.c:169, 176, 177, 397, 403, 404, 405 |
<S12>/g_Ha | BLDC_controller.c:170, 176, 390, 404 |
<S12>/g_Hb | BLDC_controller.c:171, 177, 391, 404, 405 |
<S12>/vec_hallToPos | BLDC_controller.c:223, 227, 248, 251, 388, 401, 403, 552, 577, 584, 593, 599, 603 BLDC_controller.h:113 BLDC_controller_data.c:92 |
Object Name | Code Location |
---|
<S13>/Action Port | BLDC_controller.c:217 |
<S13>/Constant20 | BLDC_controller.c:231, 239 |
<S13>/Constant23 | BLDC_controller.c:232, 242 |
<S13>/Constant24 | BLDC_controller.c:233, 240 |
<S13>/Constant8 | BLDC_controller.c:234, 239 |
<S13>/Logical
Operator3 | BLDC_controller.c:235, 239 |
<S13>/Relational
Operator1 | BLDC_controller.c:236, 239 |
<S13>/Relational
-Operator6 | BLDC_controller.c:237, 239 |
<S13>/Sum2 | BLDC_controller.c:222, 227 |
<S13>/Switch2 | BLDC_controller.c:230, 239, 240, 242, 245 BLDC_controller.h:50 |
<S13>/UnitDelay1 | BLDC_controller.c:219, 220 BLDC_controller.h:49 |
<S13>/UnitDelay2 | BLDC_controller.c:225, 228, 247, 251 BLDC_controller.h:51 |
Object Name | Code Location |
---|
<S14>/Abs2 | BLDC_controller.c:345, 346, 347, 349, 352 |
<S14>/Abs5 | BLDC_controller.c:327, 328, 329, 331, 334 |
<S14>/CTRL_COMM | BLDC_controller.c:550, 568 |
<S14>/Constant6 | BLDC_controller.c:203, 254, 262 |
<S14>/Counter_Hold_and_Error_Calculation | BLDC_controller.c:256, 274, 677, 684 |
<S14>/If1 | BLDC_controller.c:202, 215, 291 |
<S14>/Logical
-Operator2 | BLDC_controller.c:554, 568, 569 |
<S14>/Relational
-Operator1 | BLDC_controller.c:558, 568, 569 |
<S14>/Relational
-Operator3 | BLDC_controller.c:559, 568 |
<S14>/Relational
-Operator4 | BLDC_controller.c:560, 568 |
<S14>/Sign | BLDC_controller.c:528, 529, 530, 532, 535 |
<S14>/Sign1 | BLDC_controller.c:537, 540, 541, 543, 546 |
<S14>/Sum1 | BLDC_controller.c:209, 254, 265, 288, 293, 294, 304, 306 |
<S14>/UnitDelay1 | BLDC_controller.c:212, 259, 266, 644, 645 BLDC_controller.h:47 |
<S14>/dz_counter | BLDC_controller.c:354, 355, 356, 358, 359, 561, 569 BLDC_controller.h:57, 159, 162 ert_main.c:68, 73 |
<S14>/n_commDeacv | BLDC_controller.c:336, 337, 338, 340, 341, 562, 569 BLDC_controller.h:56, 144, 147 ert_main.c:43, 48 |
<S14>/r_commDCDeacv | BLDC_controller.c:551, 568 BLDC_controller.h:150 ert_main.c:53 |
Object Name | Code Location |
---|
<S16>/Constant1 | BLDC_controller.c:297, 307 |
<S16>/Constant2 | BLDC_controller.c:315, 324 |
<S16>/Constant3 | BLDC_controller.c:316, 325 |
<S16>/Divide1 | BLDC_controller.c:318, 324, 325 |
<S16>/Divide2 | BLDC_controller.c:314, 324, 325 |
<S16>/Divide3 | BLDC_controller.c:319, 324 |
<S16>/Divide4 | BLDC_controller.c:301, 309 |
<S16>/Logical
-Operator1 | BLDC_controller.c:300, 306 |
<S16>/Relational
-Operator2 | BLDC_controller.c:302, 306 |
<S16>/Relational
-Operator5 | BLDC_controller.c:303, 306 |
<S16>/Sum1 | BLDC_controller.c:320, 324 |
<S16>/Sum2 | BLDC_controller.c:321, 324 |
<S16>/Switch1 | BLDC_controller.c:296, 306, 307, 309, 312 |
<S16>/UnitDelay2 | BLDC_controller.c:322, 324, 647, 648 BLDC_controller.h:40 |
<S16>/cf_spdCoef | BLDC_controller.c:298, 309 BLDC_controller.h:138 ert_main.c:33 |
<S16>/cf_speedFilt | BLDC_controller.c:317, 324, 325 BLDC_controller.h:141 ert_main.c:38 |
<S16>/z_maxCntRst | BLDC_controller.c:299, 306 |
Object Name | Code Location |
---|
<S17>/Constant1 | BLDC_controller.c:204, 276, 283, 285 |
<S17>/Constant23 | BLDC_controller.c:205, 254, 263 |
<S17>/Relational
-Operator1 | BLDC_controller.c:208, 276 |
<S17>/Switch1 | BLDC_controller.c:210, 215, 254, 288 |
<S17>/Switch2 | BLDC_controller.c:211, 276, 277, 280, 282, 285 |
<S17>/UnitDelay1 | BLDC_controller.c:213, 276, 278, 280, 641, 642, 674, 675 BLDC_controller.h:46 |
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.