diff --git a/Inu/app_wrapper/def.h b/Inu/app_wrapper/def.h index f901fdc..ae10217 100644 --- a/Inu/app_wrapper/def.h +++ b/Inu/app_wrapper/def.h @@ -11,7 +11,7 @@ // раскомментировать, если есть сдвиг между обмотками ГЭД (30 град.) #define SHIFT -#define SIMULINK_SEQUENCE V_PWM24_PHASE_SEQ_REVERS_BAC +#define SIMULINK_SEQUENCE V_PWM24_PHASE_SEQ_NORMAL_ABC /* V_PWM24_PHASE_SEQ_NORMAL_ABC, - красивый ток, некрасивое напряжения V_PWM24_PHASE_SEQ_NORMAL_BCA, - всё херня V_PWM24_PHASE_SEQ_NORMAL_CAB, - всё херня diff --git a/Inu/mcu_wrapper_conf.h b/Inu/mcu_wrapper_conf.h index ad1be02..7ef62bd 100644 --- a/Inu/mcu_wrapper_conf.h +++ b/Inu/mcu_wrapper_conf.h @@ -50,12 +50,11 @@ #define MCU_CORE_CLOCK 150000000 ///< MCU clock rate for simulation // Parameters of S_Function -#define NPARAMS 1 ///< number of input parametrs (only Ts) #define IN_PORT_WIDTH 20 ///< width of input ports #define IN_PORT_NUMB 1 ///< number of input ports #define OUT_PORT_WIDTH 51 ///< width of output ports #define OUT_PORT_NUMB 1 ///< number of output ports -#define DISC_STATES_WIDTH OUT_PORT_WIDTH*OUT_PORT_NUMB ///< width of discrete states array (outbup buffer) + #define RWORK_0_WIDTH 5 //width of the real-work vector #define IWORK_0_WIDTH 5 //width of the integer-work vector @@ -71,6 +70,9 @@ * @{ */ +// Fixed parameters(?) of S_Function +#define NPARAMS 1 ///< number of input parametrs (only Ts) +#define DISC_STATES_WIDTH OUT_PORT_WIDTH*OUT_PORT_NUMB ///< width of discrete states array (outbup buffer) /** * @brief Define for creating thread in suspended state. * @details Define from WinBase.h. We dont wanna include "Windows.h" or smth like this, because of HAL there are a lot of redefine errors. diff --git a/allmex.m b/allmex.m index 13310d4..be5c76d 100644 --- a/allmex.m +++ b/allmex.m @@ -1,4 +1,4 @@ -clear, clc +clc % Компилирует S-function delete("wrapper_inu.mexw64") diff --git a/init.m b/init.m index a686576..202a5ac 100644 --- a/init.m +++ b/init.m @@ -19,7 +19,7 @@ w0 = 0;%0.5;%-0.75;% Mst = 0.6;%0.6; % разрешаем/запрещаем сбросы/набросы момента нагрузки -changingLoadEnable = 1;%1 +changingLoadEnable = 0;%1 % разрешаем/запрещаем шум в измеренном токе noiseEnable = 0;%1;% % ... мощность шума @@ -58,12 +58,21 @@ UdcNom = Unom*SQRT2*1.18; Inom = Snom/(Unom*SQRT3)*SQRT2*0.5;%0.5 - т.к. обмоток две % параметры ГЭД -Rs = 11.8e-3;%Ом -Xls = 72.7e-3;%72.7e-3;%Ом -Rr = 11.1e-3*2.0;%*0.8;%Ом -Xlr = 85.5e-3;%Ом -Xm = 2.9322;%2.87;%Ом -Fe = 18;%Гц +% Rs = 11.8e-3;%Ом +% Xls = 72.7e-3;%72.7e-3;%Ом +% Rr = 11.1e-3*2.0;%*0.8;%Ом +% Xlr = 85.5e-3;%Ом +% Xm = 2.9322;%2.87;%Ом +% Fe = 18;%Гц +% Lls = Xls/(Fe*PI2);%Гн +% Llr = Xlr/(Fe*PI2);%Гн +% Lm = Xm/(Fe*PI2);%Гн +Rs = 0.0362;%Ом +Xls = 0.4016;%Ом +Rr = 0.139;%Ом +Xlr = 0.2006;%Ом +Xm = 5.2796;%Ом +Fe = 18.2;%Гц Lls = Xls/(Fe*PI2);%Гн Llr = Xlr/(Fe*PI2);%Гн Lm = Xm/(Fe*PI2);%Гн