Sensorless Drive Startup Sequence

Before a sensorless FOC drive can enter closed-loop control, the rotor position must be known or established. The startup sequence walks through the following steps:

Standard startup (motor at standstill):

  1. Initial Position Detection (Motor Align or IPD) — establishes the rotor angle at standstill. Motor Align applies a DC hold current; IPD uses pulse injection for more accurate detection on salient motors.

  2. Open-Loop Ramp (Forced Angle) — accelerates the motor in open-loop to build sufficient back-EMF for the sensorless observer to lock on.

  3. Closed-Loop Transition — the sensorless observer (FAST or ESMO) takes over once the motor reaches the open-loop to closed-loop transition speed threshold.

Alternative startup (motor already spinning — fans, blowers, high-inertia loads):

  1. Flying Start (ISD) — detects whether the rotor is already spinning and, if the speed is above the minimum threshold, transitions directly to closed-loop without a full restart.

Algorithm

Purpose

Motor Startup

Initial position detection — Motor Align or IPD

Open-Loop Ramp

Forced-angle ramp to build back-EMF before closed-loop transition

Closed-Loop Transition

Estimator selection, closed-loop ramp rate, max current, and SVM mode

Flying Start (ISD)

Detect and resume from a spinning rotor without restart

Motor Startup

Before the motor can be accelerated, the rotor’s initial angular position must be established. Two methods are available depending on the motor type and application requirements:

  • Motor Align — applies a DC hold current to force the rotor to a known angle. Simple and reliable; suitable for SPM motors or when a brief rotor movement at startup is acceptable.

  • IPD (Initial Position Detection) — uses high-frequency pulse injection to detect the rotor angle without moving it. Preferred for IPM motors or applications where rotor movement at startup is not acceptable.

Note

Hall Sensor Users: If your motor uses Hall sensors for commutation feedback, see Hall Sensor Calibration for automatic calibration of Hall transition angles. Hall calibration must be performed before the first motor startup to establish accurate forward and reverse angle tables.

Motor Align

Motor alignment is the simplest startup method. A fixed DC voltage vector is applied to the stator for a configurable duration, forcing the rotor to align with the applied field direction. Once alignment is complete, the rotor angle is known and the open-loop ramp can begin.

When to Use

  • When a brief rotor movement at startup is acceptable.

  • When the motor has low saliency (SPM motors) where IPD may be less effective.

  • As a fallback when IPD is not required or not supported.

Configuration

Motor Align parameters are defined as macros in motor_params.h and stored in the Motor_ParamsType struct in motor_params.c. To configure for your motor, update the macro block for your motor and the struct initializer:

/* In motor_params.h — define per-motor alignment macros */
#define MOTOR_<NAME>_ALIGN_CURRENT_A    (1.0f)   /* DC hold current (A) */
#define MOTOR_<NAME>_ALIGN_DELAY_sec    (5.0f)   /* Hold duration (s) */

/* In motor_params.c — populate the Motor_ParamsType struct */
.AlignCurrent_A = MOTOR_<NAME>_ALIGN_CURRENT_A,
.AlignDelay_sec = MOTOR_<NAME>_ALIGN_DELAY_sec,

Key Parameters

Parameter (Motor_ParamsType field)

Description

Example (Teknic)

AlignCurrent_A

DC current applied to hold the rotor in place

1.0 A

AlignDelay_sec

Duration the alignment current is held

5.0 s

These are consumed by mtr1_init.c:

objSets->alignCurrent_A     = motorParams->AlignCurrent_A;
objSets->alignTimeDelay_cnt = (uint32_t)(objUser->ctrlFreq_Hz * motorParams->AlignDelay_sec);
obj->angleAlign_rad         = 0.0;
obj->inputCtrl.flagEnableAlignment = true;

Note

The alignment duration AlignDelay_sec must be long enough for the rotor to fully settle. Too short a duration may leave the rotor at an incorrect angle, causing startup failure. A value of 5 seconds is used for the reference motors; reduce only if the load inertia is low.

Watch Window — Runtime Control

In CCS or IAR, add the following expressions to the watch window to enable, disable, or tune Motor Align at runtime without rebuilding:

Watch Window Expression

Type

Description

motorVars_M1.inputCtrl.flagEnableAlignment

bool

Enable (true) or disable (false) alignment

motorVars_M1.inputCtrl.startupMode

STARTUP_Mode_e

Set to STARTUP_ALIGN to force alignment mode

motorSetVars_M1.alignCurrent_A

float

Adjust alignment hold current (A)

motorSetVars_M1.alignTimeDelay_cnt

uint32_t

Adjust alignment hold duration (ISR counts)

Initial Position Detection (IPD)

Initial Position Detection (IPD) is a technique used in sensorless Field-Oriented Control (FOC) to determine the rotor’s initial angular position before starting the motor. Without accurate initial position knowledge, the motor may produce incorrect torque or even rotate in the wrong direction at startup.

The IPD algorithm implemented in this SDK uses high-frequency voltage pulse injection to detect the rotor position based on the inductance variation caused by magnetic saturation.

How It Works

  1. Pulse Injection: Short voltage pulses are injected in multiple stator vector (6 sectors) across the stator windings.

  2. Current Response Measurement: The peak current response to each pulse is measured. The direction with the highest current response corresponds to the d-axis (rotor flux axis).

  3. Position Estimation: The rotor angle is computed from the measured current responses using interpolation between the two highest-response sectors.

  4. Polarity Detection: An additional pulse is used to distinguish between the N and S poles of the rotor magnet (180° ambiguity resolution).

Configuration

IPD parameters are defined as macros in motor_params.h and stored in the Motor_ParamsType struct in motor_params.c:

/* In motor_params.h — define per-motor IPD macros */
#define MOTOR_<NAME>_IPD_PULSE_CURRENT_A   (2.0f)  /* Pulse current limit (A) */
#define MOTOR_<NAME>_IPD_CYCLE_COUNT_MAX   (2U)    /* Injection cycles per sector */
#define MOTOR_<NAME>_IPD_TIMEOUT_FAULT_sec (5.0f)  /* Fault timeout (s) */

/* In motor_params.c — populate the Motor_ParamsType struct */
.IpdPulseCurrent_A   = MOTOR_<NAME>_IPD_PULSE_CURRENT_A,
.IpdCycleCountMax    = MOTOR_<NAME>_IPD_CYCLE_COUNT_MAX,
.IpdTimeoutFault_sec = MOTOR_<NAME>_IPD_TIMEOUT_FAULT_sec,

Key Parameters

Parameter (Motor_ParamsType field)

Description

Example (Teknic)

IpdPulseCurrent_A

Peak current limit for each injection pulse

2.0 A

IpdCycleCountMax

Number of injection cycles (repetitions per sector)

2

IpdTimeoutFault_sec

Fault timeout if IPD does not complete

5.0 s

These are consumed by mtr1_init.c:

obj->inputCtrl.startupMode = STARTUP_IPD;
obj->ipdHandle->halInterface->halFOCDataHandle->ipdCurrentLimit = motorParams->IpdPulseCurrent_A;
objSets->ipdCycleCountMax     = motorParams->IpdCycleCountMax;
obj->ipdHandle->cycleCountMax = objSets->ipdCycleCountMax;
obj->ipdHandle->noMotorFaultCount =
    (uint32_t)(objUser->ctrlFreq_Hz * motorParams->IpdTimeoutFault_sec);

Limitations

  • IPD requires the motor to be at standstill.

  • Performance depends on the motor’s saliency ratio (works best with IPM motors).

  • High-frequency pulse injection may cause audible noise during detection.

Watch Window — Runtime Control

In CCS or IAR, add the following expressions to the watch window to enable, disable, or tune IPD at runtime without rebuilding:

Watch Window Expression

Type

Description

motorVars_M1.inputCtrl.startupMode

STARTUP_Mode_e

Set to STARTUP_IPD to enable IPD, STARTUP_ALIGN for alignment

motorSetVars_M1.ipdCycleCountMax

uint16_t

Adjust number of injection cycles per sector


Open-Loop Ramp (Forced Angle)

After the initial rotor position is established (by Motor Align or IPD), the motor is accelerated in open-loop using a forced angle ramp. During this phase, the FOC controller applies a rotating voltage vector at a programmatically increasing angle, driving the rotor to follow. The purpose is to build sufficient back-EMF so that the sensorless observer (FAST or ESMO) can lock on to the rotor position before closed-loop control begins.

How It Works

The open-loop ramp operates in two sub-states:

MOTOR_OL_START — Speed and Angle Ramp:

  1. Open-Loop Current: A fixed torque current OlTorqueCurrent_A is applied to the q-axis to drive the rotor.

  2. Speed Ramp: The speed trajectory (TRAJ) ramps the internal speed reference at OlAccelRate_Hzps (Hz/s). The angle generator integrates this speed to produce the forced stator angle each ISR tick.

  3. Transition Trigger: Once the internal speed reference reaches OlSpeedThr_Hz, the state machine captures the angular difference between the forced angle and the observer angle, then moves to MOTOR_OL_END.

MOTOR_OL_END — Smooth Angle Handover:

  1. Angle Blending: The difference between the forced angle and the observer angle is gradually reduced to zero. OlThetaRampRate_dps controls the step size of this blending — a smaller value gives a smoother but slower handover.

  2. Closed-Loop Entry: Once the angular offset is negligible, the state machine switches to MOTOR_CTRL_RUN (closed-loop), using the observer angle directly.

Configuration

Open-loop ramp parameters are defined as macros in motor_params.h and stored in the Motor_ParamsType struct in motor_params.c:

/* In motor_params.h — define per-motor open-loop ramp macros */
#define MOTOR_<NAME>_OL_SPEED_THR_Hz        (30.0f)   /* Speed threshold to trigger OL->CL handover (Hz) */
#define MOTOR_<NAME>_OL_ACCEL_RATE_Hzps     (10.0f)   /* Open-loop speed ramp rate (Hz/s) */
#define MOTOR_<NAME>_OL_THETA_RAMP_RATE_dps (360.0f)  /* Angle blending step at OL->CL transition (deg/s) */
#define MOTOR_<NAME>_OL_TORQUE_CURRENT_A    (1.0f)    /* Open-loop torque current (A) */
#define MOTOR_<NAME>_FORCE_RUN_DELAY_sec    (1.0f)    /* Hold time after transition (s) */

/* In motor_params.c — populate the Motor_ParamsType struct */
.OlSpeedThr_Hz       = MOTOR_<NAME>_OL_SPEED_THR_Hz,
.OlAccelRate_Hzps    = MOTOR_<NAME>_OL_ACCEL_RATE_Hzps,
.OlThetaRampRate_dps = MOTOR_<NAME>_OL_THETA_RAMP_RATE_dps,
.OlTorqueCurrent_A   = MOTOR_<NAME>_OL_TORQUE_CURRENT_A,
.ForceRunDelay_sec   = MOTOR_<NAME>_FORCE_RUN_DELAY_sec,

Key Parameters

Parameter (Motor_ParamsType field)

Description

Example (Teknic)

OlSpeedThr_Hz

Electrical speed threshold that triggers OL→CL handover

30.0 Hz

OlAccelRate_Hzps

Open-loop speed ramp rate — controls how fast the angle ramps up

10.0 Hz/s

OlThetaRampRate_dps

Angle blending step rate during OL→CL transition (smaller = smoother)

360.0 deg/s

OlTorqueCurrent_A

Torque current applied during open-loop ramp

1.0 A

ForceRunDelay_sec

Hold time in forced-angle mode after reaching threshold

1.0 s

These are consumed by mtr1_init.c:

objSets->olSpeedThr             = motorParams->OlSpeedThr_Hz;
objSets->accelerationStart_Hzps = motorParams->OlAccelRate_Hzps;
objSets->startCurrent_A         = motorParams->OlTorqueCurrent_A;
obj->angleOLStep_rad = (motorParams->OlThetaRampRate_dps * MATH_TWO_PI)
                       / (360.0f * objUser->ctrlFreq_Hz);
objSets->forceRunTimeDelay_cnt  =
    (uint32_t)(objUser->ctrlFreq_Hz * motorParams->ForceRunDelay_sec);

Note

OlSpeedThr_Hz must be high enough for the sensorless observer to produce a reliable angle estimate. For ESMO, a minimum of 10–20% of rated electrical speed is recommended. For FAST, the threshold can be lower.

OlAccelRate_Hzps controls how quickly the motor accelerates during the open-loop ramp. Setting it too high may cause the rotor to lose synchronism; too low prolongs the startup time.

OlThetaRampRate_dps controls the smoothness of the angle handover from forced angle to observer angle at the end of the ramp. A smaller value gives a smoother transition but takes longer. A value of 360 deg/s is a good starting point for most motors.

Watch Window — Runtime Control

In CCS or IAR, add the following expressions to the watch window to observe and tune the open-loop ramp at runtime without rebuilding:

Watch Window Expression

Type

Description

motorVars_M1.inputCtrl.flagEnableForceAngle

bool

true while in forced-angle open-loop mode

motorVars_M1.inputCtrl.flagEnableOpenLoopDebug

bool

Set true to hold in open-loop state for debug

motorSetVars_M1.olSpeedThr

float

OL→CL transition speed threshold (Hz)

motorSetVars_M1.accelerationStart_Hzps

float

Open-loop acceleration rate (Hz/s)

motorSetVars_M1.startCurrent_A

float

Open-loop torque current (A)

Related Algorithms

  • Motor Align / IPD — precede the open-loop ramp to establish the initial rotor angle.

  • ESMO — takes over angle estimation after the ramp.

  • FAST Observer — alternative observer that takes over after the ramp.


Closed-Loop Transition

Once the open-loop ramp completes and the sensorless observer has locked on to the rotor position, the drive transitions into closed-loop FOC. This section describes the parameters that govern the closed-loop entry and steady-state operation: estimator selection, closed-loop acceleration rate, maximum current, and SVM modulation mode.

How It Works

  1. Observer Lock-On: At the end of the open-loop ramp (MOTOR_OL_END), the angular difference between the forced angle and the observer angle is blended to zero. Once the offset is negligible, the state machine switches to MOTOR_CTRL_RUN.

  2. Closed-Loop Speed Ramp: The speed trajectory (TRAJ) continues to ramp the speed reference at ClAccelRate_Hzps until the target speed is reached.

  3. Current Limiting: The FOC current controllers enforce RatedCurrent_A as the maximum phase current throughout closed-loop operation.

  4. SVM Modulation: The space vector modulator uses the configured svmMode to generate the PWM duty cycles. SVM_COM_C (common-mode injection) is the default and provides the best DC bus utilisation.

Estimator Method

The estimator used for closed-loop angle and speed estimation is selected at runtime via inputCtrl.estimatorMode in mtr1_init.c:

/* In mtr1_init.c — select the sensorless observer */
obj->inputCtrl.estimatorMode = ESTIMATOR_MODE_FAST;   /* TI FAST observer (default) */
// obj->inputCtrl.estimatorMode = ESTIMATOR_MODE_ESMO; /* Extended Sliding Mode Observer */

Mode

Description

ESTIMATOR_MODE_FAST

TI proprietary FAST observer — flux, angle, speed, torque estimator. Recommended for most applications.

ESTIMATOR_MODE_ESMO

Extended Sliding Mode Observer — lower computational cost, suitable for high-speed or cost-sensitive designs.

See FAST Observer and ESMO for detailed descriptions of each observer.

Configuration

Closed-loop transition parameters are defined in motor_params.h and user_mtr1.h:

/* motor_params.h — per-motor closed-loop tuning macros */
#define MOTOR_<NAME>_CL_ACCEL_RATE_Hzps   (20.0f)   /* Closed-loop speed ramp rate (Hz/s) */
#define MOTOR_<NAME>_RATED_CURRENT_A       (2.2f)    /* Maximum phase current (A) */

/* user_mtr1.h — board-level voltage and modulation limits */
#define USER_M1_MAX_VS_MAG_PU  (0.576f)   /* Maximum Vs magnitude in per-unit (sets SVM headroom) */
#define USER_M1_VD_SF          (0.95f)    /* Vd scale factor (fraction of Vs budget reserved for d-axis) */

These are consumed by mtr1_init.c:

/* Closed-loop acceleration rate */
objSets->accelerationMax_Hzps = motorParams->ClAccelRate_Hzps;

/* Maximum current */
objSets->maxCurrent_A = motorParams->RatedCurrent_A;

/* SVM mode — SVM_COM_C uses common-mode injection for maximum DC bus utilisation */
obj->inputCtrl.svmMode = SVM_COM_C;

/* Vs magnitude limit (per-unit) */
objSets->overModulation = USER_M1_MAX_VS_MAG_PU;
obj->VsRef_pu           = 0.98f * USER_M1_MAX_VS_MAG_PU;

Key Parameters

Parameter

Source

Description

Example

ClAccelRate_Hzps

Motor_ParamsType

Closed-loop speed ramp rate after CL entry

20.0 Hz/s

RatedCurrent_A

Motor_ParamsType

Maximum phase current enforced by the FOC current controllers

2.2 A

estimatorMode

mtr1_init.c

Sensorless observer: ESTIMATOR_MODE_FAST or ESTIMATOR_MODE_ESMO

FAST

svmMode

mtr1_init.c

Space vector modulation mode: SVM_COM_C (common-mode injection)

SVM_COM_C

USER_M1_MAX_VS_MAG_PU

user_mtr1.h

Maximum output voltage magnitude in per-unit — controls SVM headroom

0.576 pu

USER_M1_VD_SF

user_mtr1.h

Fraction of the Vs budget reserved for the d-axis voltage

0.95

Note

ClAccelRate_Hzps controls how quickly the motor accelerates in closed-loop. Setting it too high may cause current saturation or instability during the ramp; too low prolongs the time to reach the target speed.

USER_M1_MAX_VS_MAG_PU determines the SVM modulation depth:

  • 0.5 — pure sinewave, peak at 86.6% duty cycle. No current reconstruction needed.

  • 0.5774 (1/√3) — pure sinewave, peak at 100% duty cycle. Current reconstruction needed.

  • 0.6666 (2/3) — trapezoidal voltage waveform. Current reconstruction needed.

The default value of 0.576 is a good compromise for single-shunt and three-shunt topologies.

Watch Window — Runtime Control

Watch Window Expression

Type

Description

motorVars_M1.inputCtrl.estimatorMode

enum

Active observer: 0 = FAST, 1 = ESMO

motorVars_M1.inputCtrl.svmMode

enum

SVM mode: SVM_COM_C = common-mode injection

motorSetVars_M1.accelerationMax_Hzps

float

Closed-loop speed ramp rate (Hz/s)

motorSetVars_M1.maxCurrent_A

float

Maximum phase current limit (A)

motorSetVars_M1.overModulation

float

Vs magnitude limit in per-unit

Related Algorithms

  • Open-Loop Ramp — precedes the closed-loop transition.

  • FAST Observer — default estimator for closed-loop angle and speed.

  • ESMO — alternative estimator for closed-loop operation.

  • Field Weakening — extends the operating speed range above base speed.


Flying Start (Initial Speed Detection)

Flying Start, also called Initial Speed Detection (ISD), allows the drive to start a motor that is already spinning — for example, a fan or blower that is coasting after a power interruption or a brief stop command. Instead of forcing the rotor to stop and restart from zero, the drive detects the existing rotor speed and, if it is above the minimum threshold, transitions directly into closed-loop control without a full restart sequence.

Note

ISD is supported without voltage sensing. The speed detection relies entirely on the sensorless observer (FAST or ESMO) using only phase current measurements. No DC bus voltage sensing or back-EMF voltage measurement is required for flying start operation.

How It Works

  1. Detection Phase (MOTOR_SEEK_POS state): When flagEnableFlyingStart is true, the state machine enters the MOTOR_SEEK_POS state at startup instead of immediately commanding alignment or IPD. The sensorless observer runs passively, estimating the rotor speed from the back-EMF induced by the spinning rotor.

  2. Speed Check: After the detection time (flyingStartTimeDelay_cnt ISR counts), the estimated speed is compared against the minimum threshold speedFlyingStart_Hz.

  3. Flying Start Decision:

    • If speedAbs_Hz > speedFlyingStart_Hz: the drive transitions directly to closed-loop control, synchronising to the spinning rotor.

    • If speedAbs_Hz ≤ speedFlyingStart_Hz: the rotor is considered stopped; the drive falls through to the normal startup sequence (Motor Align or IPD → Open-Loop Ramp).

The detection logic is implemented in application.c via StateMachine_handleFlyingStart():

/* Simplified flying start decision in application.c */
if (obj->statusVars.stateRunTimeCnt > obj->motorSetsHandle->flyingStartTimeDelay_cnt)
{
    if (obj->statusVars.speedAbs_Hz > obj->motorSetsHandle->speedFlyingStart_Hz)
    {
        /* Rotor is spinning fast enough — go directly to closed-loop */
        obj->motorState = MOTOR_CL_RUNNING;
    }
    else
    {
        /* Rotor is stopped or too slow — fall through to normal startup */
        obj->motorState = MOTOR_ALIGNMENT;
    }
}

When to Use

  • Fan and blower loads with high rotational inertia that coast for several seconds after a stop command or power interruption.

  • Applications where a full stop-and-restart cycle would cause mechanical stress or unacceptable delay.

  • Systems where the motor may be driven by the load (windmilling) and must be caught on the fly.

Configuration

Flying Start parameters are defined as macros in motor_params.h and stored in the Motor_ParamsType struct in motor_params.c:

/* In motor_params.h — define per-motor flying start macros */
#define MOTOR_<NAME>_FLYING_START_MIN_SPEED_Hz  (3.0f)   /* Min speed to detect (Hz) */
#define MOTOR_<NAME>_FLYING_START_DELAY_sec     (0.5f)   /* Detection window (s) */

/* In motor_params.c — populate the Motor_ParamsType struct */
.FlyingStartMinSpeed_Hz = MOTOR_<NAME>_FLYING_START_MIN_SPEED_Hz,
.FlyingStartDelay_sec   = MOTOR_<NAME>_FLYING_START_DELAY_sec,

Key Parameters

Parameter (Motor_ParamsType field)

Description

Example (Panasonic Blower)

FlyingStartMinSpeed_Hz

Minimum electrical speed to consider the rotor spinning

3.0 Hz

FlyingStartDelay_sec

Detection window — how long to observe before deciding

0.5 s

These are consumed by mtr1_init.c:

objSets->speedFlyingStart_Hz      = motorParams->FlyingStartMinSpeed_Hz;
objSets->flyingStartTimeDelay_cnt =
    (uint32_t)(objUser->ctrlFreq_Hz * motorParams->FlyingStartDelay_sec);
obj->inputCtrl.flagEnableFlyingStart = true;

Note

FlyingStartMinSpeed_Hz should be set above the noise floor of the speed estimator at standstill. A value of 3–5 Hz is typical. Setting it too low may cause false detections when the rotor is stationary. FlyingStartDelay_sec should be long enough for the observer to produce a stable speed estimate — 0.5 s is a good starting point for most fan loads.

Watch Window — Runtime Control

In CCS or IAR, add the following expressions to the watch window to enable, disable, or tune Flying Start at runtime without rebuilding:

Watch Window Expression

Type

Description

motorVars_M1.inputCtrl.flagEnableFlyingStart

bool

Enable (true) or disable (false) flying start

motorSetVars_M1.speedFlyingStart_Hz

float

Minimum speed threshold for detection (Hz)

motorSetVars_M1.flyingStartTimeDelay_cnt

uint32_t

Detection window in ISR counts

motorVars_M1.outVars.speed_Hz

float

Observed rotor speed during detection phase (Hz)

Related Algorithms

  • Motor Align / IPD — used as fallback when the rotor is found to be stationary after the detection window.

  • FAST Observer — provides the speed estimate used during the detection phase.

  • ESMO — alternative observer for speed detection.