Creating Easy Iteration Vehicle Model

70 views
Skip to first unread message

Michael

unread,
Apr 19, 2023, 9:51:53 PM4/19/23
to ProjectChrono
Hello,

I am looking to create a lap time simulator for a vehicle model and was wondering where the actual vehicle models for the city bus is. I see this code:  my_bus = veh.CityBus() which calls the city bus model into the simulation,  but I was wondering where the actual file for the creation of the geometry of the city bus is stored. I would like to be able to create a vehicle with an easily iterable wheel base, track width, COG, etc. so that the effects of these values can be shown across different lap time simulations. 

I am I on the right path in trying to create a specific vehicle model that can be easily iterated on and then call this vehicle model into the lap simulation to see the effects or should I be creating the vehicle model within the actual lap simulation?

Also, are there specific tire models within pychrono that can be used for modeling the slip limit and such of the car or will I have to create a model of this as well?

Thank you,
Michael

Radu Serban

unread,
Apr 20, 2023, 3:03:17 AM4/20/23
to ProjectChrono

Michael,

 

You may find it useful to consult the paper “Chrono::Vehicle – Template-based Ground Vehicle Modeling and Simulation” (you can get the PDF here) and look over the Chrono::Vehicle module description at https://api.projectchrono.org/manual_vehicle.html.  That will help you understand the philosophy and design of the vehicle module in Chrono.

 

Vehicle models in Chrono::Vehicle are constructed from parameterized templates of the various subsystems (chassis, suspension, steering, etc) and that can be done either by providing a set of concrete classes or else through a hierarchy of specification files in JSON format.  For example, the classes for the CityBus modeled the first way are in: https://github.com/projectchrono/chrono/tree/main/src/chrono_models/vehicle/citybus, while the corresponding JSON files (for the same vehicle modeled the second way) are in: https://github.com/projectchrono/chrono/tree/main/data/vehicle/citybus.  The concrete vehicle models distributed with Chrono (first method above) are all implemented in C++ and they can only be used as they are from PyChrono.  A vehicle specified through JSON files can also be created in Python (see demo_VEH_WheeledJSON.py).

 

Having said that, some of the modifications to the vehicle model you want to make on the fly do not make much sense. Data for a vehicle model (at the level of fidelity of the Chrono::Vehicle models) must be consistent. For example, one doesn’t just change the track width – that is a result of how various hardpoints used to specify the suspension are provided.  Others (such as the COG of the chassis subsystem) are meaningful to change during a simulation (unfortunately, that is currently not exposed for easy modification through a user-callable function – I’ll look into providing some of this functionality).

 

To make a long story short, vehicle models are assumed to be more or less “constant” and representing a meaningful vehicle system, specified through a consistent data set.  Most of the parameters cannot be arbitrarily changed, else you end up with an incorrect model.  But if you still want to try some of these things, one approach is to use a vehicle model specified through JSON files, modify one or more of these files, and then recreate the vehicle model with the new JSON specification.  Look in https://github.com/projectchrono/chrono/tree/main/src/demos/vehicle/visualization for examples of reloading a vehicle model from (potentially modified) JSON files at run-time.  There are two versions of that demo program there, one using the Chrono::OpenGL run-time visualization module, the other using the Chrono::VSG module.  Note however, that neither Chrono::OpenGL nor Chrono::VSG are currently exposed to Python.

 

Regarding your question about tire models:  you do not have to create a “tire model”, but you may have to specify the parameters in an existing Chrono tire model to represent the tire on the particular vehicle you are interested in. There are several tire models available in Chrono::Vehicle (see the links above and look in the source tree).  Some of the Chrono models encoded in concrete C++ classes come with a few concrete tire implementations which you can select during construction.  Look through the various demos in Chrono.

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/a6a946d1-b823-4fea-bcd4-0b2098c807efn%40googlegroups.com.

Michael

unread,
Apr 20, 2023, 10:19:12 AM4/20/23
to ProjectChrono
Hi Radu,

Since I only have a limited amount of time to complete this model, my plan is to first create a steady-state model which does not take into account any suspension considerations initially and then potentially build up to a quasi-steady and potentially a transient model that takes into account suspension considerations. The plan for this lap time simulator would be used for comparison of vehicle parameters and how changing each of these effects the vehicles performance. For example, simulations could be ran with a number of different track widths and COGs to see the effects of changing these parameters. 

I do not plan on initially using the lap simulator to be able to model the forces in each of the chassis hardpoints or in any of the control arms/tie rods, the whole purpose of the lap simulator would be to compare how changing different parameters on the car change the lap time. Using the change in lap time from the different variables it can be determined what kind of vehicle setup (track width, wheel base, COG, etc.) would comparatively create a vehicle that is optimal to any other potential vehicle set-up. 

Thank you,
Michael

Reply all
Reply to author
Forward
0 new messages