field-凯发k8网页登录
this example uses a look-up table (lut) for a non-linear pmsm and controller to run the motor using field-weakening control (with mtpa). use this example to replicate and run a finite element analysis (fea)-based non-linear high fidelity permanent magnet synchronous motor (pmsm) in simulation. this example helps motor design engineers to simulate high performance motors for real-world motor control applications. in addition, control system engineers can use this example to design control algorithms for a given set of motor parameter data to achieve high levels of accuracy in tracking and controlling speed and torque as well as meet efficiency requirements especially for high-performance motors.
the following image shows the mtpa and field-weakening operating points for an interior pmsm (ipmsm).
using an actual pmsm and hardware to design a motor as well as the control algorithm can be impractical due to higher operation costs and time, safety issues, as well as sporadic machine and inverter failures. the example effectively solves these problems by using a simulation-based model driven by an lut that contains motor parameter data. it uses an lut that contains ld
and lq
data with respect to currents id
and iq
.
traditionally, generation of optimal reference current data would require an actual motor and hardware in a dyno setup. the example reduces this effort by using the block that characterizes the pmsm and obtains the machine's nonlinear inductance and permanent magnet flux linkage data, which can then be used to design and implement flux-weakening torque control id
(torque, speed), iq
(torque, speed) luts by using iterative analytical methods.
by default, the example uses pre-generated and calibrated inductance and permanent magnet flux linkage lut data sets provided by jmag. however, as an alternative, you can configure this block and generate your own reference current id
(torque, speed), iq
(torque, speed) lut and automatically use it in the same example.
you can use the example to simulate the lut-based motor model and run tests to design the control algorithm. this enables you to run challenging tests easily and perform robust machine and control algorithm validation, which in turn reduces the time required for hardware testing and saves the overall development time.
the example model accepts pre-calibrated reference current lut data files for non-linear pmsms. because solving the underlying motor equations for non-linear high-performance motors is computation-intensive, the example relies on luts generated by solving these (non-approximated) equations. this enables you to run control algorithms on the controller hardware with high accuracy (because lut data mimics the actual non-linear motor characteristics).
using this approach, you can reduce the complexities that occur when the algorithm relies on the controller hardware to solve approximated equations for non-linear pmsm.
the example helps you build a field-weakening (with mtpa) control algorithm that can compensate for the reduced torque caused by non-linearity developed due to a magnetically saturated pmsm stator core.
for more details about these operating regions, see field-weakening control (with mtpa) of pmsm and pmsm drive characteristics and constraint curves.
model
this example includes the following simulink® model:
you can use this model only for simulation. click the preceding link or use the following open_system command to open the model:
open_system('mcb_pmsm_nonlin_fwc.slx');
required mathworks® products
motor control blockset™
simscape™ electrical™
about lut data files
by default, the example uses the following two lut data files, which are loaded and read by the model initialization script mcb_pmsm_nonlin_fwc_data.m
associated with the example model:
1k_s_c_iv.mat
— lut from the product simscape electrical
jmag_rtml-004_ldlq.mat
— data generated from the inductance luts sourced from jmag (for rtml-004 pmsm)
note: both the preceding .mat
files include data for the same pmsm model from jmag's model library.
for more details, see the system parameters section of the model initialization script.
the following blocks in the example model uses the loaded lut data:
mcb_pmsm_nonlin_fwc/control system/torque control/lut based pmsm control reference
— uses the reference current luts derived from the inductance luts.
mcb_pmsm_nonlin_fwc/control system/torque control/control_system/current_controllers/pmsm feed forward control
— uses the inductance luts.
mcb_pmsm_nonlin_fwc/inverter and motor/motor model
- non-linear pmsm with 2d luts — this motor model uses a (simscape electrical) block from simscape electrical that extracts and uses 2d data (id
, iq
) from the loaded .mat
file.
- fem parameterized pmsm 2d luts — this motor model uses the (simscape electrical) block from simscape electrical that extracts and uses 2d data (id
, iq
) from the loaded .mat
file.
- fem parameterized pmsm 3d luts — this motor model uses the (simscape electrical) block from simscape electrical that extracts and uses 3d data (imag
, iangle
, rotortheta
) from the loaded .mat
file.
simulate model
1. open the simulink model mcb_pmsm_nonlin_fwc.slx
associated with this example.
2. use the motor plant model radio button in the example model to select one of the following motor models that you want to simulate using the lut data:
a. non-linear pmsm with 2d luts
b. fem parameterized pmsm with 2d luts
c. fem parameterized pmsm with 3d luts
3. click run on the simulation tab to simulate the model.
4. set the reference speed and reference torque values using the speed reference (rpm) and torque reference (nm) knobs.
5. click data inspector on the simulation tab to view and analyze the simulation results.
generate lut data file for custom motor design
the following procedure explains the steps needed to obtain the inductance lut data set (either manually generated or downloaded from jmag) and use it with the same or a similar example model.
1. obtain the .rtt
file and rt-viewer tool:
a. visit to download the lut data set (.rtt
file) for your motor, which includes the ld
, lq
maps.
note: downloading and using this file requires type-2 (free) license that you can obtain by requesting for it.
b. visit to obtain the tool rt-viewer.
2. use the rt viewer tool to open the .rtt
file and export the ld
, lq
table values into an identical grid of the id
, iq
values. for example, save the ld
, lq
table values as jmag_ld.csv
, and jmag_lq.csv
.
- in the rt viewer tool menu, select table value > inductance > id-iq-ld.
- in the map window menu, select file > csv export to open the csv export window.
- in the csv export window, provide id
, iq
grid details and the file name to proceed with the data export.
note: if you have a manually generated lut data set, skip steps 1 and 2.
3. in the model initialization script associated with the simulink model, create template structures for pmsm and inverter as shown below:
pmsm=mcb_setpmsmmotorparameters('teknic2310p');
inverter= mcb_setinverterparameters("boostxl-drv8305");
pmsm.b=pmsm.b*100; % increasing the viscous damping coefficient since this is a bigger motor than the teknic2310p.
4. in the script, find the motor parameters and update the following fields:
pmsm.p (pole pairs)
pmsm.rs (stator/coil resistance)
pmsm.ld (d_inductance)
pmsm.lq (q_inductance)
pmsm.j (inertia)
pmsm.fluxpm (magflux)
pmsm.i_rated (rated_current)
inverter.v_dc (rated_voltage)
5. calculate the rated torque value using the following function:
pmsm.t_rated=mcbpmsmratedtorque(pmsm);
6. create a seed structure with the file paths to read the .csv files that you created in step 2.
seed.ldfilepath='jmag_ld.csv';
seed.lqfilepath='jmag_lq.csv';
note: if you are using a manually generated inductance lut data set, use the paths to the associated .csv
files instead.
7. create luts using the following api:
pmsmlut=mcbgeneratetables(pmsm,inverter,'jmagindfiles2inddq',seed);
the preceding command converts the .csv
files generated by the jmag rt-viewer into a regular matrix, filling the empty places using extrapolation. because we also need the permanent magnet flux linkage (fluxpm) in the same lut format, create an array using the following command:
pmsmlut.fluxpmtable=pmsm.fluxpm*ones(size(pmsmlut.ldtable));
8. configure the following blocks in the example model to use the non-linear luts:
- lut based pmsm control reference — in the block dialog box, set the parameter motor parameter input method to non-linear model with id and iq luts
.
- pmsm feed forward control — in the block dialog box, set the parameter motor parameter input method to non-linear model with ld, lq and fluxpm luts
.
- pmsm torque estimator — in the block dialog box, set the parameter motor parameter input method to non-linear model with ld, lq and fluxpm luts
.
9. in the example model, create a plant using the fem-parameterized pmsm block.
10. in the fem-parameterized pmsm block dialog box, set the modelling option parameter to 2-d partial derivative data | no thermal port.
11. in the electrical section of the dialog-box, set the parameterization parameter to assume sinusoidal back emf - tabulate with d- and q- axis currents
.
12. to generate the id
, iq
luts from inductance lut data, use the following command:
pmsmlut=mcbgeneratetables(pmsm,inverter,'idiqluts',seed);
for more details about structure of the variable seed, use the matlab command help mcbgeneratetables
.
13. in the model initialization script, populate the pmsm lut fields at appropriate places depending on the parameter input method:
pmsmlut.idvec
pmsmlut.iqvec
pmsmlut.ldtable
pmsmlut.lqtable
pmsmlut.fluxpmtable
or
pmsmlut.trefvec
pmsmlut.wrpmvec
pmsmlut.idtable
pmsmlut.iqtable
14. similarly, populate the rest of the motor parameters at their respective places.
15. for the pmsm plant model:
- maintain the default value for the stator zero sequence inductance.
- update the variables pmsm.b
and pmsm.j
in the mechanical parameters section.
- set initial targets for rotor speed and rotor position to 0
.