# Flux Observer

Compute electrical position, magnetic flux, and electrical torque of rotor

Since R2020a

Libraries:
Motor Control Blockset HDL Support / Sensorless Estimators
Motor Control Blockset / Sensorless Estimators

## Description

The Flux Observer block computes the electrical position, magnetic flux, and electrical torque of a surface-mount permanent magnet synchronous motor (SPMSM) or an induction motor by using the per unit voltage and current values along the α- and β-axes in the stationary αβ reference frame.

The block also accepts 16-bit fixed-point data type inputs. To perform mathematical operations on 16-bit fixed-point data type signals, the block uses optimized implementation of equations for maintaining the best possible precision.

In addition, you can use the advanced options to enable the ParameterBus input port, which you can use with the Compute Parameter block to update the block parameters optimally at run-time. You can use this functionality when motor parameters can change over time, for example, while building applications that may require swapping of motors at run-time.

### Equations

These equations describe how the block computes the electrical position, magnetic flux, and electrical torque for an SPMSM in the αβ reference frame.

If $\left({V}_{\alpha }-{I}_{\alpha }R\right)={v}_{1}\left(t\right)$ and $\left({V}_{\beta }-{I}_{\beta }R\right)={v}_{2}\left(t\right)$

Then, the following Laplace transforms represent the integral terms available in Ψα and Ψβ:

$\begin{array}{l}L\left({\int }^{\text{​}}{\text{v}}_{1}\text{(t)dt}\right)=\frac{1}{s}L\left({\text{v}}_{1}\text{(t)}\right)=\frac{1}{s}{v}_{1}\left(s\right)\\ L\left({\int }^{\text{​}}{\text{v}}_{2}\text{(t)dt}\right)=\frac{1}{s}L\left({\text{v}}_{2}\text{(t)}\right)=\frac{1}{s}{v}_{2}\left(s\right)\end{array}$

The block uses low-pass filter (LPF) based integrator to compute these integral terms.

If the input electrical speed of the motor (ωe) is much greater than the speed corresponding to the cutoff frequency of LPF-based integrator (ωc), then

$\begin{array}{l}L\left({\int }^{\text{​}}{\text{v}}_{1}\text{(t)dt}\right)=\frac{1}{\left(s+{\omega }_{c}\right)}{v}_{1}\left(s\right)\\ L\left({\int }^{\text{​}}{\text{v}}_{2}\text{(t)dt}\right)=\frac{1}{\left(s+{\omega }_{c}\right)}{v}_{2}\left(s\right)\end{array}$

The LPF-based integrator does not allow any DC offset (in the block inputs) to ramp up the block output. For example, consider an input function X(s)=k/s corresponding to a step input x(t) = k*u(t). Using the preceding transfer function of the LPF-based integrator, $G\left(s\right)=\frac{1}{\left(s+{\omega }_{c}\right)}$, we obtain:

$\begin{array}{l}Y\left(s\right)=G\left(s\right)X\left(s\right)=\frac{k}{s\left(s+{\omega }_{c}\right)}=\frac{k}{{\omega }_{c}}\left(\frac{1}{s}\right)-\frac{k}{{\omega }_{c}}\left(\frac{1}{s+{\omega }_{c}}\right)\\ Y\left(t\right)=\frac{k}{{\omega }_{c}}u\left(t\right)-\frac{k}{{\omega }_{c}}\mathrm{exp}\left(-{\omega }_{c}t\right)u\left(t\right)\end{array}$

According to the preceding equation, the step response of the LPF integrator asymptotically settles to a DC value (that depends on the magnitude of the step input). Whereas the step response of a pure integrator is a ramp function. Using a highpass filter at the LPF integrator output eliminates the DC offset (present in the input) completely.

${T}_{\text{e}}=\frac{3}{2}P\left({\psi }_{\alpha }{I}_{\beta }-{\psi }_{\beta }{I}_{\alpha }\right)$

These equations describe how the block computes the rotor electrical position, rotor magnetic flux, and electrical torque for an induction motor.

$\sigma =1-\frac{{L}_{m}^{2}}{{L}_{r}\cdot {L}_{s}}$

${T}_{\text{e}}=\frac{3}{2}\cdot P\cdot \frac{{L}_{m}}{{L}_{r}}\left({\psi }_{\alpha }{I}_{\beta }-{\psi }_{\beta }{I}_{\alpha }\right)$

where:

• ${V}_{\alpha }$ and ${V}_{\beta }$ are the α-axis and β-axis voltages (volts).

• ${I}_{\alpha }$ and ${I}_{\beta }$ are the α-axis and β-axis current (amperes).

• $R$ is the stator resistance of the motor (ohms).

• ${L}_{s}$ is the stator inductance of the motor (henry).

• ${L}_{r}$ is the rotor inductance of the motor (henry).

• ${L}_{m}$ is the magnetizing inductance of the motor (henry).

• $\sigma$ is the total leakage factor of the induction motor.

• $P$ is the number of motor pole pairs.

• $\psi$ is the rotor magnetic flux (weber).

• ${\psi }_{\alpha }$ and ${\psi }_{\beta }$ are the rotor magnetic fluxes along the α- and β-axes (weber).

• ${T}_{e}$ is the electrical torque of the rotor (Nm).

• ${\theta }_{e}$ is the electrical position of the rotor (radians).

## Ports

### Input

expand all

Voltage component along the α-axis in the stationary αβ reference frame.

Data Types: single | double | fixed point

Voltage component along the β-axis in the stationary αβ reference frame.

Data Types: single | double | fixed point

Current along the α-axis in the stationary αβ reference frame.

Data Types: single | double | fixed point

Current along the β-axis in the stationary αβ reference frame.

Data Types: single | double | fixed point

The pulse (true value) that resets the block algorithm.

Data Types: single | double | fixed point

Computed parameters for the Flux Observer block. You can specify the following parameters at this port:

• Pole pairs

• Stator resistance (ohm)

• Stator d-axis inductance (H)

• Stator leakage inductance (H)

• Rotor leakage inductance (H)

• Magnetizing inductance (H)

• Cutoff frequency (Hz)

Use this port along with the Compute Parameter block to update the preceding block parameters optimally at run-time.

#### Dependencies

To enable this port, select the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Data Types: single | double

### Output

expand all

The electrical position of the rotor as estimated by the block.

#### Dependencies

To enable this port, select the Position option in the Block output parameter.

Data Types: single | double | fixed point

The magnetic flux of the rotor as estimated by the block.

#### Dependencies

To enable this port, select the Flux option in the Block output parameter.

Data Types: single | double | fixed point

The electrical torque of the motor as estimated by the block.

#### Dependencies

To enable this port, select the Torque option in the Block output parameter.

Data Types: single | double | fixed point

## Parameters

expand all

### Parameters

Select the type of motor from the types that the block supports.

To process 16-bit fixed-point inputs and perform computation using 16-bit fixed-point data type, select this parameter. To use a data type other than 16-bit fixed point, clear this parameter.

If you select this parameter:

• The block sets the Input unit parameter to Per-unit.

• The block selects the Position option in the Block output parameter because it does not support flux and torque computations when using the 16-bit data type.

Select the unit of the α- and β-axes voltage and current input values.

The maximum phase voltage applied to the motor. For details, see Per-Unit System.

#### Dependencies

To enable this parameter, set Input unit to Per-unit.

The maximum measurable current supplied to the motor. For details, see Per-Unit System.

#### Dependencies

To enable this parameter, set Input unit to Per-unit.

Select one or more quantities that you want the block to compute and display in the block output.

Note

You must select at least one value. The block displays an error message if you click or without selecting a value.

Number of pole pairs available in the motor.

#### Dependencies

To enable this parameter:

• Select the Torque option in the Block output parameter.

• Clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Stator phase winding resistance of the motor in ohms.

#### Dependencies

To enable this parameter, clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Stator winding inductance of the motor along the d-axis in henries.

#### Dependencies

To enable this parameter:

• Set Motor selection to PMSM.

• Clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Leakage inductance of the induction motor stator winding in henries.

#### Dependencies

To enable this parameter:

• Set Motor selection to ACIM.

• Clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Leakage inductance of the induction motor rotor winding in henries.

#### Dependencies

To enable this parameter:

• Set Motor selection to ACIM.

• Clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Magnetizing inductance of the induction motor in henries.

#### Dependencies

To enable this parameter:

• Set Motor selection to ACIM.

• Clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

Cutoff frequency of the internal highpass filter (that filters noise) in hertz.

The Flux Observer block uses an internal first-order IIR highpass filter. Set the Cutoff frequency (Hz) for this filter to a value that is lower than the electrical frequency corresponding to the minimum speed of the motor. For example, you can enter a value that is one-tenth of the minimum frequency of the motor currents. However, you can adjust this value to determine a more accurate cutoff frequency that generates the desired block output.

#### Dependencies

To enable this parameter, clear the Use input port for computed parameters (run-time motor swap) parameter available in the Advanced Options section.

The fixed time interval in seconds between two consecutive instances of block execution.

Select this parameter to enable the ParameterBus input port and disable the following parameters:

• Pole pairs

• Stator resistance (ohm)

• Stator d-axis inductance (H)

• Stator leakage inductance (H)

• Rotor leakage inductance (H)

• Magnetizing inductance (H)

• Cutoff frequency (Hz)

This parameter enables you to use the input port along with the Compute Parameter block to update block parameters optimally at run-time.

### Datatypes

Unit of the electrical position output.

#### Dependencies

To enable this parameter, select the Position option in the Block output parameter.

Data type of the electrical position output.

#### Dependencies

To enable this parameter, select the Position option in the Block output parameter.

Unit of the magnetic flux output.

#### Dependencies

To enable this parameter, select the Flux option in the Block output parameter.

Flux value (in weber) corresponding to one per-unit. For details about the per-unit system, see Per-Unit System.

#### Dependencies

To enable this parameter:

• Select the Flux option in the Block output parameter.

• Set the Flux unit parameter to Per-unit.

Data type of the magnetic flux output.

#### Dependencies

To enable this parameter, select the Flux option in the Block output parameter.

Unit of the electrical torque output.

#### Dependencies

To enable this parameter, select the Torque option in the Block output parameter.

Torque value (in Nm) corresponding to one per-unit. For details about the per-unit system, see Per-Unit System.

#### Dependencies

To enable this parameter:

• Select the Torque option in the Block output parameter.

• Set the Torque unit parameter to Per-unit.

Data type of the electrical torque output.

#### Dependencies

To enable this parameter, select the Torque option in the Block output parameter.

## References

[1] A. Podder and D. Pandit, "Study of Sensorless Field-Oriented Control of SPMSM Using Rotor Flux Observer & Disturbance Observer Based Discrete Sliding Mode Observer," 2021 IEEE 22nd Workshop on Control and Modelling of Power Electronics (COMPEL), 2021, pp. 1-8. (doi: 10.1109/COMPEL52922.2021.9645939)

[2] O. Sandre-Hernandez, J. J. Rangel-Magdaleno and R. Morales-Caporal, "Simulink-HDL cosimulation of direct torque control of a PM synchronous machine based FPGA," 2014 11th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE), Campeche, 2014, pp. 1-6. (doi: 10.1109/ICEEE.2014.6978298)

[3] Y. Inoue, S. Morimoto and M. Sanada, "Control method suitable for direct torque control based motor drive system satisfying voltage and current limitations," The 2010 International Power Electronics Conference - ECCE ASIA -, Sapporo, 2010, pp. 3000-3006. (doi: 10.1109/IPEC.2010.5543698)

## Version History

Introduced in R2020a