# How to generate FEA data for LUT based PMSM?

**URL:** https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337
**Category:** PLECS
**Tags:** pmsm, lut
**Created:** [March 26, 2024, 9:45pm UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337 "2024-03-26T21:45:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Bijen\_Mali](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bijen\_Mali](https://forum.plexim.com/u/Bijen_Mali)
#### Post date: [March 26, 2024, 9:45pm UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337/1 "2024-03-26T21:45:57Z")

</div>

I have been trying to create a nonlinear model of a PMSM as stated in this video. [Demo Model Video - PLECS: Look-up Table-Based PMSM | Plexim](https://plexim.com/content/demo-model-video-plecs-lookup-table-pmsm)

In the video, it is stated that there is an application note on the Plexin website showing how to import FEA data in PLECS readable form.

The only content related to this I have found is [Incorporating Magnetic Saturation of a PMSM for Drive Systems Modeling | Plexim](https://www.plexim.com/support/application-examples/948)

However, this tutorial/ example does not seem to work.

Is there any tutorials relating to the import of FEA data from third-party software like Motorsolve?

---

<div class="post-metadata">

### Author: ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)
#### Post date: [March 28, 2024, 10:48am UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337/2 "2024-03-28T10:48:57Z")

</div>

The application note you referenced is dated, as the library model for the Non-Excited Synchronous Machine (Look-up) has a different input data format.

Exploring the machine data used in the "Look-up table based PMSM” demo model might be instructive. The data is in the look\_up\_table\_based\_pmsm\_prius\_motor\_data.mat file. Attached to this post is an Octave script to plot the data so you can better visualize it.

Basically, 2D look-up tables are required for the D and Q axis flux linkages (Psid and Psiq) where the flux linkage values will vary as a function of the D and Q axis currents. Psid=F(Id,Iq) and Psiq=G(Id,Iq) where D axis current corresponds to the row and Q axis current corresponds to the column of the table. Id and Iq are row vectors corresponding to the machine’s operating point.

You can specify incremental inductance tables in the same format. If you leave the incremental inductance fields blank, then the values will be calculated using the flux linkage data entered.

If you have example output data from MotorSolve I can help you convert the data into the appropriate format. However we do not have MotorSolve licenses so I cannot guide you through the export process.

[plot\_mat.m](https://forum.plexim.com/uploads/short-url/ltUibq6rEz2TG8whPwmVGS6Sd1F.m) (628 Bytes)

---

<div class="post-metadata">

### Author: ![Bijen\_Mali](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bijen\_Mali](https://forum.plexim.com/u/Bijen_Mali)
#### Post date: [March 28, 2024, 1:06pm UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337/3 "2024-03-28T13:06:13Z")

</div>

Thank you for the insight.  
As per your suggestion, I have tried visualizing the FEA data obtained using your .m file.

I have included FEA data in the attached Matlab file as well as the plot.  
Is there a way to convert this data into the one that is suited to be implemented in PLECs.

[plot\_mat.m](https://forum.plexim.com/uploads/short-url/cbEXzSSsFxNQD8hFejBDxeeCEKm.m) (9.72 KB)

 ![Capture.JPG](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/8/87247269f702313c20df9e0e7b364bb59c12df9b.jpeg)

---

<div class="post-metadata">

### Author: ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)
#### Post date: [March 28, 2024, 3:16pm UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337/4 "2024-03-28T15:16:01Z")

</div>

The idd and iqq matrices aren’t ordered in your data. Here’s a bit of code that can resort the data appropriately. The remaining issue is that the interpolation methods I used to reshape the data do not support extrapolation, so extrapolated data is a NaN in the attached script.

Your idd, iqq data points fill an oval on the id,iq plane. The input data for the model requires a rectangular projection on the id, iq plane (since Id and Iq are row vectors). I will leave solving the NaN issue to you, but if you stay in the id, iq area of your initial data the model should not run into extrapolation issues.

[reshape\_machine\_data.m](https://forum.plexim.com/uploads/short-url/iIZWB4J1uLla7N7M15N831bol1k.m) (10.3 KB)

---

<div class="post-metadata">

### Author: ![Bijen\_Mali](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bijen\_Mali](https://forum.plexim.com/u/Bijen_Mali)
#### Post date: [July 14, 2024, 10:29pm UTC](https://forum.plexim.com/t/how-to-generate-fea-data-for-lut-based-pmsm/1337/5 "2024-07-14T22:29:02Z")

</div>

Thank you for all your help. The issue seems to have been solved!!!
