How to generate FEA data for LUT based PMSM?

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 (10.3 KB)