state equations from Chrono

75 views
Skip to first unread message

Yasonandan Vadlamudi

unread,
Nov 2, 2023, 10:42:22 AM11/2/23
to ProjectChrono
Hello I am trying to build an external MPC using the pychrono vehicle model, but for MPC to estimate states(x,y,yaw) using the control inputs (steer,brake,throttle) we need the  coefficient Matrixes of states and control inputs , is there a way to get these coefficients? 

ex:  x(k+1) = A * x(k) + B* u(k)

I know Chrono uses template based dynamic models and it depends on the tires, powertrain, chassis etc.. that are used.

but is there a way I can get these state coefficients for the vehicle that I am using?

Thanks and Regards,
Yaso

HUZAIFA MUSTAFA UNJHAWALA

unread,
Nov 2, 2023, 1:25:10 PM11/2/23
to ProjectChrono
Hello Yaso,

It might not be the best to use a PyChrono vehicle as the vehicle model inside a MPC controller. Why this is not the best of ideas is exactly for reasons like this, it is difficult to linearize all the states of a PyChrono vehicle model to get the Jacobian matrices A and B. A PyChrono model can very well be used to simulate a vehicle running an MPC controller which uses another vehicle model whose Jacobian matrices you can compute easily (either analytically, through finite differences or through automatic differentiation). This distinction is confusing - there are 2 vehicle models at play here, (1) The PyChrono vehicle model which is the actual vehicle on which your MPC controller is running, (2) The faster and leaner vehicle model that your MPC controller needs to provide control commands.
For the model inside the MPC controller, it is useful to have lower fidelity models, such as bicycle models, 8 DOF models, 14 DOF models etc. A library of such models is under development here - https://github.com/uwsbel/low-fidelity-dynamic-models/tree/main/wheeled_vehicle_models/18dof. These are fast and accurate models, that provide matrices A and B through finite differences. We also did a sim2real experiment on this  which is described in this paper (currently under review) here - https://arxiv.org/pdf/2309.09870.pdf

Best
Huzaifa
Reply all
Reply to author
Forward
0 new messages