Data type mismatch error in PMSM block.
30 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am modeling motor controller with Surface Mount PMSM block from motor control blockset. The model is modified from an example and works fine until I add the MTPA block. Error message indicate that the error is due to data type mismatch of a add block inside PMSM block. However, the input and output data type of the PMSM block remain the same as before.

The two block mentioned in the error message seems related to the electric power calculation, but I didn't connect the PwrInfo part. I also tried connecting a dummy speed signal to the input port of MTPA, and the error disappered. The error only appear when the feedback speed is connected to the MTPA block. I don't know how this action is related to the error, please help.
0 Kommentare
Antworten (1)
Vedant Shah
vor etwa 18 Stunden
The error is caused by a data type mismatch inside the Simulink model. It appears after connecting the real speed feedback signal to the MTPA block, even though the PMSM block inputs/outputs seem unchanged.
When the real speed feedback is connected:
PMSM speed (double) → MTPA block (expects single)
Simulink propagates the double data type into a subsystem where internal signals are defined as single, which leads to the error. That is why the message points to a block inside the PMSM subsystem — it is simply where the mismatch is detected, not where it originates.
Although I was not able to reproduce the issue on my side due to the missing MAT file or required workspace variables, based on the model analysis it should be resolved by inserting a "Data Type Conversion" block between the plant speed output and the MTPA input:
Speed feedback → Data Type Conversion (single) → MTPA
This ensures datatype consistency between the plant and control sections.
For more information, refer to the following documentations:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Electrical Block Libraries finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!