motorcontroldemo_028/Vinclude/V_common.h
2019-07-29 08:18:57 +03:00

129 lines
3.6 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 v_common.h
\brief Îáúÿâëåíèå ñòðóêòóð äàííûõ ðàçëè÷íîãî íàçíà÷åíèÿ, êîòîðûå åùå ñëèøêîì ìàëû äëÿ òîãî, ÷òîáû
îðãàíèçîâûâàòü èõ â îòäåëüíûé ìîäóëü
\author ÎÎÎ "ÍÏÔ Âåêòîð". Âñå ïðàâà çàùèùåíû. http://motorcontrol.ru
\version v 2.0 25/03/2016
\defgroup v_common Îáúÿâëåíèå ñòðóêòóð äàííûõ ðàçëè÷íîãî íàçíà÷åíèÿ
@{*/
#ifndef V_COMMON_H
#define V_COMMON_H
#ifdef __cplusplus
extern "C"
{
#endif
//!Áèòîâîå ïîëå äëÿ áèòîâîãî ñòàòóñà ñèñòåìû óïðàâëåíèÿ
typedef struct
{
unsigned int ready:
1;
unsigned int running:
1;
unsigned int fault:
1;
unsigned int alarm:
1;
unsigned int testing:
1;
unsigned int overheat:
1;
} DRV_STATUS_BIT;
//!Ñòðóêòóðà äëÿ ñòàòóñà ñèñòåìû óïðàâëåíèÿ (ñîäåðæèò DRV_STATUS_BIT)
typedef union
{
int all;
DRV_STATUS_BIT bit;
}TDrvStatus;
//!Áèòîâîå ïîëå ñëîâà óïðàâëåíèÿ
typedef struct
{
unsigned int start:
1;
unsigned int stop:
1;
unsigned int trip_reset:
1;
unsigned int reserved:
5;
} CMD_BIT;
//!Ñòðóêòóðà ñëîâà óïðàâëåíèÿ (ñîäåðæèò DRV_STATUS_BIT)
typedef union
{
unsigned int all;
CMD_BIT bit;
}TCmd;
//! Ñòðóêòóðà, ñîäåðæàùèÿ îñíîâíûå çàäàíèÿ äëÿ ïðèâîäà
typedef volatile struct
{
long speed_ref;//!< Çàäàíèå ñêîðîñòè
long Iq_ref;//!< Çàäàíèå òîêîîãðàíè÷åíèÿ äëÿ âåêòîðíîé ñèñòåìû óïðàâëåíèÿ
long i_flux_ref;//!< Çàäàíèå òîêà äëÿ çàìêíóòîé ïî òîêó ñèñòåìû óïðàâëåíèÿ (íå âåêòîðíîé)
long theta_elec;//!< Çàäàíèå óãëîâîãî ïîëîæåíèÿ âåêòîðà òîêà/íàïðÿæåíèÿ
long ua_ref, uf_ref; // Çàäàíèÿ òîêà ÿêîðÿ è òîêà ÎÂ äëÿ ÄÏÒ
long DCMspeed_ref;//!< Çàäàíèå ñêîðîñòè
} TRefs;
//! Ñòðóêòóðà äëÿ õðàíåíèÿ ïàðàìåòðîâ ïðèâîäà, äâèãàòåëÿ, áàçîâûõ âåëè÷èí ñèñòåìû óïðàâëåíèÿ
typedef struct
{
long Rs;//!< Ñîïðîòèâëåíèå ôàçû ñòàòîðà
long Ls;//!< Èíäóêòèâíîñòü ôàçû ñòàòîðà
int p;//!< Êîëè÷åñòâî ïàð ïîëþñîâ
int I_nom;//!< Íîìèíàëüíûé (áàçîâûé) ôàçíûé òîê â ôîðìàòå 16.0
long _1_I_nom;//!< 1/I_nom
int U_nom;//!< Íîìèíàëüíîå (áàçîâîå) ôàçíîå íàïðÿæåíèå â ôîðìàòå 16.0
long _1_U_nom;//!< 1/U_nom
int Udc_nom;//!< Íîìèíàëüíîå (áàçîâîå) íàïðÿæåíèå ÇÏÒ â ôîðìàòå 16.0
long _1_Udc_nom;//!< 1/Udc_nom
int speed_nom;//!< Íîìèíàëüíàÿ (áàçîâàÿ) ñêîðîñòü â ôîðìàòå 16.0
int freq_nom;//!< Íîìèíàëüíàÿ (áàçîâàÿ) ÷àñòîòà â ôîðìàòå 16.0
int power;//!< Íîìèíàëüíàÿ (áàçîâàÿ) ìîùíîñòü â ôîðìàòå 16.0
int sens_type;//!< Òèï äàò÷èêà ïîëîæåíèÿ
} TDrvParams;
//! Ñòðóêòóðà äëÿ áèòîâûõ "ïåðåêëþ÷àòåëåé", òàêèõ êàê íàïðàâëåíèå âðàùåíèÿ, ðàçðåøåíèå ðåêóïåðàöèè è ò.ï.
typedef struct {
Uint16 recuperation_ena;//!< Ðàçðåøåíèå ðåêóïåðàöèè ýíåðãèè ïðè òîðìîæåíèè
Uint16 rotation_dir;//!< Íàïðàâëåíèå âðàùåíèÿ
Uint16 Reboot;//!< Ïðîãðàììíàÿ ïåðåçàãðóçêà
Uint16 AutoOffset;//!< àâòîñìåùåíèå ÀÖÏ
Uint16 HardwareType;//!< Òèï æåëåçà, ïîä êîòîðûé ñîáðàí ïðîåêò
Uint16 excitation_ena;//!< Ðàçðåøåíèå âîçáóäèòåëÿ
} TSysSwitches;
#ifdef __cplusplus
}
#endif
#endif
/*@}*/