Train chassis powered by AngularVelocity Constraints can't even make it up a 2 degree slope

I’m currently working on a train chassis with working bogie suspension with SpringConstraints and rolling wheels on HingeConstraints. The train works fine on level track, but when I made a 2 degree slope, the train just rolled down as soon as I released the brakes and applied full power.


Here are the properties of each AngularVelocity instance. There’s one of these on each axle for a total of 8. Since the train has variable torque the MaxTorque of the constraint is 12000 on full notch acceleration and 15000 when in full brake.
image
Just for reference, this how the train accelerates on flat ground.

3 Likes

Try increasing the friction of the wheels and try making the chassis massless.

2 Likes

For the suspension use prismatic constraints and springs to limit the train to the y-axis if you want a more advanced suspension that doesn’t glitch out you will need to script it using raycasting.

1 Like

It does, along with a BallSocketConstraint to allow the train to have some yawing motion.

1 Like

The wheels aren’t slipping and the bogies especially need a lot of mass since I don’t want it to be toppled over when a passenger bumps their head against the ceiling upon getting out of a seat.

If the wheels aren’t slipping then increase torque.

1 Like

If so then use hinge constraints and set the max torque to inf. Also try increaing speed maybe? And definitely use hinge constraints.

1 Like

This was the approach for a while but I found that the top speed, acceleration, and general behavior of the train was completely random and out of wack. Sometimes it was capped at 177 SPS and sometimes it went the full intended 305 SPS. Sometimes upon releasing the brakes my train would accelerate backwards to 50 SPS. Acceleration would be abnormally quick upon its first run but would then go back to normal. AngularVelocity constraints solve all of these problems and weird inconsistencies, however, there is no acceleration property, meaning that the max torque will literally determine how fast your train accelerates/decelerates and how well your train can travel up and down slopes. My train acceleration is fine, but I can’t alter the torque to help it handle the hills better or else the train will literally go from 0-300 SPS in 20 seconds on standard level track.

1 Like

Read the last part of my latest reply to Auburn.

1 Like

I’m not sure what SPS stands for. Studs per second? Spins per second?

Tune the torque to be high and the speed to be the desired rotations per second if it is going too fast.

Be sure to max out friction on wheels and rails, and decrease friction on any part of the train that the wheels could be touching.

1 Like

SPS is studs per second, yes. Also I just stated that turning up the torque would also mean making the acceleration extremely quick along with a better hill performance. I tried turning up the Friction on both the wheels and the rails and setting their FrictionWeight to 100, and it still doesn’t do anything. The flanges are already at Friction 0 and FrictionWeight 100.

Is there a balance for the torque that mimics what we’d expect in real life? Such that it can climb a hill but not accelerate too quickly?

I’ve tried torquing up the same axles that the AngularVelocity constraints are on using TorqueConstraints and bumping up the MaxTorque on the AngularVelocity constraints to a number that could easily take a hill in hopes that the Torque constraints would balance it out but it really just made it decelerate really quickly, then the train will stutter around 20 SPS and stay that way until I release the brakes for the train to roll to a stop. I also tried the same method except changing the ActuatorType of the axles’ HingeConstraints to Motor and setting MotorMaxAcceleration to 0 and playing with the torque and it returned similar results to the Torque constraint trial.

Try a VectorForce instead. You can use HingeConstraints too.
I’ve got a model I made up for someone else with the same issues. It can run either by changing the HingeConstraint AngularVelocity, or by changing the force on the VectorForces in the carriages.

EDIT, this version had collision groups disabled, see my next post.

The bogeys tilt and rotate, there are wheels under and between the tracks to keep the train on the rails.
As it stands now just hop in the seat and press W to increase the VectorForces in the carriages by 1000 each time you click (S to decrease the VectorForce. The train will go surprisingly fast up the hills, around the corners, and across the switches (click the blue Union to switch between rails on the switches).

You mentioned your Friction was set to 0 and FrictionWeight 100.
0 is no friction, higher is more friction, so your wheels will slip at 0.

If that’s the case with higher torque then it is time for a scripting session.

-- First we get slope angle
local chassis = -- path to chassis
local angularvelocity = -- angular velocities
local ogtorque = angularvelocity.MaxTorque
local function GetSlopeAngle()
     return chassis.Orientation.X
end
local function SetTorque()
     angularvelocity.MaxTorque = ogtorque * (1+GetSlopeAngle()/5)
end
chassis.Changed:Connect(SetTorque)

Doing something like this would change the torque accordingly to slope.

Shouldn’t you use lookVector for this?

This chassis doesn’t really allow for grade crossings though (paved surfaces between tracks).

Oh, jeez, I was messing with it a few months ago because there was a Roblox issue.
That’s what the CollisionGroups take care of. The alignment wheels ONLY collide with the rails. The baseplate and other parts are CanCollide true.

I just saved it with the Collision groups enabled again. You can add rail ties, crossings and whatever else you want between the rails.
Test Train, bogeys with tilt (VectorForce or Hinges).rbxl (190 KB)

You can but I just did it my way.