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.
SCIM Field Oriented Control - SPS
Description
This model illustrates the closed loop control of eFPGASIM based Squirrel Cage Induction Machine (SCIM) interconnected to a two level voltage source converter built with eHS solver. This example is flexible for different real-time simulators, efsChassisSelection drop-down list gives five options in total. This model has CPU and FPGA as two major processing units. Here, the scim and the converter 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:
Firmware selection for different platforms
Exchange happening within the software
Exchange through analog and digital I/O cards present on the simulator
A SimPowerSystems equivalent model "SPS_SCIM_ref" is also provided along with these models for the users reference. This model needs "ParameterInitialization" file with this model for initializing parameters.
SIM POWER SYSTEMS OP4510 OP5607 OP5707
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 20 microseconds and all the variables required for eFPGASIM SCIM, eHS power network and controller block are defined in "ParameterInitialization.m" file which gets loaded during simulation automatically.
For the model with I/O configured, DB37 pin based analog and digital loop back cables are required to be connected at the rear side of the simulator.
For the model without I/O, no cables are required.
Procedure
The following procedure will help the user understand how to work with the eHS solver, and eFPGASIM based SCIM with field oriented control (FOC).
Firmware Selection :
It supports five options, three for OP4510 (325T with eHSx32 and x64 and 410T with eHSx128) while two for OP5700 (eHSx64 and x128).
RT-LAB model without IO Configuration [Software-in-the-loop]
Run this demo : efsOpenExample('SCIM_rtlab');
Software-in-the-loop based RT-Lab model, "SCIM_rtlab", is provided to show the exchange of information between the controller and plant.
Click on "Run this demo" on the top of this page (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 master subsystem i.e. "SM_Controller" and console subsystem i.e. "SC_Console" .
The master subsystem has FPGA interface of SCIM i.e. "Induction Machine", converter interface i.e. "eHS CPU Block" and Field oriented control of the machine
The console subsystem is used to control set points like magnitude and frequency of source voltages, reference speed, mechanical torque and control activation during real time simulation. Also, user 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 "eHS_SCIM" is built by keeping the conventions of source, switch and measurements compatible to solver requirements. Out of 5 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 SCIM stator terminals (Currents Ia and Ib). The eHS solver form factor to be chosen while using is 64. 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 Generic Machine block, in the Machine #1 tab with the Configure Inputs button. By doing this way we ensure a proper loading/coupling between eHS solver and eFPGASIM machine.
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. These matrices are generated during model compilation in RT-LAB.
Induction machine available in eFPGASIM library solves only electrical side of the system and mechanical model is computed in the CPU. 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 SCIM.
Data In Port Number 28
Load In Port Number 18
Data Out Port Number 9
Field Oriented Control of scim is implemented on the CPU which runs at a sampling time of 20 micro-sec. This has a standard outer loop speed control and inner loop current control implemented. The transformation used is original parks transformation (2/3 factor) with d axis aligned to phase A axis. RTE_SPWM block is used to generate PWM pulses for eHS converter upon activation of control from console. The modulating waves are clamped to a value between 0 and 1 using a clamping circuit. The carrier frequency is 10kHz 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.
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 start the control algorithm: Give value 1 to PWM_Enable;
To set the reference speed: Give value between 0 and 2000 RPM to Speed_Ref;
To add mechanical torque to the machine: Give value between 0 and 150 to Mech_Torque.
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.
RT-LAB model with IO Configuration [Hardware-in-the-loop]
Run this demo : efsOpenExample('SCIM_IOs_rtlab');
The following procedure will help the user understand how to work with the eHS solver and eFPGASIM based SCIM with field oriented control. Hardware-in-the-loop based RT-Lab model, "SCIM_IOs_rtlab", provided to show the exchange of information between the controller and plant.
Click on "Run this demo" on the top of this page (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 previous model, exchange of information between the controller and plant happens through analog and digital I/O cards present on the simulator as shown in the figure below.
"Analog Output Mapping and Rescaling block Control Panel" block in the console subsystem 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 Ch03 are fixed as the controller expects the inputs in the same order
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 start the control algorithm: Give value 1 to PWM_Enable;
To set the reference speed: Give value between 0 and 2000 RPM to Speed_Ref;
To add mechanical torque to the machine: Give value between 0 and 150 to Mech_Torque.
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