Documentation Home Page Specialized Solutions Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Control Software

How the Model Works

Opal-RT provides a complete and fully-integrated model and interface for the DriveLab kit. The kit allows users to quickly set up a simulation to perform tests on their choice of motor and inverter circuit.

The model provided already includes all the required I/O access for such classic applications as position control and speed control as shown in the two figures below.

 Position control schematic

Speed control schematic



Note: Basic knowledge of RT-LAB is sufficient to use the DriveLab kit with its preconfigured models, however, if users wish to modify the models or perform other tests, more advanced knowledge is required. Refer to the RT-LAB User Guide and to the training material for more details.



The Model

The model provided with the DriveLab kit contains multiple subsystems that users may modify in order to implement their own control and algorithms. The references, controls, and feedbacks are easily accessible and can be modified as needed. The common I/O interface subsystem should only be modified by advanced users.

The model references are located in the console subsystem (SC) of the RT-LAB model, which includes: frequency, voltage and duty controls that are used as references for the various motors. The reference range and type can be modified to suit different type of controls. Motor selection and clear fault options are also available. Make sure to select which motor is connected to which inverters before using the references controls.


 Model References part


The controls model section (circled in red) is found in the master subsystem (SM) of the RT-LAB model.

It precedes the common I/O interface because the results of the control are frequency and duty sent to digital outputs (PWM). This is the part of the model in which users can implement their control logic to provide frequency and duty to the PWMO block. The reference is received from the console subsystem, which can be considered the set point. If using speed or position control, feedback must be looped back into this model part.

The model feedback section (circled in green) is also located in the master subsystem (SM) of the RT-LAB model.



Note: The final displays and graphical interfaces are found in the console (SC) as per visual requirements but the main routing and logic addition (if needed) will be in the master subsystem.



It is connected to the common I/O interface by retrieving the information provided by analog and digital inputs of the real-time simulator.

For each motor, specific feedback routing is implemented to obtain the right values. For example, the BLDC motor’s encoder can only be connected to the encoder 1 connection of the DriveLab box. Therefore, the routing found in the BLDC feedback subsystem is consequent and returns encoder 1 feedback, regardless of the inverter circuit to which the BLDC is actually connected.


Control and Feedbacks Model Sections

The TestDrive Interface

The interface provided with the DriveLab kit uses TestDrive software, Opal-RT Technologies’ solution for clean and efficient interfacing. The TestDrive software is based on NI NI LabView panels, on which signals can be assigned to control and display them as needed.

Three editable panels are provided for the DriveLab kit1: one for inverter circuit 1, inverter circuit 2 and Virtual Scope. Each panel already has the appropriate signal assignments.



1 Note: Opal-RT packages the model with the NI LabView runtime engines necessary to run the Opal-RT TestDrive interface. Users need not have NI's LabView installed.



TestDrive Workbench for DriveLab

The main screen controls interaction with the model.


TestDrive, DriveLab main screen


The left side of the screen controls what will be displayed:

DK_Inv1displays the Inverter 1 page, with Motor Selection menu.
DK_Inv2displays the Inverter 2 page, with Motor Selection menu.
VirtualScopdisplays the Virtual Scope page.

The Motor Selection option (center) lets users select the type of motor to connect to the inverter.

Motor options are:

  • No Motor
  • AC Induction
  • DC Motor
  • DC Generator
  • BLDC

Once the motor is selected, the screen automatically switches to the panel specific to that motor.

AC Induction, DC Generator, and BLDC all display the following graphs:

  • Speed (RPM)
  • Angle (Degrees)
  • Current A1
  • Current B1
  • DC Bus Voltage

The DC Motor panel displays three graphs:

  • Current A1
  • Current B1
  • DC Bus Voltage

Two controls are available to the right of the panel at all times:

Clear Fault

Click to clear the fault on both inverters. Once pressed, it automatically reverts to its initial position.

Refer to Fault detection and fault clearance for more details about fault clearance.

Click to come back to motor selectionUse this button to return to the main screen and to select another motor on that particular inverter.

AC Induction page

Virtual Scope Panel

The Virtual Scope panel is included as an add-on for the DriveLab kit. The Virtual Scope samples analog inputs at 2.5 µs and displays the results on graphs. It does not go through the standard acquisition process, to which both the Simulink console (SC subsystem) and the TestDrive interface are subject.

Therefore, more detailed feedback signals can be visualized.

The Virtual Scope displays the five analog signals in the following order:

  • Common 36V DC bus voltage
  • Phase 1A current
  • Phase 1B current
  • Phase 2A current
  • Phase 2B current

Triggering and recording features are available. Please refer to the Virtual Scope’s documentation for more information about how to use it.

Graphical interface Virtual Scope page

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323