3 Using Your Plugin Solver in VI-CarRealTime - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim Toolboxes : MapleSim Connector for VI-CarRealTime : Getting Started Guide : MapleSimCRTConnectorGSG/Chapter03

Contents     Previous     Next     Index

3 Using Your Plugin Solver in VI-CarRealTime

This chapter describes how to import your powertrain model into VI-CarRealTime. You will be using the Full Powertrain plugin solver that you generated in Generating the Plugin Solver Code for the Full Powertrain Model and the complete vehicle model example that comes with VI-CarRealTime.

Note: For a complete description of VI-CarRealTime, see the VI-Grade VI-CarRealTime Help.

3.1 Preparing a MapleSim Model to Run as a New VI-CarRealTime Project

The preparation procedure consists of the following steps:

1. 

Loading the complete vehicle model example into VI-CarRealTime

2. 

Disabling the example model's powertrain

3. 

Enabling your powertrain plugin solver

4. 

Configuring the road environment

5. 

Running the simulation

3.2 Loading the complete vehicle model example into VI-CarRealTime

The first step in using your powertrain model is to load a vehicle model into VI-CarRealTime. You will be using the complete vehicle model example that comes with VI-CarRealTime.

To load the complete vehicle model example

1. 

Start VI-CarRealTime.

2. 

If you are not already in Build mode, click the Build icon ( ) to enter Build mode.

3. 

From the Build menu, select Load Model....

4. 

In the Select File window, select the mdids://carrealtime_shared/ database from the   Registered Databases section.

5. 

Select the VI_CRT_Demo_compl.xml model from the list of files.

6. 

Click Open.

The complete vehicle demo model is now loaded into VI-CarRealTime. This example comes with its own powertrain (that is, engine, clutch, and gearbox systems). Before you can use your powertrain, you have to disable the built-in systems.

3.3 Disabling the example model's powertrain

To disable the example model's powertrain

1. 

From the treeview, select VI_CRT_Demo_compl.

2. 

Under the Properties tab, select system_parameters.
The system_parameters page contains information about your model vehicle setup, components, and general system settings. This is where you will turn off the built-in engine, clutch, and gearbox solvers.

3. 

Find the names of the following parameters, and set their values to 0 (zero):

Parameter Name

Value

built_in_clutch_active

0

built_in_engine_active

0

built_in_gearbox_active

0

Your system_parameters page should look like the following figure.

The built-in powertrain is disabled. You are now ready to configure VI-CarRealTime to use the custom powertrain solver that you developed.

3.4 Enabling your powertrain plugin solver

To enable your custom powertrain solver in VI-CarRealTime

1. 

 Under the Properties tab, select plugin.

2. 

 Set the value of the active parameter to 1.

3. 

Click the Value field for the library parameter, and enter the location of the plugin solver library (that is, the dll file) that you generated from your powertrain model.

The custom solver library is found in the directory that the VI-CarRealTime Plugin Solver Generation template stored the generated C code files. For example, if you entered C:\MS_CRT_models for the Target directory and FullPowertrain1 for the Model Name in the template, then your C code files are in C:\MS_CRT_models\FullPowertrain1 directory, and your custom library is the file named FullPowertrain1.dll in that directory. In this case you would enter C:\MS_CRT_models\FullPowertrain1\FullPowertrain1.dll in the library field. The following figure illustrates this.

4. 

Click Apply.

Your powertrain model is now configured as the plugin solver for the vehicle model.

3.5 Configuring the road environment

To configure the road environment for your model

1. 

Click the Test icon ( ) to enter Test Mode.

2. 

From the Events treeview, open Events, and then open ADAMSCar. From here, select DrivingMachine.

3. 

From the fingerprint treeview, open fingerprint_1, and then select VI_CRT_Demo_compl_dm.

4. 

Click the open file icon ( ) next to the Driving Machine File input field.

5. 

In the Select File window, select the chicane_R100_25.xml file, and then click Open.

Note: If the chicane_R100_25.xml file is not available, select the mdids://carrealtime_shared/ database from the   Registered Databases section. This also applies for the Road Data File and the Road Graphics File.

6. 

Click the open file icon ( ) next to the Road Data File input field.

7. 

In the Select File window, select the chicane_R100.rdf file, and then click Open.

8. 

Click the open file icon ( ) next to the Road Graphics File input field.

9. 

In the Select File window, select the chicane_R100.obj file, and then click Open.

10. 

In the Solver Settings section, enter the following values:

• 

Integration Time Step: 0.001

• 

Output Time Step: 0.01

• 

Integrator: Euler

• 

Mode of Simulation: live animation

The following figure illustrates how your simulation should be configured.

3.6 Running the simulation

To run the simulation using your custom powertrain

Click the Run icon ( ) in the VI-CarRealTime menu bar. Alternatively, from Test, select Run Selected Events.

The VI.PTW (VI-CarRealTime Python Task Window) opens, followed by the VI-Animator window (see the following figure). Your simulation starts automatically.

 

 

Note: If the simulation does not behave as expected (for example, it does not look as though the simulation is using your custom powertrain), the messages in the VI.PTW (VI-CarRealTime Python Task Window) may indicate why the simulation failed. For example, if you did not set the simulation to use your plugin solver properly, you would see a warning message stating that there were problems initializing the user library (see the following figure).

 

 

 

 

Contents     Previous     Next     Index


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam