Modular Vehicles Tutorial 1: Creating a Vehicle Topology

Modular Vehicles Tutorial 1: Creating a Vehicle Topology

This tutorial includes video content: 

 

In this first module, we will setup the file structure as well as the topology of the drivetrain of an 8x8 land vehicle.

The goal is to fully create a modular vehicle without using templates. This will give you a better understanding of the structure of modular vehicles, allowing you to create complex powertrain systems.

Prerequisites

You need to have Vortex Studio and the Vortex Studio Samples and Demo Scenes installed to be able to follow all steps in this tutorial : https://asset-store.prod.vortex-cloud.net/

Creating the vehicle file structure

  1. In your working directory, create a folder named AWD_8x8

  2. Copy the Components folder (C:\CM Labs\Vortex Studio Content <version>\Samples\Vehicle Systems) to this new folder.

  3. Create a Resources folder. We'll use this folder later in the tutorial.

  4. In Vortex Studio, Create an Assembly. Save it in the AWD_8x8 folder and name it AWD_8x8.vxassembly.

Creating the vehicle topology

  1. Open AWD_8x8.vxassembly, created in the previous section.

  2. From the Basics section of the Toolbox, insert Assemblies From Files

  3. Select Chassis.vxassembly from ...\Components\Chassis

  4. Repeat this process to add all the parts of the vehicle's powertrain:

    1. Engine (Advanced)

    2. Torque Converter (Advanced)

    3. Automatic Transmission

    4. Differentials (7)

    5. Wheels (8)

  5. Rename each wheels to identify their positions on the LAV ("FL" for Front Left, "FML" for Front Middle Left, etc.).



  6. From the Basics section of the Toolbox, insert a Connection Container. Rename it "Chassis Connections"

  7. Insert the Chassis Part Output from the Chassis Attachments VHL in the Chassis Assembly.

  8. For each other component, find their Attachments VHL and insert the Chassis Part Input, connecting it to the Chassis Part Output of the Chassis assembly



  9. From the Basics section of the Toolbox, insert a Connection Container. Rename it "Vehicle Topology"

  10. Insert all Shaft Part Inputs and Parameters from the Engine, Torque Converter, Transmission, Differentials and Wheels Attachments VHL.

  11. Connect Inputs and Parameters following to the topology below:



  12. Insert Shaft RPM and Shaft Speed from the Engine Interface and Torque Converter Coupling Interface.

  13. Insert Input Shaft Speed from the Transmission Interface and Torque Converter Coupling Interface.

  14. Make these connections:

Creating a Wheel Positioner

  1. From the Simulation section of the Toolbox, insert a Dynamics Script.

  2. Close the resulting window and rename it "Wheel Positioner"

  3. In the Code field of the extension, copy the following Python Code.

    Wheel Positioner Code

    from Vortex import * def on_simulation_start(self): create_input(self, 'Enable', Types.Type_Bool).setDescription("True to update positions") create_parameter(self, 'Wheel Position Front', Types.Type_VxReal).setDescription("Position of front axle") create_parameter(self, 'Wheel Position Front Middle', Types.Type_VxReal).setDescription("Position of front middle axle") create_parameter(self, 'Wheel Position Rear Middle', Types.Type_VxReal).setDescription("Position of rear middle axle") create_parameter(self, 'Wheel Position Rear', Types.Type_VxReal).setDescription("Position of rear axle") create_parameter(self, 'Wheel Spacing', Types.Type_VxReal).setDescription("Distance between left and right wheels") create_parameter(self, 'Wheel Height', Types.Type_VxReal).setDescription("Vertical position of wheels") create_output(self, 'Wheel FL Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel FR Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel FML Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel FMR Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel RML Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel RMR Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel RL Transform', Types.Type_VxMatrix44) create_output(self, 'Wheel RR Transform', Types.Type_VxMatrix44) def paused_update(self): config_update(self) def config_update(self): # Skip update if disabled if not self.inputs.Enable.value: return # Place wheels pos = VxVector3(self.parameters.Wheel_Position_Front.value, self.parameters.Wheel_Spacing.value/2.0, self.parameters.Wheel_Height.value) #Front self.outputs.Wheel_FL_Transform.value = createTranslation(pos) pos.y = -pos.y self.outputs.Wheel_FR_Transform.value = createTranslation(pos) #Front Middle pos.x = self.parameters.Wheel_Position_Front_Middle.value self.outputs.Wheel_FMR_Transform.value = createTranslation(pos) pos.y = -pos.y self.outputs.Wheel_FML_Transform.value = createTranslation(pos) #Rear Middle pos.x = self.parameters.Wheel_Position_Rear_Middle.value self.outputs.Wheel_RML_Transform.value = createTranslation(pos) pos.y = -pos.y self.outputs.Wheel_RMR_Transform.value = createTranslation(pos) #Rear pos.x = self.parameters.Wheel_Position_Rear.value self.outputs.Wheel_RR_Transform.value = createTranslation(pos) pos.y = -pos.y self.outputs.Wheel_RL_Transform.value = createTranslation(pos) def create_output(extension, name, o_type, default_value=None): """Create output field with optional default value, reset on every simulation run.""" if extension.getOutput(name) is None: extension.addOutput(name, o_type) if default_value is not None: extension.getOutput(name).value = default_value return extension.getOutput(name) def create_parameter(extension, name, p_type, default_value=None): """Create parameter field with optional default value set only when the field is created.""" if extension.getParameter(name) is None: field = extension.addParameter(name, p_type) if default_value is not None: field.value = default_value return extension.getParameter(name) def create_input(extension, name, i_type, default_value=None): """Create input field with optional default value set only when the field is created.""" if extension.getInput(name) is None: field = extension.addInput(name, i_type) if default_value is not None: field.value = default_value return extension.getInput(name)
  4. From the Basics section of the Toolbox, insert a Connection Container. Rename it "Wheel Positioner Connections"

  5. Connect the Wheel Transform Outputs from the script to the Local Transform of each wheel assembly.

  6. From the Basics section of the Toolbox, insert a Folder. Rename it "Components". Insert all of the other extensions into this folder.

  7. From the Simulation section of the Toolbox, insert a VHL Interface. Rename it "Component Configuration".

  8. Drag and drop the Parameters of the Wheel Positioner script into its Parameters section.

  9. Add the Body Attachment Point Parameter from the Chassis Attachments VHL in the Chassis.

Adding Wheel and Suspension Tuning Interface

  1. From the Simulation section of the Toolbox, insert a VHL Interface. Rename it "Wheel and Suspension Tuning"

  2. Add and group all of the following Inputs from the Wheel Interface VHL from each wheel in the Wheel and Suspension Tuning interface.

    • Radius

    • Width

    • Mass

    • Suspension Stiffness

    • Suspension Damping

    • Type Type

    • Tire Stiffness

Adding Engine Tuning Interface

  1. From the Simulation section of the Toolbox, insert a VHL Interface. Rename it "Engine Tuning".

  2. From the Engine Interface VHL, insert the following Inputs and Parameters in the Parameters section of this new VHL.

    • Torque Scale

    • Braking Torque Scale

    • Shaft Mass

    • Shaft Inertia

    • Torque Table

    • Braking Torque Table

Adding Torque Converter Tuning Interface

  1. From the Simulation section of the Toolbox, insert a VHL Interface. Rename it "Torque Converter Tuning".

  2. From the Coupling Interface VHL, insert the following Inputs and Parameters in the Parameters section of this new VHL.

    • Stall RPM

    • Stall Torque

    • All Parameters.