Re: Aggressive tracking in a newtonian simulation
Jon Watte <[email protected]> Thu, 2 Dec 2010 11:31:53 -0800
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
First: You want to use R-K-4 for your integrators, if at all possible. That will make "springy" behavior from the errors of a first-order (forward or backward) integrator go away. Second: From doing this before, I think you should treat this system as a PID controller, although you probably can keep the I term zero. Use P for the "gas" thrust/torque, and D for the "brake" thrust/torque. Given that the available thrust/torque for navigation thrusters are generally tiny compared to the mass of the spacecraft, you have to use pretty large look-ahead for the D part. If you tune the system carefully, you can even get it to the point where the relation between error, velocity/spin, and forces becomes a critically dampened system, which means it will be "optimal" in some sense in obtaining the desired kinetic pose. (Google "critically dampened mechanics" or something like that for the math) Sincerely, jw -- Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable. On Tue, Nov 30, 2010 at 1:48 AM, Darren Grant < [email protected]> wrote: > So I originally posted the following to the bulletphysics.org general > discussion forum. But perhaps this mailing list is a better venue since the > subject is related to what I imagine is basic flight sim development and > steering behavior: > > > I am a programmer tasked with developing a newtonian simulation of high > performance spacecraft. For the sake of discussion, each craft is a rigid > body with non uniform moments that must navigate its environment by applying > only (central) forces and torques. Mass and acceleration can vary by a > couple orders of magnitude. Linear and angular tracking are treated > independently. The high order parameters are: max speed, max angular speed, > max torque scalar (may be component-wise) and max force magnitude. > > Here's what I have now: > > The linear tracking code is very simple and attempts to minimize the > difference between actual velocity and desired velocity using kinematic > knowledge of motion to produce the desired velocity at each tick (accelerate > to apogee, decelerate to target). This is comfortable territory. > > Angular tracking is significantly more bloated and follows the same > principals by trying to minimize local angular error component-wise. There > is some hand-waving of the coupling of large angular terms that makes this > even remotely acceptable. So it works alright if there is an abundance of > turning power, but the big problem is that it is just a messy solution that > I'm afraid might blow up in my face later. > > Is there a better way to approach the angular tracking problem or is this > just how it is done? I intend to start layering flight AI on top of this > simulation. > > (If there are flight sim devs out there in the crowd, what can I say, I > would really appreciate your advice!) [image: :)] > > > > > Cheers, > Darren > > _______________________________________________ > Sweng-Gamedev mailing list > [email protected] > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > > _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com