# How to use Flux LookUp Tables function of Id/Iq?

### Objectives

This article shows how to speed-up MANATEE software electromagnetic calculations in case of skewing, variable speed operation or skew pattern optimization using the so-called Flux Look Up Tables (FLUT) feature. This feature is especially useful when working with non-linear electromagnetic model of MANATEE (coupling with FEMM).

### Principle

The idea consists in building a flux distribution lookup table for different Id/Iq combination and interpolating this table when flux distribution is needed, in particular during variable speed operation or skewed operation. The calculation of the flux at different slices in case of skew can be indeed interpreted as a local change of current angle and time reference.

The Flux Look Up Table is saved in Results folder under the name [machine_name,’_FluxTableIdIq.mat’], it also includes the remanent flux and the angular position of the rotor.

Note that the flux lookup table can be built with third party electromagnetic software as long as the following format is respected. The .mat file should contain

• TableId vector of Id current of size [1 ,nid]
• TableIq vector of Iq current of size [1 ,niq]
• FluxTableIdIq matrix of complex (radial + 1j*tangential) flux waveform of size [nid,niq,nt,na] where the flux is taken in the middle of the airgap at Output.Geometry.Rag_min radius, nt is the number of time steps and na is the number of angles along the airgap.
• xThetaR_IdIq vector of rotor angular positions in radians over time of size [1,nt]
• npert_FLUT integer representing the time periodicity of the flux density distribution
• npera_FLUT integer representing the space periodicity of the flux density distribution
• BH_FLUT matrix of B(H) curve of size [nb_points,2] where nb_points is the number of points of the B(H) curve, with H in the first column and B in the second column
• Brm_FLUT double representing the remanent magnetic flux density of the permanent magnets (in Tesla)

To precise what time and space periodicities mean, repeating both radial and tangential flux density distributions by npert_FLUT in the first dimension and npera_FLUT in the second dimension yields the complete distributions for one mechanical period and 2*pi=360°. This enables to reduce the amount of relevant data which is saved in the flux lookup table.

Storing the B(H) curve and the permanent magnet remanent flux density enables to check if the flux density look up table matches well with the simulation.

To be completed

### Scripting implementation

The flux table is built when specifying

`Input.Simu.is_build_flux_table = 1; `

In this case the flux table is built, saved and loaded each time the airgap flux needs to be calculated. To avoid loading the flux table when available and enforcing the build of the table one can use

`Input.Simu.is_build_flux_table = 2; `

The Id/Iq current values are linear spaced in boundaries defined by

• Input.Simu.idmin
• Input.Simu.idmax
• Input.Simu.Nb_id
• Input.Simu.iqmax
• Input.Simu.iqmin
• Input.Simu.Nb_iq

WARNING: in case of skew make sure that you go above the current limits defined by the mid-slice of the motor (reference slice for the definition of the current angle). The effective current angle seen by first and last axial motor slice are Phi0+/-p*alpha_skew/2 where Phi0 is the current angle and alpha_skew is the total mechanical skew angle. Besides, the skew should not be activated when generating the flux table.

To ease the definition of Id/Iq boundaries the following scripts can be called:

`[IdminPeak, IdmaxPeak, IqminPeak, IqmaxPeak]=comp_IdIq_boundaries(Id0RMS,Iq0RMS,alpha_skew_tot,p)`

to generate max and min Id/Iq depending on max skew angle alpha_skew_tot in radian and RMS current vectors Id0RMS and Iq0RMS, and

` [TableId,TableIq]=comp_IdIq_vectors(idmin,idmax,Nb_id,iqmin,iqmax,Nb_iq)`

to generate the final current vector TableId and TableIq to be used during FLUT calculation.

This table can then be used inside the skew optimization environment or at variable speed. To load a special Flux LookUp Table one should specify

```Input.Simu.is_build_flux_table = 3; Input.Simu.filename_fluxtable='MyFluxTableIdIq.mat'; ```

### Validation cases

Validation cases ALG_027, ALG_028, ALG_029, ALG_031, ALG_032, ALG_033 deal with the validation of the flux lookup table.