Razvalyaev
7e0063eee0
Все основные файлы подтянуты без изменений Изменены (только папка main_matlab): - заглушки для ненужных функций (main_matlab.c) - iq библиотека (IQmathLib_matlab.c) - библиотеки DSP281x
183 lines
5.9 KiB
C
183 lines
5.9 KiB
C
#ifndef _PARAMS
|
|
#define _PARAMS
|
|
|
|
|
|
#if(_FLOOR6)
|
|
|
|
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_ROTOR 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_PWM 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_RS 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_SYNC 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_GO 0//1
|
|
|
|
#else
|
|
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS 0
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_ROTOR 0
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_PWM 0
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_RS 0
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_SYNC 0//1
|
|
#define _ENABLE_PWM_LINES_FOR_TESTS_GO 0//1
|
|
#endif
|
|
|
|
|
|
#if(_FLOOR6)
|
|
#define MODE_DISABLE_ENABLE_WDOG 1 // 0 - wdog ðàáîòàåò, 1 - çàïðåùåí
|
|
#else
|
|
#define MODE_DISABLE_ENABLE_WDOG 0 // 0 - wdog ðàáîòàåò, 1 - çàïðåùåí
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CHECK_IN_OUT_TERMINAL 1
|
|
|
|
#define WORK_ON_STEND_D 0//1
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
#ifndef MODE_DISABLE_ENABLE_WDOG
|
|
#define MODE_DISABLE_ENABLE_WDOG 0
|
|
#endif
|
|
|
|
|
|
#ifndef CHECK_IN_OUT_TERMINAL
|
|
#define CHECK_IN_OUT_TERMINAL 0
|
|
#endif
|
|
|
|
#ifndef WORK_ON_STEND_D
|
|
#define WORK_ON_STEND_D 0
|
|
#endif
|
|
|
|
|
|
|
|
/*************************************************************************************/
|
|
//#define BAN_ROTOR_REVERS_DIRECT 1
|
|
|
|
//#define TIME_PAUSE_ZADATCHIK 750//500
|
|
|
|
//#define TIME_SET_LINE_RELAY_FAN 3000 // âðåìß ïîäà÷è èìïóëüñà íà ðåëå âêëþ÷åíèå âûêëþ÷åíèå âåíòèëßòîðà
|
|
//#define LEVEL_FAN_ON_TEMPER_ACDRIVE 1400 //óðîâåíü âêëþ÷åíèß âåíòèëßòîðà îõëàæäåíèß äâèãàòåëß
|
|
//#define LEVEL_FAN_OFF_TEMPER_ACDRIVE 1200 //óðîâåíü âûêëþ÷åíèß âåíòèëßòîðà îõëàæäåíèß äâèãàòåëß
|
|
//(äîëæåí áûòü ìåíüøå LEVEL_FAN_ON_TEMPER_ACDRIVE ñ çàïàñîì íà ãåñòèðåçèñ ~20 ãðàäóñîâ )
|
|
//#define TIME_SET_LINE_RELAY_FAN 3000 //âðåìß ïîäà÷è èìïóëüñà íà ðåëå âêëþ÷åíèå âûêëþ÷åíèå âåíòèëßòîðà
|
|
|
|
/*
|
|
#define MAX_TIME_DIRECT_ROTOR 5000 // ìàêñ. çíà÷åíèå ñ÷åò÷èêà íà îïðåäåëåíèå íàïðàâëåíèß âðàùåíèß
|
|
#define MIN_TIME_DIRECT_ROTOR -5000 // ìèíèìàëüíîå çíà÷åíèå ñ÷åò÷èêà íà îïðåäåëåíèå íàïðàâëåíèß âðàùåíèß
|
|
|
|
#define LEVEL_FORWARD_TIME_DIRECT_ROTOR 4000 // çíà÷åíèå ñ÷åò÷èêà êîòîðîå ñ÷èòàåòñß ÷òî íàïðàâëåíèå âïåðåä
|
|
#define LEVEL_BACK_TIME_DIRECT_ROTOR -4000 // çíà÷åíèå ñ÷åò÷èêà êîòîðîå ñ÷èòàåòñß ÷òî íàïðàâëåíèå íàçàä
|
|
|
|
#define MAX_TIME_ERROR_ROTOR 5000 // ìàêñ. çíà÷åíèå ñ÷åò÷èêà íà îïðåäåëåíèå íåèñïðàâíîñòè îïðåäæåëåíèß âðàùåíèß
|
|
#define MIN_TIME_ERROR_ROTOR 0 // ìèí. çíà÷åíèå ñ÷åò÷èêà íà îïðåäåëåíèå íåèñïðàâíîñòè îïðåäæåëåíèß âðàùåíèß
|
|
|
|
|
|
#define LEVEL_ON_ERROR_ROTOR 4000 // çíà÷åíèå ñ÷åò÷èêà êîòîðîå ñ÷èòàåòñß ÷òî íàïðàâëåíèå îïðåäåëßåòñß ñ îøèáêîé
|
|
#define LEVEL_OFF_ERROR_ROTOR 1000 // çíà÷åíèå ñ÷åò÷èêà êîòîðîå ñ÷èòàåòñß ÷òî íàïðàâëåíèå îïðåäåëßåòñß áåç îøèáêîé
|
|
*/
|
|
|
|
|
|
/*
|
|
#define PID_KP_IM 0.018 //0.036 //0.018 //0.18 //0.095 // PID Kp
|
|
#define PID_KI_IM 0.08 // 0.008 // PID Ki
|
|
#define PID_KD_IM 0.0000 //100 // PID Kd
|
|
#define PID_KC_IM 0.09 // PID Kc
|
|
|
|
|
|
#define PID_KP_F 12//26//12 //40 //20 //12 //20 //60.0 //20.0 //0.095 // PID Kp
|
|
#define PID_KI_F 0.00010 // 0.008 // PID Ki
|
|
#define PID_KD_F 0.000 //100 PID Kd
|
|
#define PID_KC_F 0.005 // PID Kc
|
|
//#define PID_KC_F 0.000 // PID Kc
|
|
|
|
#define ADD_KP_DF (1000.0/NORMA_MZZ)//(500.0/NORMA_MZZ)//(50.0/NORMA_MZZ)
|
|
#define ADD_KI_DF (2000.0/NORMA_MZZ)//(1000.0/NORMA_MZZ)//(100.0/NORMA_MZZ)
|
|
#define MAX_DELTA_pidF 2.0
|
|
#define MIN_MZZ_FOR_DF 1761607 //(210/NORMA_MZZ)
|
|
*/
|
|
|
|
/*
|
|
#define Im_PREDEL 600 // ïðåäåëüíûé ôàçíûé òîê ïðè ðàáîòå îò ñåòè
|
|
#define I_OUT_PREDEL -20 // ïðåäåëüíûé ìèí. òîê ïîòðåáëåíèy ïðè ðàáîòå îò ñåòè
|
|
#define U_IN_PREDEL 500 // ïðåäåëüíîå ìàêñèìàëüíîå âõîäíîå íàïðyæåíèå ïðè ðàáîòå îò ñåòè
|
|
|
|
#define IQ_NORMAL_CHARGE_UD_MAX 12163481 // 1450 V //13002342 // 1550 //_IQtoF(filter.iqU_1_long)*NORMA_ACP
|
|
#define IQ_NORMAL_CHARGE_UD_MIN 10066329 // 1200 V
|
|
|
|
|
|
#define U_D_MAX_ERROR_GLOBAL 17616076 // 2100 V //17196646 //2050V // 16777216 //2000V/2000*2^24
|
|
#define U_D_MAX_ERROR 16777216 // 2000V //16357785 //1950V //15938355 //1900V/2000*2^24
|
|
|
|
//#define U_D_NORMA_MIN 3774873 // 450 V // 13421772 // 450 V 22.05.08 //1600V/2000*2^24
|
|
//#define U_D_NORMA_MAX 15518924 // //15099494 //1850V/2000*2^24
|
|
|
|
#define U_D_MIN_ERROR 10905190 // 1300V/2000*2^24
|
|
|
|
#define I_IN_MAX_ERROR_GLOBAL 18454937 // 2200 A //16777216 //2000 A // 13421772 //1600 A //10905190 //1300 // 900A
|
|
|
|
#define KOEFF_WROTOR_FILTER_SPARTAN 7//8
|
|
#define MAX_DELTA_WROTOR_S_1_2 1
|
|
|
|
#define ENABLE_I_HDW_PROTECT_ON_GLOBAL 1 // ðàçðåøèòü îòêëþ÷àòü ñèëîâûå àâòîìàòû ïî àïïàðàòíîé òîêîâîé çàùèòå
|
|
|
|
#define TIME_WAIT_CHARGE 2000 //5000 // 10000
|
|
#define TIME_WAIT_CHARGE_OUT 15000 //15000
|
|
#define TIME_SET_LINE_RELAY 10000
|
|
#define TIME_SET_LINE_RELAY5 3000
|
|
#define TIME_WAIT_LEVEL_QPU2 3000
|
|
*/
|
|
|
|
|
|
/*
|
|
///--------------------------- 22220 paremetrs -------------------/////////
|
|
|
|
////////////////////////////////////////////////////////////////
|
|
// Loaded capasitors level
|
|
#define V_CAPASITORS_LOADED_IQ 11184810 //13421772 ~ 2400V // 11184810 ~ 2000V
|
|
#define V_NOMINAL 15099494 //15099494 ~ 2700V
|
|
|
|
// Level of nominal currents
|
|
#define I_OUT_NOMINAL_IQ 10066329 //8388608 ~ 1500A //5592405 ~ 1000A // 10066329 ~ 1800A
|
|
//11184811 ~ 2000A // 12482249 ~ 2232A // 6710886 ~ 1200A
|
|
#define I_ZPT_NOMINAL_IQ 6123683 //1095A
|
|
|
|
|
|
|
|
#define NORMA_MZZ 3000 //5000
|
|
//#define NORMA_ACP 3000
|
|
#define DISABLE_TEST_TKAK_ON_START 1
|
|
//#define MOTOR_STEND 1
|
|
|
|
|
|
//#define FREQ_PWM 350 //401 //379
|
|
|
|
#ifdef MOTOR_STEND
|
|
#define POLUS 4 // ÷èñëî ïàð ïîëþñîâ
|
|
|
|
#define BPSI_NORMAL 0.9//0.7 //Hz
|
|
#define MAX_FZAD_FROM_SU 16.7 // Ìàêñèìàëüíî âîçìîæíî çàäàííûå îáîðîòû ñ ñèòåìû ÂÓ Ãö
|
|
#define MAX_FZAD_FROM_SU_OBOROT 1100
|
|
|
|
#else
|
|
#define POLUS 6 // ÷èñëî ïàð ïîëþñîâ
|
|
#define BPSI_NORMAL 0.9 //Hz
|
|
#define MAX_FZAD_FROM_SU 16.7 // Ìàêñèìàëüíî âîçìîæíî çàäàííûå îáîðîòû ñ ñèòåìû ÂÓ Ãö
|
|
#define MAX_FZAD_FROM_SU_OBOROT 1650
|
|
#define COS_FI 0.83
|
|
|
|
#endif
|
|
*/
|
|
|
|
#define KOEF_TEMPER_DECR_MZZ 2.0
|
|
|
|
#endif
|
|
|
|
|
|
|