Editing Vessel Tutorial 2

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 101: Line 101:
 
== Translation RCS ==
 
== Translation RCS ==
  
Many modern and historical spacecraft have only limited translational capability. For example, the Cassini orbiter only has translation forward. Surveyor had no translation RCS at all. Instead it relies on the vernier engines. So let's ditch the translation thruster groups. We will leave the thrusters, but just remove the capability to use them as translation thrusters, while retaining them as rotation thrusters. Cut the following code chunks:
+
Many modern and historical spacecraft have only limited translational capability. For example, the Cassini orbiter only has translation forward. Surveyor had no translation RCS at all. Instead it relies on the vernier engines. So let's ditch the translation thruster groups. We will leave the thrusters, but just remove the capability to use them as translation trhusters, while retaining them as rotation thrusters. Cut the following code chunks:
  
 
   th_group[0] = th_rcs[0];
 
   th_group[0] = th_rcs[0];
Line 136: Line 136:
 
# Main retro solid fuel
 
# Main retro solid fuel
  
Notice that even though in reality the vernier fuel and oxidizer need to be kept in separate tanks (they are hypergolic), in Orbiter, they are both treated as "propellant" and are both kept in the same propellant resource. This is because each engine can only use one propellant resource at a time.
+
Notice that even though in reality the vernier fuel and oxidizer needs to be kept in separate tanks (they are hypergolic), in Orbiter, they are both treated as "propellant" and are both kept in the same propellant resource. This is because each engine can only use one propellant resource at a time.
  
 
First, let's recycle the ShuttlePB fuel tank as the vernier propellant tanks. We already did this above when we replaced hpr with ph_vernier. We will, however, change the mass of propellant in it. Find the line which defines ph_vernier, and change it like this:
 
First, let's recycle the ShuttlePB fuel tank as the vernier propellant tanks. We already did this above when we replaced hpr with ph_vernier. We will, however, change the mass of propellant in it. Find the line which defines ph_vernier, and change it like this:
Line 169: Line 169:
 
Surveyor carried a number of cold-gas thrusters for reaction control. These just used high-pressure nitrogen. These engines are weak and inefficient, but extremely simple and safe. No flammable fuel is needed for them, only a high-pressure gas tank.
 
Surveyor carried a number of cold-gas thrusters for reaction control. These just used high-pressure nitrogen. These engines are weak and inefficient, but extremely simple and safe. No flammable fuel is needed for them, only a high-pressure gas tank.
  
It is a fundamental principle of attitude control that you need a minimum of two thrusters for each control direction. This is so that the linear forces of each thruster cancel out and only the torques remain. For a total of three axes (pitch, yaw, roll), and two control directions for each (plus and minus), you would seem to need 2*3*2=12 thrusters at a minimum for rotational RCS.  
+
It is a fundamental principle of attitude control that you need a minimum of two thrusters for each control direction. This is so that the linear forces of each thruster cancel out and only the torques remain. For a total of three axes (Pitch, yaw, roll), and two control directions for each (Plus and minus), you would seem to need 2*3*2=12 thrusters at a minimum for rotational RCS.  
  
 
Surveyor only has six.
 
Surveyor only has six.
  
This is because the designers of Surveyor were primarily concerned with simplicity on board the spacecraft. They put on one thruster for plus roll and one for minus roll. These engines were installed up on Leg 1, pointing to +X and -X (left and right). Using one of these engines creates both a roll torque and a linear force. Burn one of these engines long enough, and you may deflect your landing site or miss the moon completely. Back in the day, the guys on the ground calculating the mid-course correction had to take into account this imbalance of force. This kept with the philosophy of spacecraft simplicity by shifting the complexity to the big, room-sized computers on the ground. Fortunately since the RCS is weak, this force is small. Also, once the spacecraft settles into a particular attitude, one would expect to use about the same amount of + and - control to keep it stable. Thus, the linear forces mostly cancel out anyway.
+
This is because the designers of Surveyor were primarily concerned with simplicity on board the spacecraft. They put on one thruster for plus roll and one for minus roll. These engines were installed up on Leg 1, pointing to +X and -X (left and right). Using one of these engines creates both a roll torque and a linear force. Burn one of these engines long enoug, and you may deflect your landing site or miss the moon completely. Back in the day, the guys on the ground calculating the mid-course correction had to take into account this unbalance of force. This kept with the philosophy of spacecraft simplicity by shifing the complexity to the big, room-sized computers on the ground. Fortunately since the RCS is weak, this force is small. Also, once the spacecraft settles into a particular attitude, one would expect to use about the same amount of + and - control to keep it stable. Thus, the linear forces mostly cancel out anyway.
  
Surveyor has two thrusters on Leg 2 and two on Leg 3. Both pairs have one member pointing at +Z (forward) and one at -Z (back). These are used to control pitch and yaw. To yaw, one +Z engine on one leg and one -Z engine on the other leg are fired. These are balanced, resulting in a perfect yaw control system. To pitch, either both +Z or both -Z engines are fired. This generates a pitch torque, but also a linear thrust, which again must be accounted for on the ground.
+
Surveyor has two thrusters on Leg 2 and two on Leg 3. Both pairs have one member pointing at +Z (foreward) and one at -Z (back). These are used to control pitch and yaw. To yaw, one +Z engine on one leg and one -Z engine on the other leg are fired. These are balanced, resulting in a perfect yaw control system. To pitch, either both +Z or both -Z engines are fired. This generates a pitch torque, but also a linear thrust, which again must be acconted for on the ground.
  
 
One more thing to remember: The legs are well behind the spacecraft center of mass. Because of this, the roll jets will induce a certain amount of yaw, as well as roll.
 
One more thing to remember: The legs are well behind the spacecraft center of mass. Because of this, the roll jets will induce a certain amount of yaw, as well as roll.
Line 278: Line 278:
 
= Spacecraft Empty Mass =
 
= Spacecraft Empty Mass =
  
The total mass of the spacecraft is continually tracked by Orbiter, and consists of the declared empty mass of the spacecraft and the total mass in all the propellant resources. The empty mass is normally constant, but things like jettisons will change the mass. Let's put the mass determination into a separate function. This will help out later when we start jettisoning parts.
+
The total mass of the spacecraft is continually tracked by Orbiter, and consists of the declared empty mass of the spacecraft and the total mass in all the propellant resources. The empty mass is normally constant, but things like jettisons will change the mass. Let's put the mass determination into a seperate function. This will help out later when we start jettisoning parts.
  
 
Add the following code to the class definition, to define the new method
 
Add the following code to the class definition, to define the new method
Line 333: Line 333:
 
= Main Retro =
 
= Main Retro =
  
Can we land yet? Yes, if you are less than 15km from the surface and travelling downward at less than 200m/s. You can try to set up a scenario by flying a much more maneuverable vehicle (like, say, a ShuttlePB) to an appropriate altitude and velocity. Go up to about 15km, then use translation jets or just point nose down and use the main jets, to get to about 200m/s downward. The horizontal speed should be as close to zero as you can get it. Point the nose straight up, then quit Orbiter, edit the Current State scenario, and replace the ShuttlePB with Surveyor. Remember to set the PRPLEVEL line correctly, or you may end up without RCS fuel!
+
Can we land yet? Yes, if you are less than 15km from the surface and travelling downward at less than 200m/s. You can try to set up a scenario by flying a much more maneuverable vehicle (Like, say, a ShuttlePB) to an appropriate altitude and velocity. Go up to about 15km, then use translation jets or just point nose down and use the main jets, to get to about 200m/s downward. The horizontal speed should be as close to zero as you can get it. Point the nose straight up, then quit Orbiter, edit the Current State scenario, and replace the ShuttlePB with Surveyor. Remember to set the PRPLEVEL line correctly, or you may end up without RCS fuel!
  
 
Now run Orbiter again, and start the Current State. Turn on the retrograde autopilot. Then just land it! It is theoretically possible, and with sufficient practice actually possible, to land Surveyor under these conditions. It's almost exactly like all the old lunar lander video games. Just get vertical speed to zero as altitude reaches zero. The survivable landing speed of a Surveyor is something around 5m/s downward.
 
Now run Orbiter again, and start the Current State. Turn on the retrograde autopilot. Then just land it! It is theoretically possible, and with sufficient practice actually possible, to land Surveyor under these conditions. It's almost exactly like all the old lunar lander video games. Just get vertical speed to zero as altitude reaches zero. The survivable landing speed of a Surveyor is something around 5m/s downward.
Line 361: Line 361:
 
  const double RETRO_STA  = -0.75;
 
  const double RETRO_STA  = -0.75;
  
Notice that the retro ISP is calculated here, unlike for the other engines. This is because there was no specification in the documentation. However, the nominal average thrust and total burn time was specified.
+
Notice that the retro ISP is calculated here, unlike for the other engines. This is because there was no specifications in the documentation. However, the nominal average thrust and total burn time was specified.
  
 
Compile and test. Notice how much heavier the spacecraft is now. If you are in the air, you probably can't land safely anymore, and if you are on the surface, you probably can't take off. Also, the retro engine is there, ready to be fired, but what button fires it? Right now, none. You can't control the retro at all. Let's fix that. Add another method to the class definition
 
Compile and test. Notice how much heavier the spacecraft is now. If you are in the air, you probably can't land safely anymore, and if you are on the surface, you probably can't take off. Also, the retro engine is there, ready to be fired, but what button fires it? Right now, none. You can't control the retro at all. Let's fix that. Add another method to the class definition
Line 430: Line 430:
 
So, we dumped the AMR and retro casing, but where did they go? It would be great to see them fall away. We can do that!
 
So, we dumped the AMR and retro casing, but where did they go? It would be great to see them fall away. We can do that!
  
First, lets prepare the new objects. Each different object has to have its own mesh and config file. In our case, we will borrow again a mesh from Surveyor1-1.zip. This time it's engine1.msh. Use the ShipEdit program to magnify this by a factor of 5, and save it as Orbiter\meshes\Surveyor-Retro.msh.
+
First, lets prepare the new objects. Each different object has to have its own mesh and config file. In our case, we will borrow again a mesh from Surveyor1-1.zip. This time its engine1.msh. Use the ShipEdit program to magnify this by a factor of 5, and save it as Orbiter\meshes\Surveyor-Retro.msh.
  
 
Now, the Surveyor1-1.zip file doesn't have a mesh for the AMR, so let's simulate one. Squish Surveyor-Retro.msh in the X and Y directions to 50% and the Z direction to 20%. Now rotate it around X by 180deg. Save this as Orbiter\meshes\Surveyor-AMR.msh
 
Now, the Surveyor1-1.zip file doesn't have a mesh for the AMR, so let's simulate one. Squish Surveyor-Retro.msh in the X and Y directions to 50% and the Z direction to 20%. Now rotate it around X by 180deg. Save this as Orbiter\meshes\Surveyor-AMR.msh
Line 553: Line 553:
 
So, now we can call SetupMeshes whenever we originally set up the vehicle state in clbkSetClassCaps, and whenever the configuration changes, like in Jettison. Replace the AddMesh line there with a call to SetupMeshes:
 
So, now we can call SetupMeshes whenever we originally set up the vehicle state in clbkSetClassCaps, and whenever the configuration changes, like in Jettison. Replace the AddMesh line there with a call to SetupMeshes:
  
   SetupMeshes();
+
   void SetupMeshes();
  
 
Also, add this line to the bottom of the Jettison method, after the case statement.
 
Also, add this line to the bottom of the Jettison method, after the case statement.
Line 572: Line 572:
  
 
Check here for the [[Surveyor Source Code]]
 
Check here for the [[Surveyor Source Code]]
 
[[Category: Articles]]
 
[[Category:Tutorials]]
 
[[Category:Add-on tutorials]]
 

Please note that all contributions to OrbiterWiki are considered to be released under the GNU Free Documentation License 1.2 (see OrbiterWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)