How to import a winding from Koil?

Case of single layer winding

Starting from MANATEE 1.06.02, a coupling with Koil is available to define the winding. Koil is a tool to automatically design winding according to the star of slot method.

Koil software
Koil software

Once you have created the winding that suits your needs, select: "Export slot matrix" (in the Koil menu File/Export). It will create a .lua file coding the distribution of phases in slots. This file should look like this:

Koil slot matrix file
Koil slot matrix file

To import this winding distribution inside MANATEE you need to set these parameters:

Input.Magnetics.type_winding1 = 6; %Select import winding from Koil
Input.Magnetics.wind_mat_filename1 = 'my_winding.lua'; %Name of the slot matrix file path

MANATEE will import the matrix by following the winding connection matrix convention. Note that MANATEE will check if the imported winding matches with specified Input.Magnetics.qs and Input.Geometry.Zs. If the winding is correctly loaded, MANATEE machine file will include:

Input.Magnetics.type_winding1 = 0;
Input.Magnetics.wind_mat1 = <the loaded matrix>;

This way, you will be able to access easily the imported matrix at the end of the simulation.

Case of double layer winding

The previous process deals perfectly with single layer winding. With double layer there are two missing information in the slot matrix file coming from Koil:

  • Are the layers radial or tangential?
  • Which phase goes in which layer?

To solve the first issue we have added a parameter in default_machine:

Input.Magnetics.type_koil_layer1=0;

0 is for radial layers, 1 is for tangential layers.

For the second issue, MANATEE is able to import the winding matrix but some layers may be reversed. It doesn’t matter from the airgap magnetic point of view. If you want to correct the winding matrix anyway, you can do it by following this procedure:
For instance at the end of the simulation plot_wind returns:

Imported winding from Koil
Imported winding from Koil

We want to switch the phases in the second slot.
We get the imported matrix from:

wind_mat = Input.Magnetics.wind_mat1;

Then we correct it with (winding matrix dimensions are [Nlay_rad, Nlay_tan, Zs, qs]):

wind_mat(2,1,2,1) = wind_mat(1,1,2,1);
wind_mat(1,1,2,1)= 0;
wind_mat(1,1,2,3) = wind_mat(2,1,2,3);
wind_mat(2,1,2,3)= 0;

To check if the changes are effective, you can overwrite Output.Electrical.wind_mat1 = wind_mat (which is used by plot_wind). Once the matrix is correct, save it with:

save('your_file_name','wind_mat')

Note that the saved variable must be named "wind_mat".

Finally import the matrix by changing your machine file to:

Input.Magnetics.type_winding1 = 7; %Select import winding from .mat
Input.Magnetics.wind_mat_filename1 = 'your_file_name'; %Name of the slot matrix file

At the end of the simulation, plot_wind returns the corrected winding:

Corrected winding in .mat
Corrected winding in .mat

Import of winding using .mat file

Alternatively you can import a winding matrix using a .mat file.

Previous Next