Warm tip: This article is reproduced from stackoverflow.com, please click
matlab simulink

Can't solve port dimension errors in Simulink FOC model

发布于 2020-07-02 17:37:13

I am trying to develop an FOC algorithm (see screenshots attached) using the Motor Control Blockset in Simulink, but I am getting the following errors (see screenshot attached). I don't know what I am doing wrong since I fed my d and q currents to my discrete PI controllers and fed the results straight into my Inverse Park Transform. I don't know how to solve this and any help would be greatly appreciated.

enter image description here

enter image description here

Simulink file OneDrive Link:

https://1drv.ms/u/s!AokIrMv_d8kz3BMaImhVY_guP_N-?e=Fu1a1e

Questioner
jefazo92
Viewed
5
thewaywewalk 2020-04-16 16:41

I can't open your model. But from your screenshot I see the following:

  • The little numbers at the signal arrows denote how many signals are in this path. I think it should be always 1 (in your model), except for the three-phase currents, where it should be 3. So everywhere you find a 2 something is wrong.
  • The probable mistake is, that you Demux the PhaseCur in the lower right corner into only 2 signal paths. For whatever reason it appears that the Clarke transform only demands for the phases a and b, but not c. But instead of dropping c you feed it into the block together with a (or a and b together, with c aside, for that matter). So instead of a 2-Way-Demux before, use a 3-Way-Demux and get rid of phase c before the Clarke transform.

This is the most apparent mistake until now, try if it works.


The documentation of the Clarke transform block states:

The block accepts two signals out of the three phases (abc), automatically calculates the third signal, and outputs the corresponding components in the αβ reference frame. For example, the block accepts a and b input values where the phase-a axis aligns with the α-axis.