66 #define FW_INC_DELTA (1000)
71 #define FW_DEC_DELTA (1000)
76 #define FW_NUM_ISR_TICKS_PER_CTRL_TICK (10)
123 extern FW_Handle
FW_init(
void *pMemory,
const size_t numBytes);
321 #endif // end of _FW_H_ definition
_iq refValue
the reference input value
Contains the public interface to the types definitions.
_iq outMax
the maximum output value allowed for the FW controller
uint32_t counter_fw
the field weakening counter
_iq fbackValue
the feedback input value
FW_Handle FW_init(void *pMemory, const size_t numBytes)
Initializes the field weakening (FW) object.
static bool FW_getFlag_enableFw(FW_Handle fwHandle)
Gets the enable flag of the field weakening (FW) object.
static uint32_t FW_getNumIsrTicksPerFwTick(FW_Handle fwHandle)
Gets the number of ISR ticks per field weakening tick of the field weakening (FW) object...
_iq output
the output of field weakening
static void FW_setOutput(FW_Handle fwHandle, const _iq output)
Sets the start value in the FW controller.
static void FW_run(FW_Handle fwHandle, const _iq refValue, const _iq fbackValue, _iq *pOutValue)
Runs the FW controller.
struct _FW_Obj_ * FW_Handle
Defines the FW handle.
static _iq FW_getOutput(FW_Handle fwHandle)
Gets the output value in the FW controller.
struct _FW_Obj_ FW_Obj
Defines the field weakening (FW) data.
static void FW_incCounter(FW_Handle fwHandle)
Increments the counter of the field weakening (FW) object.
static void FW_getMinMax(FW_Handle fwHandle, _iq *pOutMin, _iq *pOutMax)
Gets the minimum and maximum output value allowed in the FW controller.
Defines the field weakening (FW) data.
static void FW_setFlag_enableFw(FW_Handle fwHandle, const bool state)
Sets the enable flag of the field weakening (FW) object.
static void FW_clearCounter(FW_Handle fwHandle)
Clears the counter of the field weakening (FW) object.
static void FW_setDeltas(FW_Handle fwHandle, const _iq delta_inc, const _iq delta_dec)
Configures the deltas of the field weakening (FW) object.
uint32_t numIsrTicksPerFwTick
Defines the number of isr clock ticks per field weakening clock tick.
_iq outMin
the minimum output value allowed for the FW controller
_iq delta_dec
the field weakening delta decrement of Id reference
static uint32_t FW_getCounter(FW_Handle fwHandle)
Returns the counter of the field weakening (FW) object.
_iq delta_inc
the field weakening delta increment of Id reference
static void FW_setNumIsrTicksPerFwTick(FW_Handle fwHandle, const uint32_t numIsrTicksPerFwTick)
Configures the number of ISR ticks per field weakening tick of the field weakening (FW) object...
#define _IQsat(A, Pos, Neg)
bool flag_enableFw
a flag to enable field weakening
static void FW_setMinMax(FW_Handle fwHandle, const _iq outMin, const _iq outMax)
Sets the minimum and maximum output value allowed in the FW controller.