Starship

View previous topic View next topic Go down

Starship

Post by Warbird on Wed Oct 27, 2010 2:17 am

Hi guys

looks like i found the new forum ^^ and i´ll just put it to use right now: Im currently building a starship (yes it will operate in zero gravity and zero airfriction) but there is one major problem: The stabilizing. As i want the steering to be easy the starship will need to stabilize itself, therefor i startet with a small script for roll stabilizinh and.... it works but... not the way i want it to Sad
Heres the problem: If one side is higher than the other, jets will balance this by rolling the ship until its in the correct position again, but when they do that they dont stop it at the zero-position, the ships sluggishness simply makes it turn further and of course the jets simply push into the other direction so in the end the ship will only roll from one side to the other instead of stablizing itself. Any ideas on how to fix that?

By the way heres the script:

if AltLeft<AltRight {RSR=-2000}
if AltLeft<AltRight{RSL=2000}
if AltLeft<AltRight{RST=2000}
if AltLeft>AltRight{RSR=2000}
if AltLeft>AltRight{RSL=-2000}
if AltLeft>AltRight{RST=-2000}

(RSR, RSL and RST are the jets, ALTLeft is the altitude of a chip on the left of the chip and AltRight is the same vise versa)

Warbird
Tank
Tank

Posts : 60
Join date : 2010-10-27
Age : 22
Location : Germany

View user profile

Back to top Go down

Re: Starship

Post by Warbird on Wed Oct 27, 2010 10:12 am

Ok im currently working on a redundant stabilization and it starts working but please if you have any ideas tell me!
I couldn´t solve the problem of infinite rolling (same for yaw Sad ) but its at least better with the new stabilization

Code:
JFBR=((AltRear/AltFront)-1)*5000
JFBL=((AltRear/AltFront)-1)*5000
JRTL=((AltRear/AltFront)-1)*5000
JRTR=((AltRear/AltFront)-1)*5000
JFTR=((AltFront/AltRear)-1)*5000
JFTL=((AltFront/AltRear)-1)*5000
JRBL=((AltFront/AltRear)-1)*5000
JRBR=((AltFront/AltRear)-1)*5000

AltRear is the altitude of a chip in the rear section of the ship
AltFront is the altitude of a chip on the front section of the ship
Note: This is the pitch stabilization. The Jets names also tell where they are:
JRBR= Jet-Rear-Bottom-right
JFTL=Jet-Front-Top-left
JFTBL=Jet-Front-Botom-Left
... and so on


Last edited by Warbird on Thu Oct 28, 2010 4:26 am; edited 3 times in total (Reason for editing : updating (i wrote it would be yaw stabilization which is rubbish as its pitch stabilization in fact))

Warbird
Tank
Tank

Posts : 60
Join date : 2010-10-27
Age : 22
Location : Germany

View user profile

Back to top Go down

Re: Starship

Post by RA2lover on Fri Oct 29, 2010 3:29 pm

proportional only controllers have this problem. i used to use cubic stabilization(ex: jet power = (k*angleerror)^3 for a hovering vehicle(OLD), which only had the problem when the angle stabilization was too large.
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: Starship

Post by DanielLC on Sat Oct 30, 2010 12:22 am

The simple way is to give it artificial friction. Just thrust in the opposite direction that it's spinning.

If you want to get it totally ideal, have it check to see if, with the jets turning it the opposite direction, it will manage to pass the position it's supposed to go to. If it would pass it, accelerate away, otherwise, accelerate towards. Unfortunately, this requires knowing the moment of inertia for your ship. You should be able to find this fairly accurately just by turning on the jets and having it tell you how fast it accelerates.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Starship

Post by JHaskly on Sat Oct 30, 2010 5:49 am

Hmm... DanielLC, have you had a look through Bwansy's state library? I'm fairly sure it has a moment of inertia function (and heaps else).

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Starship

Post by Sting Auer on Sat Oct 30, 2010 12:54 pm

if you use _WX(),_WY(), and the _WZ() functions, you can make the jets create artificial friction.

just put (as an example) NOSEJET=_WX()*100

the value you multiply it by will have to be changed, and it would turning speed some, but it will also make it controllable, which is probably more important.
avatar
Sting Auer
Hover
Hover

Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.

View user profile

Back to top Go down

Re: Starship

Post by DanielLC on Sat Oct 30, 2010 3:31 pm

Haskley, it has principle moment of inertia. You'd still have to premultiply it by the rotation matrix to get the tensor. You'd then have to invert that matrix to figure out how much thrust to give it.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Starship

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum