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):
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.
Open-Loop Ramp (Forced Angle) — accelerates the motor in open-loop to build sufficient back-EMF for the sensorless observer to lock on.
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):
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 |
|---|---|
Initial position detection — Motor Align or IPD |
|
Forced-angle ramp to build back-EMF before closed-loop transition |
|
Estimator selection, closed-loop ramp rate, max current, and SVM mode |
|
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 ( |
Description |
Example (Teknic) |
|---|---|---|
|
DC current applied to hold the rotor in place |
|
|
Duration the alignment current is held |
|
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 |
|---|---|---|
|
|
Enable ( |
|
|
Set to |
|
|
Adjust alignment hold current (A) |
|
|
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
Pulse Injection: Short voltage pulses are injected in multiple stator vector (6 sectors) across the stator windings.
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).
Position Estimation: The rotor angle is computed from the measured current responses using interpolation between the two highest-response sectors.
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 ( |
Description |
Example (Teknic) |
|---|---|---|
|
Peak current limit for each injection pulse |
|
|
Number of injection cycles (repetitions per sector) |
|
|
Fault timeout if IPD does not complete |
|
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 |
|---|---|---|
|
|
Set to |
|
|
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:
Open-Loop Current: A fixed torque current
OlTorqueCurrent_Ais applied to the q-axis to drive the rotor.Speed Ramp: The speed trajectory (
TRAJ) ramps the internal speed reference atOlAccelRate_Hzps(Hz/s). The angle generator integrates this speed to produce the forced stator angle each ISR tick.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 toMOTOR_OL_END.
MOTOR_OL_END — Smooth Angle Handover:
Angle Blending: The difference between the forced angle and the observer angle is gradually reduced to zero.
OlThetaRampRate_dpscontrols the step size of this blending — a smaller value gives a smoother but slower handover.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 ( |
Description |
Example (Teknic) |
|---|---|---|
|
Electrical speed threshold that triggers OL→CL handover |
|
|
Open-loop speed ramp rate — controls how fast the angle ramps up |
|
|
Angle blending step rate during OL→CL transition (smaller = smoother) |
|
|
Torque current applied during open-loop ramp |
|
|
Hold time in forced-angle mode after reaching threshold |
|
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 |
|---|---|---|
|
|
|
|
|
Set |
|
|
OL→CL transition speed threshold (Hz) |
|
|
Open-loop acceleration rate (Hz/s) |
|
|
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
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 toMOTOR_CTRL_RUN.Closed-Loop Speed Ramp: The speed trajectory (
TRAJ) continues to ramp the speed reference atClAccelRate_Hzpsuntil the target speed is reached.Current Limiting: The FOC current controllers enforce
RatedCurrent_Aas the maximum phase current throughout closed-loop operation.SVM Modulation: The space vector modulator uses the configured
svmModeto 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 |
|---|---|
|
TI proprietary FAST observer — flux, angle, speed, torque estimator. Recommended for most applications. |
|
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 |
|---|---|---|---|
|
|
Closed-loop speed ramp rate after CL entry |
|
|
|
Maximum phase current enforced by the FOC current controllers |
|
|
|
Sensorless observer: |
|
|
|
Space vector modulation mode: |
|
|
|
Maximum output voltage magnitude in per-unit — controls SVM headroom |
|
|
|
Fraction of the Vs budget reserved for the d-axis voltage |
|
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 |
|---|---|---|
|
|
Active observer: |
|
|
SVM mode: |
|
|
Closed-loop speed ramp rate (Hz/s) |
|
|
Maximum phase current limit (A) |
|
|
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
Detection Phase (
MOTOR_SEEK_POSstate): WhenflagEnableFlyingStartistrue, the state machine enters theMOTOR_SEEK_POSstate 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.Speed Check: After the detection time (
flyingStartTimeDelay_cntISR counts), the estimated speed is compared against the minimum thresholdspeedFlyingStart_Hz.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 ( |
Description |
Example (Panasonic Blower) |
|---|---|---|
|
Minimum electrical speed to consider the rotor spinning |
|
|
Detection window — how long to observe before deciding |
|
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 |
|---|---|---|
|
|
Enable ( |
|
|
Minimum speed threshold for detection (Hz) |
|
|
Detection window in ISR counts |
|
|
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.