I investigated the model attached by you and found some of the corrections which may be helpful:
- In the model “foc_mmd_2022b”, for the current to be sensed by the “VI measurement” block, it must flow across its terminal. Since the BLDC model made by you accepts “signal” bus, the actual current is not flowing across the terminals of “VI measurement” block. Therefore, the current reading is always zero. Therefore, instead of using VI measurement block, you can directly sense the currents from the “measurements” output of your BLDC block as shown in the below figure. Also, you can directly pass “Vab” and “Vbc” from the output of “alpha-beta to ABC” block as shown in below figure:
- Inside the block “BLDC Model”, I changed the location of “theta_e” goto block. This is because, the “Wr_elec” is already in rad/sec, but not in RPM. Therefore, the gain block of “2*pi/60” is not required.
- I also made corrections to the “Generation of Hall Effect Sensors” block.
Conclusions:
After making the above corrections, the results of “foc_mmd_2022b” and “foc_2022b” model are still not matching, but they are somewhat better now.
Below given is the waveform of stator currents. They are sinusoidal.
The only issue is, the rotational speed is going towards negative values. I would recommend you to once again check with the equations of BLDC model and their implementation. It should solve the issue.
I have also attached the modified Simulink model with this answer.
I hope you find this useful !