PMSM controller doesn't work

27 views (last 30 days)
frank
frank on 14 Jul 2021
Commented: frank on 3 Aug 2021
Hi everyone,
I'm trying to implement my own PMSM model after reviewing the numerous examples inlcuded in Simulink and the simulink community. I think I have all the right components and settings, but the motor erratically oscillates for a constant commanded torque and speed.
Below is a plot of the commanded and measured torque. The speed response is just a negative divergence from zero (commanded speed is 1000 rpm or about 100 rad/s).
Can anybody point me in the right direction for debugging?
I've attached two files. Run the .m file first to load all the variables needed for the simulink .slx file. I'm using Simscape electrical components in MATLAB/Simulink 2021a. Note, I use 'M' to symbolize torque to avoid confusion with 'T' for sample periods.
I got my motor parameters from the Emrax 228 (datasheet link).
Thanks!

Accepted Answer

Joel Van Sickel
Joel Van Sickel on 3 Aug 2021
Hello frank,
you don't have your pole pair parameter entered correctly in your machine. Go to where your mechanical parameters are and you will see that you have friction in the spot where pole pairs should be. Your parameters for that entry should read as follows "[J F n_pole M_fric]"
Regards,
Joel
  2 Comments
frank
frank on 3 Aug 2021
Wow! I can't believe it was something that trivial. Thanks Joel!
Any suggestions for my time-related variables, like Ts, T_spdCtrl, and T_vectCtrl? Or my controller gains?
By decreasing the simulation's discrete timestep to 2e-7 s, I greatly reduced the noise in my torque signal. However, I'm curious if I can get away with a shorter timestep or higher gains.
I know this is an open-ended question, so I would appreciate any rules of thumb that Mathworks recommends for discrete simulation of motors.
Thanks,
Farid
frank
frank on 3 Aug 2021
Never mind. I got comparable results with Ts = 2e-6 s, T_vectCtrl = 5*Ts s (10e-6 s). Thanks again!

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!