How to modify speed

68 views
Skip to first unread message

ji li

unread,
Nov 8, 2022, 2:19:04 AM11/8/22
to ProjectChrono
Hello,
      When I tested this project recently, I found that the speed of the Sedan could not be modified. I want to know how to modify the speed.

Radu Serban

unread,
Nov 8, 2022, 2:36:39 AM11/8/22
to ProjectChrono

I am not quite sure I understand your question.  In general, the speed of a Chrono vehicle cannot be set directly. Instead, you accelerate / decelerate a vehicle through its throttle and braking inputs.  How you do this depends on what ‘driver’ model you use.

 

If you are talking about demo_VEH_Sedan in particular, that one uses a ‘driver’ model which expects keyboard user inputs.  You control the vehicle with the AWSD keys.

 

--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/045130e8-9383-4413-a244-665342bc50b4n%40googlegroups.com.

ji li

unread,
Nov 8, 2022, 3:46:54 AM11/8/22
to ProjectChrono
Hi Radu,
Thank you for your reply

        I want to say,   when initializing the car, can I give the  Sedan a speed and let it run at this speed?

Radu Serban

unread,
Nov 8, 2022, 3:56:36 AM11/8/22
to ProjectChrono

There is a function Sedan::SetInitialFwdVel which would allow you to impose an initial velocity on the chassis body (in its forward X direction).  You may also want to impose consistent wheel angular velocities (using Sedan::SetInitWheelAngVel).  The velocities of all bodies in the vehicle system will be inconsistent at the initial time, but that should be resolved after the first simulation step.  However, with a proper powertrain and driveline, the vehicle will not maintain this initial speed and should slowly decelerate.

 

If you want to force the vehicle to move in a straight line with constant speed, you should use lateral and longitudinal controllers to adjust the vehicle inputs (steering, throttle, and braking) accordingly.  Look at any demos using such PID-controller based driver model, for example the combined ChPathFollowerDriver as used in demo_VEH_SteeringController.

ji li

unread,
Nov 8, 2022, 4:10:50 AM11/8/22
to ProjectChrono
Oh, I see,  have a try .Thank you very  much
Reply all
Reply to author
Forward
0 new messages