Jump to main content

##

# 3.3.19.3 mcFlyI_FlyingStart

## C

    /* Perform flying start  */
    tmcTypes_StdReturn_e  mcFlyI_FlyingStart( tmcFly_Parameters_s * const pParameters,
                                       const float32_t speed, const float32_t commandDirection,
                                       float32_t * const pIdref, float32_t * const pIqref,
                                       bool * const pDutyOverride, int16_t * const pDuty )

## Summary

This function performs the Flying Start operation.

## Description

This function implements a state machine to manage the flying start process by monitoring rotor speed and applying the appropriate controls to ensure a smooth transition to closed-loop operation. A flying start is used to start a motor that is already spinning, preventing abrupt torque or current spikes.

## Precondition

The flying start module must be initialized and enabled.

## Parameters

Param | Description
--- | ---
pParameters | A pointer to the flying start module parameter structure.
speed | Current speed value.
commandDirection | Commanded direction value.
pIdref | A pointer to a floating-point variable where the d-axis current reference will be set.
pIqref | A pointer to a floating-point variable where the q-axis current reference will be set.
pDutyOverride | A pointer to a boolean value indicating whether PWM duty cycle override is active.
pDuty | A Pointer to the duty cycle value.

## Returns

Returns status of the flying start process:

- StdReturn_Progress: Operation in progress
- StdReturn_Success: Operation successful
- StdReturn_Fail: Operation failed
- StdReturn_Complete: Operation completed

## Example

    // Define the flying start module data structure
    tmcFly_Parameters_s pParameters;

    float32_t direction = 1.0f;
    float32_t speed =100.0f;
    bool pDutyOverride;
    float32_t iqRef, idRef;
    int16_t  duty[3];
    tmcTypes_StdReturn_e status;

    /** Initialize parameters */
    status = mcFlyI_FlyingStart(&pParameters, speed, direction, &idRef, &iqRef, duty);

    if (status == StdReturn_Complete) {
        // flying start operation is complete
    }

## Remarks

None.