# BoredEngineer

Member

55

300 Neutral

• Rank
Member

• Interests
Art
Design
Production
Programming

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## Physics [UE4]: Implement a “maximum compression” for vehicle-suspension

Hmmm, but before you get there maybe your suspension is not right in the first place. In principal you can make springs so stiff that they will work as almost solid rods. Can you post pseudo code of your suspension?
2. ## Physics [UE4]: Implement a “maximum compression” for vehicle-suspension

What I mean is simulating collision manually. Take a look at code snippets here, just ignore friction part: http://www.gamedev.net/topic/465248-calculating-impulse-due-to-rigid-body-collision-with-friction/
3. ## Physics [UE4]: Implement a “maximum compression” for vehicle-suspension

You can add a double spring. One controls suspension and second one imitates suspension limit. For the second spring you can apply impulse instead of force, proportional to distance of how far off into spring limit you moved and mass of the vehicle. To be sure that it's in balance check how many suspensions are at limit and scale weight accordingly. There isn't really a way to get mass inertia at arbitrary point but you could get some approximation from velocity at point in axis of suspension, where velocity is higher you will have higher mass on suspension.
4. ## Engine RPM and wheel angular velocity

Yes, but you don't need a minus sign there. Torque from clutch will already have a proper sign so I would change it to plus.
5. ## Engine RPM and wheel angular velocity

Forget about clamping and yes, the wheel will slow down if you push brakes or if you have some mechanical friction of the transmission which naturally slows done wheels + there is rolling friction which slows down wheels. Regardless. The most important is that moment of inertia doesn't change velocity by itself. Moment of inertia is angular mass equivalent to a normal mass. It tells you how much body will resist rotation when torque is applied. In this case moment of inertia is used only to calculate angular acceleration and by knowing angular acceleration and time step you can calculate new angular velocity. 1) apply some torque to the wheel by using it in Pacejka formula or by calculating friction 2) from step one you get Reaction force or friction force which you convert into reaction torque 3) now you can calculate new angular velocity as w += T/I*dt Just this thing should accelerate your wheels if car is on the slope.
6. ## Engine RPM and wheel angular velocity

That's has nothing to do with the scaling of reaction force... again, if you are using Pacejka you shouldn't scale reaction force but get your units and variables right. Do it on paper first for few time steps. When wheel rotates with the same linear velocity as car is moving and reaction force is zero, then wheel slows down by 1 radian a second and your reaction force should react to it, eventually accelerating wheel back to the zero relative velocity with the ground.
7. ## Engine RPM and wheel angular velocity

I divide it by total mass of the vehicle, as my friction is calculated out of the mass of the vehicle, relative velocity and number of contact points with the ground. Load on specific point has nothing to do with it. It's just a simple rationale that friction would be proportional to the mass of the object on which it has effect if it's calculated using its mass.
8. ## Engine RPM and wheel angular velocity

I do scaling of the reaction force because I don't use Pacejka. I don't understand why you need to divide your reaction force by the load if you use Pacejka. With "magic" formula you are suppose to get and exact amount of reaction force specifically for a specific wheel with a specific load on wheel.   I'll be adding description of friction model I use for the tank into documentation, can drop a link when it done. Otherwise I'm not sure how I can help here, I mean you can't just randomly change minus to plus in your formulas and expect to get some proper result. It doesn't work like that.
9. ## Engine RPM and wheel angular velocity

Check your units first. If you are using some realistic curve for a tire I would expect that you need a realistic mass and moment of inertia for the wheel. I haven't done car simulation, I'm doing this for tanks. In case of tanks I calculate friction force from local velocity and mass of the tank, plus friction coefficients and so on. When it comes to reaction force it is scaled down. I divide friction force by the mass of the vehicle and then multiple by the mass of tracks and sprocket. This seams to produce pretty accurate results.
10. ## Engine RPM and wheel angular velocity

Simple way to check is to calculate angular velocity from linear velocity. Take linear velocity of car in m/s divide by radius of wheel in meters, this is your angular velocity in radians/second. To get car moving just push it with force or place on a slope. Your reaction force should be producing exactly enough torque to accelerate wheel to the same linear velocity as car is moving. When wheel moves with the same velocity reaction force would be zero.
11. ## Engine RPM and wheel angular velocity

To all of them. If we ignore engine, like when de-clutched completely, without brakes car will roll, both front and back wheels will have the same rotation. Technically gearbox might slowdown drive wheel but this is just detail.
12. ## Engine RPM and wheel angular velocity

Check your units - some engines use angles for rotations instead of radians a second. When car is just rolling your reaction force should produce exactly enough torque to rotate wheels with exactly the same velocity as car is moving. You need to get this right before doing anything with the drive train.
13. ## Engine RPM and wheel angular velocity

That clutch algorithm that I've posted, direction of friction force is decided on sign of w1-w2. When you calculte torque transfer from engine to gear box (clutch is slipping) it will generate positive torque as engine is spinning but wheels are not. In a reverse update, from gearbox to engine, the same formula will produce negative torque, because now w1 and w2 are not engine velocity and gearbox velocity but gear box velocity and engine velocity. Does it makes sense?
14. ## Engine RPM and wheel angular velocity

Rather decelerated. To get accelerated it should be spinning slower than the rest of drive train and it will happen when you do a "jump start", like if car is rolling down the hill and clutch is unlocked completely and engine is off. As you depress clutch pedal, friction force will accelerate engine and you can start it without starter. The other way is possible too, if wheels can't move for some reason friction force will stop the engine as you depress clutch pedal.
15. ## Engine RPM and wheel angular velocity

When the torque goes through transmission and differential and gets to the wheels, it is multiplied by transmission and differential ratio, rigth? > Correct and it's divided when you bring reaction torque back from the wheels. If the wheel is turning x faster than transmission on one side, than the opposite side will be x slower than transmission? > Basically there are two types of differential as far as I'm aware - closed and open, some trucks and offroad vehicles allow driver to switch differential modes. In closed differential each wheel moves with the same speed, in open differential they are allowed to move with different speed but only as you've said, if one wheel is faster then another one is slower. I'm still not sure how to implement open differential in such setup, the closed one is easy, what ever reaction force you have on one wheel, it will effect the other wheel the rest of the drive train. How's the differential part calculated in AWD? How does the torque splitting work there at all? > Have no idea. What I know is that they have a special splitting box that does it. What happens when clutch is slipping. How would you update angular velocity of engine and angular velocity of clutch in this case? Do I assume that the clutch is locked, ignore engine and transfer torque to the differential(where it splits to wheels and receives rection torque)? And than send it back (and again skip everything) through slipping clutch send angular velocity to engine where it will update engine angular velocity only then? > Slipping clutch can't transfer torque, it creates torque from the friction of the clutch plates. So when clutch is slipping you get a friction torque which is send both to the engine and to the drive side of the clutch plate. When clutch is slipping and generate friction force, I integrate angular velocity on the "wheel" side of the clutch, taking into account MOI of the gearbox and effective MOI of the wheel passed through gearbox and differential. The same with reaction force, it gets to a clutch but if clutch is slipping then it's used in integration of the clutch "wheel" side plate angular velocity.