# Space ship angular deceleration

1. Aug 27, 2014

### GWilde

I am programming an addon for a space game/simulation (Kerbal Space Program) and I am looking for some help with a bit of physics.

The part I need a little help with is related to attitude control. If the ship is rotating, is there a mathematical way to calculate when it needs to begin to decelerate rotation to stop facing a certain point? Say I know its current angular velocity and its max angular acceleration?

Ex.
For example ships starts facing direction 1. It begins accelerating its rotation towards directions 2. Then, at the specific calculated point it stops accelerating and begins decelerating so that it stops at direction 2.

In the code I was thinking that I would repeatedly check if at its current angular velocity, if it began decelerating would it stop in time.

Thanks for any help.

2. Aug 27, 2014

### rcgldr

For real space objects, generally a short and throttled pulse is used to initiate the rotation, and another short and throttled pulse is used to stop the rotation. A computer with gyro type inputs could do this, but humans were also able to do a good job of this during early space docking test missions. For satellites, internal torques applied to gyro's can be use to reorient them.

3. Aug 27, 2014

### GWilde

Thanks, thats cool and all but its not really my question.

I want to do the rotation as fast as possible, so the ship would go directly from accelerating rotation to decelerating rotation. What I need help with is the maths for figuring out when to decelerate rotation.

4. Aug 27, 2014

### tduell

I'm not familiar with doing all the symbolic maths in a post, so I'll have a go with ancient methods.
If you know the ships rotational inertia (I) about the axis if rotation, then you can use T=I*alpha, where T=applied torque (the thruster or whatever), and alpha is the angular acceleration.
Use this with omega = alpha*t, where t is time, omega is angular velocity, and with omega = omega0 + alpha*t where omega0 is initial angular velocity and in this case omega is final angular velocity.
Hence, if you know initial omega0, and I, then calculate a torque T to be applied over time t to make omega zero.
Hope that helps.

Cheers,
Terry

5. Aug 27, 2014

### rcgldr

For the fastest reorientation, a torque is applied until rotated 1/2 of the way to the new orientation, then an opposing torque of the same magnituded is applied for the second half of the reorientation.

6. Aug 27, 2014

### GWilde

How do I factor in that I need the angular velocity to equal zero when the ship will be at the final direction?

Edit: Accelerating for half the time and decelerating for half the time would work for the example of starting from zero rotational velocity, but when implemented the ship might not start from zero rotational velocity so that isn't how I want to do it.

Last edited: Aug 27, 2014
7. Aug 27, 2014

### rcgldr

It's simialr to linear math. You have an initial angular orientation and initial angular velocity. You want to end up with a final angular orientaion and angular velocity of zero. Assume that the magnitude of the torque is constant and that only the direction changes (if it changes at all, in some cases the solution only required deceleration of the ship). This should only require algebra, not calculus, to solve.

8. Aug 28, 2014

### A.T.

time = current angular velocity / angular acceleration