#include "DSP281x_Device.h" #include "wrapper_inu.h" #include "def.h" #include "edrk_main.h" #include "vector.h" #include "vector_control.h" #include "adc_tools.h" #include "uf_alg_ing.h" #include "v_rotor.h" #include "v_rotor_22220.h" #include "v_pwm24_v2.h" #include "control_station.h" #include "control_station_project.h" #include "CAN_Setup.h" #include "RS_Functions.h" #include "master_slave.h" #include #include #include #include #include #include #ifndef __WRAPPER_CONTROLLER_H #define __WRAPPER_CONTROLLER_H // Максимальная длина параметра-вектора #define LEN_PARAM_MATR 21 // Массивы с параметрами S_Function double paramScal[NPARAMS]; double paramMatr[LEN_PARAM_MATR*2]; int paramMatrDimen; // Переменные, которые определены в controller.c (begin) //######################################################################### // Параметры //double ; // Входы typedef struct { double udc1_ml; double udc2_ml; double ia1_ml; double ib1_ml; double ic1_ml; double ia2_ml; double ib2_ml; double ic2_ml; double wm_ml; }UMotorMeasure; extern UMotorMeasure motor; // Для имитации обмена с ПУ int j; unsigned short paramNo; unsigned short paramNew[PAR_NUMBER]; // Для моделирования Event Manager // ... Time-Base Submodule, Counter-Compare Submodule и Event-Trigger Submodule typedef struct { double TxCntPlus; double TPr; double tcntAux; double tcntAuxPrev; double tcnt; double cmp1A; double cmp1B; }TimerSimHandle; extern TimerSimHandle t1sim; extern TimerSimHandle t2sim; extern TimerSimHandle t3sim; extern TimerSimHandle t4sim; extern TimerSimHandle t5sim; extern TimerSimHandle t6sim; extern TimerSimHandle t7sim; extern TimerSimHandle t8sim; extern TimerSimHandle t9sim; extern TimerSimHandle t10sim; extern TimerSimHandle t11sim; extern TimerSimHandle t12sim; // ... Action-Qualifier Submodule int ci1A; int ci1B; int ci2A; int ci2B; int ci3A; int ci3B; int ci4A; int ci4B; int ci5A; int ci5B; int ci6A; int ci6B; int ci7A; int ci7B; int ci8A; int ci8B; int ci9A; int ci9B; int ci10A; int ci10B; int ci11A; int ci11B; int ci12A; int ci12B; // ... Dead-Band Submodule typedef struct { int CntDt; int stateDt; int cntDt; int ciA_DT; int ciB_DT; }DeadBandSimHandle; extern DeadBandSimHandle dt1sim; extern DeadBandSimHandle dt2sim; extern DeadBandSimHandle dt3sim; extern DeadBandSimHandle dt4sim; extern DeadBandSimHandle dt5sim; extern DeadBandSimHandle dt6sim; extern DeadBandSimHandle dt7sim; extern DeadBandSimHandle dt8sim; extern DeadBandSimHandle dt9sim; extern DeadBandSimHandle dt10sim; extern DeadBandSimHandle dt11sim; extern DeadBandSimHandle dt12sim; // Для моделирования eQEP double Qposmax; double qposcnt; // Для моделирования ADC int tAdc; int Tadc; int nAdc; //######################################################################### // Переменные, которые определены в controller.c (end) // Переменные, которые объявлены в controller.c (begin) //######################################################################### // Для isr.c //------------------------------------------------------------------------- extern struct Offset offset; extern volatile struct Result result; extern volatile short state; extern volatile short faultNo; extern volatile struct Out out; // Udc extern float Kudc; extern volatile float udc1Nf; extern volatile float udc1; extern volatile float udc2Nf; extern volatile float udc2; // Iac extern volatile float ia1Nf; extern volatile float ib1Nf; extern volatile float ix1; extern volatile float iy1; extern volatile float iac1Nf; extern volatile float ia2Nf; extern volatile float ib2Nf; extern volatile float ix2; extern volatile float iy2; extern volatile float iac2Nf; // Wm extern float Kwm; extern volatile float wmNf; extern volatile float wm; extern volatile float wmAbs; // Me extern volatile float kMe; extern float KmeCorr; extern float Kme; extern volatile float meNf; extern volatile float me; // Pm extern volatile float pm; // защиты extern struct Protect protect; extern volatile struct Emerg emerg; extern short csmSuccess; // управляющая логика extern volatile short onceShutdown; extern volatile short testParamFaultNo; extern volatile short onceFaultReset; extern volatile short stopPause; extern volatile short inuWork; // обмен extern struct Mst mst; // Для main.c //------------------------------------------------------------------------- extern struct Eprom eprom; // Для upr.c //------------------------------------------------------------------------- extern volatile short onceUpr; extern struct SgmPar sgmPar; extern struct Rf rf; extern struct Rs rs; extern struct Rp rp; extern float IzLim; extern volatile float psi; extern float idZ; extern float iqZ; extern float iZ; extern float ws; extern float sinTheta; extern float cosTheta; extern float id1; extern float iq1; extern float id2; extern float iq2; extern struct Cc cc; extern struct Cf cf; extern struct Csp csp; extern struct Ivc ivc; extern struct Ip ip; // Для param.c //------------------------------------------------------------------------- extern unsigned short param[]; //######################################################################### // Переменные, которые объявлены в controller.c (end) #endif //__WRAPPER_CONTROLLER_H