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 51ac348..ebfbe60 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 f8bb08c..3e5b04a 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.877
+ * Model version : 1.879
* Simulink Coder version : 8.13 (R2017b) 24-Jul-2017
- * C/C++ source code generated on : Wed Jun 5 22:29:28 2019
+ * C/C++ source code generated on : Thu Jun 6 17:49:29 2019
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -154,15 +154,15 @@ void BLDC_controller_step(RT_MODEL *const rtM)
ExtU *rtU = (ExtU *) rtM->inputs;
ExtY *rtY = (ExtY *) rtM->outputs;
uint8_T rtb_Sum;
- int32_T rtb_Sum2;
+ int32_T rtb_Abs1;
uint8_T rtb_BitwiseOperator;
+ int32_T rtb_Sum2;
int16_T rtb_Abs2;
int16_T rtb_Sum1_a;
int32_T rtb_Abs5;
int8_T rtAction;
int8_T rtb_Sum2_h;
uint32_T rtb_r_phaAdvDC_XA_o2;
- int32_T rtb_Switch1_idx_0;
int32_T rtb_Switch1_idx_1;
/* Outputs for Atomic SubSystem: '
Block Name | Comment |
---|---|
<S1>/b_hallA - | Inport |
<S1>/b_hallB | Inport |
<S1>/b_hallC | Inport |
<S1>/r_DC | Inport |
<S1>/BLDC_controller | Traceability information not available |
<S1>/From1 | From |
<S1>/From18 | Traceability information not available |
<S1>/From19 | Traceability information not available |
<S1>/From20 | Traceability information not available |
<S1>/From21 | Traceability information not available |
<S1>/From5 | From |
<S1>/From6 | From |
<S1>/From7 | From |
<S1>/From8 | From |
<S1>/Goto | Goto |
<S1>/Goto1 | Goto |
<S1>/Goto18 | Traceability information not available |
<S1>/Goto19 | Traceability information not available |
<S1>/Goto2 | Goto |
<S1>/Goto20 | Traceability information not available |
<S1>/Goto21 | Traceability information not available |
<S1>/Goto22 | Traceability information not available |
<S1>/Goto3 | Goto |
<S1>/signal_log1 | Virtual SubSystem |
<S1>/signal_log2 | Virtual SubSystem |
<S1>/signal_log3 | Virtual SubSystem |
<S1>/signal_log6 | Virtual SubSystem |
<S1>/DC_phaA | Outport |
<S1>/DC_phaB | Outport |
<S1>/DC_phaC | Outport |
<S1>/n_mot | Outport |
<S1>/a_elecAngle | Outport |
<S2>/b_hallA - | Traceability information not available |
<S2>/b_hallB | Traceability information not available |
<S2>/b_hallC | Traceability information not available |
<S2>/r_DC | Traceability information not available |
<S2>/F01_Preliminary_Calculations | Traceability information not available |
<S2>/F03_Control_Method_Selection | Traceability information not available |
<S2>/F04_Control_Type_Management | Traceability information not available |
<S2>/From | Traceability information not available |
<S2>/From1 | Traceability information not available |
<S2>/From10 | Traceability information not available |
<S2>/From2 | Traceability information not available |
<S2>/From3 | Traceability information not available |
<S2>/From4 | Traceability information not available |
<S2>/From5 | Traceability information not available |
<S2>/From6 | Traceability information not available |
<S2>/From7 | Traceability information not available |
<S2>/From8 | Traceability information not available |
<S2>/From9 | Traceability information not available |
<S2>/Goto | Traceability information not available |
<S2>/Goto1 | Traceability information not available |
<S2>/Goto2 | Traceability information not available |
<S2>/Goto3 | Traceability information not available |
<S2>/Goto4 | Traceability information not available |
<S2>/Goto5 | Traceability information not available |
<S2>/Goto6 | Traceability information not available |
<S2>/Goto7 | Traceability information not available |
<S2>/Goto8 | Traceability information not available |
<S2>/Implemented_control_methods | Traceability information not available |
<S2>/Model_Info | Traceability information not available |
<S2>/DC_phaA | Traceability information not available |
<S2>/DC_phaB | Traceability information not available |
<S2>/DC_phaC | Traceability information not available |
<S2>/n_mot | Traceability information not available |
<S2>/a_elecAngle | Traceability information not available |
<S3>/b_hallB | Inport |
<S3>/Terminator_1 | Terminator |
<S4>/b_hallC | Inport |
<S4>/Terminator_1 | Terminator |
<S5>/r_DC | Inport |
<S5>/Terminator_1 | Terminator |
<S6>/b_hallA | Inport |
<S6>/Terminator_1 | Terminator |
<S7>/b_hallA | Traceability information not available |
<S7>/b_hallB | Traceability information not available |
<S7>/b_hallC | Traceability information not available |
<S7>/r_DC | Traceability information not available |
<S7>/F01_01_Edge_Detector | Traceability information not available |
<S7>/F01_02_Position_Calculation | Traceability information not available |
<S7>/F01_04_Speed_Calculation | Traceability information not available |
<S7>/From | Traceability information not available |
<S7>/From1 | Traceability information not available |
<S7>/From10 | Traceability information not available |
<S7>/From11 | Traceability information not available |
<S7>/From12 | Traceability information not available |
<S7>/From13 | Traceability information not available |
<S7>/From14 | Traceability information not available |
<S7>/From15 | Traceability information not available |
<S7>/From16 | Traceability information not available |
<S7>/From18 | Traceability information not available |
<S7>/From2 | Traceability information not available |
<S7>/From3 | Traceability information not available |
<S7>/From36 | Traceability information not available |
<S7>/From38 | Traceability information not available |
<S7>/From4 | Traceability information not available |
<S7>/From5 | Traceability information not available |
<S7>/From6 | Traceability information not available |
<S7>/From7 | Traceability information not available |
<S7>/From8 | Traceability information not available |
<S7>/From9 | Traceability information not available |
<S7>/Goto | Traceability information not available |
<S7>/Goto1 | Traceability information not available |
<S7>/Goto16 | Traceability information not available |
<S7>/Goto18 | Traceability information not available |
<S7>/Goto2 | Traceability information not available |
<S7>/Goto21 | Traceability information not available |
<S7>/Goto3 | Traceability information not available |
<S7>/Goto4 | Traceability information not available |
<S7>/Goto5 | Traceability information not available |
<S7>/Goto6 | Traceability information not available |
<S7>/Goto7 | Traceability information not available |
<S7>/Goto8 | Traceability information not available |
<S7>/Goto9 | Traceability information not available |
<S7>/z_ctrlTypSel | Traceability information not available |
<S7>/z_pos | Traceability information not available |
<S7>/z_dir | Traceability information not available |
<S7>/z_counter | Traceability information not available |
<S7>/z_counterRaw | Traceability information not available |
<S7>/b_advCtrlEna | Traceability information not available |
<S7>/n_mot | Traceability information not available |
<S8>/r_DC | Traceability information not available |
<S8>/z_pos | Traceability information not available |
<S8>/z_dir | Traceability information not available |
<S8>/z_counter | Traceability information not available |
<S8>/z_counterRaw | Traceability information not available |
<S8>/Constant2 | Traceability information not available |
<S8>/From10 | Traceability information not available |
<S8>/From11 | Traceability information not available |
<S8>/From12 | Traceability information not available |
<S8>/From2 | Traceability information not available |
<S8>/From3 | Traceability information not available |
<S8>/From5 | Traceability information not available |
<S8>/From51 | Traceability information not available |
<S8>/From52 | Traceability information not available |
<S8>/From53 | Traceability information not available |
<S8>/From54 | Traceability information not available |
<S8>/From59 | Traceability information not available |
<S8>/From6 | Traceability information not available |
<S8>/From7 | Traceability information not available |
<S8>/From9 | Traceability information not available |
<S8>/Goto | Traceability information not available |
<S8>/Goto1 | Traceability information not available |
<S8>/Goto2 | Traceability information not available |
<S8>/Goto3 | Traceability information not available |
<S8>/Goto5 | Traceability information not available |
<S8>/Goto7 | Traceability information not available |
<S8>/Goto8 | Traceability information not available |
<S8>/Goto9 | Traceability information not available |
<S8>/Mux | Traceability information not available |
<S8>/Scope | Traceability information not available |
<S8>/a_elecPeriod2 | Traceability information not available |
<S9>/z_ctrlTypSel | Traceability information not available |
<S9>/a_elecAngleAdv | Traceability information not available |
<S9>/From | Traceability information not available |
<S9>/From10 | Traceability information not available |
<S9>/From13 | Traceability information not available |
<S9>/From14 | Traceability information not available |
<S9>/From15 | Traceability information not available |
<S9>/From16 | Traceability information not available |
<S9>/From17 | Traceability information not available |
<S9>/From18 | Traceability information not available |
<S9>/From19 | Traceability information not available |
<S9>/From20 | Traceability information not available |
<S9>/From4 | Traceability information not available |
<S9>/From5 | Traceability information not available |
<S9>/From6 | Traceability information not available |
<S9>/From7 | Traceability information not available |
<S9>/From8 | Traceability information not available |
<S9>/From9 | Traceability information not available |
<S9>/Goto | Traceability information not available |
<S9>/Goto1 | Traceability information not available |
<S9>/Goto10 | Traceability information not available |
<S9>/Goto11 | Traceability information not available |
<S9>/Goto12 | Traceability information not available |
<S9>/Goto14 | Traceability information not available |
<S9>/Goto2 | Traceability information not available |
<S9>/Goto3 | Traceability information not available |
<S9>/Goto4 | Traceability information not available |
<S9>/Goto5 | Traceability information not available |
<S9>/Goto6 | Traceability information not available |
<S9>/Goto7 | Traceability information not available |
<S9>/Goto8 | Traceability information not available |
<S9>/Goto9 | Traceability information not available |
<S9>/signal_log1 | Traceability information not available |
<S9>/signal_log2 | Traceability information not available |
<S9>/signal_log6 | Traceability information not available |
<S9>/r_phaA | Traceability information not available |
<S9>/r_phaB | Traceability information not available |
<S9>/r_phaC | Traceability information not available |
<S10>/r_DC | Traceability information not available |
<S10>/r_phaA | Traceability information not available |
<S10>/r_phaB | Traceability information not available |
<S10>/r_phaC | Traceability information not available |
<S10>/z_pos | Traceability information not available |
<S10>/b_advCtrlEna | Traceability information not available |
<S10>/Demux | Traceability information not available |
<S10>/From | Traceability information not available |
<S10>/From1 | Traceability information not available |
<S10>/From10 | Traceability information not available |
<S10>/From2 | Traceability information not available |
<S10>/From27 | Traceability information not available |
<S10>/From39 | Traceability information not available |
<S10>/From40 | Traceability information not available |
<S10>/From41 | Traceability information not available |
<S10>/From8 | Traceability information not available |
<S10>/From9 | Traceability information not available |
<S10>/Goto | Traceability information not available |
<S10>/Goto1 | Traceability information not available |
<S10>/Goto10 | Traceability information not available |
<S10>/Goto2 | Traceability information not available |
<S10>/Goto4 | Traceability information not available |
<S10>/Goto6 | Traceability information not available |
<S10>/Goto7 | Traceability information not available |
<S10>/Goto8 | Traceability information not available |
<S10>/Goto9 | Traceability information not available |
<S10>/Mux2 | Traceability information not available |
<S10>/DC_phaA | Traceability information not available |
<S10>/DC_phaB | Traceability information not available |
<S10>/DC_phaC | Traceability information not available |
<S11>/b_hallA | Traceability information not available |
<S11>/b_hallB | Traceability information not available |
<S11>/b_hallC | Traceability information not available |
<S11>/b_edge | Traceability information not available |
<S12>/b_hallA | Traceability information not available |
<S12>/b_hallB | Traceability information not available |
<S12>/b_hallC | Traceability information not available |
<S12>/z_pos | Traceability information not available |
<S13>/z_pos | Traceability information not available |
<S13>/z_dir | Traceability information not available |
<S13>/z_dirPrev | Traceability information not available |
<S14>/r_DC | Traceability information not available |
<S14>/z_ctrlTypSel | Traceability information not available |
<S14>/b_edge | Traceability information not available |
<S14>/z_dir | Traceability information not available |
<S14>/z_dirPrev | Traceability information not available |
<S14>/From | Traceability information not available |
<S14>/From1 | Traceability information not available |
<S14>/From10 | Traceability information not available |
<S14>/From11 | Traceability information not available |
<S14>/From12 | Traceability information not available |
<S14>/From13 | Traceability information not available |
<S14>/From14 | Traceability information not available |
<S14>/From15 | Traceability information not available |
<S14>/From16 | Traceability information not available |
<S14>/From18 | Traceability information not available |
<S14>/From19 | Traceability information not available |
<S14>/From2 | Traceability information not available |
<S14>/From28 | Traceability information not available |
<S14>/From29 | Traceability information not available |
<S14>/From3 | Traceability information not available |
<S14>/From30 | Traceability information not available |
<S14>/From4 | Traceability information not available |
<S14>/From42 | Traceability information not available |
<S14>/From5 | Traceability information not available |
<S14>/From6 | Traceability information not available |
<S14>/From7 | Traceability information not available |
<S14>/From8 | Traceability information not available |
<S14>/From9 | Traceability information not available |
<S14>/Goto | Traceability information not available |
<S14>/Goto1 | Traceability information not available |
<S14>/Goto15 | Traceability information not available |
<S14>/Goto16 | Traceability information not available |
<S14>/Goto17 | Traceability information not available |
<S14>/Goto18 | Traceability information not available |
<S14>/Goto2 | Traceability information not available |
<S14>/Goto22 | Traceability information not available |
<S14>/Goto5 | Traceability information not available |
<S14>/Goto6 | Traceability information not available |
<S14>/Goto8 | Traceability information not available |
<S14>/Goto9 | Traceability information not available |
<S14>/Motor_Speed_Calculation | Traceability information not available |
<S14>/Mux1 | Traceability information not available |
<S14>/Mux2 | Traceability information not available |
<S14>/Scope2 | Traceability information not available |
<S14>/rst_DelayLim | Traceability information not available |
<S14>/n_mot | Traceability information not available |
<S14>/b_advCtrlEna | Traceability information not available |
<S14>/z_counter | Traceability information not available |
<S14>/z_counterRaw | Traceability information not available |
<S15>/dz_counter | Traceability information not available |
<S16>/z_dir | Traceability information not available |
<S16>/z_dirPrev | Traceability information not available |
<S16>/z_counter | Traceability information not available |
<S16>/z_counterRaw | Traceability information not available |
<S16>/From1 | Traceability information not available |
<S16>/From14 | Traceability information not available |
<S16>/From15 | Traceability information not available |
<S16>/From17 | Traceability information not available |
<S16>/From42 | Traceability information not available |
<S16>/From8 | Traceability information not available |
<S16>/Goto | Traceability information not available |
<S16>/Goto1 | Traceability information not available |
<S16>/Goto2 | Traceability information not available |
<S16>/Goto22 | Traceability information not available |
<S16>/Goto3 | Traceability information not available |
<S16>/n_motRaw | Traceability information not available |
<S16>/n_mot | Traceability information not available |
<S17>/u | Traceability information not available |
<S17>/rst | Traceability information not available |
<S17>/y | Traceability information not available |
<S18>/a_elecAngleAdv | Traceability information not available |
<S18>/r_phaA_Trap | Traceability information not available |
<S18>/r_phaB_Trap | Traceability information not available |
<S18>/r_phaC_Trap | Traceability information not available |
<S19>/a_elecAngleAdv | Traceability information not available |
<S19>/r_phaA_Sin | Traceability information not available |
<S19>/r_phaB_Sin | Traceability information not available |
<S19>/r_phaC_Sin | Traceability information not available |
<S20>/a_elecAngleAdv | Traceability information not available |
<S20>/r_phaA_Sin3 | Traceability information not available |
<S20>/r_phaB_Sin3 | Traceability information not available |
<S20>/r_phaC_Sin3 | Traceability information not available |
<S21>/r_phaB | Traceability information not available |
<S21>/Terminator_1 | Traceability information not available |
<S22>/r_phaC | Traceability information not available |
<S22>/Terminator_1 | Traceability information not available |
<S23>/r_phaA | Traceability information not available |
<S23>/Terminator_1 | Traceability information not available |
No traceable objects in this Subsystem.
Object Name | Code Location |
---|---|
<S2>/F02_Electrical_Angle_Calculation | BLDC_controller.c:373, 448 |
<S2>/If1 | BLDC_controller.c:352, 355, 356, 357, 358, 361, 362, 372, 451, 673, 674 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 |
---|---|
<S10>/Constant1 | BLDC_controller.c:620, 623, 626, 629, 656, 659 |
<S10>/Divide1 | BLDC_controller.c:621, 623, 627, 629, 657, 659 |
<S10>/Divide2 | BLDC_controller.c:560, 612, 613, 614 |
<S10>/Divide4 | BLDC_controller.c:561, 575, 576, 577 |
<S10>/Switch1 | BLDC_controller.c:552, 572, 575, 576, 577, 612, 613, 614, 617 |
<S10>/z_commutMap_M1 | BLDC_controller.c:559, 569, 579, 580, 582, 585, 586, 587, 589, 592, 594, 598, 601, 604, 608, 611, 612, 613, 614 BLDC_controller.h:108 BLDC_controller_data.c:86 |
Object Name | Code Location |
---|---|
<S12>/Selector | BLDC_controller.c:213, 216, 238, 240, 385, 390, 392, 393, 394, 567, 579, 586, 596, 601, 606 |
<S12>/Sum | BLDC_controller.c:169, 176, 177, 386, 392, 393, 394 |
<S12>/g_Ha | BLDC_controller.c:170, 176, 379, 393 |
<S12>/g_Hb | BLDC_controller.c:171, 177, 380, 393, 394 |
<S12>/vec_hallToPos | BLDC_controller.c:212, 216, 237, 240, 377, 390, 392, 553, 579, 586, 595, 601, 605 BLDC_controller.h:113 BLDC_controller_data.c:92 |
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.
No traceable objects in this Subsystem.