The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: scheurneus | Created: 2013-07-22 14:54:46
Subject: Bug?
Hello,

I was setting up Scheurline and then I encountered the car floating up, up, up and go on that way. This is my XML file, source of scheurline NOT updated:

<?xml version="1.0" encoding="UTF-8"?>
<!--
file : viper-gts-r.xml
created : Sat Mar 3 18:46:37 CET 2001
copyright : (C) 2001 by Eric Espi&#38944;
email : Eric.Espie@torcs.org
version : $Id: e-track-1.xml,v 1.8 2003/08/23 01:03:31 berniw Exp $
-->

<!-- This program is free software; you can redistribute it and/or modify -->
<!-- it under the terms of the GNU General Public License as published by -->
<!-- the Free Software Foundation; either version 2 of the License, or -->
<!-- (at your option) any later version. -->

<!DOCTYPE params SYSTEM "../../../../src/libs/tgf/params.dtd">

<params name="car4-trb1" type="template">

<section name="Front Wing">
<attnum name="angle" unit="deg" min="0" max="12" val="12"/>
</section>

<section name="Rear Wing">
<attnum name="angle" unit="deg" min="0" max="17" val="5"/>
</section>

<section name="Gearbox">
<section name="gears">
<section name="r">
<attnum name="ratio" min="-3" max="0" val="-2.0"/>
</section>
<section name="1">
<attnum name="ratio" min="0" max="5" val="5"/>
</section>
<section name="2">
<attnum name="ratio" min="0" max="5" val="3.5"/>
</section>
<section name="3">
<attnum name="ratio" min="0" max="5" val="2.25"/>
</section>
<section name="4">
<attnum name="ratio" min="0" max="5" val="1.75"/>
</section>
<section name="5">
<attnum name="ratio" min="0" max="5" val="1.25"/>
</section>
<section name="6">
<attnum name="ratio" min="0" max="5" val="1"/>
</section>
</section>
</section>

<section name="Brake System">
<attnum name="front-rear brake repartition" min="0.3" max="0.7" val="0.40"/>
<attnum name="max pressure" unit="kPa" min="5000" max="40000" val="40000"/>
</section>

<section name="Front Anti-Roll Bar">
<attnum name="spring" unit="lbs/in" min="0" max="5000" val="0"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="1" max="5" val="2.5"/>
</section>

<section name="Rear Anti-Roll Bar">
<attnum name="spring" unit="lbs/in" min="0" max="5000" val="1500"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="1" max="5" val="2.5"/>
</section>

<section name="Front Right Wheel">
<attnum name="ride height" unit="mm" min="70" max="100" val="70"/>
<attnum name="toe" unit="deg" min="-5" max="5" val="0"/>
<attnum name="camber" min="-5" max="0" unit="deg" val="-5"/>
</section>

<section name="Front Left Wheel">
<attnum name="ride height" unit="mm" min="70" max="100" val="70"/>
<attnum name="toe" unit="deg" min="-5" max="5" val="0"/>
<attnum name="camber" min="-5" max="0" unit="deg" val="-5"/>
</section>

<section name="Rear Right Wheel">
<attnum name="ride height" unit="mm" min="70" max="100" val="70"/>
<attnum name="toe" unit="deg" min="-5" max="5" val="0"/>
<attnum name="camber" min="-5" max="0" unit="deg" val="-5"/>
</section>

<section name="Rear Left Wheel">
<attnum name="ride height" unit="mm" min="70" max="100" val="70"/>
<attnum name="toe" unit="deg" min="-5" max="5" val="0"/>
<attnum name="camber" min="-5" max="0" unit="deg" val="-5"/>
</section>

<section name="Front Right Suspension">
<attnum name="spring" unit="lbs/in" min="0" max="10000" val="5000"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="0.1" max="5" val="3"/>
<attnum name="packers" unit="mm" min="0" max="10" val="0"/>
<attnum name="slow bump" unit="lbs/in/s" min="0" max="1000" val="280"/>
<attnum name="slow rebound" unit="lbs/in/s" min="0" max="1000" val="340"/>
<attnum name="fast bump" unit="lbs/in/s" min="0" max="1000" val="40"/>
<attnum name="fast rebound" unit="lbs/in/s" min="0" max="1000" val="50"/>
</section>

<section name="Front Left Suspension">
<attnum name="spring" unit="lbs/in" min="0" max="10000" val="5000"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="0.1" max="5" val="3"/>
<attnum name="packers" unit="mm" min="0" max="10" val="0"/>
<attnum name="slow bump" unit="lbs/in/s" min="0" max="1000" val="280"/>
<attnum name="slow rebound" unit="lbs/in/s" min="0" max="1000" val="340"/>
<attnum name="fast bump" unit="lbs/in/s" min="0" max="1000" val="40"/>
<attnum name="fast rebound" unit="lbs/in/s" min="0" max="1000" val="50"/>
</section>

<section name="Rear Right Suspension">
<attnum name="spring" unit="lbs/in" min="0" max="10000" val="6000"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="0.1" max="5" val="3"/>
<attnum name="packers" unit="mm" min="0" max="10" val="0"/>
<attnum name="slow bump" unit="lbs/in/s" min="0" max="1000" val="280"/>
<attnum name="slow rebound" unit="lbs/in/s" min="0" max="1000" val="340"/>
<attnum name="fast bump" unit="lbs/in/s" min="0" max="1000" val="40"/>
<attnum name="fast rebound" unit="lbs/in/s" min="0" max="1000" val="50"/>
</section>

<section name="Rear Left Suspension">
<attnum name="spring" unit="lbs/in" min="0" max="10000" val="6000"/>
<attnum name="suspension course" unit="m" min="0" max="0.2" val="0.2"/>
<attnum name="bellcrank" min="0.1" max="5" val="3"/>
<attnum name="packers" unit="mm" min="0" max="10" val="0"/>
<attnum name="slow bump" unit="lbs/in/s" min="0" max="1000" val="280"/>
<attnum name="slow rebound" unit="lbs/in/s" min="0" max="1000" val="340"/>
<attnum name="fast bump" unit="lbs/in/s" min="0" max="1000" val="40"/>
<attnum name="fast rebound" unit="lbs/in/s" min="0" max="1000" val="50"/>
</section>

<section name="private">
<!-- CornerSpeed - increase to make car corner quicker -->
<attnum name="CornerSpeed" val="20"/>

<!-- CornerAccel - increase to accelerate more out of corners -->
<!-- it multiplies CornerSpeed, so be careful -->
<attnum name="CornerAccel" val="1.5"/>

<!-- BrakeDelay - increase to brake later -->
<attnum name="BrakeDelay" val="25"/>

<!-- AvoidSpeedAdjust - increase or decrease avoidance speed -->
<!-- relative to CornerSpeed -->
<attnum name="AvoidSpeedAdjust" val="-3"/>

<!-- ExtMargin - decrease to get closer to track's edge on -->
<!-- the approaches to & exits from corners -->
<attnum name="ExtMargin" val="3"/>

<!-- IntMargin - decrease to cut closer to the corner apex -->
<attnum name="IntMargin" val="-0.025"/>

<!-- PitOffset - adjusts cars entry point into the pit lane -->
<!-- positive to make it closer to pits, negative -->
<!-- to make it start turning in further away -->
<attnum name="PitOffset" val="0.0"/>
</section>

</params>

Quinten
Last Edited: 2013-07-22 14:54:46 by scheurneus
    Author: berniw | Created: 2013-07-22 15:28:22
    Subject: Re: Bug?
    Up? You mean into the air? I am just guessing now, let me know if this helps: Currently your ride height is 70mm, the bellcrank is 3 and the suspension course is just 200mm, which is smaller than 70*3 -> 210. So the system is initialized eventually in a "weird" state, see susp.cpp, wheel.cpp.

    I ran in the past as well such setups, but the cars did not fly off, the suspension could just not extend (I mention this as well in the car creation tutorial video part 5), maybe there is a little bit of force remaining (from the wheels vertical acceleration/deceleration) because your spring is over the bellcrank equivalent to 15000/18000, which is pretty hard (never tried this by myself, IIRC I tested bellcrank up to 5 but just with spring values around 300-2000).

    I will give it a try myself when I find the time, so I recommend you to increase the suspension course (if allowed) or to set bellcrank lower (maybe 3*200/(210+1)) does already the trick). Have a look at the console if TORCS accepts your values.

    Bernhard
    Last Edited: 2013-07-22 15:38:01 by berniw
    Author: berniw | Created: 2013-07-22 15:50:17
    Subject: Re: Bug?
    Quickly had a look into the code over web CVS access, and I think the above guess could be right. I spotted an "inconsistency" though, while the spring is scaled with the bellcrank, the damper velocity is not on a first glimpse (maybe I am wrong, I will have a closer look later), but ordinary constructions would scale both (spring/damper mounted on the same piston).

    So if you increase the bellcrank you might want to increase the damping as well with the current implementation.

    Bernhard
    Last Edited: 2013-07-22 15:50:17 by berniw
      Author: scheurneus | Created: 2013-07-22 16:50:11
      Subject: Re: Bug?
      Well, just try it! With the current source codes of scheurline ;)

      Quinten
      Last Edited: 2013-07-22 16:50:11 by scheurneus
      Author: scheurneus | Created: 2013-07-22 16:54:35
      Subject: Re: Bug?
      Reduced bellcrank of all suspensions to 2.5, still strange...
      Last Edited: 2013-07-22 16:54:35 by scheurneus
    Author: wdbee | Created: 2013-07-22 17:02:43
    Subject: Re: Bug?
    Hello Quinten,

    this is well known here, we called it "the force".

    As it (the bellcrank * spring > limit) was only at one axle, the car went up on this axle only and drove at two wheels. You will find a lot of posts here about "the force". It happened not at start but while race ;-).

    Cheers

    Wolf-Dieter

    Last Edited: 2013-07-22 17:02:43 by wdbee
    Author: berniw | Created: 2013-08-03 16:19:41
    Subject: Re: Bug?
    Ok, I had a look into this, I guess the main problem is in wheel.cpp, around line 167. In the else path the force is set to zero, so if the suspension heavily oscillates on the boundary the force is biased to the upper direction.

    Because this happens just on extreme setups I will do nothing instantly, but maybe I will apply the following change for 1.3.5 (I need to test it though, it is always delicate).

    Because the wheel is mechanically limited the stopping is fine, BUT on the stop the wheel should transfer its impulse to the car body, I might try that, so instead of forces.z = 0; I will try to do something like:
    v = v0 + a*t, with v = 0 -> v0 = -a*t -> a = -v0/t
    F = m*a, so
    wheel->forces.z = -wheel->rel_vel/SimDeltaTime*wheel->mass

    I am not sure if this will work, but I will give it a try.

    Best regards, thank you for the reminder

    Bernhard
    Last Edited: 2013-08-03 16:35:49 by berniw
    Author: berniw | Created: 2013-08-04 13:34:45
    Subject: Change in CVS, please review
    Hi all

    I changed the wheel forces calculation a bit, I would be happy if you
    review and test the changes. Changelog:
    - Fixed car flying off with extreme suspension settings, see
    http://www.berniw.org/trb/forum/showthread.php?topicid=3640.
    - Fixed applied force when wheel has lost touch with the ground but
    suspension is not fully extended.

    http://torcs.cvs.sourceforge.net/viewvc/torcs/torcs/torcs/src/modules/simu/simuv2/wheel.cpp?r1=1.26.2.1&r2=1.26.2.2&pathrev=r1-3-1
    http://torcs.cvs.sourceforge.net/viewvc/torcs/torcs/torcs/src/modules/simu/simuv2/wheel.h?r1=1.7&r2=1.7.2.1&pathrev=r1-3-1

    Best regards

    Bernhard
    Last Edited: 2013-08-04 13:34:45 by berniw