[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Flywheel attitude control system.

Flywheel attitude control system.

Official forum for the .

Flywheel attitude control system.

Postby speeder » Thu Aug 14, 2008 2:08 pm

Hello! I am making a game where the player must control a ship that uses a flywheel attitude control system (yes, there are rotational intertia on the ship, to make things easier, the player can not move)

But I've got the following problem: How much impulse or force I apply to the flywheel and to the ship? (that rotates in the opposite direction obviously)

The ship is a "tube" (ie: if viewed from top a circle with a round hole on it), and also the same applied to the flywheel, also the flywheel is inside the ship (the external radius of the flywheel is a tad smaller than the internal radius of the ship), and I know how much power I have avaible per frame (ie: how much power I can draw from the ship powerplant)

But I found not way to know how I accelerate the flywheel correctly, but that I need to apply a force or a impulse on two opposite sides (or the flywheel moves around), and the same applies to the ship.
speeder
 
Posts: 14
Joined: Thu Aug 14, 2008 2:04 pm

Re: Flywheel attitude control system.

Postby tartley » Thu Aug 14, 2008 3:10 pm

The cpBody structure has a member 't', for torque. Instead of applying to forces on opposite sides, I'd experiment with setting this. A torque is the twisting provided by two equal and opposite forces with an offset between them.
Tartley - Jonathan Hartley,
Using Pymunk (Chipmunk's Python bindings) for a game project:
User avatar
tartley
 
Posts: 37
Joined: Thu Jun 12, 2008 5:01 pm
Location: London, England

Re: Flywheel attitude control system.

Postby speeder » Thu Aug 14, 2008 3:40 pm

Huh... And how I apply that to my problem?
speeder
 
Posts: 14
Joined: Thu Aug 14, 2008 2:04 pm

Re: Flywheel attitude control system.

Postby tartley » Thu Aug 14, 2008 10:34 pm

Hey. I was trying to answer the first problem you asked about, 'knowing how to accelerate the flywheel correctly' Once you have created the flywheel body, try setting its 't' member, see if that makes it rotate in the way you want. It might not, I may have misunderstood how Chipmunk works. If it doesn't work, then you should probably try applying two opposing impulses on opposite sides of the flywheel.

The other problem you asked about is how much force or impulse to apply. I don't know that - I'd suggest experimenting is the way to go : creating a program with the body and shapes first and then try out different sizes of forces (or impulses or torques) and see which one produces the results you want.

Am I misunderstanding your question?

Good luck! Let us know how it works out!
Tartley - Jonathan Hartley,
Using Pymunk (Chipmunk's Python bindings) for a game project:
User avatar
tartley
 
Posts: 37
Joined: Thu Jun 12, 2008 5:01 pm
Location: London, England

Re: Flywheel attitude control system.

Postby speeder » Fri Aug 15, 2008 5:35 am

Yes, indeed you misunderstood the question :P

I want to know how much force or impulse I apply to make the thing physically correct, not how to use chipmunk actually :)
speeder
 
Posts: 14
Joined: Thu Aug 14, 2008 2:04 pm

Re: Flywheel attitude control system.

Postby maximile » Fri Aug 15, 2008 6:18 am

Apply the same torque in opposite directions (+ve and -ve) to the ship and the wheel. That's enough to make it physically correct. How much you apply is up to you, and depends on the power of the motor or brakes or whatever is applying it.

And again, you don't want to apply "force or impulse", you'll definitely want to set the torque like tartley said.
maximile
 
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK

Re: Flywheel attitude control system.

Postby speeder » Fri Aug 15, 2008 7:08 am

I want to know how much torque I need to apply (and indeed, I made some tests, and torque works, but it needs reseting, that is annoying :( impulse is easier)

I know how much power I can draw from the powerplant, how I convert energy into torque?
speeder
 
Posts: 14
Joined: Thu Aug 14, 2008 2:04 pm

Re: Flywheel attitude control system.

Postby tartley » Sun Aug 17, 2008 3:04 pm

Thanks for the clarification.

If you have E Joules of energy, you can apply a torque of E/theta Newton-metres, where theta is the angle turned by the object being twisted:

T = energy / theta

or, equivalently

T = power / angular velocity

(where all angles are measured in radians)

It sounds like you are keen to calculate an accurate simulation, in which case you should bear in mind that in order for formulae like these to be useful, everything you do must be in S.I. units: distances in metres, masses in kilograms, angles in radians, and everything else in units directly derived from these (eg. velocity in metres per second.)

If the flywheel is being used to turn the ship, then the torque on the wheel should be equal and opposite to the torque on the ship.
Tartley - Jonathan Hartley,
Using Pymunk (Chipmunk's Python bindings) for a game project:
User avatar
tartley
 
Posts: 37
Joined: Thu Jun 12, 2008 5:01 pm
Location: London, England


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 5 guests

cron