135 lines
4.4 KiB
C
135 lines
4.4 KiB
C
/*!
|
|
Copyright 2017 ÀÎ "ÍÈÈÝÒ" è ÎÎÎ "ÍÏÔ ÂÅÊÒÎÐ"
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
\file build.h
|
|
\brief Êîíôèãóðàöèîííûé çàãîëîâî÷íûé ôàéë
|
|
Ñîäåðæèò ãëîáàëüíûå ìàêðîîïðåäåëåíèÿ, èñïîëüçóåìûå âî âñåì ïðîåêòå.
|
|
\author ÎÎÎ "ÍÏÔ Âåêòîð". http://motorcontrol.ru
|
|
\version v 3.0 30/05/2017
|
|
|
|
@{
|
|
*/
|
|
|
|
//Âûáîð òèïà àïïàðàòíîé ÷àñòè
|
|
|
|
//Êîíòðîëëåð MCB3 ñ ðåôåðåíñíûì ñèëîâûì ïðåîáðàçîâàòåëåì
|
|
//#define HW_MCB3
|
|
|
|
//Êîíòðîëëåð MCB3 ñ èìèòàöèîííûìè ìîäåëÿìè äâèãàòåëåé
|
|
#define HW_MCB3_SIMULATOR
|
|
|
|
//Äëÿ UART, âûáèðàåòñÿ ÷åì åãî çàíÿòü - MODBUS èëè CANtoRS äðàéâåðîì
|
|
//#define MODBUS_ENA
|
|
#define CANTORS_ENA
|
|
|
|
//Âûáîð òèïà òðèãîíîìåòðè÷åñêèõ îïåðàöèé äëÿ ïðåîáðàçîâàíèé Park è iPark - àïïàðàòíî ÷åðåç áëîê TMU èëè ïðîãðàììíî ñ ïîìîùüþ áèáëèîòåêè IQMath
|
|
#define PARK_IPARK_TMU
|
|
//#define PARK_IPARK_IQMATH
|
|
|
|
|
|
//!Ðåæèìû ðàáîòû (ñîñòîÿíèÿ ÄÀ sm_ctrl)
|
|
//! Ðåæèì îñòàíîâ
|
|
#define CTRL_STOP 0
|
|
//! Ðåæèì çàïóñêà (âêëþ÷åíèå ØÈÌ, ïåðåõîä â äðóãîé æåëàåìûé ðåæèì ðàáîòû)
|
|
#define CTRL_RUN 1
|
|
//! Ðåæèì íàìàãíè÷èâàíèå (ïîñòîÿííûé òîê), ðàáîòàåò êîíòóð òîêà
|
|
#define CTRL_FLUXING 2
|
|
//! Ðåæèì ñêàëÿðíîãî óïðàâëåíèÿ ïî êðèâîé U(f) áåç êîíòóðîâ òîêà
|
|
#define CTRL_RUN_U2F 3
|
|
//! Ðåæèì âðàùåíèÿ âåêòîðà òîêà
|
|
#define CTRL_RUN_I2F 4
|
|
//! Âåêòîðíàÿ ñòðóêòóðà óïðàâëåíèÿ äâóõêîíòóðíàÿ ñ äàò÷èêîì äëÿ ñèíõðîííîé ìàøèíû
|
|
#define CTRL_RUN_VECTOR_SM 5
|
|
//! Âåêòîðíàÿ ñòðóêòóðà óïðàâëåíèÿ ñ ýíêîäåðîì è ñ êîíòóðîì ïîëîæåíèÿ äëÿ ñèíõðîííîé ìàøèíû
|
|
#define CTRL_RUN_VECTOR_SM_ENCODER_POS 10
|
|
|
|
//! Âåêòîðíîå óïðàâëåíèå äëÿ àñèíõðîííîãî äâèãàòåëÿ ñ ýíêîäåðîì ñ êîíòóðîì ñêîðîñòè
|
|
#define CTRL_RUN_VECTOR_IM_ENCODER 55
|
|
|
|
//! Âåêòîðíîå óïðàâëåíèå äëÿ àñèíõðîííîãî äâèãàòåëÿ ñ ýíêîäåðîì ñ êîíòóðîì ñêîðîñòè è ïîëîæåíèÿ
|
|
#define CTRL_RUN_VECTOR_IM_ENCODER_POS 60
|
|
|
|
//! Ðåæèì êàëèáðîâêè äàò÷èêà ïîëîæåíèÿ
|
|
#define CTRL_AUTO_SENSOR_TUNING 29
|
|
|
|
//! Ñòðóêòóðà óïðàâëåíèÿ äâèãàòåëåì ïîñòîÿííîãî òîêà áåç êîíòóðîâ: çàäàíèå íàïðÿæåíèÿ íà îáìîòêè
|
|
#define CTRL_DC_DRIVE 35
|
|
//! Ñòðóêòóðà óïðàâëåíèÿ äâèãàòåëåì ïîñòîÿííîãî òîêà ñ êîíòóðîì òîêà è ñêîðîñòè
|
|
#define CTRL_DC_DRIVE_FB 36
|
|
|
|
//! Ðåæèì àâòîêîììóòàöèè äëÿ SRM
|
|
#define CTRL_RUN_SRM_AUTOCOMMUTATION 101
|
|
|
|
|
|
|
|
|
|
//Ôëàãè àâàðèé äëÿ ìîäóëÿ çàùèò
|
|
|
|
//bit_fault1
|
|
#define F_CTRL_LOW_UDC 0x1
|
|
#define F_CTRL_HI_UDC 0x2
|
|
#define F_ENCODER_FAULT 0x4
|
|
#define F_MODEL_FAULT 0x8
|
|
#define F_FLASH_PROGRAM 0x10
|
|
#define F_CTRL_HI_TEMP 0x20
|
|
//#define F_RESERVED 0x40
|
|
//#define F_RESERVED 0x80
|
|
#define F_PROGRAM_1K 0x100
|
|
#define F_PROGRAM_10K 0x200
|
|
#define F_PROGRAM_40K 0x400
|
|
//#define F_RESERVED 0x800
|
|
#define F_PDPINT 0x1000
|
|
#define F_RELAY_START 0x2000
|
|
#define F_PROGRAM_IS_ON_BFLASH 0x4000
|
|
//#define F_RESERVED 0x8000
|
|
|
|
//bit_fault2
|
|
//#define F_RESERVED 0x1
|
|
//#define F_RESERVED 0x2
|
|
//#define F_RESERVED 0x4
|
|
//#define F_RESERVED 0x8
|
|
#define F_CTRL_MAX_I_PH_A 0x10
|
|
#define F_CTRL_MAX_I_PH_B 0x20
|
|
#define F_CTRL_MAX_I_PH_C 0x40
|
|
//#define F_RESERVED 0x80
|
|
//#define F_RESERVED 0x100
|
|
#define F_CTRL_SPEED_MAX 0x200
|
|
//#define F_RESERVED 0x400
|
|
//#define F_RESERVED 0x800
|
|
#define F_PDP_SWITCH_A0 0x1000
|
|
#define F_PDP_SWITCH_A1 0x2000
|
|
#define F_PDP_SWITCH_A2 0x4000
|
|
#define F_PDP_SWITCH_LOWER 0x8000
|
|
|
|
|
|
#define POS_SENSOR_TYPE_NO_SENSOR 0
|
|
#define POS_SENSOR_TYPE_ENCODER 1
|
|
#define POS_SENSOR_TYPE_HALL 2
|
|
#define POS_SENSOR_TYPE_ENC_HALL 3
|
|
#define POS_SENSOR_TYPE_SSI 4
|
|
#define POS_SENSOR_TYPE_SENSORLESS 5
|
|
|
|
//!Âðåìÿ äèñêðåòèçàöèè áûñòðîãî ðàñ÷åòà (ïðåðûâàíèå, êîòîðîå îáû÷íî 10êÃö)
|
|
#define FAST_CALC_TS _IQ(0.0001)
|
|
|
|
|
|
|
|
#if (!defined(HW_MCB3)) && (!defined(HW_MCB3_SIMULATOR))
|
|
#error íåîáõîäèìî îïðåäåëèòü õîòÿ áû îäíó âåðñèþ àïïàðàòíîé ÷àñòè
|
|
#endif
|
|
|
|
|
|
/*@}*/
|