MotorWare f2806x Module API Documentation
Data Structures | Macros | Typedefs | Functions
FW

Data Structures

struct  _FW_Obj_
 Defines the field weakening (FW) data. More...
 

Macros

#define FW_INC_DELTA   (1000)
 Defines the Field Weakening (FW) increment delta correction. More...
 
#define FW_DEC_DELTA   (1000)
 Defines the Field Weakening (FW) decrement delta correction. More...
 
#define FW_NUM_ISR_TICKS_PER_CTRL_TICK   (10)
 Defines the number of isr ticks per field weakening clock tick. More...
 

Typedefs

typedef struct _FW_Obj_ FW_Obj
 Defines the field weakening (FW) data. More...
 
typedef struct _FW_Obj_FW_Handle
 Defines the FW handle. More...
 

Functions

FW_Handle FW_init (void *pMemory, const size_t numBytes)
 Initializes the field weakening (FW) object. More...
 
static void FW_getMinMax (FW_Handle fwHandle, _iq *pOutMin, _iq *pOutMax)
 Gets the minimum and maximum output value allowed in the FW controller. More...
 
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. More...
 
static void FW_setDeltas (FW_Handle fwHandle, const _iq delta_inc, const _iq delta_dec)
 Configures the deltas of the field weakening (FW) object. More...
 
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. More...
 
static uint32_t FW_getNumIsrTicksPerFwTick (FW_Handle fwHandle)
 Gets the number of ISR ticks per field weakening tick of the field weakening (FW) object. More...
 
static void FW_clearCounter (FW_Handle fwHandle)
 Clears the counter of the field weakening (FW) object. More...
 
static void FW_incCounter (FW_Handle fwHandle)
 Increments the counter of the field weakening (FW) object. More...
 
static uint32_t FW_getCounter (FW_Handle fwHandle)
 Returns the counter of the field weakening (FW) object. More...
 
static void FW_setFlag_enableFw (FW_Handle fwHandle, const bool state)
 Sets the enable flag of the field weakening (FW) object. More...
 
static bool FW_getFlag_enableFw (FW_Handle fwHandle)
 Gets the enable flag of the field weakening (FW) object. More...
 
static void FW_setOutput (FW_Handle fwHandle, const _iq output)
 Sets the start value in the FW controller. More...
 
static _iq FW_getOutput (FW_Handle fwHandle)
 Gets the output value in the FW controller. More...
 
static void FW_run (FW_Handle fwHandle, const _iq refValue, const _iq fbackValue, _iq *pOutValue)
 Runs the FW controller. More...
 

Detailed Description


Data Structure Documentation

struct _FW_Obj_

Defines the field weakening (FW) data.

Definition at line 85 of file fw.h.

Data Fields
uint32_t counter_fw the field weakening counter
_iq delta_dec the field weakening delta decrement of Id reference
_iq delta_inc the field weakening delta increment of Id reference
_iq fbackValue the feedback input value
bool flag_enableFw a flag to enable field weakening
uint32_t numIsrTicksPerFwTick Defines the number of isr clock ticks per field weakening clock tick.
_iq outMax the maximum output value allowed for the FW controller
_iq outMin the minimum output value allowed for the FW controller
_iq output the output of field weakening
_iq refValue the reference input value

Macro Definition Documentation

#define FW_DEC_DELTA   (1000)

Defines the Field Weakening (FW) decrement delta correction.

Definition at line 71 of file fw.h.

#define FW_INC_DELTA   (1000)

Defines the Field Weakening (FW) increment delta correction.

Definition at line 66 of file fw.h.

#define FW_NUM_ISR_TICKS_PER_CTRL_TICK   (10)

Defines the number of isr ticks per field weakening clock tick.

Definition at line 76 of file fw.h.

Typedef Documentation

typedef struct _FW_Obj_* FW_Handle

Defines the FW handle.

Definition at line 108 of file fw.h.

typedef struct _FW_Obj_ FW_Obj

Defines the field weakening (FW) data.

Function Documentation

static void FW_clearCounter ( FW_Handle  fwHandle)
inlinestatic

Clears the counter of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle

Definition at line 198 of file fw.h.

References _FW_Obj_::counter_fw.

static uint32_t FW_getCounter ( FW_Handle  fwHandle)
inlinestatic

Returns the counter of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle

Definition at line 222 of file fw.h.

References _FW_Obj_::counter_fw.

static bool FW_getFlag_enableFw ( FW_Handle  fwHandle)
inlinestatic

Gets the enable flag of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle
Returns
The Field Weakening enable state

Definition at line 246 of file fw.h.

References _FW_Obj_::flag_enableFw.

static void FW_getMinMax ( FW_Handle  fwHandle,
_iq pOutMin,
_iq pOutMax 
)
inlinestatic

Gets the minimum and maximum output value allowed in the FW controller.

Parameters
[in]fwHandleThe FW controller handle
[out]pOutMinThe pointer to the minimum output value allowed
[out]pOutMaxThe pointer to the maximum output value allowed

Definition at line 130 of file fw.h.

References _FW_Obj_::outMax, and _FW_Obj_::outMin.

static uint32_t FW_getNumIsrTicksPerFwTick ( FW_Handle  fwHandle)
inlinestatic

Gets the number of ISR ticks per field weakening tick of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle
Returns
The number of ISR ticks per field weakening ticks

Definition at line 188 of file fw.h.

References _FW_Obj_::numIsrTicksPerFwTick.

static _iq FW_getOutput ( FW_Handle  fwHandle)
inlinestatic

Gets the output value in the FW controller.

Parameters
[in]fwHandleThe FW controller handle
Returns
The output value for the FW controller

Definition at line 270 of file fw.h.

References _FW_Obj_::output.

static void FW_incCounter ( FW_Handle  fwHandle)
inlinestatic

Increments the counter of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle

Definition at line 210 of file fw.h.

References _FW_Obj_::counter_fw.

FW_Handle FW_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the field weakening (FW) object.

Parameters
[in]pMemoryA pointer to the memory for the field weakening object
[in]numBytesThe number of bytes allocated for the field weakening object, bytes
Returns
The field weakening (FW) object handle

Definition at line 55 of file fw.c.

static void FW_run ( FW_Handle  fwHandle,
const _iq  refValue,
const _iq  fbackValue,
_iq pOutValue 
)
inlinestatic

Runs the FW controller.

Parameters
[in]fwHandleThe FW controller handle
[in]refValueThe reference value to the controller
[in]fbackValueThe feedback value to the controller
[in]pOutValueThe pointer to the controller output value

Definition at line 283 of file fw.h.

References _IQsat, _FW_Obj_::delta_dec, _FW_Obj_::delta_inc, _FW_Obj_::fbackValue, _FW_Obj_::outMax, _FW_Obj_::outMin, _FW_Obj_::output, and _FW_Obj_::refValue.

static void FW_setDeltas ( FW_Handle  fwHandle,
const _iq  delta_inc,
const _iq  delta_dec 
)
inlinestatic

Configures the deltas of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle
[in]delta_incThe delta increment to Id reference
[in]delta_decThe delta decrement to Id reference

Definition at line 160 of file fw.h.

References _FW_Obj_::delta_dec, and _FW_Obj_::delta_inc.

static void FW_setFlag_enableFw ( FW_Handle  fwHandle,
const bool  state 
)
inlinestatic

Sets the enable flag of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle
[in]stateThe Field Weakening enable state

Definition at line 233 of file fw.h.

References _FW_Obj_::flag_enableFw.

static void FW_setMinMax ( FW_Handle  fwHandle,
const _iq  outMin,
const _iq  outMax 
)
inlinestatic

Sets the minimum and maximum output value allowed in the FW controller.

Parameters
[in]fwHandleThe FW controller handle
[in]outMinThe minimum output value allowed
[in]outMaxThe maximum output value allowed

Definition at line 145 of file fw.h.

References _FW_Obj_::outMax, and _FW_Obj_::outMin.

static void FW_setNumIsrTicksPerFwTick ( FW_Handle  fwHandle,
const uint32_t  numIsrTicksPerFwTick 
)
inlinestatic

Configures the number of ISR ticks per field weakening tick of the field weakening (FW) object.

Parameters
[in]fwHandleThe Field Weakening handle
[in]numIsrTicksPerFwTickThe number of ISR ticks per field weakening ticks

Definition at line 175 of file fw.h.

References _FW_Obj_::numIsrTicksPerFwTick.

static void FW_setOutput ( FW_Handle  fwHandle,
const _iq  output 
)
inlinestatic

Sets the start value in the FW controller.

Parameters
[in]fwHandleThe FW controller handle
[in]outputThe start value for the FW controller

Definition at line 257 of file fw.h.

References _FW_Obj_::output.