Download presentation
Presentation is loading. Please wait.
1
Chrono::Vehicle Tutorial
2
Agenda Chrono::Vehicle overview Simulation loop JSON format
What is Chrono::Vehicle? Overall architecture and design philosophy Code structure and organization Simulation loop Co-simulation framework Data flow and communication Skeleton of a driver program JSON format What is JSON? Syntax, C++ library support in Chrono::Vehicle (rapidJSON)
3
Agenda Vehicle system Other simulation systems
Vehicle subsystems, inter-communication Description of the base class (members, accessors, virtual functions) JSON specification file for a Vehicle system Other simulation systems Tire, terrain, driver, powertrain Suspension test rig system Vehicle subsystem templates Suspension, steering, wheel, brake, driveline Description of base classes (members, accessors, virtual functions) Description of templates, parameters, JSON specification files Visualization Run-time Irrlicht animation Post-processing with PovRay
4
Agenda Hands-on demo – Using templates
Exercise 1: implement a concrete class of a double wishbone suspension Modify the Generic_Vehicle class to optionally use the new suspension type Exercise 2: Create JSON specification files for a subsystem (Rack-pinion steering mechanism) and a vehicle Hands-on demo – Creating templates Option 1: add a new vehicle subsystem Simple anti-roll bar Design and implement base class for anti-roll bar Define interface to other vehicle subsystems Implement a template for a simple 2-body anti-roll bar using a rotational spring-damper Option 2: add a new suspension template MacPherson strut Design and implement template ChMcPherson Implement generic concrete class using data from a JSON specification file
5
Chrono::Vehicle Availability, documentation, configuration
Code design, structure, and organization
6
Chrono::Vehicle Chrono::Vehicle is a C++ middleware library for the modeling, simulation, and visualization of wheeled ground vehicles Chrono::Vehicle is a Chrono vertical app, consisting of two libraries: Chrono_Subsys Defines the system and subsystem base classes Provides concrete, derived classes for instantiating templates from JSON specification files Chrono_Utils Provides miscellaneous utility classes and free functions for file I/O, creating contact and visualization geometry, validation against reference data files, etc. Dependencies: Chrono Engine library (required) Chrono UNIT_Irrlicht and the Irrlicht library (optional)
7
Code availability Chrono::Vehicle is distributed open source, under a BSD-3 license Available from GitHub: Issues and bug-tracking on the GitHub project page Doxygen documentation:
8
Chrono::Vehicle configuration
CMake-based build system
9
Code design – systems and subsystems
Systems are the functional blocks that participate in a co-simulation framework: are isolated and separated respect a well-defined communication data flow can advance their state (dynamics) independently and asynchronously Examples: powertrain, Tire, Terrain, Driver, Vehicle (Vehicle) Subsystems are functional elements in a vehicle model have a particular functional role (the subsystem ‘type’) a subsystem type can have many different implementations Examples: suspension, steering, driveline, brake, wheel
10
Code design - templates
Template-based modeling (not in the C++ sense) In Chrono::Vehicle, templates are parameterized models that define a particular implementation of a subsystem type: Define the basic Chrono modeling elements (bodies, joints, force elements, etc.) Impose the subsystem topology (connectivity) Define the template parameters Implement common functionality for the type of subsystem (e.g. ‘suspension’), particularized to the specific template (e.g. ‘double-wishbone’)
11
Code design – class hierarchy
Chrono::Vehicle encapsulates templates for systems and subsystems in polymorphic C++ classes: A base abstract class for the system/subsystem type (e.g. ChSuspension) A derived, still abstract class for the system/subsystem template (e.g. ChDoubleWishbone) Concrete class that particularize a given system/subsystem template (e.g. HMMWV_DoubleWishboneFront) Concrete classes: User-defined – a derived class that satisfies all virtual functions imposed by the inherited template class not part of the Chrono::Vehicle library several example concrete classes and demo programs are provided Generic – a derived class that satisfies all required virtual functions using parameter data from a specification file part of the Chrono::Vehicle library specification files use the JSON format
12
SYSTEM AND SUBSYSTEM TEMPLATES
BASE CLASSES SYSTEM AND SUBSYSTEM TEMPLATES ChDataDriver ChIrrGuiDriver data file ChDriver RigidTerrain FlatTerrain ChTerrain ChSimplePowertrain ChShaftsPowertrain SimplePowertrain JSON file ChPowertrain ChRigidTire ChLugreTire ChPacejkaTire RigidTire LugreTire JSON file ChTire data file ChSuspensionTest SuspensionTest JSON file ChVehicle Vehicle JSON file ChDoubleWishbone ChDoubleWishboneReduced ChSolidAxle ChMultiLink DoubleWishbone DoubleWishboneReduced SolidAxle MultiLink JSON file ChSuspension ChSteering ChPitmanArm ChRackPinion PitmanArm RackPinion JSON file JSON file ChDriveline ChShaftsDriveline2WD ChShaftsDriveline4WD ShaftsDriveline2WD ShaftsDriveline4WD JSON file ChBrake JSON file ChBrakeSimple BrakeSimple JSON file ChWheel Wheel JSON file
13
Code organization FOLDER CONTENT cmake CMake configuration files data
JSON specification files, visualization meshes, validation reference files doxygen Doxygen configuration files models Concrete system and subsystem class definitions, driver programs rapidjson Clone of rapidjson – a JSON parser and generator library subsys Base system and subsystem class definitions (main Chrono::Vehicle library implementation) tests Driver programs for Chrono component validation tests; Pacejka tire test programs utils Utility class and function definitions (Chrono::Vehicle support library)
14
Code organization – subsys
FOLDER CONTENT Abstract base class definitions for systems and subsystems (ChVehicle, ChSuspension, ChTire, etc.) brake Class definitions for brake subsystem templates; concrete JSON-based implementations driveline Class definitions for driveline subsystem templates; concrete JSON-based implementations driver Driver system class definitions (ChDataDriver – file-based driver inputs; ChIrrGuiDriver – interactive driver inputs) powertrain Class definitions for powertrain subsystem templates; concrete JSON-based implementations steering Class definitions for steering subsystem templates; concrete JSON-based implementations suspension Class definitions for suspension subsystem templates; concrete JSON-based implementations suspensionTest Concrete implementation of a JSON-based suspension test rig terrain Terrain system class definitions (RigidTerrain, FlatTerrain) tire Class definitions for tire system templates; concrete JSON-based implementations vehicle Concrete implementation of a JSON-based vehicle system template wheel Concrete implementation of a JSON-based wheel subsystem template
15
Code organization – models
FOLDER CONTENT ModelDefs.h miscellaneous enums for model definition and creation renderZ.pov a generic PovRay script for frame rendering articulated Concrete implementations of system and subsystem classes for an articulated vehicle model generic Concrete implementations of system and subsystem classes for a generic vehicle hmmwv Concrete implementations of system and subsystem classes for a HMMWV demo_Articulated Driver program for simulating an articulated vehicle demo_GenericVehicle Driver program for simulating a generic vehicle demo_HMMWV Driver program for simulating a HMMWV vehicle (full double-wishbone suspension) demo_HMMWV9 Driver program for simulating a HMMWV vehicle (reduced double-wishbone suspension) demo_SuspensionTest Driver program for simulating a suspension test rig defined through a JSON specification file demo_Vehicle Driver program for simulating a vehicle completely defined through JSON specification files
16
Simulation Inter-system communication Skeleton of the simulation loop
17
Data flow VEHICLE DRIVER POWERTRAIN TIRES TERRAIN Height Normal
Forces and moments on wheel bodies Wheel states Driveshaft speed torque Throttle input Steering input Braking input
18
CREATE-GV data flow CHRONO (VEHICLE) PACE DRIVER GCE FORD/SWIM
COLLISION Steering wheel position Torque at shaft Tire forces on body Tire moment on body External forces on body External moment on body Body position Body orientation Body accelerations Vehicle velocity Wheel orientations Shaft angular speed Wheel positions Wheel linear velocities Wheel angular velocities Vehicle position Vehicle orientation SCENE MGR RESULTS Seat accelerations (POI) GVI Aerodynamic drag force Air density Steering ratio
19
Create and initialize systems
Simulation loop Create and initialize systems 1. Get system outputs 2. Update systems 3. Advance systems 𝑇= 𝑇 0 𝑇=𝑇+∆𝑇 Framework: co-simulation with explicit coupling Systems advance between communication points asynchronously and at independent rates Between two successive communication points, each system extrapolates data from other systems
20
1. Get system outputs Outputs from each system are obtained from accessor methods (virtual functions declared by the corresponding base class) // Collect output data from modules (for inter-module communication) throttle_input = driver.GetThrottle(); steering_input = driver.GetSteering(); braking_input = driver.GetBraking(); powertrain_torque = powertrain.GetOutputTorque(); driveshaft_speed = vehicle.GetDriveshaftSpeed(); for (int i = 0; i < num_wheels; i++) { tire_forces[i] = tires[i]->GetTireForce(); wheel_states[i] = vehicle.GetWheelState(i); }
21
2. Update systems Each system base class declares a virtual function Update() with a signature appropriate for the particular type of system // Update modules (process inputs from other modules) time = vehicle.GetChTime(); driver.Update(time); powertrain.Update(time, throttle_input, driveshaft_speed); vehicle.Update(time, steering_input, braking_input, powertrain_torque, tire_forces); terrain.Update(time); for (int i = 0; i < num_wheels; i++) tires[i]->Update(time, wheel_states[i]);
22
3. Advance systems Each system base class declares a virtual function Advance() with a single parameter, the time interval between two communication points (∆𝑇) A particular system may take as many intermediate steps (constant or variable step- size) as needed to advance the state of the system by ∆𝑇. If the system has no internal dynamics, this function can be a no-op. // Advance simulation for one timestep for all modules double step = realtime_timer.SuggestSimulationStep(step_size); driver.Advance(step); powertrain.Advance(step); vehicle.Advance(step); terrain.Advance(step); for (int i = 0; i < num_wheels; i++) tires[i]->Advance(step);
23
JavaScript Object Notation
24
What is JSON? JavaScript Object Notation
JSON is syntax for storing and exchanging text information. Much like XML. JSON is smaller than XML, faster and easier to parse. JSON: JSON is a lightweight text-data interchange format JSON is language-independent (the “JavaScript” in its name is misleading) JSON is "self-describing" and easy to understand (that’s why it doesn’t even provide for comments!) Defined in RFC 4627 has more information
25
Data types and syntax JSON’s basic types are:
Number: usually double precision floating-point String: double-quoted Boolean: true or false Array: ordered sequence of values, comma-separated, enclosed in square brackets ‘[‘ and ‘]’ Object: unordered collection of key:value pairs, comma-separated, enclosed in curly braces ‘{‘ and ‘}’ null: empty Structural characters: [ ] { } : , White spaces have no semantics around the structural characters
26
Very simple grammar
27
Example key : value pair string number object Keys array Values
{ "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": 10021 }, "phoneNumbers": [ "type": "home", "number": " “, “extension": 307 "type": "fax", "number": " " } ] Keys Values Structural characters
28
RapidJSON Copyright (c) 2011-2014 Milo Yip (miloyip@gmail.com)
RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml Available on GitHub: Documentation: RapidJSON is a header-only C++ library. The main RapidJSON headers are bundled in the chrono-T project
29
Vehicle system
30
Data flow DRIVER POWERTRAIN TERRAIN VEHICLE TIRES Throttle input
Driveshaft torque Driveshaft speed VEHICLE TIRES Steering input Braking input Wheel states Forces and moments on wheel bodies
31
VEHICLE SYSTEM I/O Front suspension subsystem Chassis speed Body state
1D shaft element 3D rigid body shaft – body connector vehicle subsystem Chassis Steering subsystem Body state Driveshaft torque Front suspension subsystem Rear suspension Tire forces Wheel state Steering Body forces Driveline speed Brake torque
32
VEHICLE SYSTEM CONNECTIONS Tire Tire Brake Brake Driver Powertrain
vehicle subsystem other system Front suspension subsystem Chassis Driveline subsystem Steering subsystem Driver Powertrain Environment Rear suspension subsystem Brake Brake Tire Tire
33
VEHICLE TEMPLATE PARAMETERS Front suspension subsystem Chassis
Suspension instance chassis mass and inertia tensor concrete subsystem instance Front suspension subsystem Location / orientation Chassis Driveline subsystem Steering instance Steering subsystem Driveline instance Rear suspension subsystem Suspension instance
34
Vehicle ISO reference frames
Y X Z FRONT REAR RIGHT LEFT (XYZ) – chassis reference frame (XYZ) – suspension reference frame (XYZ) – steering reference frame
35
ChVehicle base class A ChVehicle is a Chrono ChSystem:
A ChVehicle has: /// /// Base class for chrono vehicle systems. /// This class provides the interface between the vehicle system and other /// systems (tires, driver, etc.) class CH_SUBSYS_API ChVehicle : public ChSystem ChSharedPtr<ChBodyAuxRef> m_chassis; ///< handle to the chassis body ChSuspensionList m_suspensions; ///< list of handles to suspension subsystems ChSharedPtr<ChDriveline> m_driveline; ///< handle to the driveline subsystem ChSharedPtr<ChSteering> m_steering; ///< handle to the steering subsystem ChWheelList m_wheels; ///< list of handles to wheel subsystems ChBrakeList m_brakes; ///< list of handles to brake subsystems
36
ChVehicle base class accessors
Deferring to its constituent subsystems as needed, a ChVehicle provides accessors for: Vehicle subsystems Chassis state (reference frame and COM) States of the vehicle’s wheel bodies (the suspension spindle bodies) Angular speed of the vehicle driveshaft (connection to powertrain) A ChVehicle intermediates communication between other systems (e.g., tires, driver, etc.) and constituent subsystems (e.g., suspensions, brakes, etc.)
37
ChVehicle base class virtual functions
Initialize the vehicle at a specified position and orientation Update the vehicle at a communication time with data from other systems Advance the state of the vehicle system to the next communication time /// Initialize this vehicle at the specified global location and orientation. virtual void Initialize( const ChCoordsys<>& chassisPos ///< [in] initial global position and orientation ) {} /// Update the state of this vehicle at the current time. /// The vehicle system is provided the current driver inputs (throttle between /// 0 and 1, steering between -1 and +1, braking between 0 and 1), the torque /// from the powertrain, and tire forces (expressed in the global reference /// frame). virtual void Update( double time, ///< [in] current time double steering, ///< [in] current steering input [-1,+1] double braking, ///< [in] current braking input [0,1] double powertrain_torque, ///< [in] input torque from powertrain const ChTireForces& tire_forces ///< [in] vector of tire force structures ) {} /// Advance the state of this vehicle by the specified time step. virtual void Advance(double step);
38
Data exchange structures
ChWheelID class – encodes the ID of a vehicle wheel By convention, wheels are counted front to rear and left to right For a vehicle with 2 axles, the order is: front-left, front-right, rear-left, rear-right A wheel ID encodes an axle number (0,1,2,…) and the vehicle side (0: left, 1: right) 𝑖𝑑=2 ∗𝑎𝑥𝑙𝑒+𝑠𝑖𝑑𝑒 ChWheelID(int id) : m_id(id), m_axle(id / 2), m_side(ChVehicleSide(id % 2)) {} ChWheelID(int axle, ChVehicleSide side) : m_id(2 * axle + side), m_axle(axle), m_side(side) {} /// Return the wheel ID. int id() const { return m_id; } /// Return the axle index for this wheel ID. /// Axles are counted from the front of the vehicle. int axle() const { return m_axle; } /// Return the side for this wheel ID. /// By convention, left is 0 and right is 1. ChVehicleSide side() const { return m_side; }
39
Data exchange structures
ChBodyState structure – encapsulates the full state of a Chrono body Position – as a 3D vector Orientation – as a unitary quaternion Linear velocity (with respect to the global frame) – as a 3D vector Angular velocity (with respect to the global frame) – as a 3D vector /// /// Structure to communicate a full body state. struct ChBodyState { ChVector<> pos; ///< global position ChQuaternion<> rot; ///< orientation with respect to global frame ChVector<> lin_vel; ///< linear velocity, expressed in the global frame ChVector<> ang_vel; ///< angular velocity, expressed in the global frame };
40
Data exchange structures
ChWheelState structure – encapsulates the full state of a wheel body Position, orientation, velocity – same as ChBodyState Additionally contains the wheel angular speed about its rotation axis – as a double scalar A wheel state structure is passed to each tire system during the inter- system communication phase /// /// Structure to communicate a full wheel body state. /// In addition to the quantities communicated for a generic body, the wheel /// state also includes the wheel angular speed about its axis of rotation. struct ChWheelState { ChVector<> pos; ///< global position ChQuaternion<> rot; ///< orientation with respect to global frame ChVector<> lin_vel; ///< linear velocity, expressed in the global frame ChVector<> ang_vel; ///< angular velocity, expressed in the global frame double omega; ///< wheel angular speed about its rotation axis };
41
Data exchange structures
ChTireForce structure – encapsulates the tire forces applied to a wheel body Force vector and application point (expressed in the global reference frame) Moment vector (expressed in the global reference frame) A tire force structure is obtained from each tire system during the inter-system communication phase The tire force and moment are applied to the wheel (spindle) body as external forces /// /// Structure to communicate a set of generalized tire forces. struct ChTireForce { ChVector<> force; ///< force vector, epxressed in the global frame ChVector<> point; ///< global location of the force application point ChVector<> moment; ///< moment vector, expressed in the global frame };
42
JSON specification file for a vehicle
{ "Name": "Test vehicle - 3 axles", "Type": "Vehicle", "Template": "Vehicle", "Chassis": "Mass": , "COM": [ , , ], "Inertia": [125.8, 497.4, 531.4] }, System type (string) Template type (string) Offset of the chassis COM with respect to the chassis reference frame. Chassis moments of inertia with respect to the chassis centroidal frame.
43
JSON specification file for a vehicle
"Axles": [ { "Suspension Input File": "hmmwv/suspension/HMMWV_DoubleWishboneFront.json", "Suspension Location": [1.6914, 0, ], "Left Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontLeft.json", "Right Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontRight.json", "Left Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Front.json", "Right Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Front.json" }, "Suspension Input File": "generic/suspension/SolidAxleRear.json", "Suspension Location": [-0.5, 0, ], "Left Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_RearLeft.json", "Right Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_RearRight.json", "Left Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Rear.json", "Right Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Rear.json" "Suspension Location": [-1.8, 0, ], } ], Offset of the suspension reference frame with respect to the chassis reference frame
44
JSON specification file for a vehicle
"Steering": { "Input File": "hmmwv/steering/HMMWV_PitmanArm.json", "Location": [ , 0, ], "Orientation": [ , 0, , 0], "Suspension Index": 0 }, "Driveline": "Input File": "hmmwv/driveline/HMMWV_Driveline4WD.json", "Suspension Indexes": [0, 2] "Driver Position": "Location": [0, 0.5, 1.2], "Orientation": [1, 0, 0, 0] } Position and orientation of the steering subsystem reference frame with respect to the chassis reference frame. Index of the vehicle axle that is connected to the steering subsystem (here, the first axle in the list). Indexes of the vehicle axles that are connected to the driveline subsystem (here, the first and third in the list). Must be consistent with the driveline type. Position and orientation of driver with respect to the chassis reference frame.
45
JSON specification file for a vehicle
Optional JSON block specifying chassis visualization Name of a Waveform OBJ file "Visualization": { "Mesh Filename": "hmmwv/hmmwv_chassis.obj", "Mesh Name": "hmmwv_chassis_POV_geom" } Name of a PovRay input file (mesh_name.inp) which defines a PovRay object (mesh_name)
46
Tire Models Rigid Tire LuGre Tire Pacejka Tire
47
Data flow DRIVER POWERTRAIN TERRAIN VEHICLE TIRES Height Normal
Wheel states Forces and moments on wheel bodies
48
ChTire base class Defines the common interface for any tire system
All classes defining particular tire templates inherit from ChTire A ChTire is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a tire system. /// A tire subsystem is a force element. It is passed position and velocity /// information of the wheel body and it produces ground reaction forces and /// moments to be applied to the wheel body. class CH_SUBSYS_API ChTire : public ChShared
49
ChTire base class members
A ChTire has: std::string m_name; ///< name of this tire subsystem const ChTerrain& m_terrain; ///< reference to the terrain system
50
ChTire base class virtual methods
Update the tire at a communication time with data from other systems Advance the state of the tire to the next communication point Set the (output) torque to be applied to the associated wheel body /// Update the state of this tire system at the current time. /// The tire system is provided the current state of its associated wheel. virtual void Update( double time, ///< [in] current time const ChWheelState& wheel_state ///< [in] current state of associated wheel body ) {} /// Advance the state of this tire by the specified time step. virtual void Advance(double step) {} /// Get the tire force and moment. /// This represents the output from this tire system that is passed to the /// vehicle system. Typically, the vehicle subsystem will pass the tire force /// to the appropriate suspension subsystem which applies it as an external /// force one the wheel body. virtual ChTireForce GetTireForce() const = 0;
51
Tire Models Rigid Tire
52
ChRigidTire and RigidTire
ChRigidTire is an abstract class (i.e., system template) Define basic functions for pure virtual functions (only GetTireForce) Define virtual functions that are common for all RigidTire models Initialize(ChSharedPtr<ChBody> wheel) virtual and pure virtual functions RigidTire is a concrete class Cylinder collision geometry, constant tire inertia Interacts with terrain using rigid body frictional contact Implements pure virtual functions in ChRigidTire Defines how to read input JSON file class ChRigidTire: public ChTire; class RigidTire: public ChRigidTire;
53
JSON specification file for rigid tire
{ "Name": "HMMWV Rigid Tire", "Type": "Tire", "Template": "RigidTire", "Radius": , "Width": , "Coefficient of Friction": } System type (string) Template type (string)
54
Tire Models LuGre Tire
55
ChLugreTire and LugreTire
ChLugreTire is an abstract class (i.e., system template) virtual functions that are common for all Lugre tire models: LugreTire is a concrete class Defines how to read tire parameters from input JSON file Tangent/Traction forces according to first order ODE Documentation – SBEL Tech Report “Lugre Tire Model for HMMWV”, Aki Mikkola sbel.wisc.edu/Publications virtual int getNumDiscs() = 0; virtual double getRadius() = 0; virtual const double* getDiscLocations() = 0; virtual double getNormalStiffness() = 0; virtual double getNormalDamping() = 0; virtual void SetLugreParams() = 0;
56
JSON specification file for LuGre tire
{ "Name": "HMMWV Lugre Tire", "Type": "Tire", "Template": "LugreTire", "Radius": , "Disc Locations": [-0.127, 0, 0.127], "Normal Stiffness": 2e6, "Normal Damping": 1e3, "Lugre Parameters" : "sigma0": [181.0, 60.0], "sigma1": [ 1.0, 0.2], "sigma2": [ 0.02, ], "Fc": [ 0.6, 0.6], "Fs": [ 1.0, 1.0], "vs": [ 3.5, 3.5] } System type (string) Template type (string) Transversal locations of the constituent discs, relative to the tire’s center plane. This particular tire uses 3 equally spaced discs. Stiffness and (viscous) damping used in calculating the normal tire force LuGre tire parameters. Two values are specified for each parameter, the first for the longitudinal direction, the second for the transversal direction.
57
Tire Models Pacejka Tire
58
ChPacejkaTire ChPacejkaTire is a concrete class
Could benefit from the abstract/concrete organization of previous two models Allow older Pacejka formulations to be tested Pac2002 formulation is ubiquitous in commercial software ChronoT implementation heavily tested and validated against commercial solutions Documentation: SBEL Tech Reports and “Validation of a Steady-State Magic Formula Tire in Chrono with a Comercial Software Implementation”, J. Madsen and A. Dirr. “Validation of a Single Contact Point Tire Model Based on the Transient Pacejka Model in the Open-Source Dynamics Software Chrono”, J. Madsen sbel.wisc.edu/Publications
59
ChPacejkaTire with full vehicle model
demo_HMMWV9 Vehicle Chassis Suspension system x 2 Steering Wheel x 4 Brake x 4 Driveline Tire x 4 <ChPacejkaTire> Simple Powertrain Rigid Terrain (flat) Based on a HMMWV M1037-S250 Interactive (Irrlicht) or scripted simulations Modifications to Pacejka Tire required for full- vehicle dynamics Ground contact and vertical force, 𝐹 𝑧 Besselink Limit ODEs at low velocity Left / Right tire effects (conicity, plysteer)
60
ChPacejkaTire with demo_HMMWV9
(1-4) indicates iterate over command n times Initialization HMMWV9_VehicleReduced vehicle(…) ChSharedPtr<ChPacejkaTire> tire_(1-4)(“name”, “../data/hmmwv/tire/HMMWV_pacejka.tir”); ChWheelState wheel_state(4); ChTireForces tire_force(4); Simulation Loop tire_force[(1-4)] = tire_(1-4).GetTireForce(); wheel_state[(1-4)] = vehicle.GetWheelState((1-4)); tire_(1-4).Update(time, wheel_state[(1-4)] ); vehicle.Update(time, steer_input, brake_input, powertrain_input, tire_force); // >>> Advance: driver, terrain, tire_(1-4), powertrain, vehicle tire_(1-4).WriteOutData(time, “tire_data_(1-4).csv”); Vehicle->Initialize() Tire->Initialize()
61
Terrain Models
62
Data flow DRIVER POWERTRAIN TERRAIN Height Normal VEHICLE TIRES
63
ChTerrain base class Defines the common interface for any terrain system All classes defining particular terrain model inherit from ChTerrain A ChTerrain is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a height-field terrain system. class CH_SUBSYS_API ChTerrain : public ChShared
64
ChTerrain base class virtual methods
Update() and Advance() – common to all subsystems Common to all systems but typically not used for non-deformable terrains Return terrain height and normal direction /// Get the terrain height at the specified (x,y) location. virtual double GetHeight(double x, double y) const = 0; /// Get the terrain normal at the specified (x,y) location. virtual ChVector<> GetNormal(double x, double y) const = 0;
65
Driver Models
66
Data flow DRIVER POWERTRAIN TERRAIN VEHICLE TIRES Throttle input
Steering input Braking input
67
ChDriver base class Defines the common interface for any driver system
Currently, the driver system is open-loop. All classes defining particular driver model inherit from ChDriver A ChDriver is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a vehicle driver system. /// A driver system must be able to report the current values of the inputs /// (throttle, steering, braking). A concrete driver class must set the member /// variables m_throttle, m_steering, and m_braking. class CH_SUBSYS_API ChDriver : public ChShared
68
ChDriver base class members and functions
A ChDriver has: ChDriver provides accessors for driver inputs (steering, throttle, and braking) and functions to record them in a file: double m_throttle; ///< current value of throttle input double m_steering; ///< current value of steering input double m_braking; ///< current value of braking input /// Initialize output file for recording driver inputs. bool LogInit(const std::string& filename); /// Record the current driver inputs to the log file. bool Log(double time);
69
ChDriver base class virtual methods
Update the driver at a communication time with data from other systems. A concrete driver class may override the default no-op implementation (see ChDataDriver) Advance the state of the tire to the next communication point. A concrete driver class may override the default no-op implementation (see ChIrrGuiDriver) /// Update the state of this driver system at the current time. virtual void Update(double time) {} /// Advance the state of this driver system by the specified time step. virtual void Advance(double step) {}
70
ChIrrGuiDriver Concrete driver system for interactive vehicle simulation Implemented as an Irrlicht event receiver, it reads the keyboard (A,W,S,D) to generate driver inputs Provides additional support for: Vehicle tracking camera Optional engine sound (using the IrrKlang library) Rendering of joints, springs Displaying vehicle stats
71
ChDataDriver Driver model based on inputs provided as time series:
Programmatically – a vector of 4-tuples {time, steering, throttle, braking} From data file – ASCII file with a 4-tuple per line Time values must be unique If time values are not in ascending order, this must be indicated at construction Values at intermediate times are obtained through linear interpolation
72
Powertrain Models Simple Powertrain Shafts Powertrain
73
Data flow DRIVER POWERTRAIN TERRAIN VEHICLE TIRES Throttle input
Driveshaft torque Driveshaft speed VEHICLE TIRES
74
ShaftsPowertrain model
Uses Chrono ChShaft elements Engine model based on speed-torque curves: 𝜏 𝐸 = 𝜏 𝐸 𝜔 𝐸 Torque converter model uses two curves: - capacity factor curve: 𝐾=𝐾 𝑅 𝜔 torque ratio curve: 𝑅 𝜏 = 𝑅 𝜏 𝑅 𝜔 where 𝑅 𝜔 = 𝜔 𝑇 𝜔 𝐼 speed ratio (turbine – impeller) 𝑅 𝜏 = 𝜏 𝑇 𝜏 𝐼 torque ratio (turbine – impeller) 𝐾= 𝜔 𝐼 𝜏 𝐼 capacity factor Transmission is a gear box, parameterized by a set of forward gear ratios and a single reverse gear ratio
75
Transmission (Gear box)
4WD POWERTRAIN DATA FLOW 1D shaft element 3D rigid body shaft – body connector TC Front shaft 2 Front shaft 1 Front diff. Rear shaft 1 Rear shaft 2 Central diff. Rear diff. Transmission (Gear box) Crank shaft Engine Motor block Chassis In shaft Out shaft Front-right axle Front-left Rear-left Rear-right Conical gear spindle Angular speed Torque
76
TEMPLATE PARTITIONING
TC Front shaft 2 Front shaft 1 Front diff. Rear shaft 1 Rear shaft 2 Central diff. Rear diff. Transmission (Gear box) Crank shaft Engine Motor block Chassis In shaft Out shaft Front-right axle Front-left Rear-left Rear-right Conical gear spindle powertrain subsystem driveline subsystem 4WD POWERTRAIN TEMPLATE PARTITIONING
77
Transmission (Gear box)
Torque map rotational inertia template parameters POWERTRAIN TEMPLATE PARAMETERS Chassis TC Engine Capacity factor map Torque ratio map Motor block Crank shaft In shaft Transmission (Gear box) Rear-right spindle Front-right spindle Gear ratios (forward + reverse) Front-right axle Out shaft Rear-right axle Front diff. Central diff. Rear diff. Front shaft 2 Conical gear Front shaft 1 Rear shaft 1 Conical gear Rear shaft 2 Front-left axle Rear-left axle Front-left spindle Rear-left spindle
78
SimplePowertrain model
Very simple model: 𝜔 𝑚 = 𝜔 𝑠 𝑔 𝜏 𝑚 =𝑡ℎ𝑟𝑜𝑡𝑡𝑙𝑒∙ 𝜏 𝑚𝑎𝑥 ∙ 1− 𝜔 𝑚 𝜔 𝑚𝑎𝑥 𝜏 𝑠 = 𝜏 𝑚 𝑔 No torque converter, no transmission
79
JSON specification file for SimplePowertrain
{ "Name": "HMMWV Simplified Powertrain", "Type": "Powertrain", "Template": "SimplePowertrain", "Forward Gear Ratio": , "Reverse Gear Ratio": , "Maximum Engine Torque": , "Maximum Engine Speed": } Subsystem type (string) Template type (string)
80
Suspension Test Rig
81
Suspension Test Rig Purpose: Analyze combined front suspension/steering subsystem behavior without involving complex full vehicle dynamics. Examples: Shock spring prelength/preload Steering wheel input limits
82
Suspension Test Rig Overview
Similar to a full vehicle system Front half, chassis fixed to ground Shaker posts added to the system Left=Green, Right=Red Constrained to move only vertically (global) Linear Actuator specifies post displacement Wheel spindle body CM point constrained in plane Plane vertically offset from shaker post surface Logs important measurements to console or file
83
JSON specification file for SuspensionTestRig
{ "Name": "HMMWV Front Suspension Test", "Type": "SuspensionTest", "Template": "SuspensionTest", "Suspension": "Input File": "hmmwv/suspension/HMMWV_DoubleWishboneFront.json", "Location": [ , 0, 0], "Left Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontLeft.json", "Right Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontRight.json" }, "Steering": "Input File": "hmmwv/steering/HMMWV_PitmanArm.json", "Location": [ , 0, ], "Orientation": [ , 0, , 0], "Suspension Index": } Subsystem type (string) Template type (string) Subsystems (suspension and steering) specified as in a vehicle JSON specification file. The block specifying the steering subsystem is optional.
84
Suspension Subsystem
85
ChSuspension base class
Defines the common interface for any suspension subsystem All classes defining particular suspension templates inherit from ChSuspension A ChSuspension is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a suspension subsystem. class CH_SUBSYS_API ChSuspension : public ChShared
86
ChSuspension base class members
A ChSuspension has: std::string m_name; ///< name of the subsystem ChSharedPtr<ChBody> m_spindle[2]; ///< handles to spindle bodies ChSharedPtr<ChShaft> m_axle[2]; ///< handles to axle shafts ChSharedPtr<ChShaftsBody> m_axle_to_spindle[2]; ///< handles to spindle-shaft connectors ChSharedPtr<ChLinkLockRevolute> m_revolute[2]; ///< handles to spindle revolute joints
87
ChSuspension base class accessors
A ChSuspension provides access to: Its constituent parts (spindle body, axle shaft, etc.) States of the wheel (spindle) bodies Angular speed of the axle shafts
88
ChSuspension base class methods
A ChSuspension provides methods to: /// Apply the provided tire forces. /// The given tire force and moment is applied to the specified (left or /// right) spindle body. This function provides the interface to the tire /// system (intermediated by the vehicle system). void ApplyTireForce( ChVehicleSide side, ///< spindle body (left or right) where forces should be applied const ChTireForce& tire_force ///< generalized tire forces ); /// Apply the provided motor torque. /// The given torque is applied to the specified (left or right) axle. This /// function provides the interface to the drivetrain subsystem (intermediated /// by the vehicle system). void ApplyAxleTorque( ChVehicleSide side, ///< indicates the axle (left or right) where the torque should be applied double torque ///< value of applied torque
89
ChSuspension base class virtual methods
A concrete class must implement /// Initialize this suspension subsystem. /// The suspension subsystem is initialized by attaching it to the specified /// chassis body at the specified location (with respect to and expressed in /// the reference frame of the chassis). It is assumed that the suspension /// reference frame is always aligned with the chassis reference frame. /// Finally, tierod_body is a handle to the body to which the suspension /// tierods are to be attached. For a steerable suspension, this will be the /// steering link of a suspension subsystem. Otherwise, this is the chassis. virtual void Initialize( ChSharedPtr<ChBodyAuxRef> chassis, ///< [in] handle to the chassis body const ChVector<>& location, ///< [in] location relative to the chassis frame ChSharedPtr<ChBody> tierod_body ///< [in] body to which tireods are connected ) = 0;
90
Suspension Templates Double Wishbone (full and reduced)
91
UCA balljoint Upper control arm Upright Shock UCA revolute Spindle Spindle revolute LCA revolute LCA balljoint Tierod Lower control arm
92
DOUBLE A-ARM SUSPENSION TEMPLATE
1D shaft element 3D rigid body shaft – body connector joint Upper control arm Lower control arm Chassis Upright Spindle Axle Tire forces Wheel state Angular velocity Motor torque Revolute joint Spherical Distance constraint Shock
93
DOUBLE A-ARM SUSPENSION TEMPLATE PARAMETERS
rotational inertia mass and inertia tensor spring coef., damping, free length point location Upper control arm Lower control arm Chassis Upright Spindle Axle Revolute joint Spherical Distance constraint Shock
94
(R) DOUBLE A-ARM SUSPENSION TEMPLATE
1D shaft element 3D rigid body shaft – body connector joint Chassis Upright Spindle Axle Tire forces Wheel state Angular velocity Motor torque Revolute joint Distance constraint Shock
95
(R) DOUBLE A-ARM SUSPENSION TEMPLATE PARAMETERS
rotational inertia mass and inertia tensor spring coef., damping, free length point location (R) DOUBLE A-ARM SUSPENSION TEMPLATE PARAMETERS Chassis Upright Spindle Distance constraint Distance constraint Distance constraint Revolute joint Axle Shock Distance constraint Distance constraint
96
Z X Y X Z Y SUSPENSION SUBSYSTEM REFERENCE FRAME CONTROL ARM
SHOCK_C Z X UCA_U UCA_F Y SPINDLE UCA_CM UPRIGHT LCA_F X SHOCK_U Z TIEROD_U UCA_B LCA_U Y LCA_CM LCA_B SUSPENSION SUBSYSTEM REFERENCE FRAME CONTROL ARM CENTROIDAL FRAME TIEROD_C
97
ChDoubleWishbone base class
/// /// Base class for a double-A arm suspension modeled with bodies and constraints. /// Derived from ChSuspension, but still an abstract base class. /// The suspension subsystem is modeled with respect to a right-handed frame, /// with X pointing towards the front, Y to the left, and Z up (ISO standard). /// The suspension reference frame is assumed to be always aligned with that of /// the vehicle. When attached to a chassis, only an offset is provided. /// All point locations are assumed to be given for the left half of the /// suspension and will be mirrored (reflecting the y coordinates) to construct /// the right side. class CH_SUBSYS_API ChDoubleWishbone : public ChSuspension
98
ChDoubleWishbone (pure) virtual functions
/// Identifiers for the various hardpoints. enum PointId { SPINDLE, ///< spindle location UPRIGHT, ///< upright location UCA_F, ///< upper control arm, chassis front UCA_B, ///< upper control arm, chassis back UCA_U, ///< upper control arm, upright UCA_CM, ///< upper control arm, center of mass LCA_F, ///< lower control arm, chassis front LCA_B, ///< lower control arm, chassis back LCA_U, ///< lower control arm, upright LCA_CM, ///< lower control arm, center of mass SHOCK_C, ///< shock, chassis SHOCK_A, ///< shock, lower control arm SPRING_C, ///< spring, chassis SPRING_A, ///< spring, lower control arm TIEROD_C, ///< tierod, chassis TIEROD_U, ///< tierod, upright NUM_POINTS }; /// Return the location of the specified hardpoint. /// The returned location must be expressed in the suspension reference frame. virtual const ChVector<> getLocation(PointId which) = 0;
99
ChDoubleWishbone (pure) virtual functions
/// Return the mass of the spindle body. virtual double getSpindleMass() const = 0; /// Return the mass of the upper control arm body. virtual double getUCAMass() const = 0; /// Return the mass of the lower control body. virtual double getLCAMass() const = 0; /// Return the mass of the upright body. virtual double getUprightMass() const = 0; /// Return the moments of inertia of the spindle body. virtual const ChVector<>& getSpindleInertia() const = 0; /// Return the moments of inertia of the upper control arm body. virtual const ChVector<>& getUCAInertia() const = 0; /// Return the moments of inertia of the lower control arm body. virtual const ChVector<>& getLCAInertia() const = 0; /// Return the moments of inertia of the upright body. virtual const ChVector<>& getUprightInertia() const = 0; /// Return the inertia of the axle shaft. virtual double getAxleInertia() const = 0;
100
ChDoubleWishbone (pure) virtual functions
/// Indicate whether the spring is modeled as a nonlinear element. /// If true, the concrete class must provide a callback function to calculate /// the force in the spring element (see getSpringForceCallback). virtual bool useNonlinearSpring() const { return false; } /// Indicate whether the shock is modeled as a nonlinear element. /// the force in the shock element (see getShockForceCallback). virtual bool useNonlinearShock() const { return false; } /// Return the spring coefficient (for linear spring elements). virtual double getSpringCoefficient() const { return 1.0; } /// Return the damping coefficient (for linear shock elements). virtual double getDampingCoefficient() const { return 1.0; } /// Return the free (rest) length of the spring element. virtual double getSpringRestLength() const = 0; /// Return the callback function for spring force (for nonlinear spring). virtual ChSpringForceCallback* getSpringForceCallback() const { return NULL; } /// Return the callback function for shock force (for nonlinear shock). virtual ChSpringForceCallback* getShockForceCallback() const { return NULL; }
101
ChDoubleWishbone (pure) virtual functions
/// Return the radius of the spindle body (visualization only). virtual double getSpindleRadius() const = 0; /// Return the width of the spindle body (visualization only). virtual double getSpindleWidth() const = 0; /// Return the radius of the upper control arm body (visualization only). virtual double getUCARadius() const = 0; /// Return the radius of the lower control arm body (visualization only). virtual double getLCARadius() const = 0; /// Return the radius of the upright body (visualization only). virtual double getUprightRadius() const = 0;
102
JSON specification for double wishbone
{ "Name": "Generic DoubleWishbone Front", "Type": "Suspension", "Template": "DoubleWishbone", "Spindle" : "Mass": , "COM": [-0.040, 0.910, ], "Inertia": [ , , ], "Radius": , "Width": }, "Upright": "Mass": , "Inertia": [0.0138, , ], "Radius": Identifier name (string) Subsystem type (string) Template type (string) Mass in kg (float) Location of the center of mass in m (float) with respect to the suspension reference frame Moments of inertia in kg m2 (float) Visualization dimensions in m (float)
103
JSON specification for double wishbone
"Upper Control Arm": { "Mass": , "COM": [-0.196, 0.645, 0.245], "Inertia": [ , , ], "Radius": , "Location Chassis Front": [-0.160, 0.539, 0.243], "Location Chassis Back": [-0.339, 0.587, 0.249], "Location Upright": [-0.088, 0.808, 0.243] }, "Lower Control Arm": "Mass": , "COM": [-0.040, 0.639, ], "Inertia": [0.0151, , ], "Radius": , "Location Chassis Front": [0.199, 0.479, ], "Location Chassis Back": [-0.279, 0.539, ], "Location Upright": [-0.040, 0.898, ] Locations of the front and back attachment points between the control arm and the chassis in m (float) with respect to the suspension reference frame. These points form the axis of rotation for the revolute joint between the chassis and the control arm Location of the spherical joint between the control arm and the upright in m (float) with respect to the suspension reference frame
104
JSON specification for double wishbone
"Tierod": { "Location Chassis": [-0.279, 0.479, ], "Location Upright": [-0.220, 0.898, ] }, "Spring": "Location Chassis": [-0.064, 0.659, 0.094], "Location Arm": [-0.040, 0.718, ], "Spring Coefficient": , "Free Length" : "Shock": "Location Chassis": [-0.088, 0.599, 0.393], "Damping Coefficient": "Axle": "Inertia": } Locations of the upper and lower attachment points between the control arm and the chassis in m (float) with respect to the suspension reference frame Rotational moment of inertia in kg m2 (float)
105
Suspension Templates Solid Axle
106
SOLID ARM SUSPENSION TEMPLATE Chassis Distance constraint Knuckle
1D shaft element 3D rigid body shaft – body connector joint Chassis Distance constraint Knuckle Spindle Universal joint Universal joint Shock Upper link Lower link Revolute joint Angular velocity Axle Motor torque Spherical joint Spherical joint Axle tube Revolute joint Wheel state Tire forces
107
Z X Y SUSPENSION SUBSYSTEM PARTS SUSPENSION SUBSYSTEM HARDPOINTS
SHOCK_C Spindle Z X SPINDLE SHOCK_U Y TIEROD_U TIEROD_C SUSPENSION SUBSYSTEM PARTS SUSPENSION SUBSYSTEM HARDPOINTS
108
JSON specification file for solid axle
Identifier name (string) { "Name": "Generic Solid Axle Front", "Type": "Suspension", "Template": "SolidAxle", "Spindle" : "Mass": , "COM": [0, 0.910, 0], "Inertia": [ , , ], "Radius": , "Width": }, "Knuckle": "Mass": , "COM": [-0.006, 0.834, 0.015], "Inertia": [ , , ], "Radius": , "Location Lower": [0.006, 0.849, ], "Location Upper": [-0.018, 0.819, 0.091] Subsystem type (string) Template type (string) Mass in kg (float) Location of the center of mass in m (float) with respect to the suspension reference frame Moments of inertia in kg m2 (float) Visualization dimensions in m (float) Locations of the upper and lower attachment points between the knuckle and axle tube in m (float) with respect to the suspension reference frame. These points form the axis of rotation for the revolute joint between the knuckle and the axle tube
109
JSON specification file for solid axle
"Upper Link": { "Mass": , "COM": [0.182, 0.591, 0.182], "Inertia": [0.011, 0.011, ], "Radius": , "Location Axle": [-0.067, 0.576, 0.182], "Location Chassis": [0.431, 0.606, 0.182], "Universal Joint Axis Link": [0, -1, 0], "Universal Joint Axis Chassis": [0, 0, 1] }, "Lower Link": "Mass": , "COM": [0.279, 0.577, ], "Inertia": [0.0514, , ], "Location Axle": [0.012, 0.728, ], "Location Chassis": [0.546, 0.425, ], "Universal Joint Axis Link": [0, 1, 0], "Axle Tube" : "Mass": , "COM": [0, 0, 0], "Inertia": [7.744, 0.045, 7.744], "Radius": Location of the spherical joint that attaches the link to the axle tube with respect to the suspension reference frame in m (float) Location of the universal joint that attaches the link to the axle tube with respect to the suspension reference frame in m (float) Directions of the universal joint that attaches the link to the axle tube
110
JSON specification file for solid axle
"Tierod": { "Location Chassis": [-0.091, 0.400, ], "Location Knuckle": [-0.091, 0.825, ] }, "Spring": "Location Chassis": [-0.097, 0.679, 0.364], "Location Axle": [-0.079, 0.697, ], "Spring Coefficient": , "Free Length": "Shock": "Damping Coefficient": "Axle": "Inertia": } Locations of the upper and lower attachment points between the control arm and the chassis in m (float) with respect to the suspension reference frame Rotational moment of inertia in kg m2 (float)
111
Suspension Templates Multi-link
112
MULTI-LINK SUSPENSION TEMPLATE
Lateral Trailing link Chassis Upright Spindle Axle Tire forces Wheel state Angular velocity Motor torque Universal joint Revolute Spherical Distance constraint Shock Upper arm MULTI-LINK SUSPENSION TEMPLATE 1D shaft element 3D rigid body shaft – body connector joint
113
Z X Y SUSPENSION SUBSYSTEM PARTS SUSPENSION SUBSYSTEM HARDPOINTS
SHOCK_C Spindle SPINDLE Z X SHOCK_U Y TIEROD_U SUSPENSION SUBSYSTEM PARTS SUSPENSION SUBSYSTEM HARDPOINTS TIEROD_C
114
JSON specification file for multi-link
{ "Name": "Generic Multi-Link Front", "Type": "Suspension", "Template": "MultiLink", "Spindle" : "Mass": , "COM": [0.000, 0.950, 0.000], "Inertia": [ , , ], "Radius": , "Width": }, "Upright": "Mass": , "COM": [0.000, 0.910, 0.000], "Inertia": [0.0250, , ], "Radius": Identifier name (string) Subsystem type (string) Template type (string) Mass in kg (float) Location of the center of mass in m (float) with respect to the suspension reference frame Moments of inertia in kg m2 (float) Visualization dimensions in m (float)
115
JSON specification file for multi-link
"Upper Arm": { "Mass": , "COM": [-0.014, 0.640, 0.098], "Inertia": [0.0237, , ], "Radius": , "Location Chassis Front": [0.060, 0.547, 0.082], "Location Chassis Back": [-0.157, 0.508, 0.062], "Location Upright": [0.056, 0.864, 0.151] }, "Lateral": "Mass": , "COM": [0.033, 0.590, ], "Inertia": [0.0543, , ], "Location Chassis": [0.036, 0.338, ], "Location Upright": [0.029, 0.842, ], "Universal Joint Axis Link": [ , , 0.0], "Universal Joint Axis Chassis": [ , , ] "Trailing Link": "Mass": , "COM": [0.279, 0.693, ], "Inertia": [0.0762, 0.527, 0.567], "Radius": , "Location Chassis": [0.723, 0.599, ], "Location Upright": [-0.000, 0.864, ], "Universal Joint Axis Link": [0.0, 0.0, 1.0], "Universal Joint Axis Chassis": [-0.272, 0.962, 0.0]
116
JSON specification file for multi-link
"Tierod": { "Location Chassis": [-0.257, 0.320, ], "Location Upright": [-0.144, 0.862, ] }, "Spring": "Location Chassis": [0.181, 0.641, 0.110], "Location Link": [0.181, 0.669, ], "Spring Coefficient": , "Free Length" : "Shock": "Location Chassis": [0.171, 0.628, 0.315], "Location Link": [0.181, 0.669, ], "Damping Coefficient": "Axle": "Inertia": }
117
Support for non-linear spring-damper
Currently supported by the ChDoubleWishbone and ChMultiLink suspension templates Implemented using the Chrono ChLinkSpringCB element which accepts a user-defined functor class Default implementation is linear spring-damper A concrete, derived class can override the functor class to implement an arbitrary non-linear spring and/or damper Example: HMMWV_DoubleWishboneFront & HMMWV_DoubleWishboneRear class ChSpringForceCallback : public ChShared { public: virtual double operator()( double time, ///< current time double rest_length, ///< undeformed length double length, ///< current length double vel ///< current velocity (positive when extending) ) = 0; };
118
Wheel Subsystem
119
Wheel subsystem A wheel subsystem does not own a body.
It is just a container for mass properties and geometric information When attached to a suspension subsystem, the wheel's mass properties are used to update those of the spindle body owned by the suspension. A concrete wheel subsystem can optionally carry its own visualization assets (which are associated with the suspension's spindle body).
120
ChWheel base class Defines the common interface for a wheel subsystem
A ChWheel is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a vehicle wheel subsystem. /// A wheel subsystem does not own a body. Instead, when attached to a suspension /// subsystem, the wheel's mass properties are used to update those of the /// spindle body owned by the suspension. /// A concrete wheel subsystem can optionally carry its own visualization assets /// (which are associated with the suspension's spindle body). class CH_SUBSYS_API ChWheel : public ChShared
121
JSON specification file for wheel
{ "Name": "HMMWV Wheel Front-Left", "Type": "Wheel", "Template": "Wheel", "Mass": , "Inertia": [0.113, 0.113, 0.113], "Visualization": "Mesh Filename": "hmmwv/wheel_L.obj", "Mesh Name": "wheel_L_POV_geom", "Radius": , "Width": } Subsystem type (string) Template type (string)
122
Brake Subsystem
123
ChBrake base class Defines the common interface for any brake subsystem All classes defining particular brake templates inherit from ChBrake A ChBrake is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a brake subsystem class CH_SUBSYS_API ChBrake : public ChShared
124
Brake Templates Simple brake
125
ChSimpleBrake Simple brake model using a constant torque opposing wheel rotation. Uses a speed-dependent torque It cannot simulate sticking On initialization, it is associated with a revolute joint connecting the spindle body Has a single parameter, the maximum braking torque
126
JSON specification file for SimpleBrake
{ "Name": "HMMWV Brake Front", "Type": "Brake", "Template": "BrakeSimple", "Maximum Torque": } Subsystem type (string) Template type (string) Maximum braking torque in Nm (double)
127
Steering Subsystem
128
ChSteering base class Defines the common interface for any steering subsystem All classes defining particular steering templates inherit from ChSteering A ChSteering is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a steering subsystem. class CH_SUBSYS_API ChSteering : public ChShared
129
ChSteering base class members
A ChSteering has: std::string m_name; ///< name of the subsystem ChSharedPtr<ChBody> m_link; ///< handle to the main steering link
130
ChSteering base class accessors
A ChSteering provides access to: Its constituent parts (the steering link body)
131
ChSteering base class virtual methods
Initialize the steering subsystem relative to the chassis body Update the steering subsystem with data from the driver system /// Initialize this steering subsystem. /// The steering subsystem is initialized by attaching it to the specified /// chassis body at the specified location (with respect to and expressed in /// the reference frame of the chassis) and with specified orientation (with /// respect to the chassis reference frame). virtual void Initialize( ChSharedPtr<ChBodyAuxRef> chassis, ///< [in] handle to the chassis body const ChVector<>& location, ///< [in] location relative to the chassis frame const ChQuaternion<>& rotation ///< [in] orientation relative to the chassis frame ) = 0; /// Update the state of this steering subsystem at the current time. /// The steering subsystem is provided the current steering driver input (a /// value between -1 and +1). Positive steering input indicates steering /// to the left. This function is called during the vehicle update. virtual void Update( double time, ///< [in] current time double steering ///< [in] current steering input [-1,+1] ) = 0;
132
Steering Templates Pitman Arm
133
PITMAN ARM STEERING TEMPLATE Distance constraint Distance constraint
3D rigid body joint Distance constraint Distance constraint Steering Link Pitman Arm Universal joint Revolute-spherical joint Revolute joint Steering input Chassis
134
Z X Y STEERING SUBSYSTEM PARTS STEERING SUBSYSTEM HARDPOINTS
Universal joint TIEROD_PA Z UNIV Steering link X REV Y PITMANARM TIEROD_IA STEERINGLINK Revolute joint Pitman arm REVSPH_R REVSPH_S Idler arm STEERING SUBSYSTEM PARTS STEERING SUBSYSTEM HARDPOINTS
135
JSON specification for Pitman arm
{ "Name": "HMMWV Pitman Arm Steering", "Type": "Steering", "Template": "PitmanArm", "Steering Link": "Mass": , "COM": [ 0.129, 0, 0], "Inertia": [1, 1, 1], "Radius": }, "Pitman Arm": "Mass": , "COM": [ 0.064, 0.249, 0], "Radius": Identifier name (string) Subsystem type (string) Template type (string)
136
JSON specification for Pitman arm
"Revolute Joint": { "Location": [0, 0.249, 0], "Direction": [0, 0, 1], "Maximum Angle": }, "Universal Joint": "Location": [ 0.129, 0.249, 0], "Direction Arm": [0, 0, 1], "Direction Link": [1, 0, 0] "Revolute-Spherical Joint": "Location Chassis": [0, , 0], "Location Link": [0.129, , 0], "Direction": [0, 0, 1] "Tierod Locations": "Pitman Side": [0.195, , 0.035], "Idler Side": [0.195, , 0.035] } Direction of the axis of rotation Maximum steering angle in degrees (float)
137
Steering Templates Rack Pinion
138
RACK-PINION STEERING TEMPLATE Distance constraint Distance constraint
3D rigid body joint Distance constraint Distance constraint Steering Link Steering input Prismatic joint Chassis
139
Y X Z STEERING SUBSYSTEM PARTS STEERING SUBSYSTEM HARDPOINTS Rack
Rack COM Rack STEERING SUBSYSTEM PARTS STEERING SUBSYSTEM HARDPOINTS
140
JSON specification file for rack-pinion
{ "Name": “Name of this subsystem", "Type": "Steering", "Template": "RackPinion", "Steering Link": "Mass": , "COM": , "Inertia": [1.0, 1.0, 1.0], "Radius": , "Length": }, "Pinion": "Maximum Angle": } Identifier name (string) Subsystem type (string) Template type (string) Mass in kg (float) Lateral offset in m (float) Moments of inertia in kg m2 (float) Visualization radius in m (float) Visualization length in m (float) Pinion radius in m (float) Maximum rotation angle in rad (float)
141
JSON specification file for rack-pinion
User specifies all values, except those in red The reference frame for a rack-pinion steering subsystem is assumed to be aligned with the chassis reference frame and centered at the middle of the steering link The rack displacement is obtained as 𝑑=𝑟∙ 𝛼 𝑚𝑎𝑥 ∙𝑠 where 𝑟 is the pinion radius, 𝛼 𝑚𝑎𝑥 is the maximum pinion angle, and 𝑠 is the steering input (𝑠∈ −1,1 )
142
Driveline Subsystem
143
ChDriveline base class
Defines the common interface for any driveline subsystem All classes defining particular driveline templates inherit from ChDriveline A ChDriveline is a Chrono ChShared object (i.e. it keeps track of its own reference count and it can be wrapped in a ChSharedPtr smart pointer) /// /// Base class for a driveline subsystem. class CH_SUBSYS_API ChDriveline : public ChShared
144
ChDriveline base class members
A ChDriveline has: ChSharedPtr<ChShaft> m_driveshaft; ///< handle to the shaft connection to the powertrain std::vector<int> m_driven_axles; ///< indexes of the driven vehicle axles
145
ChDriveline base class accessors and methods
A ChDriveline provides access to: Its constituent parts (driveshaft) Angular speed of the driveshaft Motor torque to be applied to a given vehicle wheel A ChDriveline provides a method to set the (input) torque from the powertrain system (typically invoked by the owning vehicle system) /// Apply the specified motor torque. /// This represents the input to the driveline subsystem from the powertrain /// system. void ApplyDriveshaftTorque(double torque) { m_driveshaft->SetAppliedTorque(torque); }
146
ChDriveline base class virtual methods
Initialize the driveline and connect it to the specified vehicle axles Specify number of driven axles Set the (output) torque to be applied to the specified wheel /// Initialize the driveline subsystem. /// This function connects this driveline subsystem to the axles of the /// specified suspension subsystems. virtual void Initialize( ChSharedPtr<ChBody> chassis, ///< handle to the chassis body const ChSuspensionList& suspensions, ///< list of all vehicle suspension subsystems const std::vector<int>& driven_axles ///< indexes of the driven vehicle axles ) = 0; /// Return the number of driven axles. virtual int GetNumDrivenAxles() const = 0; /// Get the motor torque to be applied to the specified wheel. virtual double GetWheelTorque(const ChWheelID& wheel_id) const = 0;
147
Driveline Templates ShaftsDriveline4WD
148
Transmission (Gear box)
rotational inertia template parameters 4WD DRIVELINE TEMPLATE PARAMETERS Chassis TC Engine Motor block Crank shaft In shaft Transmission (Gear box) Rear-right spindle Front-right spindle Front-right axle Out shaft Rear-right axle Front diff. Central diff. Rear diff. Transmission ratio Transmission ratio Front shaft 2 Conical gear Front shaft 1 Rear shaft 1 Conical gear Rear shaft 2 Front-left axle Gear ratio Transmission ratio Gear ratio Rear-left axle Front-left spindle Rear-left spindle
149
JSON specification file for ShaftsDriveline4WD
{ "Name": "HMMWV AWD Driveline", "Type": "Driveline", "Template": "ShaftsDriveline4WD", "Shaft Direction": "Motor Block": [1, 0, 0], "Axle": [0, 1, 0] }, "Shaft Inertia": "Driveshaft": , "Front Driveshaft": , "Rear Driveshaft": , "Central Differential Box": 0.6, "Front Differential Box": 0.6, "Rear Differential Box": "Gear Ratio": "Front Conical Gear": , "Rear Conical Gear": , "Central Differential": , "Front Differential": , "Rear Differential": } Subsystem type (string) Template type (string)
150
Driveline Templates ShaftsDriveline2WD
151
Transmission (Gear box)
rotational inertia template parameters 2WD DRIVELINE TEMPLATE PARAMETERS Chassis TC Right spindle Engine Motor block Crank shaft In shaft Right axle Transmission (Gear box) Rear diff. Transmission ratio Out shaft Conical gear Left axle Gear ratio Left spindle
152
JSON specification file for ShaftsDriveline2WD
{ "Name": "HMMWV RWD Driveline", "Type": "Driveline", "Template": "ShaftsDriveline2WD", "Shaft Direction": "Motor Block": [1, 0, 0], "Axle": [0, 1, 0] }, "Shaft Inertia": "Driveshaft": , "Differential Box": "Gear Ratio": "Conical Gear": , "Differential": } Subsystem type (string) Template type (string)
153
Visualization Runtime visualization with
155
Visualization Post-processing with
157
Preparing output data files – WriteShapesPovray
Call this function at each simulation frame that needs to be post-processed Outputs a Comma Separated Value (CSV) file with specified name File contains information for All bodies in the Chrono system (position and orientation) All visualization assets (position, orientation, type, parameters) Selected types of joints // Write CSV output file for PovRay. // Each line contains information about one visualization asset shape, as // follows: // index, x, y, z, e0, e1, e2, e3, type, geometry // where 'geometry' depends on 'type' (an enum). CH_UTILS_API void WriteShapesPovray(ChSystem* system, const std::string& filename, bool body_info = true, const std::string& delim = ",");
158
Preparing output data files – WriteMeshPovray
Call this function once to generate a PovRay input file from a specified Waveform OBJ mesh file Quick and dirty alternative to using a more powerful tool (e.g., PoseRay – // Write the triangular mesh from the specified OBJ file as a macro in a PovRay // include file. The output file will be "[out_dir]/[mesh_name].inc". The mesh // vertices will be tramsformed to the frame with specified offset and // orientation. CH_UTILS_API void WriteMeshPovray(const std::string& obj_filename, const std::string& mesh_name, const std::string& out_dir, const ChColor& color = ChColor(0.4f, 0.4f, 0.4f), const ChVector<>& pos = ChVector<>(0, 0, 0), const ChQuaternion<>& rot = ChQuaternion<>(1, 0, 0, 0));
159
Creating PovRay images – renderZ.pov script
Generic script for (batch) processing of output files in the format generated by WriteShapesPovray Assumes all data is expressed in a right-hand frame with Z up (and performs all required transformations to PovRay’s Y-up left-handed frames) User controls: Render a single frame or a sequence of frames (batch processing) Turn on/off rendering of body and object (asset) reference frames Turn on/off rendering of objects (assets) Turn on/off rendering of static objects (assets of bodies fixed to ground) Turn on/off rendering of links (joints) Camera location and “look-at” point (with a few presets) Enable/disable shadows Optionally render environment (ground and sky)
161
Chrono::Vehicle hands-on tutorial
Creating a vehicle from existing templates
162
Instantiating a subsystem template
Subsystem Templates are implemented as C++ (abstract) base classes A Subsystem Template (e.g., ChDoubleWishbone) defines the topology (bodies, shafts, joints, etc.) and the interface To use a given template in modeling a vehicle, the user must either: Implement a derived, concrete class (e.g., HMMWV_DoubleWishbone) which implements all required virtual methods Create a JSON specification file and use the appropriate generic concrete class (e.g., DoubleWishbone) which implements all required virtual methods using data from the specification file
163
Exercise 1 Implement a concrete class Generic_DoubleWishbone
Modify the Generic_Vehicle class to optionally construct the vehicle using the Generic_DoubleWishbone suspension (for both front and rear) Modify the demo_GenericVehicle driver to construct a Generic_Vehicle with double wishbone suspension Work in the chrono-T project demo_GenericVehicle Use parameters from the JSON specification file data/generic/suspension/DoubleWishboneFront.json
164
DOUBLE A-ARM SUSPENSION TEMPLATE PARAMETERS
rotational inertia mass and inertia tensor spring coef., damping, free length point location Upper control arm Lower control arm Chassis Upright Spindle Axle Revolute joint Spherical Distance constraint Shock
165
Z X Y X Z Y SUSPENSION SUBSYSTEM REFERENCE FRAME CONTROL ARM
SHOCK_C Z X UCA_U UCA_F Y SPINDLE UCA_CM UPRIGHT LCA_F X SHOCK_U Z TIEROD_U UCA_B LCA_U Y LCA_CM LCA_B SUSPENSION SUBSYSTEM REFERENCE FRAME CONTROL ARM CENTROIDAL FRAME TIEROD_C
166
ChDoubleWishbone base class
/// /// Base class for a double-A arm suspension modeled with bodies and constraints. /// Derived from ChSuspension, but still an abstract base class. /// The suspension subsystem is modeled with respect to a right-handed frame, /// with X pointing towards the front, Y to the left, and Z up (ISO standard). /// The suspension reference frame is assumed to be always aligned with that of /// the vehicle. When attached to a chassis, only an offset is provided. /// All point locations are assumed to be given for the left half of the /// suspension and will be mirrored (reflecting the y coordinates) to construct /// the right side. class CH_SUBSYS_API ChDoubleWishbone : public ChSuspension
167
ChDoubleWishbone (pure) virtual functions
/// Identifiers for the various hardpoints. enum PointId { SPINDLE, ///< spindle location UPRIGHT, ///< upright location UCA_F, ///< upper control arm, chassis front UCA_B, ///< upper control arm, chassis back UCA_U, ///< upper control arm, upright UCA_CM, ///< upper control arm, center of mass LCA_F, ///< lower control arm, chassis front LCA_B, ///< lower control arm, chassis back LCA_U, ///< lower control arm, upright LCA_CM, ///< lower control arm, center of mass SHOCK_C, ///< shock, chassis SHOCK_A, ///< shock, lower control arm SPRING_C, ///< spring, chassis SPRING_A, ///< spring, lower control arm TIEROD_C, ///< tierod, chassis TIEROD_U, ///< tierod, upright NUM_POINTS }; /// Return the location of the specified hardpoint. /// The returned location must be expressed in the suspension reference frame. virtual const ChVector<> getLocation(PointId which) = 0;
168
ChDoubleWishbone (pure) virtual functions
/// Return the mass of the spindle body. virtual double getSpindleMass() const = 0; /// Return the mass of the upper control arm body. virtual double getUCAMass() const = 0; /// Return the mass of the lower control body. virtual double getLCAMass() const = 0; /// Return the mass of the upright body. virtual double getUprightMass() const = 0; /// Return the moments of inertia of the spindle body. virtual const ChVector<>& getSpindleInertia() const = 0; /// Return the moments of inertia of the upper control arm body. virtual const ChVector<>& getUCAInertia() const = 0; /// Return the moments of inertia of the lower control arm body. virtual const ChVector<>& getLCAInertia() const = 0; /// Return the moments of inertia of the upright body. virtual const ChVector<>& getUprightInertia() const = 0; /// Return the inertia of the axle shaft. virtual double getAxleInertia() const = 0;
169
ChDoubleWishbone (pure) virtual functions
/// Indicate whether the spring is modeled as a nonlinear element. /// If true, the concrete class must provide a callback function to calculate /// the force in the spring element (see getSpringForceCallback). virtual bool useNonlinearSpring() const { return false; } /// Indicate whether the shock is modeled as a nonlinear element. /// the force in the shock element (see getShockForceCallback). virtual bool useNonlinearShock() const { return false; } /// Return the spring coefficient (for linear spring elements). virtual double getSpringCoefficient() const { return 1.0; } /// Return the damping coefficient (for linear shock elements). virtual double getDampingCoefficient() const { return 1.0; } /// Return the free (rest) length of the spring element. virtual double getSpringRestLength() const = 0; /// Return the callback function for spring force (for nonlinear spring). virtual ChSpringForceCallback* getSpringForceCallback() const { return NULL; } /// Return the callback function for shock force (for nonlinear shock). virtual ChSpringForceCallback* getShockForceCallback() const { return NULL; }
170
ChDoubleWishbone (pure) virtual functions
/// Return the radius of the spindle body (visualization only). virtual double getSpindleRadius() const = 0; /// Return the width of the spindle body (visualization only). virtual double getSpindleWidth() const = 0; /// Return the radius of the upper control arm body (visualization only). virtual double getUCARadius() const = 0; /// Return the radius of the lower control arm body (visualization only). virtual double getLCARadius() const = 0; /// Return the radius of the upright body (visualization only). virtual double getUprightRadius() const = 0;
171
Modifying the Generic_Vehicle class
In Generic_Vehicle::Genric_Vehicle() – Complete the switch statement for constructing the two vehicle suspension objects with the DOUBLE_WISHBONE case In Generic_Vehicle::Initialize() – When initializing the rack-and-pinion steering subsystem, use an offset of [1.4, 0, -0.03] Update the various reporting functions to downcast to the appropriate class when using a DOUBLE_WISHBONE suspension and invoke the corresponding ChDoubleWishbone methods
172
Modyfying the demo_GenericVehicle driver
Change the call to the Generic_Vehicle constructor to specify DOUBLE_WISHBONE as the suspension type
173
Exercise 2 Create a JSON specification file (RackPinion.json) for a rack-pinion steering subsystem equivalent to the one implemented in the Generic_RackPinion* class Create a JSON specification file (MyVehicle.json) for a vehicle using: Double wishbone front suspension (DoubleWishboneFron.json) Solid-axle rear suspension (SolidAxleRear.json) Your rack-pinion steering (RackPinion.json) A 2WD driveline (Driveline2WD.json) – use either FWD or RWD Modify the demo_Vehicle driver to simulate your vehicle * Located in “chrono-T/models/generic/Generic_RackPinion.h”
174
JSON specification file for rack-pinion
{ "Name": “Name of this subsystem", "Type": "Steering", "Template": "RackPinion", "Steering Link": "Mass": , "COM": , "Inertia": [1.0, 1.0, 1.0], "Radius": , "Length": }, "Pinion": "Maximum Angle": } Identifier name (string) Subsystem type (string) Template type (string) Mass in kg (float) Lateral offset in m (float) Moments of inertia in kg m2 (float) Visualization radius in m (float) Visualization length in m (float) Pinion radius in m (float) Maximum rotation angle in rad (float)
175
JSON specification file for rack-pinion
User specifies all values, except those in red The reference frame for a rack-pinion steering subsystem is assumed to be aligned with the chassis reference frame and centered at the middle of the steering link The rack displacement is obtained as 𝑑=𝑟∙ 𝛼 𝑚𝑎𝑥 ∙𝑠 where 𝑟 is the pinion radius, 𝛼 𝑚𝑎𝑥 is the maximum pinion angle, and 𝑠 is the steering input (𝑠∈ −1,1 )
176
JSON specification file for a vehicle
{ "Name": "Test vehicle - 3 axles", "Type": "Vehicle", "Template": "Vehicle", "Chassis": "Mass": , "COM": [ , , ], "Inertia": [125.8, 497.4, 531.4] }, Offset of the chassis COM with respect to the chassis reference frame. Chassis moments of inertia with respect to the chassis centroidal frame.
177
JSON specification file for a vehicle
"Axles": [ { "Suspension Input File": "hmmwv/suspension/HMMWV_DoubleWishboneFront.json", "Suspension Location": [1.6914, 0, ], "Left Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontLeft.json", "Right Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_FrontRight.json", "Left Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Front.json", "Right Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Front.json" }, "Suspension Input File": "generic/suspension/SolidAxleRear.json", "Suspension Location": [-0.5, 0, ], "Left Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_RearLeft.json", "Right Wheel Input File": "hmmwv/wheel/HMMWV_Wheel_RearRight.json", "Left Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Rear.json", "Right Brake Input File": "hmmwv/brake/HMMWV_BrakeSimple_Rear.json" "Suspension Location": [-1.8, 0, ], } ], Offset of the suspension reference frame with respect to the chassis reference frame
178
JSON specification file for a vehicle
"Steering": { "Input File": "hmmwv/steering/HMMWV_PitmanArm.json", "Location": [ , 0, ], "Orientation": [ , 0, , 0], "Suspension Index": 0 }, "Driveline": "Input File": "hmmwv/driveline/HMMWV_Driveline4WD.json", "Suspension Indexes": [0, 2] "Driver Position": "Location": [0, 0.5, 1.2], "Orientation": [1, 0, 0, 0] } Position and orientation of the steering subsystem reference frame with respect to the chassis reference frame. Index of the vehicle axle that is connected to the steering subsystem (here, the first axle in the list). Indexes of the vehicle axles that are connected to the driveline subsystem (here, the first and third in the list). Must be consistent with the driveline type. Position and orientation of driver with respect to the chassis reference frame.
179
Chrono::Vehicle hands-on tutorial
Creating a new subsystem template
180
Option 1: Anti-roll bar subsystem
Design and create a new base class (ChAntiRollBar) Create a new derived, still abstract class (ChSimpleAntiRollBar) which implements the parameterized template for the simple anti-roll bar model Optionally, create a concrete class (SimpleAntiRollBar), derived from ChSimpleAntiRollBar which defines a concrete subsystem using parameters from a JSON specification file Modify the base class ChSuspension to add a virtual function which returns the suspension bodies to which an anti-roll bar subsystem could be attached Modify the base class ChVehicle to add a member variable for an anti-roll bar vehicle subsystem
181
Simple anti-roll bar (model)
LCA left Distance constraint (droplink) LCA right Left Arm Revolute (left arm – right arm) with rotational stiffness Distance constraint (droplink) Revolute (left arm - chassis) Right Arm
182
Simple anti-roll bar (template parameters)
Z X Z Y Y X Z k H Y X L / 2 W L / 2
183
Simple anti-roll bar (template parameters)
Geometric Arm length (L) Arm width (W) Arm radius (r) – visualization only Droplink height (H) Mass properties Arm mass (m) Arm moments of inertia (Ixx) Stiffness Spring coefficient (k) Subsystem reference frame (XYZ) Assumed parallel to the chassis reference frame Left arm centroidal frame (XYZ) at 0, 𝐿 2 ,0 Right arm centroidal frame (XYZ) at 0, −𝐿 2 ,0
184
Option 2: MacPherson Strut
Create a new derived, still abstract class (ChMacPhersonStrut) which implements the parameterized template for the MacPherson strut from the existing ChSuspension parent class Create a concrete class (MacPhersonStrut), derived from ChMacPhersonStrut which defines a concrete subsystem using parameters from a JSON specification file
185
MACPHERSON STRUT SUSPENSION
TEMPLATE 1D shaft element 3D rigid body shaft – body connector joint Control arm Strut Chassis Upright Spindle Axle Tire forces Wheel state Angular velocity Motor torque Revolute joint Universal Spherical Cylindrical Distance constraint Shock
186
MACPHERSON STRUT SUSPENSION
TEMPLATE PARAMETERS mass and inertia tensor Revolute joint Spherical joint Chassis Upright Spindle rotational inertia Control arm point location unit vector direction spring coef., damping, free length Distance constraint Revolute joint Axle Shock Strut Cylindrical joint Universal joint
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.