rec.autos.simulators

My sim: differentials

Alex Smit

My sim: differentials

by Alex Smit » Tue, 13 Aug 2002 05:05:22

I'm attempting to get some sort of differential model into my game

Initially I am just trying to implement a completely open one for
simplicity.

I have an input A and outputs B1 and B2

I am simply applying torque to A from the gearbox
B1 and B2 are currently A * differential Ratio

However the difficulties start when I want some feedback from the road to
travel
from the wheels through the differential into the engine.

I'm assuming the road reaction torque to be the resistive torque
so

torqueAtDiffB1/2 = resistiveForceWheel * radiusWheel
torqueAtDiffA - = torqueAtDiffB1/2/drivelineInertia

But this does not work in any way. So I must have the wrong end of the
stick, or
maybe not even a stick, but a twig (erm :)

Does anyone know any decent articles for this? At the mo i'm doing it
completely
using my own newtonian physics knowledge, which isn't very much.

J. Todd Wass

My sim: differentials

by J. Todd Wass » Tue, 13 Aug 2002 14:36:06

Sorry for the long links :-)

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3ab2075e.3...
533%40news.xs4all.nl&rnum=1&prev=/groups%3Fq%3D%2522car%2Bphysics%2522%2B%
252Bdifferentials%2Bgroup:rec.autos.simulators%26hl%3Den%26lr%3D%26ie%3DUT
F-8%26selm%3D3ab2075e.354986533%2540news.xs4all.nl%26rnum%3D1

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3ab2075e.3...
533%40news.xs4all.nl&rnum=1&prev=/groups%3Fq%3D%2522car%2Bphysics%2522%2B%
252Bdifferentials%2Bgroup:rec.autos.simulators%26hl%3Den%26lr%3D%26ie%3DUT
F-8%26selm%3D3ab2075e.354986533%2540news.xs4all.nl%26rnum%3D1

Todd Wasson
---
Performance Simulations
Drag Racing and Top Speed Prediction
Software
http://PerformanceSimulations.Com

My little car sim screenshots:
http://performancesimulations.com/scnshot4.htm

Alex Smit

My sim: differentials

by Alex Smit » Tue, 13 Aug 2002 18:05:47

I took a look and I think they are the same ones on the Racer usenet
discussion page. Problem is Ruud starts that thread at a more advanced stage
than I am at :( . So I've changed my goals for now.

Initially I am trying to get reaction from the wheels straight to the
engine, ignoring the differential, because currently I am simply taking the
rpm from the avg angV of the driven wheels. So now I want to have the wheel
reaction go through the gearbox to the engine.

But either
a) Ruud has done more than just FX * r and put it back into the engine for
the wheels, and I am missing it, or,
b) I have implemented it completely wrongly

Also, while I'm on the topic, another problem

I am assigning the car an angV variable which is increased by angA/inertia.
All good so far. But when I change gear, there is no -ve torque to reduce
the rpms so say I change from 1st to 2nd, the rpm doesn't jump from 6000 to
3000, it just keeps getting bigger. Where does this -ve torque come from?
Engine friction (although engine friction is overcome when accelerating, in
my model) ?

Jonny Hodgso

My sim: differentials

by Jonny Hodgso » Wed, 14 Aug 2002 04:27:13

[re-ordered and snipped for my convenience ;-) ]

You need some wind-up, with possibly a torque-limiting clutch to
prevent the transients from causing *** 'shuffle'.

Put a propshaft model between the engine and gearbox (or 'box
and axle), which takes the engine speed and the output speed
and integrates the difference to give a wind-up angle.  Use a
stiffness value to multiply this wind-up, and feed the resulting
torque both forwards to the drivetrain and back to the engine.

If the car starts to pogo backwards and forwards on gearshifts,
limit the wind-up value to give a maximum torque of, say,
1.5 x max engine torque.

Hard to tell now how far you've got...  How far have you got
since reading the fora?  How much do you understand about
differentials?

HTH,
Jonny

Ruud van Ga

My sim: differentials

by Ruud van Ga » Wed, 14 Aug 2002 20:24:07

On Sun, 11 Aug 2002 20:05:22 +0000 (UTC), "Alex Smith"


>I'm attempting to get some sort of differential model into my game

>Initially I am just trying to implement a completely open one for
>simplicity.

>I have an input A and outputs B1 and B2

>I am simply applying torque to A from the gearbox
>B1 and B2 are currently A * differential Ratio

Actually, according to RCVD, B1 and B2 are both T_A*diffRatio/2.
Take a look at www.howstuffworks.com and its differential animation.
You'll see the ring gear and side gears rotate, and although it's not
really intuitive to me, you might be able to understand from that that
the torque is not passed on just like that.

Inertia is used to calculate acceleration, not torque ratios. And
also, I don't see the diffRatio coming back here.

Diff articles are few. You'll find some links on my site
(www.racer.nl). However, these generally don't relate to direct
formulae that easily. For example, my open diff uses a cunning
Lagrange-derived closed set of formulae to solve a system, courtesy
Gregor Veble.

Problem is the brakes really; they only generate enough torque to keep
things from moving, as long as they can generate that torque. But a
brake fully depressed at zero speed will still generate 0 torque (!).

I haven't really deduced any non-closed system formulae yet which
tries to do it in a more simple way. The idea is to integrate things
like braking torque to let it slide up to its locking point if needed.
All non-trivial.

But for an open diff, things are more simple:
T_B1=T_B2=T_A*diffRatio/2, no matter what.
Once you get to accelerations of B1/B2/A though, that's the hard part.
Gregor uses a non-symmetrical approach, which you may have read in
those archives that Todd posted.

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

Ruud van Ga

My sim: differentials

by Ruud van Ga » Wed, 14 Aug 2002 20:28:14

On Mon, 12 Aug 2002 09:05:47 +0000 (UTC), "Alex Smith"


>I took a look and I think they are the same ones on the Racer usenet
>discussion page. Problem is Ruud starts that thread at a more advanced stage
>than I am at :( . So I've changed my goals for now.

>Initially I am trying to get reaction from the wheels straight to the
>engine, ignoring the differential, because currently I am simply taking the
>rpm from the avg angV of the driven wheels. So now I want to have the wheel
>reaction go through the gearbox to the engine.

Hm, that might work.

...

If you derive RPM straight from angV, how could RPM not jump? If
you're dividing by the new gear ratio, surely RPM drops?

Actually, you should let the engine have its own spin speed. If it
doesn't match the wheel speed (as you do now), or rather the
differential A speed, than a torque is generated to get the 2
velocities to match (gearbox ratio's left out for a moment).
That torque is ofcourse also related to the clutch; I just use
clutchTorque=clutch*maxClutchTorque, where clutch=0..1 (the user's
pedal), maxClutchTorque is the maximum torque the clutch can handle
(often to be found for a car/engine), and clutchTorque then is the
torque trying to slow down the engine & speeding up the wheels, or
vice versa.

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

Alex Smit

My sim: differentials

by Alex Smit » Wed, 14 Aug 2002 21:10:49



> On Mon, 12 Aug 2002 09:05:47 +0000 (UTC), "Alex Smith"

> >I took a look and I think they are the same ones on the Racer usenet
> >discussion page. Problem is Ruud starts that thread at a more advanced
stage
> >than I am at :( . So I've changed my goals for now.

> >Initially I am trying to get reaction from the wheels straight to the
> >engine, ignoring the differential, because currently I am simply taking
the
> >rpm from the avg angV of the driven wheels. So now I want to have the
wheel
> >reaction go through the gearbox to the engine.

> Hm, that might work.

> ...
> >I am assigning the car an angV variable which is increased by
angA/inertia.
> >All good so far. But when I change gear, there is no -ve torque to reduce
> >the rpms so say I change from 1st to 2nd, the rpm doesn't jump from 6000
to
> >3000, it just keeps getting bigger.

> If you derive RPM straight from angV, how could RPM not jump? If
> you're dividing by the new gear ratio, surely RPM drops?

I don't think I explained my problem very well :)
Unitl now, I was calculating the engine RPM doing what you said above, using
the
gearbox ratios and the wheel speed. However, this is not very realistic, and
inflexible
if I wanted a clutch in the system. So what I am now trying to do is base
the engine
rpm on torques and inertias generated by the engine and the wheels.

Yup, thats what I'm trying, giving it its own angularV.

Its currently calculated by, for example in neutral
angAcc = engTorque/engInertia            [in a neutral situation]

Works fine. The problem arises when it is in gear, as the equations I
thought up
to feed in the road reaction torque are wrong. So because the effective
inertia
is greater in gear, doing the above calculation gives an rpm like 800 (due
to
smaller acc) when it should be 6000 judgiung by the wheel speed. So what I
need is some other torque to increase the engine speed. But how!?

From where, and applied to which? At the moment I do not have a clutch
implemented, so I am trying to do this *more simplified* :) version first so
that later I can have a clutch.

- Show quoted text -

Ruud van Ga

My sim: differentials

by Ruud van Ga » Thu, 15 Aug 2002 02:30:37

On Tue, 13 Aug 2002 12:10:49 +0000 (UTC), "Alex Smith"




>> Actually, you should let the engine have its own spin speed.

>Yup, thats what I'm trying, giving it its own angularV.

>Its currently calculated by, for example in neutral
>angAcc = engTorque/engInertia            [in a neutral situation]

>Works fine. The problem arises when it is in gear, as the equations I
>thought up
>to feed in the road reaction torque are wrong.
...
>> If it
>> doesn't match the wheel speed (as you do now), or rather the
>> differential A speed, than a torque is generated to get the 2
>> velocities to match (gearbox ratio's left out for a moment).

>From where, and applied to which? At the moment I do not have a clutch
>implemented, so I am trying to do this *more simplified* :) version first so
>that later I can have a clutch.

Well, it IS the clutch that is generating the torque to keep the 2
velocities synchronised. If they were connected hard, then
engine_vel==differentialA_vel, but they only loose part inbetween is
the clutch I'm afraid...

It isn't hard really if you already have the diffA velocity and engine
velocity, just use the difference to create a torque
(T_clutch=factor*velocityDifference). That's your clutch already. :)
(factor is clutchApplication*maxClutch; if you don't want to add a
clutch axis to your control system then I'd say just set
clutchApplication as a constant to something. I use autoclutching
myself but that's a bit more complicated with RPM's for autoclutch=0
and autoclutch=1).

Hope that helps,

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

Alex Smit

My sim: differentials

by Alex Smit » Thu, 15 Aug 2002 03:47:04

yeh that should help me on my way, thanks Ruud!
Stefano Casil

My sim: differentials

by Stefano Casil » Thu, 15 Aug 2002 18:13:10

Hi Alex,

What I'm doing with netKar is using a gear network system. That could
look a bit overcomplicated (I'm sure it is), but it lets you look at
the problem in a very different way.
I got the idea of the network looking for infos about clutches and
diff while I was approaching the problem, and, "googling" around I
found several references to ADAMS and Modelica libraries for geared
components drivetrains.
So I came up with a complete modular system of geared components all
based on torques (no speed forcing anywhere)...
Now.. it'll be impossible to explain all that mess here now... but I
think it is an elegant way to go (not very optimized tough)...

Now... to the differential part...
Are you sure to understand what an open differential is doing and how
it's working? I found the information on the internet quite misleading
about diffs.. at least if u try to read those with a "programmer point
of view". You often read: "the open diff sends all the torque to the
less resistent wheel"... Now..it does.. but if u try to do that in
code, that is. sending the torque to one wheel u'll end up in
troubles...
I found myself struggling for days trying to get the diff code working
without success.. then, one of my mate at work _built_ a real open
differential with meccano for me... and after 5 mins playing with it
in my hands I said: "right! now I know how to do it!"..
Try your local garage and have a go if u can with a real diff... it's
simple once u understand it.

I've tried to write a post here explaining my solution..but it was
really really messy... anyway.. I try again..
U have this situation:

     E
     |
  _______
  |     |
  w1    w2

E, w1 and w2 are torques from engine and the 2 wheels (from the road
reaction).
Now, E is always splitted in 2. equally.. if u see a diff it's easy to
convince yourself.. the engine can just act on the cage of the diff.

Now.. w1 and w2. You need to wait to have them both to actually decide
what to do. The "combined force" of w1 and w2 act on the cage.
Combined force for me is the fraction of the torques acting in the
same direction.
Example.. if w1=100 and w2=30.. the combined force is 30*2.. the 30
N/m of w1 is acting in the same direction of the 30 of w2. so they
combine and go to the cage..
Then u have the unbalanced torque.. the torque difference between w1
and w2.. this won't act on the cage but will be transfered to the
weaker wheel.. in our example we'll have 100-30=70N/m going from w1 to
w2...

This looks crazy I know.. let's do the "wheel on ice" example.. the
engine is sending say 200N/m of torque. .I split 50% and send it to
the wheels.. they accellerate and get the reaction from the road.. the
wheel on tarmac (say w1) will get 100 N/m of reaction force while the
wheel on ice (w2) will get 0N/m reaction...
Step 2..  the combined force is 0 so nothing is going back to the
engine. the unbalanced force is 100 that is sent right to w2 from
w1...
So w1 received 100 from the engine and 100 from the road. so basically
stays there... w2 got 100 from the engine plus 100 from w1 and it's
spinning like a crazy...

It's very easy to get this system and add stuff like internal clutches
to make a limited slip (I just did it yesterday)..

Whatever system u do.. there's one thing u have to check ALWAYS.. the
diff cage speed MUST always be the sum of the wheel speed divided by
2.. always, no matter what kind of diff u have. In a torque based
system like mine.. speed is an output not an input... and u need to
check it always..I've been running with this in my code forever:

if (differential->speed!=(outShaftL->speed+outShaftR->speed)/2.0f)
{
  printf("**** DIFF SPEED CHECK FAILED! ****\n");
  exit(0);

I hope it helps... looks scary.. but it works..

ciao

Stefano Casillo
www.drivingitalia.com/netkar


> I'm attempting to get some sort of differential model into my game

> Initially I am just trying to implement a completely open one for
> simplicity.

> I have an input A and outputs B1 and B2

> I am simply applying torque to A from the gearbox
> B1 and B2 are currently A * differential Ratio

> However the difficulties start when I want some feedback from the road to
> travel
> from the wheels through the differential into the engine.

> I'm assuming the road reaction torque to be the resistive torque
> so

> torqueAtDiffB1/2 = resistiveForceWheel * radiusWheel
> torqueAtDiffA - = torqueAtDiffB1/2/drivelineInertia

> But this does not work in any way. So I must have the wrong end of the
> stick, or
> maybe not even a stick, but a twig (erm :)

> Does anyone know any decent articles for this? At the mo i'm doing it
> completely
> using my own newtonian physics knowledge, which isn't very much.

Alex Smit

My sim: differentials

by Alex Smit » Thu, 15 Aug 2002 21:06:19

thanks Stefano, between you and Ruud I *should* be able to implement some
sort of working model. I'll be sure to get back to you if I can't :)
Alex Smit

My sim: differentials

by Alex Smit » Thu, 15 Aug 2002 22:10:21

Not sure I follow exactly. So I am not using torque to find the engine
acceleration?

Also, this may sound like a newbie question but I'm having a mental block at
the moment
and was wondering if I had a gear A ratio 5 and a gear B ratio 1. If I give
gear A 10 units of torque
does this mean B will haeve (10* (5/1) ) = 2 units? Or will it stay the
same, just have different acceleration?

Jonny Hodgso

My sim: differentials

by Jonny Hodgso » Fri, 16 Aug 2002 04:30:36


>      E
>      |
>   _______
>   |     |
>   w1    w2

> E, w1 and w2 are torques from engine and the 2 wheels (from the road
> reaction).
> Now, E is always splitted in 2. equally.. if u see a diff it's easy to
> convince yourself.. the engine can just act on the cage of the diff.
[snip]
> This looks crazy I know.. let's do the "wheel on ice" example.. the
> engine is sending say 200N/m of torque. .I split 50% and send it to
> the wheels.. they accellerate and get the reaction from the road.. the
> wheel on tarmac (say w1) will get 100 N/m of reaction force while the
> wheel on ice (w2) will get 0N/m reaction...
> Step 2..  the combined force is 0 so nothing is going back to the
> engine. the unbalanced force is 100 that is sent right to w2 from
> w1...
> So w1 received 100 from the engine and 100 from the road. so basically
> stays there... w2 got 100 from the engine plus 100 from w1 and it's
> spinning like a crazy...

Careful here.  If we're talking about an open diff, remember what
you wrote above: the output torques *must be equal*.  In the "wheel
on ice" example, since wheel 2 cannot sustain any reaction torque
(other than by inertia as it accelerates), the steady state torque
on wheel 1 is *also* zero and the car does not move!

For an open diff:
 torque 1 = torque 2 = input torque / 2
 (speed 1 + speed 2) / 2 = input speed.

Limited slips get more complicated, depending on the type.
In brief, you can have
 output torque difference = k * output speed difference
  (this is a Viscous Coupling, approximately)

 output torque difference <= k * input torque

but it all needs to depend on the reaction torques from
the wheels...

HTH,
Jonny

Stefano Casil

My sim: differentials

by Stefano Casil » Fri, 16 Aug 2002 17:24:23



> Careful here.  If we're talking about an open diff, remember what
> you wrote above: the output torques *must be equal*.  In the "wheel
> on ice" example, since wheel 2 cannot sustain any reaction torque
> (other than by inertia as it accelerates), the steady state torque
> on wheel 1 is *also* zero and the car does not move!

Exactly... w2 is not getting any reaction force because the wheel
isn't generating any force on the ground... but it is still receiving
tons of torque and it _is_ spinning. w1 is stopped because almost in
equilibrium and the car is not moving at all...

This is only true for torque coming from the engine of course.

Yep... that's why I have the *** "if" that stops everything if this
goes wrong.

Yes, for the clutches in the diff I'm using a RARS style friction
model... and with k function of ramp angles, clutch preload and input
torque.

Stefano Casillo
www.drivingitalia.com/netkar

Jonny Hodgso

My sim: differentials

by Jonny Hodgso » Sat, 17 Aug 2002 05:14:55


> > For an open diff:
> >  torque 1 = torque 2 = input torque / 2

> This is only true for torque coming from the engine of course.

Surely it's true at all times, unless you're being *really*
excessive and modelling the inertia of the *diff*... ;-)

Jonny


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.