# Object movement in the space with many engines

## Recommended Posts

Hi, everyone!

I have a nasty problem to solve. Half by physics, half by math. And hope UE4 can help me with that too.

I have an object in the space. We know the center of its mass (C). There also a lot of engines/thrusters. We know where are they placed (P1...Pn) and in which direction they turned (D1...Dn). Each engine has maximum thrust (0...Ti). All those values we know.

1) We should be able to move (strafe) the object in the space by custom normalized vector (V) with custom thrust power (0 <= T <= 1).

2) We should be able to turn the object on the place centered on (C) with custom thrust power (0 <= T <= 1).

3) Of course, there are situations, where it's impossible. If so -> T = 0.

Any thoughts or formulas?

##### Share on other sites

So what are you actually trying to achieve here? Are you trying to work out how much thrust each engine needs to produce to achieve 1,2 or 3? Or are you trying to work out what combination of engines are needed to do each one?

##### Share on other sites

2 hours ago, Steel said:

So what are you actually trying to achieve here? Are you trying to work out how much thrust each engine needs to produce to achieve 1,2 or 3? Or are you trying to work out what combination of engines are needed to do each one?

I'm trying to work out how much thrust each engine needs to produce to achieve a maximum speed of the object along a custom vector.

##### Share on other sites

54 minutes ago, Hakuhonoo said:

I'm trying to work out how much thrust each engine needs to produce to achieve a maximum speed of the object along a custom vector.

Assuming you mean maximum acceleration, you can get to any speed with any amount of thrust it just takes less time the more you have.

Assuming fuel usage is not an issue, all you need to do is work out (using trigonometry) what component of the thrust from each engine is acting in the same direction as the vector you want to travel along. Then fire every engine that has some component of thrust in that direction (all engines not pointing directly sideways or pointing some way backwards), using throttlling to ensure there is no net torque on the craft. Unfortunately, the situation as you describe (a large amount of engines pointed in different directions) has no unique solution; there is more than one way to do it and there's no single "best" way to do it, the best way depends on how many engines you have and what direction they're pointed.

Edited by Steel
##### Share on other sites

Hmm... I guess you're right.

Then I need to know another thing. Here is an image: http://prntscr.com/g432th

• C - center of mass
• P1 & P2 - thrusters
• v - vector from C to P1
• u - vector of the thruster at P1
• |u| - max thrust on it

How much torque will get an object depends on how much thrust produce the thruster at P1?

What about the task at all. Now I think to make main engines directed strictly backward and many thrusters to rotate the object somehow.

##### Share on other sites

There is a special mod for this.

Unlikely, solution would be much easier.

##### Share on other sites

If what you're trying to do is akin to having multiple-engine stage, then you need to balance out the torque. So cross-product the radius from CoM vector with the force vector they produce, and find one such that they produce no torque. Indeed there are some cases where it's impossible to have one.

You can simulate in KSP as well.

I guess there's a language barrier here as well.

Edited by YNM
##### Share on other sites

Also depends on what OP wants: to get an established equilibrium condition or to dynamically manage the engines throttle.

In the second case he has to deal with PID automation like described here, and this is more complicated than a vector algebra. That's why I've mentioned TCA mod,

##### Share on other sites

3 hours ago, YNM said:

If what you're trying to do is akin to having multiple-engine stage, then you need to balance out the torque. So cross-product the radius from CoM vector with the force vector they produce, and find one such that they produce no torque. Indeed there are some cases where it's impossible to have one.

You can simulate in KSP as well.

I guess there's a language barrier here as well.

Yes, you are right about |V x U| = 0 -> no torque ( http://prntscr.com/g432th ). But if it's not - I need to compensate the torque somehow. So I need to know power (force) of the torque as well as its direction. |V x U| looks pretty much like torque force, but vector V x U definitely point towards the wrong direction. I guess to get the torque direction we need to project vector U on a surface built by point (CoM + V) and vector V. Am I right?

And yes, the language barrier is a problem to some degree, but math is our language! )))

2 hours ago, kerbiloid said:

Also depends on what OP wants: to get an established equilibrium condition or to dynamically manage the engines throttle.

In the second case he has to deal with PID automation like described here, and this is more complicated than a vector algebra. That's why I've mentioned TCA mod,

2

It's not really connected to KSP. And Throttle Controlled Avionics is using aerodynamics and gravity. I don't need those.

What about equilibrium or dynamic... well... if I'll get equilibrium each few frames it becomes dynamic, isn't it?

Edited by Hakuhonoo
##### Share on other sites

Not an easy problem! You need to work out what combination of engine thrusts provides rotational equilibrium. As others have mentioned there may be more than one unique solution.

Then you either want the axis (solution) in which you get maximum thrust or maximum ISP depending on whether or not you are fuel limited or time limited.

Over any reasonable time period the answer will always be to first rotate the axis of maximum engine thrust or maximum isp onto your custom vector.

Edited by RCgothic
##### Share on other sites

7 minutes ago, RCgothic said:

Not an easy problem! You need to work out what combination of engine thrusts provides rotational equilibrium. As others have mentioned there may be more than one unique solution.

Then you either want the axis (solution) in which you get maximum thrust or maximum ISP depending on whether or not you are fuel limited or time limited.

Over any reasonable time period the answer will always be to first rotate the axis of maximum engine thrust or maximum isp onto your custom vector.

I know, it's difficult. So I need help

I'm still thinking about another idea to move the custom built ship. But nothing too valuable for now...

##### Share on other sites

Honestly I doubt there's an analytic solution for Pn engines. I envisage a program where you step through every possible combination of engine thrusts in 10% increments for combinations of values close to zero on all but the 1 degree of freedom you're interested in. Then iterate at a finer resolution around those values.

Repeat for each degree of freedom. It's a brute force approach but should give you a solution of there is one. May miss 'spiky' solutions where equilibrium is reached very quickly from an unlikely combination.

##### Share on other sites

Ah, I see. You're asking for how to solve a set of cases.

What I can think of is that if the thrust direction for each engine is the same, and all the engines are on a plane, it's a matter of balancing some equation. It can have many answers.

For even more complicated cases (like engines in different plane or multiple thrust directions), I think you need something like what @kerbiloid said. For every instance there'll be a condition where the criteria is fulfilled (or there could be none as well). So probably the only way out is to simulate one. I don't think a continous analytical answer is possible really. Unless the cases you're trying to work out have simplified one of the aspects involved (or one of the aspects can be simplified) such that an analytical solution is possible.

Edited by YNM
##### Share on other sites

14 hours ago, Hakuhonoo said:

How much torque will get an object depends on how much thrust produce the thruster at P1?

Seriously, man, if you're asking this question, I suggest you shelf this project for later, and go back to learning some elementary physics before continuing:

##### Share on other sites

1 hour ago, monstah said:

Seriously, man, if you're asking this question, I suggest you shelf this project for later, and go back to learning some elementary physics before continuing:

Or just be a little too lazy and ask the community for help

Thanks anyway

##### Share on other sites

That's not what I mean. If you expect any progress, you need to understand motion, acceleration, torque, etc., not just know the equations. And if you're asking about torque in such a basic example, then I suspect you really don't.

There's no fault in that, learning comes at its own pace too each one. But I think you're skipping the basics and taking a longer step than your leg. I didn't tell you to give up, after all, just to shelf it for later :)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.