Menu

#743 G/command graph goes wild when car is stopped

2.1.0
closed
Kristof
None
defect
trivial
User interface
2.1.0-dev
fixed
2022-01-26
2012-08-16
beaglejoe
No

Stop the car in the middle of the track. Select neutral gear.

The G/command graph jumps around wildly.

Related

Wiki: SimuV4TaskList

Discussion

  • simon wood

    simon wood - 2012-09-05

    Presumably the change between low speed forward/back is cause some significant accelerations.... can these just be zero'ed out if the speed is less than a particular threshold?

    Displayed in grboards.cpp line 299
    --

    const tdble X2 = -car->_DynGC.acc.y / 9.81f * 25.0f + X1;
    const tdble Y2 = car->_DynGC.acc.x / 9.81f * 25.0f + Y1;

    --

    Set in 'src/modules/simu/simuv2.1/car.cpp' line 231
    --

    / compute accelerations /
    car->DynGC.acc.x = F.F.x * minv;
    car->DynGC.acc.y = F.F.y * minv;
    car->DynGC.acc.z = F.F.z * minv;

    car->DynGCg.acc.x = (F.F.x * Cosz - F.F.y * Sinz - Rx) * minv;
    car->DynGCg.acc.y = (F.F.x * Sinz + F.F.y * Cosz - Ry) * minv;
    car->DynGCg.acc.z = car->DynGC.acc.z;

    car->DynGCg.acc.ax = car->DynGC.acc.ax = F.M.x * car->Iinv.x;
    car->DynGCg.acc.ay = car->DynGC.acc.ay = F.M.y * car->Iinv.y;
    car->DynGCg.acc.az = car->DynGC.acc.az = (F.M.z - Rm) * car->Iinv.z;

    --

     
  • simon wood

    simon wood - 2012-09-06

    Seems that the problem is in the differential, inTq0 and inTq1 jump about wildly when in neutral
    --
    Torques 202.608337 1580.898071
    Torques 1495.782471 231.032471
    Torques -255.815903 -1608.517212
    Torques -1558.411621 -271.059723
    Torques 128.005768 1457.754028
    Torques 1376.248657 59.521385
    Torques -225.099197 -1492.971313
    Torques -1472.312500 -96.994469
    Torques 110.580002 1349.337524
    Torques 774.282532 -12.511423
    --

    When these are forced to 0 the wheels stop twitching (and obviously you can't drive).

    For RWD I can actually see where these are set during simulation (they change so they must be set somewhere....)

     
  • simon wood

    simon wood - 2012-09-06

    Meant to say "can't see"... found where the 'link' is, differential->inAxis[0]->Tq == wheel->feedBack.Tq (via a pointer set in transmission.cpp)

    There seems to be an oscillation within the differential, when the car is standing a slight feedback tq cause the wheel to twitch.

     
  • Kristof

    Kristof - 2012-09-06
    • owner changed from somebody to kakukri
    • status changed from new to assigned

    Good catch, I will look at it.

     
  • simon wood

    simon wood - 2012-09-06

    Great... that 'circular' math was making my head spin :-(

    I should also note that whilst inTq is clamped to 0 the G-graph still moves, but I think once we solve the wheel twitch it will prevent the accelerations.

     
  • simon wood

    simon wood - 2012-09-26

    bump.... any progress on this?

     
  • Kristof

    Kristof - 2012-09-27

    Still thinking, I had to realise differentials can be quite tricky.

     
  • Kristof

    Kristof - 2012-10-05

    Progress report:

    the torque is actually set in wheel.cpp L268.

    I think now the problem is not in the differential code, but in the tyre friction model. First, the slip variables diverge at low speed. They are cut to 0, but then at 0 there is no friction force. So the wheel start to rotate in one direction, than the friction force changes direction, the wheel goes back, and this numerical oscillation continues. So this is basically a duplicate of #177, likely the cause of #199 and the sideways sliding on banking (#620).

    This can be solved if tires have some stationary friction when they are not moving, or moving very slowly. The tricky thing is that this force should be the exact opposite of the sum of other forces, while this is smaller than a limit value. I am now looking for ways how to do this.

     
  • simon wood

    simon wood - 2012-10-05

    From the Boxer96
    --
    <section name="Front Right Wheel">
    ...

    <attnum name="dynamic friction" unit="%" val="50"/>
    <attnum name="rolling resistance" val="0.02"/>
    <attnum name="mu" val="1.3"/>

    </section>

    --

    http://ffden-2.phys.uaf.edu/211_fall2002.web.dir/ben_townsend/staticandkineticfriction.htm

     
  • Kristof

    Kristof - 2013-03-16

    First step of the solution was added in r5326. It prevents the divergence of tangential slip at low speed, and adds a simulation of sticking force when car speed is less than 0.1 m/s, to prevent:
    - sliding sideways,
    - having a low amount of yaw when stationary.

    The wheel can still rotate freely, next step is to stop this when stationary.

     

    Related

    Commit: [r5326]

  • Kristof

    Kristof - 2013-03-18
    • status changed from assigned to closed
    • resolution set to fixed

    After a lot of debugging and thinking I think it is fixed now in r5330. To prevent wheel angular velocity oscillating around the wheel tangential velocity / radius value, it is artificially set to exactly that value whenever it wants to cross it, unless the car is braking. Besides, some sticking was added to help exactly zero the car speed when it is about to stop, and low speed slip variable is calculated consistently with the normal speed slip value.

    All of these changes are conditional, set "fixed low speed grip" to "yes" in the "Features" section. For humans it is set this way by default in car.xml.

    Please test it, although I have tried my best in testing it under some rare circumstances it might cause weird behavior of the car.

     

    Related

    Commit: [r5330]

  • rvlander

    rvlander - 2013-03-18

    If I stop the car on the road, and I try to start again, I hardly can. I can't throttle for about 10 seconds or more and then it just come back all at once.

     
  • beaglejoe

    beaglejoe - 2013-03-19

    Nice work. Did a little testing on Windows, seems OK.
    I did not have any throttle troubles. I am using mouse button for throttle (maybe a clue)

     
  • Kristof

    Kristof - 2013-03-19

    Hello rvlander, can you please specify the track and car combo you experienced this problem with?

     
  • rvlander

    rvlander - 2013-03-19

    The problem seems to happen with Archer R-9 (LS-GT1) on all tracks (ex. milky-five).

     
  • Kristof

    Kristof - 2013-03-20
    • status changed from closed to reopened
    • resolution fixed deleted

    Thanks, I can see it, r5335 helps to reduce time needed for speeding up, but I still feel it starts a bit slower. I will further debug it.

     

    Related

    Commit: [r5335]

  • Kristof

    Kristof - 2013-04-03

    Hopefully r5391 fixes this bug, definitely helps, but needs further testing.

     

    Related

    Commit: [r5391]

  • Kristof

    Kristof - 2013-04-14
    • status changed from reopened to closed
    • resolution set to fixed

    I have not experienced the starting problem since r5391, so close this ticket now. Please reopen if still experience it or other problems.

     

    Related

    Commit: [r5391]

  • beaglejoe

    beaglejoe - 2022-01-26
    • Description has changed:

    Diff:

    
    
    • Milestone: to be defined --> 2.1.0
     

Log in to post a comment.