Documentation Home Page ◇ eHS Toolbox Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
v2.15 SRM Speed Control - SPS - OP4510
Description
This model illustrates the closed loop control of eFPGASIM based Switched Reluctance Machine (SRM) interconnected with a individual phase bridge converter built with eHS solver. This example is based on OPAL-RT's OP4510 real time simulator, which has CPU and FPGA as two major processing units. Here, the SRM and the converters are simulated on FPGA and the controller on CPU in real time. Two RT-Lab models are provided to show the exchange of information between the controller and plant:
Exchange happening within the software
Exchange through analog and digital I/O cards present on the OP4510 simulator
A SimPowerSystems equivalent model "SPS_SRM_ref" is also provided along with these models for the users reference. This models needs "motorsrm" file for initializing the parameters.
SIM POWER SYSTEMS OP4510
Requirements
The RT-LAB, RT-EVENTS, SimPowerSystems and eFPGASIM toolboxes must be installed on the host and target computers in order to run this example model properly. Please refer to the product documentation for details on version compatibility.
Setup and Connections
This model must be run with the Hardware Synchronized option, and with the XHP mode enabled. The firmware used in this model is generated using RT-XSG tool, and it can be modified to generate firmware to fit another I/O hardware configuration. The CPU model simulation time step is set to 10 microseconds and all the variables required for eFPGASIM SRM, eHS power network and controller block are defined in "ParametersInitialization.m" file which gets loaded during simulation automatically.
For the model with I/O configured, DB37 pin based analog and digital loop back cables and a DB9 pin-based digital RS422 loop-back cable are required to be connected at the rear side of the simulator.
For the model without I/O, no cables are required.
Procedure
RT-LAB model without IO Configuration [Software-in-the-loop]
Run this demo : efsOpenExample('SRM_OP4510_rtlab');
The following procedure will help the user understand how to work with the eHS solver, and eFPGASIM based SRM with speed and current control. Software-in-the-loop based RT-Lab model, "SRM_OP4510_rtlab", is provided to show the exchange of information between the controller and plant.
Click on "Run this demo" on the top of this section (if this page is displayed in the Matlab demo browser). The RT-LAB model using the eHS solver will open automatically, as well as the SimPowerSystems model describing the circuit to be solved.
Verify that the board type is set to TE0741 in the OpCtrl block in the master subsystem of the RT-LAB model. In the "OpCtrl" block, select the "Board ID" corresponding to the hardware on which eHS is executed. To get this information, select "Tools > Get I/O infos" on the target context menu in RT-LAB and find the index of your hardware.
To run this example, user needs to ensure that the RT-Lab model and eHS model are present in the same folder.
RT Lab model consists of a master subsystem i.e. "SM_SRMeHS" and a console subsystem i.e. "SC_Console" .
The master subsystem has FPGA interface of SRM i.e. "Switch Reluctance Motor", converter interface i.e. "eHS CPU Block" and Control of the machine
The console subsystem is used to control set points, like magnitude and frequency of source voltages, speed reference, mechanical torque, and control activation during real time simulation. Also, users can monitor voltages, currents, machine torque and speed of the machine at any point of time during simulation
eHS model consists of power network and is solved by eHS solver present in the master subsystem of RT-Lab model. eHS model "SRM_eHS_LCA" is built by keeping the conventions of sources, switch and measurements compatible to solver requirements. Out of 6 voltage/current sources needed by eHS circuit, three are generated and mapped via RT-Lab model (Voltage Source Va,Vb and Vc) and the remaining are fed back from eFPGASIM SRM stator terminals (Currents Ia, Ib and Ic). The convention to follow in eHS solver "Input Settings" tab is shown below. Here, the switch configuration is also shown. The user can choose to send the gating pulses from the CPU or configuring Digital In.
The converter terminal voltage measurements, namely, Y01, Y02 and Y03 are routed to machine terminals internally using machine interface block. By doing this way we ensure a proper loading/coupling between eHS solver and eFPGASIM machine. LoadIn port number to configure this block is 17.
When the model is compiled in Simulink, the configuration of the eHS solver will be generated according to the SimPowerSystem circuit characteristics. Elements will be put into matrices and stored into .mat files that will be transferred into the solver when the model is run from the RT-LAB interface. Matrices are generated during model compilation in RT-LAB.
The SRM available in eFPGASIM library has the capability to solve two motors with OP4510 hardware. This machine model can solve both mechanical and electrical side of the system. The converter terminal voltages measured from eHS solver will feed the machine terminals and similarly, the machine stator currents are fed back to the converter terminals as mentioned in point 5. Following are the necessary information to configure SRM.
DataIn Port Number 20
LoadIn Port Number 11
DataOut Port Number 12
Speed Control of SRM is implemented on the CPU which runs at a sampling time of 10 micro-sec. This has a standard outer loop speed control and inner loop current control implemented. Torque and Currents tables are imported in matrix form with respect to rotor angle, flux and stator currents. RTE_SPWM block is used to generate PWM pulses for eHS converter. The modulating waves are clamped to a value between 0 and 1 using a clamping circuit. The carrier frequency is 10000 Hz and the number of events chosen is 4. Exchange of information between the controller and plant happens within the software model. Machine generated currents, speed and theta information are routed to the controller as an input, and output of the controller is connected to eHS solver in RTE format.
Note: To capture the data during real time simulation, OpWriteFile block can be used. A mat file is available in the following folder model_name\model_name_SM_xxxx\OpREDHAWKtarget upon model reset. This .mat file can be used to visualize more accurately the outputs, or to compare the results of several simulations together.
To run simulations which includes eHS solver and eFPGASIM machines in real time, create a RT-LAB project and add the RT-LAB model into the project. The eHS model should not be added to the RT-LAB project, as it does not need to be transferred to the target computer for execution. Compile the model, then assign a target node to run it in real time, then load the model onto it.
During real time execution;
To set the reference speed: Give value between 0 and 150 to Ref_Speed_rad/s;
To add mechanical torque to the machine: Give value between 0 and 10 to Tmech.
RT-LAB model with IO Configuration [Hardware-in-the-loop]
Run this demo : efsOpenExample('SRM_OP4510_IOs_rtlab');
The following procedure will help the user understand how to work with the eHS solver and eFPGASIM based SRM with field oriented control. Hardware-in-the-loop based RT-Lab model, "SRM_OP4510_IOs_rtlab", is provided to show the exchange of information between the controller and plant.
Click on "Run this demo" on the top of this section (if this page is displayed in the Matlab demo browser). The RT-LAB model using the eHS solver will open automatically, as well as the SimPowerSystems model describing the circuit to be solved.
Step 2 to 8 from the previous section must be repeated to ensure proper configuration of the demo.
Unlike the previus model, exchange of information between the controller and plant happens through analog and digital I/O cards present on the OP4510 simulator as shown in the figure below.
"Analog Output Mapping and Rescaling block Control Panel" block in the console subsytem is customised to map measurements from eHS converter as well as signals from CPU model to analog out (DAC) card. For this example, analog out channels Ch00 to Ch06 are fixed as the controller expects the inputs in the following order {'SRM1.Ia', 'SRM1.Ib', 'SRM1.Ic', 'Resolver1.Cosine', 'Resolver1.Sine', 'Resolver1.Excitation'}.
"DualAngleSensors_wfaults" block in master subsystem configures Resolver and Encoder sensors. Cosine, Sine and Excitation outputs of resolver1 are mapped to channels 03, 04 and 05 of analog out card and Encoder signals are looped back using RS422 connectors.
Machine currents are provided to the controller using Analog In (ADC) of simulator.
"Encoder In" block reads the encoder output and generates speed and angle information of the machine shaft.
Firing pulses generated by controller are sent out via digital out card present on the simulator, and fed back through digital loop back cable to fire eHS converter internally.
To run simulations which includes eHS solver and eFPGASIM machines in real time, create a RT-LAB project and add the RT-LAB model into the project. The eHS model should not be added to the RT-LAB project, as it does not need to be transferred to the target computer for execution. Compile the model, then assign a target node to run it in real time, then load the model onto it.
During real time execution;
To set the reference speed: Give value between 0 and 150 to Ref_Speed_rad/s;
To add mechanical torque to the machine: Give value between 0 and 10 to Tmech.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter