Muushy / Sprocket-Feedback

Report bugs or suggest features for Sprocket.
4 stars 0 forks source link

[UPDATED] Fixes to incorrect torsion bar suspension #105

Open A1ex-Andro opened 2 years ago

A1ex-Andro commented 2 years ago

1). In the game, the suspension "torque" changes when the length of the swing arms is changed. It's not supposed to. Making the swing arms longer (increasing the "suspension scale") is supposed to increase only the "specific weight" parameter, because you make the weight of tank act at a larger distance away from the centre of the swing arm's rotation.

The "specific weight" parameter in-game refers to the torque acting on each axle due to the tank's weight. This is equal to mglcos(θ)/N, where m is the sprung mass of the tank (does not include the mass of the tracks, roadwheels, swing arms, etc.), g=9.80665, l is the swing arm length, θ is the swing arm angle from the horizontal, and N is the number of axles, all in SI units.

The "torque" parameter should change only if the characteristics of the torsion bar are changed. Here, I think you have confused torque with force. Increasing the length of the swing arm will decrease the downward force applied by the arm, which is equal to T/[lcos(θ)], where T is the torsion bar torque, l is the swing arm length, and θ is swing arm angle from the horizontal. Not the torque. To set the "specific weight" and "torque" equal, you need to think of both in terms of torque or both in terms of vertical force. One is a force acting at a distance l away from a centre of rotation, causing a torque about that centre of rotation. The other is a torque acting about a centre of rotation, which applies a force at a distance l away. In summary, the torque due to the specific weight changes with arm length (increases linearly). The torque of the torsion bar does not.

2). Specifying the swing arm length with an arbitrary "suspension scale" does not make sense. Replace it with a "swing arm length" parameter, specified in millimetres. In case you don't know what size the suspension is in-game, I used g=9.80665 and simple physics to determine that a scale of 1.00 corresponds to a swing arm length of 656.54331 mm (not even a round number!).

3). The torque of a torsion bar should increase linearly with the twist angle (how far the bar is twisted from the position that it would return to if the load was removed). This torque is given by T = kα, where k is the spring rate in Nm/rad, and α is the twist angle in radians. The spring rate is k = πGd^4/(32L), where G=78, d is the torsion bar diameter in millimetres, and L is the torsion bar length also in millimetres. If necessary, you can multiply the spring rate by π/180 to convert it from Nm/rad to Nm/°.

Here are the parameters the user should specify:

Here is the resulting parameters that the game should display:

The rest angle, instead of being specified by the user, will now be the result of the specified parameters and should be calculated automatically, displayed to the user to one-tenth of a degree, and reflected in the tank model on the design platform.

Please implement this fix as soon as possible as there are many more fundamental mechanics to fix, and I would like to get through them before the next semester of university starts in September. If you have any questions, message A1exAndro#2738 on Discord.

A1ex-Andro commented 1 year ago

@Muushy The second half of this post has been changed. Please re-read it. Attached below is a simple Excel spreadsheet that takes the parameters that the user should specify (green cells), and outputs what the game should display/use (yellow cells). Torsion Bar Calculator.xlsx

A1ex-Andro commented 1 year ago

Since there is a limit to how much you can twist something before it irreversibly deforms and then breaks, the maximum bump stop angle can be calculated. The angle in degrees is: θmax = τmax*2L/(Gd)*180/π - β Assume τmax = 1000 MPa. Make sure G is in MPa here as well (G = 78000 Mpa).

Knowing the rest angle θ, bump stop angle θmax, rebound angle β, and swing arm length l, you can now calculate the positive vertical travel: = l*(sin(θmax) - sin(θ)) As well as the rebound travel: = l*(sin(θmax) + sin(β))

Attached below is the updated Excel spreadsheet that includes the calculation of max bump stop angle and total vertical travel. Torsion Bar Calculator v2.xlsx

A1ex-Andro commented 1 year ago

The previous comment and attached spreadsheet have been updated to show the positive vertical travel and rebound travel separately. More output parameters that are commonly used to evaluate the characteristics of the suspension will be added later after the previous ones are implemented.

A1ex-Andro commented 1 year ago

I'd also like to add that in addition to the spring torque, there is also the viscous damping torque. The damping torque is proportional to the angular velocity (in the same way that the spring torque is proportional to the angular displacement), and related by the damping coefficient (usually denoted by the letter 'c'). Like the spring torque, it opposes the direction of motion. For convenience, a dimensionless parameter called the "damping ratio" is defined, denoted by the Greek letter 'ζ', having a range of 0<ζ<1 (or from 0 to 100%) for "underdamped" motion. To provide this damping ratio, the required damping coefficient can be calculated, c=2*ζ*sqrt(k*m) where k is the spring rate and m is the sprung mass (for the individual wheel, so divide the total mass by the number of wheels here). Of course, you could let the user specify the damping constant directly, but then the range of the slider would have to vary considerably between different tanks. The damping ratio on the other hand may not need to be changed at all, so it's more convenient to use.