# Pulsating High Freq Observer

Estimate initial rotor electrical position of interior PMSM using PHF injection

**Library:**Motor Control Blockset / Sensorless Estimators

## Description

The PHF Observer block estimates the initial position (in electrical radians) of a stationary interior PMSM by using pulsating-high-frequency (PHF) injection and dual-pulse (DP) techniques. In addition, the block also detects real-time position when the rotor runs using (low-speed) closed-loop control.

## Ports

### Input

`I`_{ab hf}

— PHF current response

vector

_{ab hf}

The high-frequency (phase a and b) current feedback from motor in response to the PHF voltage injection, in Amperes or per-unit.

**Data Types: **`single`

| `double`

| `fixed point`

`Enable`

— Enable block

scalar

Signal to enable block. The port supports one of the following input signals:

`1`

— Enable block operation`0`

— Disable the block

**Data Types: **`Boolean`

`θ`_{in}

— Initial rotor position

scalar

_{in}

Initial rotor position input when the block skips the stage 1 IPE operation, in radians, degrees, or per-unit.

The unit depends on the **Position unit** parameter.

**Data Types: **`single`

| `double`

| `fixed point`

`IPE`_{En}

— Enable stage 1 IPE operation

scalar

_{En}

Signal to enable stage 1 IPE operation. The port supports one of the following input signals:

`1`

— Enable the block to run stage 1 IPE followed by stage 2 closed-loop PHF injection.`0`

— Enable the block to skip stage 1 IPE and directly run stage 2 closed-loop PHF injection.

**Data Types: **`Boolean`

### Output

`V`_{αβ hf}

— PHF output

scalar

_{αβ hf}

Pulsating high-frequency voltage (in *αβ* reference frame)
output, in per-unit.

**Data Types: **`single`

| `double`

| `fixed point`

`θ`_{est}

— Estimated rotor position

scalar

_{est}

The rotor position estimated by the block, in radians, degrees, or per-unit.

The unit depends on the **Position unit** parameter.

**Data Types: **`single`

| `double`

| `fixed point`

`Pos`_{En}

— Status of *θ*_{est} port

scalar

_{En}

_{est}

The port provides one of the following outputs:

`1`

— Indicates that stage 1 IPE is successfully complete and the*θ*port output is accurate._{est}`0`

— Indicates that stage 1 IPE is in progress (*θ*port output is not accurate as yet) or estimation has failed._{est}

**Data Types: **`single`

| `double`

| `fixed point`

`Info`

— Bus signal

bus

The bus signal contains these block calculations.

Signal | Description | Units | |||
---|---|---|---|---|---|

Sin
θ_{est} | Sine and cosine of estimated rotor position | - | |||

I_{q} | Stator direct axis and quadrature axis currents | A | |||

Convergence | Difference between current and previous sample of
A
value closer to zero indicates saturation of
| rad | |||

Status | 0 | Block is not enabled ( | - | ||

1 | Block is finding the best possible initial estimate (Stage 1 Part A) | - | |||

2 | Block is running the PHF method (Stage 1 Part B) | - | |||

3 | Block is running Dual-Pulse (DP) Method (Stage 1 Part C) | - | |||

4 | Block has successfully completed stage 1 and has started stage 2 closed-loop PHF injection | - | |||

5 | Stage 1 Part B failed due to a large error in the estimated rotor position | - |

## Parameters

`Discrete step size (s)`

— Sample time after which block executes again

`50e-6`

(default) | scalar

The time between two consecutive instances of block execution.

`Position unit`

— Unit of position input and output

`Radians`

(default) | `Degrees`

| `Per-unit`

Units for the *θ _{in}* input and

*θ*output.

_{est}`Datatype`

— Input and output data type

`single`

(default) | `double`

| `fixdt(1,16)`

| `fixdt(1,16,0)`

| `fixdt(1,16,2^0,0)`

| `<data type expression>`

Data type of the block inputs and outputs.

### PHF Parameters

`PHF peak voltage (PU)`

— Peak voltage of PHF

`0.2`

(default) | scalar

Peak amplitude of the PHF voltage applied by the block, in Volts.

`PHF frequency (Hz)`

— PHF voltage frequency

`2000`

(default) | scalar

Frequency of the PHF voltage applied by the block, in Hz.

`Proportional gain`

— Proportional gain for PI controller of PHF

`3000`

(default) | scalar

Proportional PI controller gain *K _{p}* for
the PHF applied by the block.

`Integral gain`

— Integral gain for PI controller of PHF

`4000`

(default) | scalar

Integral PI controller gain *K _{i}* for the
PHF applied by the block.

`Cutoff frequency (Hz)`

— Cutoff frequency for lowpass filter of PHF

`500`

(default) | scalar

Cutoff frequency of the lowpass filter for the PHF applied by the block, in Hz.

`Open loop duration (s)`

— Duration of open-loop PHF injection during stage 1 part A

`5e-3`

(default) | scalar

Duration of the open-loop PHF injection during stage 1 part A, in seconds.

`Close loop duration (s)`

— Duration of closed-loop PHF injection during stage 1 part B

`0.2`

(default) | scalar

Duration of the closed-loop PHF injection during stage 1 part B, in seconds.

`Idle time (s)`

— Duration between algorithm steps

`5e-3`

(default) | scalar

Duration (in seconds) between steps in the algorithm related to stage 1 part A and stage 1 part B that allow for fading of transient dynamics. For example, this block stops operating for this duration between each PHF injection (open-loop or closed-loop).

### DP Parameters

`Pulse voltage (s)`

— Amplitude of injected pulses

`0.4`

(default) | scalar

Voltage amplitude of the injected pulses, in Volts.

`Pulse duration (s)`

— Duration of injected pulses

`750e-6`

(default) | scalar

Duration of the injected pulses, in seconds.

`Idle time (s)`

— Duration between two pulses during dual-pulse injection

`5e-3`

(default) | scalar

Duration (in seconds) between two pulses during dual-pulse injection (stage 1 part C).

## Model Examples

## Algorithms

The block determines the best possible initial estimation for the rotor position using open-loop PHF injection, which it uses to run closed-loop PHF.

The block executes closed-loop PHF by injecting a high-frequency signal into the estimated
rotor position to determine the actual rotor position without spinning the motor. This
technique works when the motor saliency ratio
(*L _{q}*/

*L*) is greater than 1. Due to a limitation in the PHF method, the estimated position can show ambiguity equal to the value of π (pi). The dual-pulse (DP) method uses polarity detection to resolve the ambiguity of π and applies a compensation of π if there is an error. The estimated rotor position ranges from 0 to 2π electrical radians.

_{d}The block can run in these 2 stages:

Stage 1 – Initial position estimation (IPE), which includes three parts.

Stage 2 – Closed-loop pulsating-high-frequency (PHF) injection.

Stage 1 focuses on determining the initial position of the rotor when it is stationary. This stage includes the following three parts:

### Part A: Find Best Possible Initial Estimation

The block uses the PHF injection technique. PHF injection needs initial estimation to start the algorithm.

If you use only one initial estimation,
*θ _{i_est}*, (for PHF) for all possible actual rotor
positions, the block algorithm might not work accurately for certain actual rotor positions
when the motor has low saliency. These ambiguous positions are when:

*θ*lies in the range $$\left[\left({\theta}_{i\_est}+\frac{\pi}{2}-0.1\right),\left({\theta}_{i\_est}+\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left({\theta}_{i\_est}-\frac{\pi}{2}-0.1\right),\left({\theta}_{i\_est}-\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left({\theta}_{i\_est}+\pi -0.1\right),\left({\theta}_{i\_est}+\pi +0.1\right)\right]$$_{actual}

To make PHF work for motors with low saliency, the block picks different initial estimation for different actual rotor positions.

When executing this part, the block picks the best possible initial estimation from these three alternatives:

*θ*=_{i_est}`0`

*θ*=_{i_est}`2π/3`

*θ*=_{i_est}`-2π/3`

Therefore, the block injects three high-frequency voltage signals (approximately 2000
KHz) across the preceding three *θ _{est}* values and
measures the resulting

*i*currents. For each

_{q}*i*:

_{q}$$iq\propto PHF\_signal\times \mathrm{sin}\left(2{\theta}_{err}\right)$$

Therefore, ${i}_{q}\propto \left|sin\left(2{\theta}_{err}\right)\right|\text{or}{i}_{q}\propto \left|sin\left(2({\theta}_{actual}-{\theta}_{i\_est})\right)\right|$

where:

*θ _{i_est}* — Initial estimation of rotor position
(which can be either

`0`

, `2π/3`

, or
`-2π/3`

) (in degrees, per-unit, or radians)*θ _{actual}* — Actual rotor position (in degrees,
per-unit, or radians)

*θ _{err}* =

*θ*-

_{actual}*θ*(in degrees, per-unit, or radians)

_{i_est}The block uses these definitions:

*i _{q1}* =

*i*for

_{q}*θ*= 0

_{i_est}*i _{q2}* =

*i*for

_{q}*θ*=

_{i_est}`2π/3`

*i _{q3}* =

*i*for

_{q}*θ*=

_{i_est}`-2π/3`

For *θ _{i_est}* = 0, when varying

*θ*from 0 to 2π, ${i}_{q1}\propto \left|sin2({\theta}_{actual}-0)\right|$ is the maximum among the preceding three

_{actual}*i*currents when the rotor lies in the following four highlighted regions.

_{q}If *θ _{i_est}* = 0 is used for all

*θ*=

_{actual}`0`

to
`2π`

, the algorithm fails for the following ambiguous regions (when motor
saliency is low):*θ*lies in the range $$\left[\left(0+\frac{\pi}{2}-0.1\right),\left(0+\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(0-\frac{\pi}{2}-0.1\right),\left(0-\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(0+\pi -0.1\right),\left(0+\pi +0.1\right)\right]$$_{actual}

Because these ambiguous regions are not present in the preceding four regions, you eliminate the regions where the algorithm might fail.

For *θ _{i_est}* =

`(2π/3)`

, when
varying *θ*from

_{actual}`0`

to
`2π`

, ${i}_{q2}\propto \left|sin2({\theta}_{actual}-\frac{2\pi}{3})\right|$ is the maximum among the three
*i*currents when the rotor lies in the following four highlighted regions.

_{q}If *θ _{i_est}* =

`(2π/3)`

is used
for all *θ*=

_{actual}`0`

to
`2π`

, the algorithm fails for following ambiguous regions (when motor
saliency is low):*θ*lies in the range $$\left[\left(\frac{2\pi}{3}+\frac{\pi}{2}-0.1\right),\left(\frac{2\pi}{3}+\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(\frac{2\pi}{3}-\frac{\pi}{2}-0.1\right),\left(\frac{2\pi}{3}-\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(\frac{2\pi}{3}+\pi -0.1\right),\left(\frac{2\pi}{3}+\pi +0.1\right)\right]$$_{actual}

Because these ambiguous regions are not present in the preceding four regions, you eliminate the regions where the algorithm might fail.

For *θ _{i_est}* =

`-(2π/3)`

, when
varying *θ*from

_{actual}`0`

to
`2π`

, ${i}_{q3}\propto \left|sin2({\theta}_{actual}-\left(-\frac{2\pi}{3}\right))\right|$ is the maximum among the three
*i*currents when the rotor lies in the following four highlighted regions.

_{q}If *θ _{i_est}* =

`-(2π/3)`

is used
for all *θ*=

_{actual}`0`

to
`2π`

, the algorithm fails for following ambiguous regions (when motor
saliency is low):*θ*lies in the range $$\left[\left(-\frac{2\pi}{3}+\frac{\pi}{2}-0.1\right),\left(-\frac{2\pi}{3}+\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(-\frac{2\pi}{3}-\frac{\pi}{2}-0.1\right),\left(-\frac{2\pi}{3}-\frac{\pi}{2}+0.1\right)\right]$$_{actual}*θ*lies in the range $$\left[\left(-\frac{2\pi}{3}+\pi -0.1\right),\left(-\frac{2\pi}{3}+\pi +0.1\right)\right]$$_{actual}

Because these ambiguous regions are not present in the preceding four regions, you eliminate the regions where the algorithm might fail.

Therefore, using this approach you have three sets of regions corresponding to three different initial estimates. These three sets or regions cover all the motor sectors where the rotor can lie:

In part A, the block picks the *θ _{i_est}*
corresponding to the maximum

*I*current value between

_{q}*i*,

_{q1}*i*, and

_{q2}*i*for Part B.

_{q3}### Part B: Pulsating High-Frequency (PHF) Method

After determining the best possible initial estimate
*θ _{i_est}*, the block injects a sinusoidal
high-frequency voltage along the finalized (

*θ*| t = 0) =

_{est}*θ*(resulting in an unbalanced three-phase voltage in the motor) and reads the current response from the motor. The block then performs numerical analysis of the resulting stator current response to compute the initial position of the stationary rotor (in electrical radians) by making corrections to

_{i_est}*θ*.

_{est}The block performs iterative tests on the motor. Therefore, when the block executes, the
estimated position is initially *θ _{i_est}*, but rises
steadily to saturate at the actual rotor angle (with respect to

*a*-axis).

The PHF method has a limitation due to which it might compute the rotor position with an ambiguity of π. If the rotor lies in the range $${\theta}_{actual}=\left(0,\frac{\pi}{2}\right]\cup \left[\frac{3\pi}{2},2\pi \right)$$ electrical radians (region 1), the estimated position is accurate (π compensation is not required).

If the rotor lies in the range $${\theta}_{actual}=\left(\frac{\pi}{2},\frac{3\pi}{2}\right)$$ electrical radians (region 2), the estimated position shows an ambiguity of π (π compensation is required).

Therefore, the block uses the dual-pulse method to determine if the estimated position
needs `π`

compensation.

### Part C: Dual-Pulse (DP) Method

The block injects two very short duration voltage pulses (with the same width and magnitude) in the following positions:

Pulse 1 at the rotor position estimated in Part B

Pulse 2 at the rotor position estimated in Part B +

`π`

Because pulse width is very short, the motor does not run, and the rotor remains stationary after pulse injection.

The interaction between the resulting stator magnetic flux and the rotor permanent
magnets results in two current impulses along the *d*-axis of the rotor
that rise and fall quickly.

Because the stator core is saturated, it shows nonlinear behaviour. A small
*L _{d}* results in higher current

*I*, and a high

_{d}*L*results in smaller current

_{d}*I*. Therefore, the

_{d}*I*current impulses generated by Pulse 1 and Pulse 2 show different peak values.

_{d}**Note**

The pulse duration of the injected voltage pulses is large enough to obtain a measurable difference between the peak current values. At the same time, the duration is not too high, that is, when the pulse duration exceeds a certain limit, the rotor can start spinning.

The block computes the difference between the peak values of the two current impulses
*ΔI _{d}* to determine if the position estimated in
Part A needs

*π*compensation.

*ΔI _{d}* =

*|I*-

_{d1}|*|I*

_{d2}|PHF injection benefits use cases that require the rotor to remain stationary or that require position estimation without starting the motor. The PHF injection technique also benefits use cases where you need to avoid open-loop runs to estimate position (before transitioning to closed-loop speed control) or where you require the motor to start directly in the closed-loop mode. The block algorithm in stage 1 addresses these use cases by estimating the position while keeping the rotor stationary and avoiding an open-loop run.

After the block completes stage 1, you can continue to run the block in stage 2 where it computes the rotor position while the motor runs using closed-loop control (for example, field-oriented control). Using the Stage 2 algorithm (closed-loop PHF injection), the block can continue to inject pulsating high-frequency signal (as described in Part B) and performs numerical analysis of the resulting stator-current response to compute and track the rotor position during closed-loop operation.

## Version History

**Introduced in R2022b**

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

# Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)