Hi all. So i’m trying to model a clutch and having some problems. Overall my model looks like this:
The clutch has 2 sides: sideA is the engine side, sideB is the wheel side. SideA is resisted by torque from wheels and sideB is resisted by torque from engine, so when clutch is slipping, sideA and sideB will be affected by external torque that will try to balance the speeds of 2 sides.
//The engineTorque is the sum of combustionTorque, frictionTorque, and reactionTorqueA which is the resistance torque from the sideA of the clutch.
engineNetTorque = engineTorque - frictionTorque + reactionTorqueA;
//This netEngineTorque now drives the B side of the clutch. This B side is resisted by the torque from the engine. The sum of the engine output torque and the reaction torque on this side is the output torque from the clutch
clutchNetTorque = engineNetTorque + reactionTorqueB;
//the output torque from clutch now drives the gearbox
gearBoxOutTorque = clutchNetTorque * gearRatio;
//the gearbox torque now drives the wheels
wheelTorque = gearBoxOutTorque * diffBiasRatio
And so here is the rough code:
//speed is in rad/s
//torque in Nm
//inertia in kg/m^2
//engine inertia is 0.25
//clutchStrength is abitrary, currently 10
//clutchInput goes from 0 (depressed, engaged) to 1 (pressed, disengaged)
float clutchTorque = (engineSpeed - driveTrainSpeed) * (1.0f - clutchInput) * clutchStrength * gearClutch; //gear clutch is when in neutral gear which is ratio 0
float engineOutputTorque = currentTotalEngineTorque - clutchTorque; //the torque coming out of the engine, factored in friction and resistance from clutch
float clutchOutputTorque = (engineOutputTorque + clutchTorque) * (1.0f - clutchInput); //the torque coming out of the clutch to drive the gearBox, the problem is somewhere here I guess. 1.0f-clutchinput is added later because torque is able the reach wheels even if clutch is disengaged, maybe problem related to this also.
float outputTorque = clutchOutputTorque * currentGearRatio * finalDriveRear; //the torque coming out of the gearbox to drive the wheels
currentEngineRPM += radsToRPM((engineOutputTorque * Time.fixedDeltaTime) / engineInertia) ; //accelerate the engine with the netTorque
//finally drives the wheels
RR.motorTorque = outputTorque / 2.0f;
RL.motorTorque = outputTorque / 2.0f;
So here’s the problem:
- The engine keeps on accelerating as if there is no resistance from the clutch. I’m thinking it’s because the clutchTorque that resist the engine is too low, but increasing this value by increasing clutchStrength would cause a massive negative torque resisting the engine and crashes the game.
- the output torque driving the wheel is extremely small. There is a problem in my clutchOutputTorque I believe but I can’t really figure out what. The problem I’m seeing here is that having engineOutputTorque as input torque for the clutch is wrong, because when slipping only a fraction of the engineOutput is able the reach the clutch. Second is maybe using clutchTorque as the resisting torque like above is incorrect?
Can someone give me some directions? I’ve been scratching my heads because of this final part in my simulator for weeks now. Thank you very much.