Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amcbldc: Check overload current limit against filtered Iq #358

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

constexpr embot::app::theCANboardInfo::applicationInfo applInfo
{
embot::prot::can::versionOfAPPLICATION {1, 0, 9},
embot::prot::can::versionOfAPPLICATION {1, 0, 10},
embot::prot::can::versionOfCANPROTOCOL {2, 0}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 5.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:28 2023
// C/C++ source code generated on : Mon Mar 13 14:26:47 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down Expand Up @@ -232,7 +232,7 @@ void AMC_BLDC_step_FOC(void) // Sample time: [3.65714285714286E-5s, 0.0s]
AMC_BLDC_DW.RTBInsertedForAdapter_Inserte_i[AMC_BLDC_DW.RTBInsertedForAdapter_Insert_bw];

// ModelReference: '<Root>/FOC' incorporates:
// Inport generated from: '<Root>/In Bus Element6'
// Inport generated from: '<Root>/In Bus Element5'
// Outport generated from: '<Root>/Out Bus Element'

control_foc(&AMC_BLDC_U.SensorsData_p, &rtb_BusConversion_InsertedFor_F,
Expand Down Expand Up @@ -274,7 +274,7 @@ void AMC_BLDC_step_FOC(void) // Sample time: [3.65714285714286E-5s, 0.0s]
// End of RateTransition generated from: '<Root>/Adapter1'

// RateTransition generated from: '<Root>/Adapter3' incorporates:
// Inport generated from: '<Root>/In Bus Element6'
// Inport generated from: '<Root>/In Bus Element5'

rtw_mutex_lock();
wrBufIdx = static_cast<int8_T>(AMC_BLDC_DW.RTBInsertedForAdapter_Inserte_g + 1);
Expand Down Expand Up @@ -394,27 +394,6 @@ void AMC_BLDC_step_Time(void) // Sample time: [0.001s, 0.0s]
filter_current(&rtb_BusConversion_InsertedFor_F,
&AMC_BLDC_Y.EstimatedData_p.Iq_filtered);

// RateTransition generated from: '<Root>/Adapter2' incorporates:
// Outport generated from: '<Root>/Out Bus Element2'

rtw_mutex_lock();
wrBufIdx = static_cast<int8_T>(AMC_BLDC_DW.RTBInsertedForAdapter_Insert_b2 + 1);
if (wrBufIdx == 3) {
wrBufIdx = 0;
}

if (wrBufIdx == AMC_BLDC_DW.RTBInsertedForAdapter_Insert_ko) {
wrBufIdx = static_cast<int8_T>(wrBufIdx + 1);
if (wrBufIdx == 3) {
wrBufIdx = 0;
}
}

rtw_mutex_unlock();
AMC_BLDC_DW.RTBInsertedForAdapter_Inserte_k[wrBufIdx] =
AMC_BLDC_Y.EstimatedData_p;
AMC_BLDC_DW.RTBInsertedForAdapter_Insert_b2 = wrBufIdx;

// ModelReference: '<S6>/CAN_Decoder' incorporates:
// Inport generated from: '<Root>/In Bus Element2'

Expand All @@ -431,9 +410,9 @@ void AMC_BLDC_step_Time(void) // Sample time: [0.001s, 0.0s]
SupervisorFSM_RX(&AMC_BLDC_B.RTBInsertedForAdapter_InsertedF,
&AMC_BLDC_U.ExternalFlags_p,
&AMC_BLDC_B.RTBInsertedForAdapter_Inserte_a,
&AMC_BLDC_B.CAN_Decoder_o1, &AMC_BLDC_B.CAN_Decoder_o2,
&AMC_BLDC_B.CAN_Decoder_o3, &AMC_BLDC_Y.Flags_p,
&rtb_SupervisorFSM_RX_o2,
&AMC_BLDC_B.CAN_Decoder_o1, &AMC_BLDC_Y.EstimatedData_p,
&AMC_BLDC_B.CAN_Decoder_o2, &AMC_BLDC_B.CAN_Decoder_o3,
&AMC_BLDC_Y.Flags_p, &rtb_SupervisorFSM_RX_o2,
&AMC_BLDC_Y.ConfigurationParameters_p);

// ModelReference: '<S7>/SupervisorFSM_TX' incorporates:
Expand Down Expand Up @@ -540,6 +519,27 @@ void AMC_BLDC_step_Time(void) // Sample time: [0.001s, 0.0s]
rtb_SupervisorFSM_RX_o2;
AMC_BLDC_DW.RTBInsertedForAdapter_Insert_jj = wrBufIdx;

// RateTransition generated from: '<Root>/Adapter2' incorporates:
// Outport generated from: '<Root>/Out Bus Element2'

rtw_mutex_lock();
wrBufIdx = static_cast<int8_T>(AMC_BLDC_DW.RTBInsertedForAdapter_Insert_b2 + 1);
if (wrBufIdx == 3) {
wrBufIdx = 0;
}

if (wrBufIdx == AMC_BLDC_DW.RTBInsertedForAdapter_Insert_ko) {
wrBufIdx = static_cast<int8_T>(wrBufIdx + 1);
if (wrBufIdx == 3) {
wrBufIdx = 0;
}
}

rtw_mutex_unlock();
AMC_BLDC_DW.RTBInsertedForAdapter_Inserte_k[wrBufIdx] =
AMC_BLDC_Y.EstimatedData_p;
AMC_BLDC_DW.RTBInsertedForAdapter_Insert_b2 = wrBufIdx;

// Update for UnitDelay generated from: '<Root>/Adapter4' incorporates:
// Outport generated from: '<Root>/Out Bus Element3'

Expand Down Expand Up @@ -602,7 +602,7 @@ void AMC_BLDC_initialize(void)
filter_current_Init();

// SystemInitialize for ModelReference: '<Root>/FOC' incorporates:
// Inport generated from: '<Root>/In Bus Element6'
// Inport generated from: '<Root>/In Bus Element5'
// Outport generated from: '<Root>/Out Bus Element'

control_foc_Init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 5.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:28 2023
// C/C++ source code generated on : Mon Mar 13 14:26:47 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 5.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:28 2023
// C/C++ source code generated on : Mon Mar 13 14:26:47 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 5.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:28 2023
// C/C++ source code generated on : Mon Mar 13 14:26:47 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:38 2023
// C/C++ source code generated on : Mon Mar 13 14:26:07 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:38 2023
// C/C++ source code generated on : Mon Mar 13 14:26:07 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:38 2023
// C/C++ source code generated on : Mon Mar 13 14:26:07 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:38 2023
// C/C++ source code generated on : Mon Mar 13 14:26:07 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:45 2023
// C/C++ source code generated on : Mon Mar 13 14:26:12 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:45 2023
// C/C++ source code generated on : Mon Mar 13 14:26:12 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:45 2023
// C/C++ source code generated on : Mon Mar 13 14:26:12 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:45 2023
// C/C++ source code generated on : Mon Mar 13 14:26:12 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.1
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:32:52 2023
// C/C++ source code generated on : Mon Mar 13 14:26:19 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:01 2023
// C/C++ source code generated on : Mon Mar 13 14:26:26 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:01 2023
// C/C++ source code generated on : Mon Mar 13 14:26:26 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:01 2023
// C/C++ source code generated on : Mon Mar 13 14:26:26 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:01 2023
// C/C++ source code generated on : Mon Mar 13 14:26:26 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:11 2023
// C/C++ source code generated on : Mon Mar 13 14:26:33 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:11 2023
// C/C++ source code generated on : Mon Mar 13 14:26:33 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:11 2023
// C/C++ source code generated on : Mon Mar 13 14:26:33 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:11 2023
// C/C++ source code generated on : Mon Mar 13 14:26:33 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:19 2023
// C/C++ source code generated on : Mon Mar 13 14:26:39 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:19 2023
// C/C++ source code generated on : Mon Mar 13 14:26:39 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:19 2023
// C/C++ source code generated on : Mon Mar 13 14:26:39 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C/C++ source code generated on : Thu Feb 23 16:33:19 2023
// C/C++ source code generated on : Mon Mar 13 14:26:39 2023
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex-M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// Model version : 4.0
// Simulink Coder version : 9.8 (R2022b) 13-May-2022
// C++ source code generated on : Fri Dec 9 15:00:27 2022
// C++ source code generated on : Mon Mar 13 13:21:54 2023

#include "rtwtypes.h"

Expand Down
Loading