Main Content

Add Virtual Vehicle Custom Component

In Virtual Vehicle Composer, a component is any vehicle system, subsystem, or part that is specified in the Data and Calibration pane. Engines, electric motors, brakes, and tires are all components. If the default options for a certain component do not cover your needs, you can create or import one.

If you set Model template to Simulink, you can use a Custom component catalog to designate a list of custom components that you frequently use, such as a 600 N-m electric motor. You can create or import a component and add it to the catalog for future use. The catalog is an XML file that can point to saved components in different storage locations. All vehicle configurations within your project with Model template set to Simulink can access the custom component catalog.

You select the Custom component catalog file on the Setup pane.

Custom component catalog on Setup pane

You can add a component to the Custom component catalog in two ways:

  • Modify an existing Virtual Vehicle Composer component and save it as a new component.

  • Import your own Simulink® component model and its data from another source. It must be compatible with the model template.

Save a Modified Virtual Vehicle Composer Component

If you set Model template to Simulink, you can save a modified Simulink component. For example, assume you are configuring an Electric Vehicle 1EM battery-electric vehicle with a single motor having 600 N-m maximum torque, and you want to use the Simple Motor model. The default Simple Motor option is Electric Vehicle 1EM - Simple Motor, which has 450 N-m. You can resize it to 600 N-m in Virtual Vehicle Composer and save it as a custom component.

On the Data and Calibration pane under Component Selection, select Electric Machine 1, and then Electric Vehicle 1EM - Simple Motor. Click on Motor Resize.

The motor has 450 N-m maximum torque and 211 kW maximum power. To increase the torque to 600 N-m but keep the speed capability the same, increase the desired torque and power by the same proportion. Type in 600 for Desired Torque[Nm] and 281000 for Desired Power[W]. Then click Resize Motor.

Electric motor resize menu choices

After resizing the motor, click on Parameters. The Save as New Component button is active.

Saving new custom component

On the next pane, type in the File name for your component. Click Save to save the data in a .m file.

Naming custom component and storage location

This motor is now a custom component. The motor is in the list under the default selection for Electric Machine 1.

New component in drop-down list

Import a User-Defined Simulink Component Model

If you set Model template to Simulink, and you have a Simulink component model and its data from another source, you can import it to the Custom component catalog. It must be compatible with the Model template you select.

Suppose you have saved an electric motor with 525 N-m of torque and 241 kW power, named E_Machine_525_Nm_241_kW, and wish to retrieve it from the Custom component catalog. To import the component as a certain type, such as an Electric Machine 1, navigate to its section of the app. In the Custom Components section of the toolstrip, click Import Component.

Import Component icon on Composer tab

In the Import Component pane, for Custom Data, click Browse.

Browsing for custom component

In the next pane, navigate to your model file and select it. Click Open.

Selecting custom component

When the Import Component pane reappears, the Component Name is the component type appended with the filename of your imported component.

New component name

Click Import. This model is now a custom component that the Custom catalog can reference.

Imported component in component drop-down

See Also

Related Examples

More About