This can simulate a Switched Reluctance Motor (SRM) including changing load, speed reference, etc.  


> [!WARNING] Do not use this directly in the homework. See Announcement.
> I had a question on M5 Project about allowing the teams to use _the built in_ SRM and H-bridge blocks found in Simulink or if you are required to build your own models for the SRM and H-bridge from scratch.  
> My reply is as follows: You need to build in Simulink your own SRM model based on the SS derivations developed in the lecture. However, if you wish, you can use the H-bridge controller with switching logic already built in Simulink.
> A recommendation, you can compare the results of your SRM model to the one built in Simulink for verification.


## How to use
Run the simulation by running the simulink model [[SpeedRegulatedSwitchedReluctanceMotor.slx]] or running the head file [[SpeedRegulatedSwitchedReluctanceMotorExample.m]]  

The original example can be seen by running `openExample('simscapeelectricalsps/SpeedRegulatedSwitchedReluctanceMotorExample')` in the MATLAB Command Window or see it [online](https://www.mathworks.com/help/sps/ug/power-motordrive-SRM-6-4.html). This is modified for what the assignment needs.  

## TODO
* Β=1.3942E-4  
* Incorporate the table of  SRM Inductance Data @ 1 P.U. Load  
* La, Lsa, Lu, Rs, etc.  
* friction F  
* Imax  

## Things that are changed from the MATLAB example
some parameters are changed in the base workspace, by running [[SpeedRegulatedSwitchedReluctanceMotorData.m]]  
* Inertia J = J_R + J_L = 3.248e-6 + 7.401e-4 = 7.4335e-04 kg-m^2  
* Vdc_nom = 43.5  

Other parameters are changed in the simulink model by going to the correct block in the model, or via `Signal Table -> Parameters (tab)`   
* Speed reference = 5000 rpm  
* Load Torque e=0.217 Nm  
