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

73 lines
2.0 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_AutoOffset.h (IQ version)
\brief Àâòîìàòè÷åñêèé ðàñ÷åò ñìåùåíèÿ äëÿ ÀÖÏ
\author ÎÎÎ "ÍÏÔ Âåêòîð". http://motorcontrol.ru
\version v 2.0 25/03/2016
Äàííîå ïðîãðàììíîå îáåñïå÷åíèå ðàñïðîñòðàíÿåòñÿ "êàê åñòü", è Âû,
åãî ïîëüçîâàòåëü, ïðèíèìàåòå íà ñåáÿ âñå ðèñêè, ñâÿçàííûå ñ åãî èñïîëüçîâàíèåì.
ÎÎÎ "ÍÏÔ Âåêòîð" íå íåñåò íèêàêîé îòâåòñòâåííîñòè çà âîçìîæíûå óáûòêè,
ñâÿçàííûå ñ åãî èñïîëüçîâàíèåì.
*/
#ifndef V_AUTO_OFFSET_H
#define V_AUTO_OFFSET_H
#ifdef __cplusplus
extern "C"
{
#endif
#include "DSP.h"
struct SAutoOffset
{
_iq FilterK;//!< Êîýôôèöèåíò ôèëüòðà (òåìï èçìåíåíèÿ ñìåùåíèÿ)
int32 IA_int; //!< Èíòåãðàòîð äëÿ òîêà ôàçû A
int32 IB_int; //!< Èíòåãðàòîð äëÿ òîêà ôàçû B
int32 IC_int; //!< Èíòåãðàòîð äëÿ òîêà ôàçû C
int Enabled; //!< Âêëþ÷åíî/âûêëþ÷åíî
void (*init)(volatile struct SAutoOffset *);
void (*ms_calc)(volatile struct SAutoOffset *);
void (*slow_calc)(volatile struct SAutoOffset *);
};
typedef volatile struct SAutoOffset TAutoOffset;
#define AUTO_OFFSET_DEFAULTS {\
_IQ(0.0001),\
0,0,0,\
0,\
AutoOffset_init,\
AutoOffset_calc,\
AutoOffset_slow_calc}
void AutoOffset_init(TAutoOffset *);
void AutoOffset_calc(TAutoOffset *);
void AutoOffset_slow_calc(TAutoOffset *);
#ifdef __cplusplus
}
#endif
#endif