Jump to main content

##

# 3.3.18.7 mcFlxI_FluxWeakeningInit

## C

    /* Initialize flux weakening module */
    void  mcFlxI_FluxWeakeningInit( tmcFlx_Parameters_s * const pParameters )

## Summary

Initializes the flux weakening module

## Description

This function initializes the flux weakening module by performing the following steps:

- State Variable Linking:Links the state variables by updating the state variable structure.

- Parameter Configuration:Configures the module parameters using the provided parameters structure.

- Motor Parameters Reading:Reads and sets the motor parameters, including stator resistance, stator inductance, and mechanical-to-electrical RPM conversion factor.

- Back EMF Constant Calculation:Calculates the back EMF constant.

- Field Weakening Current Limit:Sets the field weakening current limit to a defined value.

- PI Control Parameters Configuration:Configures the PI control parameters (Kp and Ki).

- Initialization Flag:Sets the initialization flag to indicate the completion of the initialization process.

## Precondition

None.

## Parameters

Param | Description
--- | ---
pParameters | A pointer to the flux control module structure, which includes the MTPA, flux weakening, and flux control parameters.

## Returns

None

## Example

    // Define the flux module data structure
    tmcFlx_Parameters_s fluxParameters;

    /** Initialize parameters */
    mcFlxI_FluxWeakeningInit(&fluxParameters);

## Remarks

None.