Jump to main content

##

# 3.3.15 tmcFoc_Input_s Struct

## C

    /* Data structure for FOC input ports: Floating point version */
    typedef struct
    {
        tmcTypes_ABC_s iABC;            /* Structure for 3 Phase current parameters */
    <#if ( MCPMSMFOC_POSITION_CALC_ALGORITHM == 'SENSORED_ENCODER' )>
        float32_t elecAngle;            /* Electrical angle in rads */
        float32_t elecSpeed;            /* Electrical speed in rads */
    </#if>
    <#if ( MCPMSMFOC_CONTROL_TYPE == 'POSITION_LOOP' ) >
        float32_t mechanicalAngle;      /* Mechanical angle in rads */
    </#if>
        float32_t uBus;                 /* DC bus voltage value */
        float32_t reference;            /* Reference value for control (e.g., speed or torque) */
    <#if 'IPD' == MCPMSMFOC_ALIGN_OR_DETECT_AXIS >
        float32_t initialAngle;         /* Initial angle */
    </#if>
    }tmcFoc_Input_s;

    /* Data structure for FOC input ports: Fixed point version */
    typedef struct
    {
        tmcTypes_ABC_s  iABC;       /* Structure for motor phase currents */
        int16_t uBus;               /* DC bus voltage value */
        int16_t reference;          /* Reference value for control (e.g., speed or torque) */
    } tmcFoc_Input_s;

## Summary

FOC module input parameter structure.

## Description

This structure holds the input parameters for the Field Oriented Control (FOC) module, including reference values, DC bus voltage and motor phase current values.

## Remarks

Refer the generated header file for the exact typedef signature.