> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/ehs/3.7/model-in-schematic-editor/library-blocks-reference/machines-blocks/electrically-excited-synchronous-machine-with-saturation.md).

# Electrically Excited Synchronous Machine With Saturation

## Description

<figure><img src="https://521571437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo99Izmvvw5eHT4ldzI4g%2Fuploads%2Fgit-blob-c74d55c280c22824136dc7ada8e81789c91af293%2FSE_eesm.png?alt=media" alt="" width="148"><figcaption></figcaption></figure>

The **Electrically Excited Synchronous Machine With Saturation** block implements a three-phase EESM model, including magnetic saturation represented by three-dimensional flux tables. Optional resolver and encoder sensors models are also available.

{% hint style="info" %}
This block is only available in the eHS library.
{% endhint %}

#### Overview Of Main Functions

* Nonlinear flux calculation using 3D look-up tables as function of the currents.
* Voltage-Behind Reactance (VBR) model for the stator and field circuits.
* Amplitude Invariant Park (DQ) transform for analysis and control.
* Customer-accessible input paths.

## Electrical Model

### Nonlinear Flux LUT Model

The nonlinear magnetic saturation behavior is represented by three 3D flux look-up tables. Each flux table is a function of the d-axis current, q-axis current, and field current.

$$
\begin{aligned}
\psi\_d=f(i\_d, i\_q, i\_f),\quad \psi\_q=f(i\_d, i\_q, i\_f),\quad \psi\_f=f(i\_d, i\_q, i\_f)\\
\end{aligned}
$$

The FPGA implementation is generalized for variable LUT dimensions and currently targets a maximum table size of 64 x 64 x 32, corresponding to 2^17 entries per flux table.

$$
\begin{aligned}
N\_d \cdot N\_q \cdot N\_f \leq 2^{17}
\end{aligned}
$$

### VBR Electrical Equations

The VBR electrical model uses the interpolated fluxes and their derivatives to compute the dq-axis voltages and the field voltage.

$$
\begin{aligned}
v\_d &= \dfrac{d\psi\_d}{dt} - \omega\_e\cdot\psi\_q + R\_s\cdot i\_d\\
v\_q &= \dfrac{d\psi\_q}{dt} + \omega\_e\cdot\psi\_d + R\_s\cdot i\_q\\
v\_f &= \dfrac{d\psi\_f}{dt} + R\_f\cdot i\_f
\end{aligned}
$$

### Torque Equation

The electromagnetic torque is computed using the fluxes and currents as follows:

$$
\begin{aligned}
T\_e = \dfrac{3}{2} \cdot pp \cdot (\psi\_d \cdot i\_q - \psi\_q \cdot i\_d)
\end{aligned}
$$

### ABC/DQ Transformation Conventions

The current transformation convention used by the model is:

$$
\begin{aligned}
i\_d &= \frac{2}{3} \cdot (i\_a \cdot \cos\_a + i\_b \cdot \cos\_b + i\_c \cdot \cos\_c)\\
i\_q &= -\frac{2}{3} \cdot (i\_a \cdot \sin\_a + i\_b \cdot \sin\_b + i\_c \cdot \sin\_c)
\end{aligned}
$$

The inverse transformation for voltages is:

$$
\begin{aligned}
v\_a &= v\_d \cdot \cos\_a - v\_q \cdot \sin\_a\\
v\_b &= v\_d \cdot \cos\_b - v\_q \cdot \sin\_b\\
v\_c &= v\_d \cdot \cos\_c - v\_q \cdot \sin\_c
\end{aligned}
$$

### Second-Order Filter

A discrete filtered derivative is implemented in the design to reduce derivative noise. The implemented form is:

$$
\begin{aligned}
y1\[k] &= Coeff\_{B1} \cdot (x\[k] - x\[k-1]) + Coeff\_{A1} \cdot y1\[k-1]\\
y2\[k] &= Coeff\_{B2} \cdot y1\[k] + Coeff\_{A2} \cdot y2\[k-1]
\end{aligned}
$$

Coefficients are computed based on the filter time constants and the effective sampling period as follows:

$$
\begin{aligned}
Coeff\_{B1} &= \dfrac{1}{ T\_{f1} + T\_{eff} }\\
Coeff\_{A1} &= \dfrac{T\_{f1}}{ T\_{f1} + T\_{eff} }\\
T\_{eff1} &= T\_{ehs}\\
Coeff\_{B2} &= \dfrac{T\_{eff}}{ T\_{f2} + T\_{eff} }\\
Coeff\_{A2} &= \dfrac{T\_{f2}}{ T\_{f2} + T\_{eff} }\\
T\_{eff2} &= T\_{ehs}
\end{aligned}
$$

### Custom Input Paths

The custom mode selection parameter controls which customer-accessible custom input paths are enabled. These input paths are tunable in runtime. Following modes are available:

* C1\_Psid: Adds the custom Psi\_d contribution to the output of the Psi\_d LUT. This gives the user access to the d-axis flux path.
* C2\_Psiq: Adds the custom Psi\_q contribution to the output of the Psi\_q LUT. This gives the user access to the q-axis flux path.
* C3\_Rf: Enables the custom field-resistance input path. This gives the user access to the field resistance Rf used by the field circuit.
* C4\_Lr: Overrides the Psi\_f LUT output with Lr \* If. This gives the user access to Lr and uses the selected Lr value together with the field current If.

### Mechanical model

The equation of the mechanical model in torque mode can be expressed as follows

$$
\omega\_r\left\[k+1\right]=a \times \omega\_r\left\[k\right]+b \times \left(T\_{e}\left\[k\right]-T\_{l}\left\[k\right]-T\_{f,s}\left\[k\right]\right)
$$

with

$$
a=1-\frac{F\_vT\_S}{J} \\\[8pt]
b=\frac{30}{\pi}\frac{T\_S}{J} \\\[8pt]
$$

where $$\omega\_r$$ is the rotor speed in RPM, $$T\_e$$ is the electromagnetic torque in $$N.m$$, $$T\_i$$ is the torque command in $$N.m$$, $$F\_v$$ is the viscous friction coefficient in $$N.m.s/rad$$, $$J$$ is the rotor moment of inertia in $$kg.m^2$$, and $$T\_s$$ the time step in $$s$$. There is a dead-zone implementation with the static friction torque $$T\_{f,s}$$, if the net torque doesn't exceed the static friction torque threshold value $$F\_s$$, given in $$N.m$$, the speed remains zero.

In speed mode, the rotor speed is directly set to the speed command $$\omega\_{r,c}$$.

A resolver is a rotary transformer where the magnitude of the signal through the resolver windings varies sinusoidally as the shaft rotates.

## Single excitation resolver <a href="#single-excitation-resover" id="single-excitation-resover"></a>

The equations of the resolver can be expressed as follows:

$$
\theta\_{res}=\left(\theta\_{mec}+\theta\_{offset}\right) R\_{pp} \\\[8pt]
\text{cosine}=\text{Excitation} \times \left\[ R\_{cc} \cos \left( \theta\_{res} \right) + R\_{cs} \sin \left( \theta\_{res} \right) \right] \\\[8pt]
\text{sine}= \left(-1\right)^{R\_{dir}} \times \text{Excitation} \times \left\[ R\_{sc} \cos \left( \theta\_{res} \right) + R\_{ss} \sin \left( \theta\_{res} \right) \right]
$$

where $$\theta\_{res}$$ is the resolver angle, $$\theta\_{mec}$$ is the mechanical angle of the machine, $$\theta\_{offset}$$ is the angle offset, $$R\_{pp}$$ is the number of pole pairs of the resolver, $$R\_{cc}$$, $$R\_{sc}$$, $$R\_{cs}$$, and $$R\_{ss}$$ are the resolver sine cosine gains and $$R\_{dir}$$ is the direction of the sensor rotation (0 = clockwise, 1 = counterclockwise).

{% hint style="info" %}
$$R\_{dir}$$ does not have an effect to the resolver angle, but change the resolver sine sign to match the counterclockwise convention.
{% endhint %}

When the gains are set to its default values ( $$R\_{cc}=1$$, $$R\_{sc}=0$$, $$R\_{cs}=0$$, and $$R\_{ss}=1$$), the sensor rotation is clockwise, and the excitation is a sinusoidal wave ( $$\text{Excitation}=\sin 2 \pi f t$$, where $$f$$ is the excitation frequency), the outputs are given by the following expressions:

$$
\text{cosine}=\sin \left( 2 \pi f t \right) \times \cos \left( \theta\_{res} \right) \\\[8pt]
\text{sine}= \sin \left( 2 \pi f t \right) \times \sin \left( \theta\_{res} \right)
$$

It means the excitation signals are modulated by the sine and cosine of the rotor position angle.

## **Excitation source**

The excitation signal can be selected among one of the following options:

* DC: a continuous signal is used as excitation, so the outputs are $$\text{cosine}= \cos \left( \theta\_{res} \right)$$ and $$\text{sine}= \sin \left( \theta\_{res} \right)$$;
* AC: a constant-frequency sinusoidal, unitary amplitude waveform is used as excitation

  $$\text{Excitation}=\sin 2 \pi f t$$, so the outputs are those expressed in the previous section.
* External: a external signal, coming from one of the analog inputs, is used as excitation. This incoming signal may be rescaled by the Analog Input Differential Rescaling module (AIR).

## **Resolver gains**

The resolver gains can be used to simulate non-ideal conditions of the sensor, occurring due to manufacturing imperfections.

**Amplitude imbalance:** Output phases have unequal inductances. Assuming the coupling between the rotor excitation winding and the cosine winding as the reference:

$$
\begin{aligned}
\left\[\begin{matrix}R\_{cc} & R\_{cs}\R\_{sc} & R\_{ss}\end{matrix}\right]
\end{aligned}=\begin{aligned}
\left\[\begin{matrix}1 & 0\0 & \alpha\end{matrix}\right]
\end{aligned}
$$

where $$0< \alpha <1$$

**Imperfect quadrature:** Output phases are not in perfect spatial quadrature. Assuming the angle $$\theta\_{res}=0$$ when the rotor excitation winding is aligned with the cosine winding:

$$
\begin{aligned}
\left\[\begin{matrix}R\_{cc} & R\_{cs}\R\_{sc} & R\_{ss}\end{matrix}\right]
\end{aligned}=\begin{aligned}
\left\[\begin{matrix}1 & 0\ \cos \alpha & \sin \alpha\end{matrix}\right]
\end{aligned}
$$

where $$\alpha$$ is the angle between the cosine winding and the sine winding. When $$\alpha = 90°$$, the windings are in perfect quadrature, and the default gain values are recovered.

## **Faults**

One of the windings is not connected due to a fault. In this case, the corresponding gain is equal to zero.

<p align="center"><span class="math">\begin{aligned} \left[\begin{matrix}R_{cc} &#x26; R_{cs}\\R_{sc} &#x26; R_{ss}\end{matrix}\right] \end{aligned}=\begin{aligned} \left[\begin{matrix}1 &#x26; 0\\ 0 &#x26; 0\end{matrix}\right] \end{aligned} \text{ or }\begin{aligned} \left[\begin{matrix}R_{cc} &#x26; R_{cs}\\R_{sc} &#x26; R_{ss}\end{matrix}\right] \end{aligned}=\begin{aligned} \left[\begin{matrix}0 &#x26; 0\\ 0 &#x26; 1\end{matrix}\right] \end{aligned}</span></p>

## **Excitation time shift**

When the excitation signal comes from an external source (one of the analog input channels) the signal can be shifted by a given amount of time.

Number of resolver pole pairs affects the number of electrical turns per mechanical turns.

Resolver sine cosine gains affect the sine (first axis) and cosine (second axis) modulation output. Default values set to 1, 0, 0, 1 make it so the sine modulation has a sine form and the cosine modulation has a cosine form. If set to 0, 1, 1, 0, the sine modulation would have a cosine and the cosine modulation would have a sine form.

Number of pulses per revolution (**Q**<sub>**ppr**</sub>) defines how many times signals A and B pulse between two Z pulses (one full rotation).

Direction of the sensor rotation describes if A leads B (Clockwise) or if B leads A (Counterclockwise)

## Parameters

{% tabs %}
{% tab title="Electrical" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets feature</th><th width="120">I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>Stator resistances R</strong><sub><strong>S</strong></sub></td><td>Resistances of the stator windings for phases a, b, and c (Ω).</td><td>No</td><td>N/A</td></tr><tr><td><strong>Field resistance R</strong><sub><strong>f</strong></sub></td><td>Equivalent field winding resistance referred to the stator (Ω)</td><td>No</td><td>N/A</td></tr><tr><td><strong>Number of pole pairs pp</strong></td><td>Number of pole pairs.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Motor configuration type</strong></td><td>Type of motor: <strong>Variable DQF</strong>. A resource file must be provided.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Motor configuration M</strong><sub><strong>file</strong></sub></td><td>Imports a Variable DQF (.json file) motor configuration resource file.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Application</strong></td><td>Selection of the application type: <strong>HIL</strong> or <strong>PHIL</strong>.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Maximum stator inductance L</strong><sub><strong>s,max</strong></sub></td><td>Maximum stator inductance of phase a, b, and c (H).</td><td>No</td><td>N/A</td></tr><tr><td><strong>Maximum field inductance L</strong><sub><strong>f,max</strong></sub></td><td>Maximum field inductance of the field circuit (H).</td><td>No</td><td>N/A</td></tr><tr><td><strong>Stator VBR coupling gain K</strong><sub><strong>vbr,s</strong></sub></td><td>Gain factor applied to the calculated stator maximum inductance for the VBR interface.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Rotor VBR coupling gain K</strong><sub><strong>vbr,r</strong></sub></td><td>Gain factor applied to the calculated rotor maximum inductance for the VBR interface.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Custom input path CU</strong><sub><strong>def</strong></sub></td><td>Mode selection enabling tunable input paths to flux, field resistance and inductance.</td><td>No</td><td>To model</td></tr><tr><td><strong>Stator currents i</strong><sub><strong>s</strong></sub></td><td>Stator currents measured at phases a, b and c (A)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator currents (DQ) i</strong><sub><strong>sqd</strong></sub></td><td>Stator currents in dq frame (A)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Field current i</strong><sub><strong>f</strong></sub></td><td>Field winding current referred to the rotor (A)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator dq voltages V</strong><sub><strong>sqd</strong></sub></td><td>Stator voltages in dq frame (V)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator dq fluxes Φ</strong><sub><strong>sqd</strong></sub></td><td>Stator fluxes in dq frame (Wb)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Field flux Φ</strong><sub><strong>f</strong></sub></td><td>Field winding magnetic flux referred to the rotor (Wb)</td><td>No</td><td>To model<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Electrical rotor position, θ</strong><sub><strong>e</strong></sub><strong> (°)</strong></td><td>Electrical rotor angle (0–360°).</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>First order filter time constant T</strong><sub><strong>f1</strong></sub></td><td>Time constant of the first order filter (s).</td><td>No</td><td>N/A</td></tr><tr><td><strong>Second order filter time constant T</strong><sub><strong>f2</strong></sub></td><td>Time constant of the second order filter (s).</td><td>No</td><td>N/A</td></tr><tr><td><strong>Ehs solver timestep T</strong><sub><strong>ehs</strong></sub></td><td>Ehs timestep (s).</td><td>No</td><td>N/A</td></tr></tbody></table>
{% endtab %}

{% tab title="Mechanical" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Stets feature</th><th width="120">I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>J Rotor inertia</strong></td><td>Rotor moment of inertia available only in Torque mode (kg·m<sup>2</sup>)</td><td>No</td><td>N/A</td></tr><tr><td><strong>F</strong><sub><strong>s</strong></sub><strong> Static friction torque</strong></td><td>Static friction torque (N.m)</td><td>No</td><td>N/A</td></tr><tr><td><strong>F</strong><sub><strong>v</strong></sub><strong> Viscous friction coefficient</strong></td><td>Viscous friction available only in Torque mode (N·m·s/rad)</td><td>No</td><td>N/A</td></tr><tr><td><strong>ctrl Mechanical control mode</strong></td><td><p>Options: Speed or Torque.</p><p>In <strong>Speed (0) mode</strong>, the mechanical model is bypassed and the speed command is applied directly.<br>In <strong>Torque (1) mode</strong>, the torque command drives the mechanical model to compute speed.</p></td><td>Yes</td><td>From model</td></tr><tr><td><strong>T Torque command</strong></td><td>Torque command to the mechanical model (N.m)</td><td>Yes</td><td>From model</td></tr><tr><td><strong>ω</strong><sub><strong>rc</strong></sub><strong> Rotor speed command</strong></td><td>Rotor speed command to the mechanical model (rpm)</td><td>Yes</td><td>From model</td></tr><tr><td><strong>ω</strong><sub><strong>r0</strong></sub><strong> Initial rotor speed command</strong></td><td>Initial rotor speed setpoint (rpm)</td><td>No</td><td>N/A</td></tr><tr><td><strong>ω</strong><sub><strong>r</strong></sub><strong> Rotor speed</strong></td><td>Mechanical rotor speed (rpm)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Electromagnetic torque T</strong><sub><strong>e</strong></sub></td><td>Torque measured at the rotor (N.m)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>θ</strong><sub><strong>0</strong></sub><strong> Initial rotor angle (°)</strong></td><td>Rotor position at time t = 0.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Rotor angle, θ (°)</strong></td><td>Mechanical rotor angle (0–360°).</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr></tbody></table>
{% endtab %}

{% tab title="Resolver" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets feature</th><th width="120">I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>Enable resolver Ren</strong></td><td><p><strong>Disable</strong> the resolver.</p><p><strong>Enable</strong> the resolver, the following parameters are displayed.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>Resolver feedback signals R</strong><sub><strong>sc</strong></sub></td><td>Resolver sine and cosine feedback signals proportional to the angle.</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>R</strong><sub><strong>pp</strong></sub><strong> Number of resolver pole pairs</strong></td><td>Resolver pole-pair count.</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>dir</strong></sub><strong> Direction of the sensor rotation</strong></td><td>Options: Clockwise or counterclockwise.</td><td>No</td><td>N/A</td></tr><tr><td><strong>θ</strong><sub><strong>offset</strong></sub><strong> Angle offset Δθ (Sensor − Rotor)</strong></td><td>Angle offset between resolver and rotor position (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>k</strong></sub><strong> Resolver sine/cosine gains</strong></td><td>The sine/cosine modulation output sine/cosine component amplitude. Default value are 1, 0, 0 and 1.</td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>type</strong></sub><strong> Excitation source type</strong></td><td><p>Options AC, DC External<br><strong>AC</strong>: generated in FPGA at the specified frequency,</p><p><strong>DC:</strong> single excitation mode only<br><strong>External</strong> provided from outside the model.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>src</strong></sub><strong> Excitation source</strong></td><td>External excitation source in External mode.</td><td>No</td><td>From AI</td></tr><tr><td><strong>E</strong><sub><strong>f</strong></sub><strong> Excitation frequency</strong></td><td>Frequency of the excitation when in AC mode (Hz)</td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>ts</strong></sub><strong> Excitation time shift</strong></td><td>Compensates time offset between the carrier generation input and modulated signal output (s)</td><td>No</td><td>N/A</td></tr></tbody></table>
{% endtab %}

{% tab title="Encoder" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets feature</th><th>I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>Enc</strong><sub><strong>en</strong></sub><strong> Enable encoder</strong></td><td><p><strong>Disable</strong> the encoder.</p><p><strong>Enable</strong> the encoder, the following parameters are displayed.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>A B Z encoder signals Q</strong><sub><strong>ABZ</strong></sub></td><td>Quadrature encoder A, B, and Z signals in Quadrature mode</td><td>No</td><td>To DO</td></tr><tr><td><strong>Q</strong><sub><strong>ppr</strong></sub><strong> Number of pulses per revolution</strong></td><td>Number of pulses in one full revolution of the encoder in Quadrature mode.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Q</strong><sub><strong>dir</strong></sub><strong> Direction of the sensor rotation</strong></td><td>Direction in which the sensor is turning. Two options: A leads B or B leads A.</td><td>No</td><td>N/A</td></tr><tr><td><strong>θ</strong><sub><strong>offset</strong></sub><strong> Angle offset Δθ (Sensor − Rotor)</strong></td><td>Angle offset between the encoder and the rotor position from 0 to 360 degrees in Quadrature mode (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>Q</strong><sub><strong>rat</strong></sub><strong> Encoder speed ratio</strong></td><td>Sensor-to-mechanical position ratio. Encoder angle = Qrat × machine mechanical angle in Quadrature mode.</td><td>No</td><td>N/A</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### EESM files parameters

<details>

<summary><strong>How to specify variable DQF parameters in the motor configuration file</strong></summary>

This block allows you to specify the electrical parameters values by providing a file when the **Variable DQF** option is selected. The parameters must be defined in **JSON format**, and the file must include the following parameters:

| Parameter (JSON key) | Value type     | Unit | Description                                                                                                                                                         | Example                                                                                                                                                                                                                                                                |
| -------------------- | -------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id_grid`            | `double[]`     | A    | One-dimensional array of current values along the **direct** axis.                                                                                                  | `"id_grid": [-650, 0, 650],`                                                                                                                                                                                                                                           |
| `iq_grid`            | `double[]`     | A    | One-dimensional array of current values along the **quadratic** axis.                                                                                               | `"iq_grid": [-650, 0, 650],`                                                                                                                                                                                                                                           |
| `if_grid`            | `double[]`     | A    | One-dimensional array of current values along the **field** axis.                                                                                                   | `"if_grid": [0, 33.6, 65],`                                                                                                                                                                                                                                            |
| `psi_d`              | `double[][][]` | Wb   | Three-dimensional array of **direct** flux values. The first index is for the direct axis, the second for the quadrature axis, and the third for the field axis.    | `"psi_d": [[<br/>[-0.24, -0.23, -0.22], <br/>[-0.24, -0.23, -0.22], <br/>[-0.24, -0.23, -0.22]<br/>], [<br/>[0.00, 0.05, 0.09], <br/>[0.00, 0.05, 0.09], <br/>[0.00, 0.05, 0.09]<br/>], [<br/>[0.24, 0.24, 0.25], <br/>[0.24, 0.24, 0.25], <br/>[0.24, 0.24, 0.25]]],` |
| `psi_q`              | `double[][][]` | Wb   | Three-dimensional array of **quadratic** flux values. The first index is for the direct axis, the second for the quadrature axis, and the third for the field axis. | `"psi_q": [[<br/>[-0.20, -0.20, -0.20], <br/>[0.00, 0.00, 0.00], <br/>[0.20, 0.20, 0.20]<br/>], [<br/>[-0.20, -0.20, -0.20], <br/>[0.00, 0.00, 0.00], <br/>[0.20, 0.20, 0.20]<br/>], [<br/>[-0.20, -0.20, -0.20], <br/>[0.00, 0.00, 0.00], <br/>[0.20, 0.20, 0.20]]],` |
| `psi_f`              | `double[][][]` | Wb   | Three-dimensional array of **field** flux values. The first index is for the direct axis, the second for the quadrature axis, and the third for the field axis.     | `"psi_f": [[<br/>[-3.55, -3.10, -2.42], <br/>[-3.55, -3.10, -2.42], <br/>[-3.55, -3.10, -2.42]<br/>], [<br/>[0.00, 1.42, 2.42], <br/>[0.00, 1.42, 2.42], <br/>[0.00, 1.42, 2.42]<br/>], [<br/>[3.55, 3.82, 4.00], <br/>[3.55, 3.82, 4.00], <br/>[3.55, 3.82, 4.00]]]`  |

OPAL-RT TECHNOLOGIES can support the user in creating the JSON file from a MATLAB (.mat) file with the correct format and values. Please contact OPAL-RT support for assistance.

Concatenating the example above results in the following valid JSON:

{% code overflow="wrap" lineNumbers="true" %}

```json
{
  "id_grid": [
    -650,
    0,
    650
  ],
  "if_grid": [
    0,
    33.6,
    65
  ],
  "iq_grid": [
    -650,
    0,
    650
  ],
    "psi_d": [
    [
      [-0.24, -0.23, -0.22],
      [-0.24, -0.23, -0.22],
      [-0.24, -0.23, -0.22]
    ],
    [
      [0.00, 0.05, 0.09],
      [0.00, 0.05, 0.09],
      [0.00, 0.05, 0.09]
    ],
    [
      [0.24, 0.24, 0.25],
      [0.24, 0.24, 0.25],
      [0.24, 0.24, 0.25]
    ]
  ],
    "psi_f": [
    [
      [-3.55, -3.10, -2.42],
      [-3.55, -3.10, -2.42],
      [-3.55, -3.10, -2.42]
    ],
    [
      [0.00, 1.42, 2.42],
      [0.00, 1.42, 2.42],
      [0.00, 1.42, 2.42]
    ],
    [
      [3.55, 3.82, 4.00],
      [3.55, 3.82, 4.00],
      [3.55, 3.82, 4.00]
    ]
    ],
  "psi_q": [
    [
      [-0.20, -0.20, -0.20],
      [0.00, 0.00, 0.00],
      [0.20, 0.20, 0.20]
    ],
    [
      [-0.20, -0.20, -0.20],
      [0.00, 0.00, 0.00],
      [0.20, 0.20, 0.20]
    ],
    [
      [-0.20, -0.20, -0.20],
      [0.00, 0.00, 0.00],
      [0.20, 0.20, 0.20]
    ]
  ]  
}
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/ehs/3.7/model-in-schematic-editor/library-blocks-reference/machines-blocks/electrically-excited-synchronous-machine-with-saturation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
