[ODE] "Ladies and gentlemen, start your engines"
henry.maddocks@met.co.nz
henry.maddocks at met.co.nz
Tue Apr 23 14:11:01 2002
On Wednesday, April 24, 2002, at 06:38 AM, Michael Sebastian Sbrissa
Bortolin wrote:
> I don't remember if this question was already made, but, have someone
> used real values in a car simulation with ode? I can't get a good
> simulation with the values i'm using.
I'm using real world values and it's going great:) (apart from tyre
friction:( )
> I'm calculating the ammount of torque delivered by the motor to the
> wheels:
> float m_fTorqueOnDriveWheels = m_fAccel * LookupTorque(m_iRPM)
> * m_fGearRatio[m_iGear]
> * m_fDifferentialRatio * m_fFrontWheelRadius;
>
> m_fAccel: the throttle position (from 0.0 to 1.0).
> LookupTorque(): returns the torque at the rpm specified, this is in a
> table.
> m_fGearRatio[m_iGear]: ratio at the specified gear
> m_fDifferentialRatio: self-explanatory
> m_fFrontWheelRadius: self-explanatory
I don't use the wheel radius. I assumed (maybe wrongly) that ode would
fiqure that out from the size of the body that was attached to the axis
of rotation. Either that or it's not needed? Here's my code...
// enginetorque * gearRatio[currentGear] * difRatio *
transEfficiency * throttlePosition;
torque = getTorqueAtRpm( currRPM) * difRatio * transEfficiency;
// rpm / gearRatio[currentGear] / difRatio;
speed = DegToRad( ( ( currRPM) / ( difRatio * transEfficiency)) *
360 / 60);
odeJoint->setHinge2Param( dParamVel2,
-theCar->getEngine()->getSpeed()); // Note the negative sign!!!!
odeJoint->setHinge2Param( dParamFMax2,
theCar->getEngine()->getTorque());
I just noticed that I've got throttle position in my comment but it
didn't make it to the code. Might have to look into that. Note also that
I only have one gear at this stage.
I suppose the bit that you are interested in are the last 2 lines.
> Where i must use the returned value (m_fTorqueOnDriveWheels) ?
>
>
> Michael Bortolin
> Development Team
> E-Business Research Center - DELL/PUCRS
> Phone: +55 (51) 3320-3639 - Ext. 230
> michael_bortolin@dell.pucrs.br
>
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>
>
"Computer games don't affect kids; I mean if Pac-Man affected us as
kids, we'd all be running around in darkened rooms, munching magic pills
and listening to repetitive electronic music." - Kristian Wilson,
Nintendo, Inc, 1989