Here are two good sources on BLDCR motor simulation:
https://www.mathworks.com/help/sps/ug/brushless-dc-motor.html
type in the command window this command and the Simulink Model will pop up:
>> ee_motor_brushless_dc
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!