MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

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 | ) |
| inline static

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

Parameters

  [in] | fwHandle | The Field Weakening handle

Definition at line 198 of file fw.h.

References _FW_Obj_::counter_fw.

static uint32_t FW_getCounter | ( | FW_Handle | fwHandle | ) |
| inline static

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

Parameters

  [in] | fwHandle | The Field Weakening handle

Definition at line 222 of file fw.h.

References _FW_Obj_::counter_fw.

static bool FW_getFlag_enableFw | ( | FW_Handle | fwHandle | ) |
| inline static

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

Parameters

  [in] | fwHandle | The 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
| ) |  |
| inline static

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

Parameters

  [in] | fwHandle | The FW controller handle
  [out] | pOutMin | The pointer to the minimum output value allowed
  [out] | pOutMax | The 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 | ) |
| inline static

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

Parameters

  [in] | fwHandle | The 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 | ) |
| inline static

Gets the output value in the FW controller.

Parameters

  [in] | fwHandle | The 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 | ) |
| inline static

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

Parameters

  [in] | fwHandle | The 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] | pMemory | A pointer to the memory for the field weakening object
  [in] | numBytes | The 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
| ) |  |
| inline static

Runs the FW controller.

Parameters

  [in] | fwHandle | The FW controller handle
  [in] | refValue | The reference value to the controller
  [in] | fbackValue | The feedback value to the controller
  [in] | pOutValue | The 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
| ) |  |
| inline static

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

Parameters

  [in] | fwHandle | The Field Weakening handle
  [in] | delta_inc | The delta increment to Id reference
  [in] | delta_dec | The 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
| ) |  |
| inline static

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

Parameters

  [in] | fwHandle | The Field Weakening handle
  [in] | state | The 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
| ) |  |
| inline static

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

Parameters

  [in] | fwHandle | The FW controller handle
  [in] | outMin | The minimum output value allowed
  [in] | outMax | The 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
| ) |  |
| inline static

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

Parameters

  [in] | fwHandle | The Field Weakening handle
  [in] | numIsrTicksPerFwTick | The 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
| ) |  |
| inline static

Sets the start value in the FW controller.

Parameters

  [in] | fwHandle | The FW controller handle
  [in] | output | The start value for the FW controller

Definition at line 257 of file fw.h.

References _FW_Obj_::output.