rec.autos.simulators

Car physics: force feedback prediction

Ruud van Ga

Car physics: force feedback prediction

by Ruud van Ga » Thu, 31 Oct 2002 20:51:32

Hi all,

As you might know, GPL uses some FF prediction time (I believe it
defaults at 0.018) to make up for the fact that most FF devices have a
bit of latency that is noticable.

I'm trying to think of ways to get something similar. Mainly because
hopefully this year I'll connect Racer to a high-end steering wheel
(one which is powerful enough to rip your arm off, hehe) and I think
this will be one of the bigger problems.

I believe most racing games have had to deal with this; small back &
forth motions once you pull the wheel a little and then let it go. It
may spring back & forth when the actual force is not in sync with the
simulation itself.

The only thing I could come up with sofar is a prediction based on the
derivate of Mz (aligning moment). So:
- keep last_Mz
- calculate new Mz
- Mz'=(last_Mz-Mz)/dt
- predict FF as: Mz_wheel=Mz+Mz'*prediction_time

In other words, from the last Mz change you predict ahead (with a
user-configurable 'prediction_time') where Mz is going to be once it
actually reaches the wheel.

I don't know how GPL does it; you might think of really putting the
car ahead of time and calculating its tire forces there, giving a
future Mz, and then retreating the car back to the realtime position,
but that seems very costly.

Anybody have any cunning ideas? :)

Ruud van Gaal
Free car sim: http://www.racesimcentral.net/
Pencil art  : http://www.racesimcentral.net/

Ashley McConnel

Car physics: force feedback prediction

by Ashley McConnel » Fri, 01 Nov 2002 03:31:29

That's how i'd do it, but I havent really thought about it yet :)

Give it a go you have nearly written it already :P

All the best,
Ash

Doug Millike

Car physics: force feedback prediction

by Doug Millike » Fri, 01 Nov 2002 06:30:46


> As you might know, GPL uses some FF prediction time (I believe it
> defaults at 0.018) to make up for the fact that most FF devices have a
> bit of latency that is noticable.

> I'm trying to think of ways to get something similar. Mainly because
> hopefully this year I'll connect Racer to a high-end steering wheel
> (one which is powerful enough to rip your arm off, hehe) and I think
> this will be one of the bigger problems.

If it's really "high-end", then the wheel should not interface through some
slow-as-molasses API...  Hook it to a cheap & fast bi-directional parallel
port or something else with essentially no latency (<< 1 msec.)

IMHO, the right solution (from Hard Drivin' & Race Drivin') is to integrate
the FF servo-control (PID loop?) into the vehicle model.  Then the FF
device is fully under your control.  After all, that is where the steering
is in a real car...

Yes this will be a pita, but the results are so much better than any
"consumer" FF wheel that I've tried, that you owe it to yourself to try it
once this way.

-- Doug Milliken
   www.millikenresearch.com/olleyfl.html  <-- review of new book

Tom De Mue

Car physics: force feedback prediction

by Tom De Mue » Fri, 01 Nov 2002 07:31:26


Hi,

Well, you are actual trying to predict a timeseries: so you may use a Neural
Network, to try something fancy ;-), just an idea...  This shouldn't be too
costly if you're not training it constantly.

Cheers,
Tom

Ruud van Ga

Car physics: force feedback prediction

by Ruud van Ga » Fri, 01 Nov 2002 20:27:53



>> As you might know, GPL uses some FF prediction time (I believe it
>> defaults at 0.018) to make up for the fact that most FF devices have a
>> bit of latency that is noticable.

>> I'm trying to think of ways to get something similar. Mainly because
>> hopefully this year I'll connect Racer to a high-end steering wheel
>> (one which is powerful enough to rip your arm off, hehe) and I think
>> this will be one of the bigger problems.

>If it's really "high-end", then the wheel should not interface through some
>slow-as-molasses API...  Hook it to a cheap & fast bi-directional parallel
>port or something else with essentially no latency (<< 1 msec.)

There were 2 options; UDP or an analog PC board (which outputs an
analog signal). We're currently going for UDP (ethernet) at hopefully
100Mbit for latency. I hope the Windows drivers don't collect too much
data before sending.
The PC board option is still there but is harder to test, and high-end
flight sims use a lot of UDP as well; although from what I've seen
there the host doing the flying only sends out aero information, and
the cabling simulation is done on a separate computer (which hooks on
to the 'controls', in the flight case a stick, not a wheel).

So that involves UDP as well, and is indeed really high-end.
We'll see what happens. :)

What's a PID loop?

Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art  : http://www.marketgraph.nl/gallery/

Stefano Casil

Car physics: force feedback prediction

by Stefano Casil » Fri, 01 Nov 2002 21:08:31


It would be interesting to have some REAL figures about how much
latency a standard controller has.

If we talk about 0.018 seconds...hmmm... that cannot be a real
problem.. if we get into 0.1 seconds it will become a problem, in both
ways, u'll feel it on the wheel and it will be very difficult to
predict.

I tell you what...
I pass... I'll stick in real time blaming wheels makers for their poor
response time ;-)..

Stefano Casillo
driving.multiplayer.it/netkar

Ruud van Ga

Car physics: force feedback prediction

by Ruud van Ga » Sat, 02 Nov 2002 02:01:44




...
>> The only thing I could come up with sofar is a prediction based on the
>> derivate of Mz (aligning moment). So:
>> - keep last_Mz
>> - calculate new Mz
>> - Mz'=(last_Mz-Mz)/dt
>> - predict FF as: Mz_wheel=Mz+Mz'*prediction_time
...
>It would be interesting to have some REAL figures about how much
>latency a standard controller has.

>If we talk about 0.018 seconds...hmmm... that cannot be a real
>problem..

Hm, it was 0.085; I just checked. In seconds. So close to 0.1 s. The
default setting from Sierra.

Problem is, even regularly, that for stiff cars the wheel might
oscillate by itself when not damped by the driver. Try a F1-type car,
drive a bit fast, then pull the wheel one side and let go. Chances are
it will go and oscillate.

Good choice. :)

Might be USB drivers which are slow, or the wheels themselves. Anyway,
once you get to high-end wheels (and high-end companies/products) it
might be something that needs more than just a big bunch of damping.
;-)

Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art  : http://www.marketgraph.nl/gallery/

Doug Millike

Car physics: force feedback prediction

by Doug Millike » Sat, 02 Nov 2002 02:30:26



> >If it's really "high-end", then the wheel should not interface through some
> >slow-as-molasses API...  Hook it to a cheap & fast bi-directional parallel
> >port or something else with essentially no latency (<< 1 msec.)
> There were 2 options; UDP or an analog PC board (which outputs an
> analog signal). We're currently going for UDP (ethernet) at hopefully
> 100Mbit for latency. I hope the Windows drivers don't collect too much
> data before sending.

100Mbit Ethernet might be good, as long as you never have any heavy network
traffic.  Yes, the analog PC board is another good way to do it, but much
more expensive.

Someone else suggested that latency of 0.018 seconds should not be a
problem, but I disagree.  It typically requires a factor of 10 in servo
loops to really get good control over the next stage (much worse than the
"times-two" factor suggested by theory -- Nyquist Rule).  Kind of like
this:

  Performance of human driver -- 2-5Hz
    Senna was recorded at 5Hz back when he drove for Lotus F1
  Electro-mechanical steering wheel needs x 10 = 20-50 Hz response
    to be acceptable to the driver
  Digital control of analog steering wheel motor x 10 = 200-500 Hz updates,
    this dictates the minimum speed of the physics model

I'd be happy if anyone with a real control theory background would
jump in at this point...

Proportional-Integral-Derivative -- common type of servo feedback
controller, different gains set on each of the three terms.  I don't
actually remember what kind of controller was used in Hard Drivin'.

-- Doug Milliken
   www.millikenresearch.com

Carl Ribbegaard

Car physics: force feedback prediction

by Carl Ribbegaard » Sat, 02 Nov 2002 06:57:50




> > >If it's really "high-end", then the wheel should not interface through
some
> > >slow-as-molasses API...  Hook it to a cheap & fast bi-directional
parallel
> > >port or something else with essentially no latency (<< 1 msec.)

> > There were 2 options; UDP or an analog PC board (which outputs an
> > analog signal). We're currently going for UDP (ethernet) at hopefully
> > 100Mbit for latency. I hope the Windows drivers don't collect too much
> > data before sending.

> 100Mbit Ethernet might be good, as long as you never have any heavy
network
> traffic.  Yes, the analog PC board is another good way to do it, but much
> more expensive.

If it's just a connection between 2 PC's a crossed TP cable would be a nice
choice.
That way there would definitely be bandwidth enough.
Just fill the PC up with NIC's ;-)

rec.autos.simulators is a usenet newsgroup formed in December, 1993. As this group was always unmoderated there may be some spam or off topic articles included. Some links do point back to racesimcentral.net as we could not validate the original address. Please report any pages that you believe warrant deletion from this archive (include the link in your email). RaceSimCentral.net is in no way responsible and does not endorse any of the content herein.