Main Content

Simulation 3D Three-Wheeled Vehicle

Implement three-wheeled vehicle in 3D environment

Since R2023b

  • Simulation 3D Three Wheeled Vehicle

Libraries:
Vehicle Dynamics Blockset / Vehicle Scenarios / Sim3D / Sim3D Vehicle / Components

Description

Note

Simulating models with the Simulation 3D Three-Wheeled Vehicle block requires Simulink® 3D Animation™.

The Simulation 3D Three-Wheeled Vehicle block implements a vehicle with three wheels in the 3D simulation environment.

To use this block, ensure that the Simulation 3D Scene Configuration block is in your model. If you set the Sample time parameter of this block to -1, the block uses the sample time specified in the Simulation 3D Scene Configuration block.

The block input uses the vehicle Z-down right-handed (RH) Cartesian coordinate system defined in SAE J6701. The coordinate system is inertial and initially aligned with the vehicle geometric center:

  • X-axis — Along vehicle longitudinal axis, points forward

  • Y-axis — Along vehicle lateral axis, points to the right

  • Z-axis — Points downward

Tip

Verify that the Simulation 3D Three-Wheeled Vehicle block executes before the Simulation 3D Scene Configuration block. That way, Simulation 3D Three-Wheeled Vehicle prepares the signal data before the Unreal Engine® 3D visualization environment receives it. To check the block execution order, right-click the blocks and select Properties. On the General tab, confirm these Priority settings:

  • Simulation 3D Scene Configuration0

  • Simulation 3D Three-Wheeled Vehicle-1

For more information about execution order, see Control and Display Execution Order.

Ports

Input

expand all

Vehicle and wheel translation, in m. Array dimensions are 5-by-3.

  • Translation(1,1), Translation(1,2), and Translation(1,3) — Vehicle translation along the inertial vehicle Z-down X-, Y-, and Z- axes, respectively.

  • Translation(...,1), Translation(...,2), and Translation(...,3) — Wheel translation relative to vehicle, along the vehicle Z-down X-, Y-, and Z- axes, respectively.

The signal contains translation information according to the axle and wheel locations.

Translation=[XvYvZvXHYHZHXFYFZFXRLYRLZRLXRRYRRZRR]

TranslationArray ElementTranslation Axis

Vehicle, Xv

Translation(1,1)Inertial vehicle Z-down X-axis

Vehicle, Yv

Translation(1,2)Inertial vehicle Z-down Y-axis

Vehicle, Zv

Translation(1,3)Inertial vehicle Z-down Z-axis

Handlebars, XH

Translation(2,1)Inertial vehicle Z-down X-axis

Handlebars, YH

Translation(2,2)Inertial vehicle Z-down Y-axis

Handlebars, ZH

Translation(2,3)Inertial vehicle Z-down Z-axis

Front wheel, XF

Translation(3,1)Vehicle Z-down X-axis

Front wheel, YF

Translation(3,2)Vehicle Z-down Y-axis

Front wheel, ZF

Translation(3,3)Vehicle Z-down Z-axis

Rear left wheel, XRL

Translation(4,1)Vehicle Z-down X-axis

Rear left wheel, YRL

Translation(4,2)Vehicle Z-down Y-axis

Rear left wheel, ZRL

Translation(4,3)Vehicle Z-down Z-axis

Rear right wheel, XRR

Translation(5,1)Vehicle Z-down X-axis

Rear right wheel, YRR

Translation(5,2)Vehicle Z-down Y-axis

Rear right wheel, ZRR

Translation(5,3)Vehicle Z-down Z-axis

Vehicle and wheel rotation, in rad. Array dimensions are 5-by-3.

  • Rotation(1,1), Rotation(1,2), and Rotation(1,3) — Vehicle rotation about the inertial vehicle Z-down X-, Y-, and Z- axes, respectively.

  • Rotation(...,1), Rotation(...,2), and Rotation(...,3) — Wheel rotation relative to vehicle, about the vehicle Z-down X-, Y-, and Z- axes, respectively.

Note

If the yaw value provided for the front wheel differs from the yaw value provided for the handlebars, the yaw value of the handlebars is used for the front wheel. The yaw value of the handlebars and the front wheel is limited to the range of [-30, 30] degrees.

The signal contains rotation information according to the axle and wheel locations.

Rotation=[RollvPitchvYawvRollHPitchHYawHRollFPitchFYawFRollRLPitchRLYawRLRollRRPitchRRYawRR]

RotationArray ElementRotation Axis

Vehicle, Rollv

Rotation(1,1)Inertial vehicle Z-down X-axis

Vehicle, Pitchv

Rotation(1,2)Inertial vehicle Z-down Y-axis

Vehicle, Yawv

Rotation(1,3)Inertial vehicle Z-down Z-axis

Handlebars, RollH

Rotation(2,1)Inertial vehicle Z-down X-axis

Handlebars, PitchH

Rotation(2,2)Inertial vehicle Z-down Y-axis

Handlebars, YawH

Rotation(2,3)Inertial vehicle Z-down Z-axis

Front wheel, RollF

Rotation(3,1)Vehicle Z-down X-axis

Front wheel, PitchF

Rotation(3,2)Vehicle Z-down Y-axis

Front wheel, YawF

Rotation(3,3)Vehicle Z-down Z-axis

Rear left wheel, RollRL

Rotation(4,1)Vehicle Z-down X-axis

Rear left wheel, PitchRL

Rotation(4,2)Vehicle Z-down Y-axis

Rear left wheel, YawRL

Rotation(4,3)Vehicle Z-down Z-axis

Rear right wheel, RollRR

Rotation(5,1)Vehicle Z-down X-axis

Rear right wheel, PitchRR

Rotation(5,2)Vehicle Z-down Y-axis

Rear right wheel, YawRR

Rotation(5,3)Vehicle Z-down Z-axis

Light controls input signal, specified as a 1-by-6 Boolean vector. Each element of the vector turns a specific vehicle light on or off, as indicated in this table. A value of 1 turns the light on; a value of 0 turns the light off.

Vector ElementVehicle Light

(1,1)

Headlight high beam

(1,2)

Headlight low beam

(1,3)

Brake

(1,4)

Reverse

(1,5)

Left signal

(1,6)

Right signal

Dependencies

To create this port, on the Light Controls tab, select Enable light controls.

Data Types: Boolean

Parameters

expand all

Vehicle Parameters

Type of vehicle. By default, Type is set to Tuk tuk. For vehicle dimensions, see Tuk tuk.

Name of vehicle. By default, when you use the block in your model, the block sets the Name parameter to SimulinkVehicleX. The value of X depends on the number of Simulation 3D Vehicle with Ground Following and Simulation 3D Vehicle blocks that you have in your model.

Sample time, Ts. The graphics frame rate is the inverse of the sample time.

Initial Values

Initial vehicle and wheel translation, in m. Array dimensions are 5-by-3.

  • Translation(1,1), Translation(1,2), and Translation(1,3) — Initial vehicle translation along the inertial vehicle Z-down coordinate system X-, Y-, and Z- axes, respectively.

  • Translation(...,1), Translation(...,2), and Translation(...,3) — Initial wheel translation relative to vehicle, along the vehicle Z-down X-, Y-, and Z- axes, respectively.

The parameter contains translation information according to the axle and wheel locations.

Translation=[XvYvZvXHYHZHXFYFZFXRLYRLZRLXRRYRRZRR]

TranslationArray ElementTranslation Axis

Vehicle, Xv

Translation(1,1)Inertial vehicle Z-down X-axis

Vehicle, Yv

Translation(1,2)Inertial vehicle Z-down Y-axis

Vehicle, Zv

Translation(1,3)Inertial vehicle Z-down Z-axis

Handlebars, XH

Translation(2,1)Vehicle Z-down X-axis

Handlebars, YH

Translation(2,2)Vehicle Z-down Y-axis

Handlebars, ZH

Translation(2,3)Vehicle Z-down Z-axis

Front wheel, XF

Translation(3,1)Vehicle Z-down X-axis

Front wheel, YF

Translation(3,2)Vehicle Z-down Y-axis

Front wheel, ZF

Translation(3,3)Vehicle Z-down Z-axis

Rear left wheel, XRL

Translation(4,1)Vehicle Z-down X-axis

Rear left wheel, YRL

Translation(4,2)Vehicle Z-down Y-axis

Rear left wheel, ZRL

Translation(4,3)Vehicle Z-down Z-axis

Rear right wheel, XRR

Translation(5,1)Vehicle Z-down X-axis

Rear right wheel, YRR

Translation(5,2)Vehicle Z-down Y-axis

Rear right wheel, ZRR

Translation(5,3)Vehicle Z-down Z-axis

Initial vehicle and wheel rotation, about the vehicle Z-down X-, Y-, and Z- axes.

Array dimensions are 5-by-3.

  • Rotation(1,1), Rotation(1,2), and Rotation(1,3) — Initial vehicle rotation about the inertial vehicle Z-down coordinate system X-, Y-, and Z- axes, respectively.

  • Rotation(...,1), Rotation(...,2), and Rotation(...,3) — Initial wheel rotation relative to vehicle, about the vehicle Z-down X-, Y-, and Z- axes, respectively.

The parameter contains rotation information according to the axle and wheel locations.

Rotation=[RollvPitchvYawvRollHPitchHYawHRollFPitchFYawFRollRLPitchRLYawRLRollRRPitchRRYawRR]

RotationArray ElementRotation Axis

Vehicle, Rollv

Rotation(1,1)Inertial vehicle Z-down X-axis

Vehicle, Pitchv

Rotation(1,2)Inertial vehicle Z-down Y-axis

Vehicle, Yawv

Rotation(1,3)Inertial vehicle Z-down Z-axis

Handlebars, RollH

Rotation(2,1)Vehicle Z-down X-axis

Handlebars, PitchH

Rotation(2,2)Vehicle Z-down Y-axis

Handlebars, YawH

Rotation(2,3)Vehicle Z-down Z-axis

Front wheel, RollF

Rotation(3,1)Vehicle Z-down X-axis

Front wheel, PitchF

Rotation(3,2)Vehicle Z-down Y-axis

Front wheel, YawF

Rotation(3,3)Vehicle Z-down Z-axis

Rear left wheel, RollRL

Rotation(4,1)Vehicle Z-down X-axis

Rear left wheel, PitchRL

Rotation(4,2)Vehicle Z-down Y-axis

Rear left wheel, YawRL

Rotation(4,3)Vehicle Z-down Z-axis

Rear right wheel, RollRR

Rotation(5,1)Vehicle Z-down X-axis

Rear right wheel, PitchRR

Rotation(5,2)Vehicle Z-down Y-axis

Rear right wheel, YawRR

Rotation(5,3)Vehicle Z-down Z-axis

Light Controls

Select whether to control the vehicle headlights. Use the enabled parameters to set the light parameters, including headlight intensity.

Dependencies

Selecting this parameter:

  • Creates the input port Light controls.

  • Enables these light parameters.

    LightsLight Parameters
    Headlights

    • Headlight color

    • High beam intensity

    • Low beam intensity

    • High beam cone half angle

    • Low beam cone half angle

    • Left headlight beam orientation

    • Right headlight beam orientation

    Brake lights

    Brake light intensity

    Reverse lights

    Reverse light intensity

    Turn signal lights

    • Turn signal light intensity

    • Period

    • Pulse width

Headlights

Headlight color, specified as a normalized 1-by-3 vector of RGB triplet values.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: int8 | uint8

High beam intensity, in cd.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Low beam intensity, in cd.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

High beam cone half angle, in rad.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Low beam cone half angle, in rad.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Pitch and yaw orientation of the left headlight beam orientation in the Z-down coordinate system, specified as a 1-by-2 vector, in rad. The first element of the vector, [1,1], is the pitch angle. The second element of the vector, [1,2], is the yaw angle.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Pitch and yaw orientation of the right headlight beam orientation in the Z-down coordinate system, specified as a 1-by-2 vector, in rad. The first element of the vector, [1,1], is the pitch angle. The second element of the vector, [1,2], is the yaw angle.

Dependencies

To enable this parameter, select Enable light controls.

Brake Lights

Brake light intensity, in cd/m^2.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Reverse Lights

Reverse light intensity, in cd/m^2.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Turn Signal Lights

Turn signal light intensity, in cd/m^2.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Turn signal light period, in s.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

Turn signal light pulse width, specified as a percent of the period.

Dependencies

To enable this parameter, select Enable light controls.

Data Types: double

More About

expand all

Version History

Introduced in R2023b

expand all