Space Engineers

Space Engineers

View Stats:
Sawakaki Jun 2, 2020 @ 12:26am
Multi-Axle Steering
I've been having some issues calculating the steering angles for multi-axle vehicles. Say a vehicle has 7 sets of wheels and I want it to turn using the middle set as the pivot point. I've done some good old fashion Google searching and pretty much everything I've been finding requires knowing the desired turning radius first, which I don't. I've also dug through the forums here and haven't found anything. Any help from the massively talented community here would be greatly appreciated.
Originally posted by Doom:
Originally posted by Sawakaki:
I've been having some issues calculating the steering angles for multi-axle vehicles. Say a vehicle has 7 sets of wheels and I want it to turn using the middle set as the pivot point. I've done some good old fashion Google searching and pretty much everything I've been finding requires knowing the desired turning radius first, which I don't. I've also dug through the forums here and haven't found anything. Any help from the massively talented community here would be greatly appreciated.
It goes like this, pretty much:
https://ibb.co/B2vQ562
https://ibb.co/3mxwZYN

It is also possible to do things like that:
https://ibb.co/XJRKfXd

This is school level geometry/trigonometry. Turn center is located on the line that passes through middle wheels.
Minimum turn radius is determined is how far the farthest wheel can turn.

Basically, the farthest wheel, middle wheel and rotation center form a right triangle.
https://ibb.co/q5H98Q5
Let steering wheel be point A, middle wheel be point B, and rotation center be point C.
https://ibb.co/3FXKJmK

Angle ABC is right, meaning 90degrees.
Sum of all angles within triangle can only be 180 degrees, meaning BAC + ACB + ABC ==> 180 degrees, and given that ABC is 90, then BAC + ACB = 90 degrees.
angle BAC is equal to 90-steeringAngle degrees and ACB is equal to steering angle (sum of BAC and ACB is 90, BAC is 90-steering, therefore ACB = 90-(90-steering) = steering)
Given that tirangle ABC is right triangle, you can calculate distance AC by multiplying distance AB by tan(ACB) where tan(ACB) is tan(steeringAngle)
https://en.wikipedia.org/wiki/Trigonometric_functions#tan

In essence turning means locating point around which you are trying to turn, and then turning each wheel so when you look from above line passing through wheel center passes through that point.

It is possible to turn around ARBITRARY point in the world, but that requires gamedev level vector math (turn angle would be acos of dotproduct between vehicle "sideways" vector and vector pointed towards point from center of the wheel, where vector to the rotation point has to be first projected onto plane formed by vehicles "up" vector and normalzied. See: https://en.wikipedia.org/wiki/Inverse_trigonometric_functions and https://en.wikipedia.org/wiki/Dot_product ).

So instead you can loop through grid blocks, locate where each wheel is in grid coordinates, calculate their "2d" coordinates, and solve rotation angle in 2d space for predetermined turn radius, which will be easier if you never messed with vector math before.

Something like that.
< >
Showing 1-7 of 7 comments
Bannor Jun 2, 2020 @ 12:51am 
Max steering angle for the wheels on the axle furthest from the centre is greater than the max steering angle for the wheels on the axle next furthest from the centre - and so on. It's not rocket science...
Originally posted by Bannor:
Max steering angle for the wheels on the axle furthest from the centre is greater than the max steering angle for the wheels on the axle next furthest from the centre - and so on. It's not rocket science...

Since the OP mentioned "calculating" the various angles then I guess it is rocket science.
The author of this thread has indicated that this post answers the original topic.
Doom Jun 2, 2020 @ 11:28am 
Originally posted by Sawakaki:
I've been having some issues calculating the steering angles for multi-axle vehicles. Say a vehicle has 7 sets of wheels and I want it to turn using the middle set as the pivot point. I've done some good old fashion Google searching and pretty much everything I've been finding requires knowing the desired turning radius first, which I don't. I've also dug through the forums here and haven't found anything. Any help from the massively talented community here would be greatly appreciated.
It goes like this, pretty much:
https://ibb.co/B2vQ562
https://ibb.co/3mxwZYN

It is also possible to do things like that:
https://ibb.co/XJRKfXd

This is school level geometry/trigonometry. Turn center is located on the line that passes through middle wheels.
Minimum turn radius is determined is how far the farthest wheel can turn.

Basically, the farthest wheel, middle wheel and rotation center form a right triangle.
https://ibb.co/q5H98Q5
Let steering wheel be point A, middle wheel be point B, and rotation center be point C.
https://ibb.co/3FXKJmK

Angle ABC is right, meaning 90degrees.
Sum of all angles within triangle can only be 180 degrees, meaning BAC + ACB + ABC ==> 180 degrees, and given that ABC is 90, then BAC + ACB = 90 degrees.
angle BAC is equal to 90-steeringAngle degrees and ACB is equal to steering angle (sum of BAC and ACB is 90, BAC is 90-steering, therefore ACB = 90-(90-steering) = steering)
Given that tirangle ABC is right triangle, you can calculate distance AC by multiplying distance AB by tan(ACB) where tan(ACB) is tan(steeringAngle)
https://en.wikipedia.org/wiki/Trigonometric_functions#tan

In essence turning means locating point around which you are trying to turn, and then turning each wheel so when you look from above line passing through wheel center passes through that point.

It is possible to turn around ARBITRARY point in the world, but that requires gamedev level vector math (turn angle would be acos of dotproduct between vehicle "sideways" vector and vector pointed towards point from center of the wheel, where vector to the rotation point has to be first projected onto plane formed by vehicles "up" vector and normalzied. See: https://en.wikipedia.org/wiki/Inverse_trigonometric_functions and https://en.wikipedia.org/wiki/Dot_product ).

So instead you can loop through grid blocks, locate where each wheel is in grid coordinates, calculate their "2d" coordinates, and solve rotation angle in 2d space for predetermined turn radius, which will be easier if you never messed with vector math before.

Something like that.
Karmaterrorᵁᴷ Jun 2, 2020 @ 12:08pm 
OP i think you putting too much thought into it. When i did my tank (that steers like your vehicle not like a real tank) I just messed with the angles untill it felt good.

The lack of diffentials could throw any angle values you work out anyway as the inside wheel wont slow to cover less distance, they will always fight eachother to some extaent and not behave like proper car wheels :)
Sawakaki Jun 2, 2020 @ 4:25pm 
Originally posted by Karmaterrorᵁᴷ:
OP i think you putting too much thought into it. When i did my tank (that steers like your vehicle not like a real tank) I just messed with the angles untill it felt good.

Yup, I definitely have a habit of doing that, haha.


Originally posted by Doom:
Originally posted by Sawakaki:
I've been having some issues calculating the steering angles for multi-axle vehicles. Say a vehicle has 7 sets of wheels and I want it to turn using the middle set as the pivot point. I've done some good old fashion Google searching and pretty much everything I've been finding requires knowing the desired turning radius first, which I don't. I've also dug through the forums here and haven't found anything. Any help from the massively talented community here would be greatly appreciated.
It goes like this, pretty much:
https://ibb.co/B2vQ562
https://ibb.co/3mxwZYN

It is also possible to do things like that:
https://ibb.co/XJRKfXd

This is school level geometry/trigonometry. Turn center is located on the line that passes through middle wheels.
Minimum turn radius is determined is how far the farthest wheel can turn.

Basically, the farthest wheel, middle wheel and rotation center form a right triangle.
https://ibb.co/q5H98Q5
Let steering wheel be point A, middle wheel be point B, and rotation center be point C.
https://ibb.co/3FXKJmK

Angle ABC is right, meaning 90degrees.
Sum of all angles within triangle can only be 180 degrees, meaning BAC + ACB + ABC ==> 180 degrees, and given that ABC is 90, then BAC + ACB = 90 degrees.
angle BAC is equal to 90-steeringAngle degrees and ACB is equal to steering angle (sum of BAC and ACB is 90, BAC is 90-steering, therefore ACB = 90-(90-steering) = steering)
Given that tirangle ABC is right triangle, you can calculate distance AC by multiplying distance AB by tan(ACB) where tan(ACB) is tan(steeringAngle)
https://en.wikipedia.org/wiki/Trigonometric_functions#tan

In essence turning means locating point around which you are trying to turn, and then turning each wheel so when you look from above line passing through wheel center passes through that point.

This is awesome and exactly what I was hoping for, thanks! I really appreciate you breaking it down to its simplest level.
Doom Jun 2, 2020 @ 7:18pm 
Originally posted by Sawakaki:
This is awesome and exactly what I was hoping for, thanks! I really appreciate you breaking it down to its simplest level.
Have fun (^_^)
mikebou (Banned) Jun 3, 2020 @ 4:17am 
@Doom: Nice work :)
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Jun 2, 2020 @ 12:26am
Posts: 7