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

102 lines
2.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_CurPar.h
\brief Ðàñ÷åò íàáëþäàåìûõ òåêóùèõ ïàðàìåòðîâ (ñì. TCurPar)
\author ÎÎÎ "ÍÏÔ Âåêòîð". http://motorcontrol.ru
\version v 2.0 25/03/2016
\defgroup V_CurPar Ðàñ÷åò íàáëþäàåìûõ òåêóùèõ ïàðàìåòðîâ (ñì. TCurPar)
@{
*/
#ifndef V_CURPAR_H
#define V_CURPAR_H
#include "filter.h"
#ifdef __cplusplus
extern "C" {
#endif
/*! \class TCurPar
\brief Ðàñ÷åò íàáëþäàåìûõ òåêóùèõ ïàðàìåòðîâ
Êëàññ \a TCurPar, îñíîâàííûé íà ñòðóêòóðå SCurPar, ñîäåðæèò
ðÿä ðàçðîçíåííûõ âû÷èñëåíèé äëÿ îòîáðàæåíèÿ òåêóùèõ ïàðàìåòðîâ ïðèâîäà.
Íàïðèìåð, ðàñ÷åò äåéñòâóþùèõ òîêîâ ôàç, òåêóùåé ìîùíîñòè è ò.ï.
*/
//! ñì. TCurPar
struct SCurPar{
long speed; //!< Òåêóùàÿ ÷àñòîòà âðàùåíèÿ
long power; //!< Òåêóùàÿ ìîùíîñòü
long Is; //!< Òåêóùàÿ òîê ñòàòîðà àìïëèòóäíûé ìãíîâåííûé
long ThetaRefCurr; //!< Çàäàííîå óãëîâîå ïîëîæåíèå
long ThetaCurr; //!< Òåêóùåå óãëîâîå ïîëîæåíèå
long IsRef; //!< Òîê ñòàòîðà çàäàííûé
long Ialpha; //!< Òîê ïî îñè àëüôà
long Ibeta; //!< Òîê ïî îñè áåòòà
long Ualpha; //!< Íàïðÿæåíèå ïî îñè àëüôà
long Ubeta; //!< Íàïðÿæåíèå ïî îñè áåòòà
long PowerK; //!< Ñëóæåáíûé ïàðàìåòð äëÿ ìàñøòàáèðîâàíèÿ ìîùíîñòè
TFilter fPower; //!< Ôèëüòð ìîùíîñòè
void (*init)(volatile struct SCurPar*);//!< ïðîöåäóðà èíèöèàëèçàöèè
void (*calc)(volatile struct SCurPar*);//!<ðàñ÷åò
void (*slow_calc)(volatile struct SCurPar*);//!<ìåäëåííûé ðàñ÷åò
};
typedef volatile struct SCurPar TCurPar;
//!èíèöèàëèçàòîð ïî-óìîë÷àíèþ
#define TCUR_PAR_DEFAULTS \
{\
0,0,0,0,0,\
0,0,0,\
0,0,0,\
FILTER_DEFAULTS,\
&CurPar_init, \
&CurPar_calc, \
&CurPar_slow_calc, \
}
//! \memberof TCurPar
void CurPar_init(TCurPar*);
//! \memberof TCurPar
void CurPar_calc(TCurPar*);
//! \memberof TCurPar
void CurPar_slow_calc(TCurPar*);
#ifdef __cplusplus
}
#endif // extern "C"
#endif // V_UF_H
/*@}*/