Starship
5 posters
RigidChips :: Rigid-Chips :: Files :: Works In Progress
Page 1 of 1
Starship
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
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)
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
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
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Starship
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 ) but its at least better with the new stabilization
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
I couldn´t solve the problem of infinite rolling (same for yaw ) 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
- Posts : 60
Join date : 2010-10-27
Age : 29
Location : Germany
Re: Starship
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.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Starship
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.
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
- Posts : 78
Join date : 2010-10-23
Re: Starship
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).
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Starship
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.
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.
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: Starship
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
- Posts : 78
Join date : 2010-10-23
RigidChips :: Rigid-Chips :: Files :: Works In Progress
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum