Difference between revisions of "Importing and Exporting to Other Applications"

From OpenRocket wiki
Jump to navigation Jump to search
(Created page with "By using OpenRocket's extension and listener mechanism, it's possible to modify the program itself to add features that are not supported by the program as distributed; some e...")
 
Line 1: Line 1:
By using OpenRocket's extension and listener mechanism, it's possible to modify the program itself to add features that are not supported by the program as distributed; some extensions that have been created already provide the ability to air-start a rocket, to add active roll control, and to calculate and save extra flight data.
+
<div style="text-align: center;">
 +
<div style="float: left;">[[Getting Started|&larr; Getting Started]]</div>
 +
<div style="float: right;">[[Basic Flight Simulation|Basic Flight Simulation &rarr;]]</div>
 +
[[Main Page|&uarr; Back to Contents]]
 +
</div>
  
This page will discuss extensions and simulations.  We'll start by showing how a simulation is executed (so you can get a taste of what's possible), and then document the process of creating the extension.  '''WARNING: writing an extension inserts new code into the program. It is entirely possible to disrupt a simulation in a way that invalidates simulation results, or can even crash the program.  Be careful!'''
+
{{UserGuideHelp}}
  
== Adding an Existing Extension to a Simulation ==
 
  
Extensions are added to a simulation through a menu in the "Simulation Options" tab.
+
__TOC__
# Open a .ork file and go to the '''Flight Simulations''' tab
 
# Click the '''Edit simulation''' button to open the '''Edit simulation''' dialog.
 
# Go to the '''Simulation options''' tab.
 
# Click the '''Add extension''' button
 
This will open a menu similar to the one in the following screenshot:
 
  
[[File:Extension-menu.png]]
 
  
Clicking on the name of an extension will add it to the simulation; if it has a configuration dialog the dialog will be opened:
+
In this section we'll look at how to design a basic rocket by examining the <strong>A simple model rocket</strong> design example. After reading this section you should have an understanding of how to start designing your own rockets. If you already know how to design your rocket, you can jump to the [[Basic Flight Simulation|next section]].<br/> <br/>
  
[[File:Air-start-configuration.png]]
+
We will start with a brief discussion on the selection of <strong><em>available components</em></strong>, and then the components used in the <strong><em>A simple model rocket</em></strong> example. Then we'll build a rocket from scratch to see how it’s done. <br />
  
In the case of the air-start extension, the configuration dialog allows you to set the altitude and velocity at which your simulation will begin.  After you close the configuration dialog (if any), a new panel will be added to the '''Simulation options''' pane, showing the new extension with buttons to reconfigure it, obtain information about it, or remove it from the simulation:
+
=== Component Configuration Window ===
  
[[File:Air-start-pane.png]]
+
There are several types of components available to you as a rocket designer, and you can either customize these to meet your specific needs, or simply load presets from the database. <br/><br/>
  
== Creating a New OpenRocket Extension ==
+
To start, let's begin a new project: <strong>File</strong> -> <strong>New</strong>. It doesn’t matter what we call it at the moment, but go ahead and save the design straight away: <strong>File</strong> -> <strong>Save</strong> your design. At this point you should be presented with a blank design window in the bottom half of the user interface.
  
The remainder of this page will describe how a new simulation extension is created.
+
[[File:01.New Design.png|thumb|800 px|center|The OpenRocket <em>main window</em>.]] <br/>
  
===Preliminary Concepts===
+
When you first start a new rocket design you will see that there are four categories of components available in the <strong>Add new component</strong> panel:
Before we can discuss writing an extension, we need to briefly discuss some of the internals of OpenRocket.  In particular,
+
<ul>
we need to talk about the simulation status, flight data, and simulation listeners.
+
<li><strong> Assembly Components</strong></li>
 +
<li><strong> Body Components and Fin Sets</strong></li>
 +
<li><strong> Inner Components</strong></li>
 +
<li><strong> Mass Components</strong></li>
 +
</ul><br>
  
====Simulation Status====
+
We would usually start building our rocket by selecting a <em>nose cone</em> but for the sake of this guide click the <strong>Body tube</strong> icon in the <strong>Body components and fin sets</strong> section. This will then open up a configuration window that we'll use to edit the parameters of the body tube. <br/>
As a simulation proceeds, it maintains its state in a <code>SimulationStatus</code>.  The <code>SimulationStatus</code> object contains information about the rocket's current position, orientation, velocity and simulation state. It also contains a reference to a copy of the rocket design and its configuration. Any simulation listener method may modify the state of the rocket by changing the properties of the <code>SimulationStatus</code> object.
 
  
You can obtain current information regarding the state of the simulation by calling <code>get*()</code> methods.  For instance, the rocket's current position is returned by calling <code>getRocketPosition()</code>; the rocket's position can be changed by calling <code>setRocketPosition<Coordinate position></code>.  All of the <code>get*()</code> and <code>set*()</code> methods can be found in <code>code/src/net/sf/openrocket/simulation/SimulationStatus.java</code>.  Note that while some information can be obtained in this way, it is not as complete as that found in <code>FlightData</code> and <code>FlightDataBranch</code> objects.
 
  
====Flight Data====
+
==== The Body Tube’ Configuration Window ====
OpenRocket refers to simulation variables as <code>FlightDataType</code>s, which are <code>List&lt;Double&gt;</code> objects with one list for each simulation variable and one element in the list for each time step.  To obtain a <code>FlightDataType</code>, for example the current motor mass, from <code>flightData</code>, we call <code>flightData.get(FlightDataType.TYPE_MOTOR_MASS))</code>. The standard <code>FlightDataType</code> lists are all created in <code>core/src/net/sf/openrocket/simulation/FlightDataType.java</code>; the mechanism for creating a new <code>FlightDataType</code> if needed for your extension will be described later.
 
  
Data from the current simulation step can be obtained with e.g. <code>flightData.getLast(FlightDataType.TYPE_MOTOR_MASS)</code>.
 
  
The simulation data for each stage of the rocket's flight is referred to as a <code>FlightDataBranch</code>.  Every simulation has at least one <code>FlightDataBranch</code> for its sustainer, and will have additional branches for its boosters.
+
At this point you should see a new window titled <strong>Body tube configuration</strong>.
  
Finally, the collection of all of the <code>FlightDataBranch</code>es and some summary data for the simulation is stored in a <code>FlightData</code> object. 
+
[[File:02.Body tube configuration.png|thumb|600 px|center|The <em>Configuration Window</em>.]] <br/>
  
====Flight Conditions====
+
This window allows you to either select a <em>preset</em> for the component type you are choosing, or make your own. Let’s start by examining how to customize it ourselves. If you have a look at the <em>Body tube configuration</em> window you will see that at the top there is a <strong> Component name</strong> field. Here we can change the name of the current component to anything we choose. (Note that this name will then appear in the design tree seen in the <em>Rocket Design</em> panel of the main program window.)<br/>
Current data regarding the aerodynamics of the flight itself are stored in a <code>FlightConditions</code> object. This includes things like the velocity, angle of attack, and roll and pitch angle and rates. It also contains a reference to the current <code>AtmosphericConditions</code>
 
  
====Simulation Listeners====
+
Just below <em>Component name</em> there are several tabs:<br/>
Simulation listeners are methods that OpenRocket calls at specified points in the computation to either record information or modify the simulation state.  These are divided into three interface classes, named <code>SimulationListener</code>, <code>SimulationComputationListener</code>, and <code>SimulationEventListener</code>.
+
<ul>
 +
<li><strong>General:</strong> allows us to alter the basic attributes of the component.</li>
 +
<li><strong>Motor:</strong> allows us to make the body tube into a motor mount, and also edit the properties of the motor.</li>
 +
<li><strong>Override:</strong> allows us to manually set the mass or centre of gravity for the component.</li>
 +
<li><strong>Appearance:</strong> allows us to select colours, textures and other finishes.</li>
 +
<li><strong>Comment:</strong> allows us to enter any comments or notes about the component.</li>
 +
</ul><br>
  
All of these interfaces are implemented by the abstract class <code>AbstractSimulationListener</code>. This class provides empty methods for all of the methods defined in the three interfaces, which are overridden as needed when writing a listener. A typical listener method (which is actually in the Air-start listener), would be
+
It should be noted that these tabs are specific to the component being designed. For example, a <em>nose cone</em> will not have a <em>motor</em> tab, but will instead have a <strong>shoulder</strong> tab. It will also have a description panel to tell you a bit more about the component you are choosing. After you learn how to navigate around one component <em>configuration panel</em>, the others should be relatively self-explanatory. <br/>
  
<pre>
 
public void startSimulation(SimulationStatus status) throws SimulationException {
 
    status.setRocketPosition(new Coordinate(0, 0, getLaunchAltitude()));
 
    status.setRocketVelocity(status.getRocketOrientationQuaternion().rotate(new Coordinate(0, 0, getLaunchVelocity())));
 
}
 
</pre>
 
  
This method is called when the simulation is first started.  It obtains the desired launch altitude and velocity from its configuration, and inserts them into the simulation status to simulate an air-start.
+
===== General Tab =====
  
The full set of listener methods, with documentation regarding when they are called, can be found in <code>core/src/net/sf/openrocket/AbstractSimulationListener.java</code>.
+
The rest of the <em>Body tube configuration</em> window lists the different parameters for the current component type. As you can see, the <em>General</em> tab provides options to manually enter numbers, or you can also use the spin boxes (coarse control) or sliders (fine control) provided to adjust the parameter values. The <strong>Automatic</strong> checkbox will adjust the dimensions of the component automatically. Here you will also see a <strong>Filled</strong> checkbox. If this is checked you will notice that the inner diameter goes to zero, i.e., a filled (solid) tube. Note how the Component mass changes when this box is checked.<br/><br/>
  
The listener methods can have three return value types:
+
On the right hand side of the window you will see the <strong>Component material</strong> and <strong>Component finish</strong> drop-down menus. If you click on these you will be presented with a list of various materials and finishes, each with their own weight and thickness. If you are using the same finish for the entire rocket you can click the <strong>Set for all</strong> button to make each component use the same finish. The last notable feature in this window is in the bottom left. There you will see a live display of the <strong>Component mass</strong>. This will update automatically as you change parameter values. Experiment with the sliders to see how the component changes in the <em>design window</em>.
  
* The <code>startSimulation()</code>, <code>endSimulation()</code>, and <code>postStep()</code> are called at a specific point of the simulation.  They are void methods and do not return any value.
+
You may have noticed that, apart from the mass, there is no noticeable difference when either the <em>inner diameter</em> or <em> wall thickness</em> parameters are changed. To see those changes reflected in the model you will have to switch to a different <em>View Type</em>, by selecting the desired view from the drop-down list at the left of the main OpenRocket program window.
  
* The <code>preStep()</code> and event-related hook methods return a boolean value indicating whether the associated action should be taken or not.  A return value of <code>true</code> indicates that the action should be taken as normally would be (default), <code>false</code> will inhibit the action.
+
===== Motor Tab =====
  
* The pre- and post-computation methods may return the computed value, either as an object or a double value. The pre-computation methods allow pre-empting the entire computation, while the post-computation methods allow augmenting the computed values.  These methods may return <code>null</code> or <code>Double.NaN</code> to use the original values (default), or return an overriding value.
+
Next to the General tab is the <strong>Motor</strong> tab. If you click on it you will see that most parameters are grayed-out, with the exception of one checkbox. As the label mentions, this is for when you want the body tube component to also be a <strong>motor mount</strong>.
 +
[[File:03.Motor tube tab.png|thumb|600 px|center|The <em>Motor tab</em> of the Configuration Window.]] <br/>
  
Every listener receives a <code>SimulationStatus</code> (see above) object as the first argument, and may also have additional arguments.
+
Have a quick look at this if you wish, but we'll discuss changing <em>flight configurations</em> for a later section of the guide.
 
 
Each listener method may also throw a <code>SimulationException</code>.  This is considered an error during simulation (not a bug), and an error dialog is displayed to the user with the exception message.  The simulation data produced thus far is not stored in the simulation.  Throwing a <code>RuntimeException</code> is considered a bug in the software and will result in a bug report dialog.
 
  
If a simulation listener wants to stop a simulation prematurely without an error condition, it needs to add a flight event of type <code>FlightEvent.SIMULATION_END</code> to the simulation event queue:
+
===== Override =====
<pre>
 
status.getEventQueue().add(new FlightEvent(FlightEvent.Type.SIMULATION_END, status.getSimulationTime(), null));
 
</pre>
 
This will cause the simulation to be terminated normally.
 
  
=== Creating a New Simulation Extension ===
+
We'll take a quick look at this tab, as it common to most components. For starting out though, you most likely will not need it.
  
Creating an extension for OpenRocket requires writing three classes:
+
[[File:04.Body tube override tab.png|thumb|600 px|center|The <em>Override tab</em> of the Configuration Window.]] <br/>
  
* A listener, which extends <code>AbstractSimulationListener</code>. This will be the bulk of your extension, and performs all the real work.
+
This tab would be used when you specifically wanted to override the mass and centre of gravity (CG) of the component.
  
* An extension, which extends <code>AbstractSimulationExtension</code>. This inserts your listener into the simulation. Your listener can (and ordinarily will) be private to your extension.
+
===== Appearance =====
  
* A provider, which extends <code>AbstractSimulationExtensionProvider</code> This puts your extension into the menu described above.
+
Everyone likes something shiny, don’t they? This tab allows you edit the appearance of the component.
  
In addition, if your extension will have a configuration GUI, you will need to write:
+
[[File:05.Body tube appearance tab.png|thumb|600 px|center|The <em>Appearance tab</em> of the Configuration Window.]] <br/>
  
* A configurator, which extends <code>AbstractSwingSimulationExtensionConfigurator&lt;E&gt;</code>
+
There are two sections here, the <strong>Figure style</strong> section and the <strong>Appearance</strong> section. <em>Figure style</em> changes what the 2D figure looks like, whereas <em>Appearance</em> will change what the 3D model will look like. If you wish to use any custom textures or images in your rocket design, you can load those through the <strong>Texture</strong> drop-down menu.
  
You can either create your extension outside the source tree and make sure it is in a directory that is in your Java classpath when OpenRocket is executed, or you can insert it in the source tree and compile it along with OpenRocket.  Since all of OpenRocket's code is freely available, and reading the code for the existing extensions will be very helpful in writing your own, the easiest approach is to simply insert it in the source tree.  If you select this option, a very logical place to put your extension is in
+
===== Comment =====
  
<code>core/src/net/sf/openrocket/simulation/extension/example/</code>
+
This section does not really need much explanation. If you want to write any comments or notes about your component (why you chose the values you did, etc.), then this is the place to do it.
  
This is where the extension examples provided with OpenRocket are located. Your configurator, if any, will logically go in
+
[[File:06.Body tube comment tab.png|thumb|600 px|center|The <em>Comment tab</em> of the Configuration Window.]] <br/>
  
<code>swing/src/net/sf/openrocket/simulation/extension/example/</code>
+
Now that we have been through all of the tabs of the <em>Body Tube</em> component, click the Close button. You should now notice that the rest of the components are now unlocked in the top right of the <em>Design window</em>. This is because all component types can be added to a body tube. However, a <strong>Nose cone</strong> should be selected <strong>first</strong> if you are making your own rocket.
  
====Extension Example====
+
Let’s have a look at the full list of components. If you cannot click on the component type, try selecting the <em>Body tube</em> in the design window in the top left panel of OpenRocket.
  
To make things concrete, we'll start by creating a simple example extension, to air-start a rocket from a hard-coded altitude.  Later, we'll add a configurator to the extension so we can set the launch altitude through a GUI at run time. This is a simplified version of the <code>AirStart</code> extension located in the OpenRocket source code tree; that class also sets a start velocity.
+
=== Available Design Elements ===
  
{| align="top"
+
As previously mentioned, there are 4 categories to choose components from within OpenRocket. These are split into four sections: <br/>
| <pre>
+
<ul>
1
+
<li><strong>Assembly Components</strong></li>
2
+
<li><strong>Body Components and Fin Sets</strong></li>
3
+
<li><strong>Inner Components</strong></li>
4
+
<li><strong>Mass Components</strong></li>
5
+
</ul> <br/>
6
+
[[File:07.Component menu.png|thumb|800 px|centre|The <em>Component types</em> menu.]] <br/>
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
 
34
 
35
 
</pre>
 
| <pre>
 
package net.sf.openrocket.simulation.extension.example;
 
  
import net.sf.openrocket.simulation.SimulationStatus;
+
==== Assembly Components ====
import net.sf.openrocket.simulation.exception.SimulationException;
 
import net.sf.openrocket.simulation.extension.AbstractSimulationExtension;
 
import net.sf.openrocket.simulation.listeners.AbstractSimulationListener;
 
import net.sf.openrocket.util.Coordinate;
 
  
/**
+
Although called components, Assembly Components are NOT physical parts. Rather, an Assembly Component is an attachment point on which the framework of the rocket is built ('''''an Assembly Component is a container for physical parts'''''), and each type has features unique to that attachment type. These framework elements are intended to contain physical components, and '''''should NOT be left empty'''''. As you will see in the image, the framework types are: <br/>
* Simulation extension that launches a rocket from a specific altitude.
 
*/
 
public class AirStartExample extends AbstractSimulationExtension {
 
  
    public void initialize(SimulationConditions conditions) throws SimulationException {
+
<ul><li><strong>Stage</strong>: Every rocket has at least one stage, which is the basic framework element to which the rocket's physical components are attached. A Stage may be renamed, and has override and comment tabs. '''''A stage should NOT be used if empty.'''''</li>
        conditions.getSimulationListenerList().add(new AirStartListener());
+
<li><strong>Boosters</strong>: A booster is a framework element to which physical components are attached, and may be used to build separate pieces of the rocket, such as a glider. Boosters may ONLY be attached to a body tube, and CAN separate during flight from the stage to which a booster is associated. Boosters may be renamed, and have separation, general, override, and comment tabs. '''''A booster should NOT be used if empty.'''''</li>
    }
+
<li><strong>Pods</strong>: A pod is a framework element to which physical components are attached, and may be used to build connected pieces of the rocket that are adjacent to the main airframe, such as side motors. Pods may ONLY be attached to a body tube, and CANNOT separate from the stage to which a pod is associated. Pods may be renamed, and have general, override, and comment tabs. '''''A pod should NOT be used if empty.'''''</li></ul><br/>
  
    @Override
+
[[File:08.Assembly Components Icons.png|thumb|800 px|centre|The <em>Assembly Components</em> submenu.]] <br/>
    public String getName() {
 
        return "Air-Start Example";
 
    }
 
  
    @Override
+
==== Body Components and Fin Sets ====
    public String getDescription() {
 
        return "Simple extension example for air-start";
 
    }
 
  
    private class AirStartListener extends AbstractSimulationListener {
+
Within <em>Body Components and Fin Sets</em> we have 8 component types. These components make up the external and main body of the rocket; everything else is inside the rocket. As you will see in the image the component types are: <br/>
  
        @Override
+
<ul><li><strong>Nose Cone</strong>: The very tip of the rocket. Usually, you will select this component first.</li>
        public void startSimulation(SimulationStatus status) throws SimulationException {
+
<li><strong>Body Tube</strong>: As we have seen, the body tube makes up the main section of a stage.</li>
            status.setRocketPosition(new Coordinate(0, 0, 1000.0));
+
<li><strong>Transition</strong>: A component that usually joins one body tube to another (normally larger) tube.</li>
        }
+
<li><strong>Trapezoidal</strong> fin: A fin set that is in the shape of a trapezoid.</li>
    }
+
<li><strong>Elliptical</strong> fin: A fin set that is in the shape of an ellipse.</li>
}
+
<li><strong>Freeform</strong> fin: This special kind of fin takes any shape you want. If you add it to your model it will open up a design window for you to alter the shape as desired.</li>
</pre>
+
<li><strong>Tube Fins</strong> Special fins, typically made from body tubes attached to the outside of the rocket body.</li>
|}
+
<li><strong>Launch Lug</strong>: This component usually goes on the outside of a body tube and is used while the rocket is on the launch pad.</li></ul><br/>
  
There are several important features in this example:
+
[[File:ComponentBodyAndFins.png|thumb|800 px|centre|The <em>Body Components and Fin Sets</em> submenu.]] <br/>
* The <code>initialize()</code> method in lines 14-16, which adds the listener to the simulations <code>List</code> of listeners. This is the only method that is required to be defined in your extension.
 
* The <code>getName()</code> method in lines 19-21, which provides the extension's name. A default <code>getName()</code> is provided by <code>AbstractSimulationExtension</code>, which simply uses the classname (so for this example, <code>getName()</code> would have returned <code>"AirStartExample"</code> if this method hadn't overridden it).
 
* The <code>getDescription()</code> method in lines 24-26, which provides a brief description of the purpose of the extension. This is the method that provides the text for the <code>Info</code> button dialog shown in the first section of this page.
 
* The listener itself in lines 28-34, which provides a single <code>startSimulation()</code> method.  When the simulation for starts executing, this listener is called and the rocket is set to an altitude of 1000 meters.
 
  
This will create the extension when it's compiled, but it won't put it in the simulation extension menu.  To be able to actually use it, we need a provider, like this:
+
==== Inner Components ====
  
{| align="top"
+
Within <em>Inner Components</em> we have 5 component types, and these components are all internal. As with <em>Body components and fin sets</em> we will now run through the list of components. <br/>
| <pre>
+
<ul>
1
+
<li><strong>Inner tube</strong>: This component lets you add tubes to the inside of the main body tube.</li>
2
+
<li><strong>Coupler</strong>: Used in multi-stage rockets, a coupler joins two sections together.</li>
3
+
<li><strong>Centering ring</strong>: These can be used to support other components (e.g., a motor), in the centre of a larger tube.</li>
4
+
<li><strong>Bulkhead</strong>: This is a block of material that forms a stop or barrier between two different areas.</li>
5
+
<li><strong>Engine block</strong>: An engine block prevents the motor from moving forward in the motor mount tube.</li>
  6
+
</ul><br />
7
 
8
 
9
 
10
 
11
 
</pre>
 
| <pre>
 
package net.sf.openrocket.simulation.extension.example;
 
  
import net.sf.openrocket.plugin.Plugin;
+
[[File:ComponentInner.png|thumb|800 px|centre|The <em>Inner Components</em> submenu.]] <br/>
import net.sf.openrocket.simulation.extension.AbstractSimulationExtensionProvider;
 
  
@Plugin
+
==== Mass Components ====
public class AirStartExampleProvider extends AbstractSimulationExtensionProvider {
 
    public AirStartExampleProvider() {
 
        super(AirStartExample.class, "Launch conditions", "Air-start example");
 
    }
 
}
 
</pre>
 
|}
 
  
This class adds your extension to the extension menu.  The first <code>String</code> (<code>"Launch Conditions"</code>) is the first menu level, while the second (<code>"Air-start example"</code>) is the actual menu entry.  These strings can be anything you want; using a first level entry that didn't previously exist will add it to the first level menu.
+
Within <em>Mass Components</em> we have 4 component types. They are:<br />
  
Try it! Putting the extension in a file named <code>core/src/net/sf/openrocket/simulation/extensions/example/AirStartExample.java</code> and the provider in <code>core/src/net/sf/openrocket/simulation/extensions/example/AirStartExampleProvider.java</code>, compiling, and running will give you a new entry in the extensions menu; adding it to the simulation will cause your simulation to start at an altitude of 1000 meters.
+
<ul>
 +
<li><strong>Parachute</strong>: Like any good parachute, this component will stop your rocket from becoming scrap.</li>
 +
<li><strong>Streamer</strong>: Another component for keeping your rocket safe, a streamer creates drag as your rocket falls down to earth.</li>
 +
<li><strong>Shock Cord</strong>: A shock cord secures the nose cone to the body of the rocket so that it isn't lost when the nose is blown off to deploy the parachute/streamer.</li>
 +
<li><strong>Mass Component</strong>: This is a block of mass used to adjust the rocket's Center of Gravity (CG). You can name it to whatever you want it to represent.</li>
 +
</ul><br/>
  
====Adding a Configurator====
+
[[File:ComponentMasses.png|thumb|800 px|centre|The <em>Mass Components</em> submenu.]] <br/>
To be able to configure the extension at run time, we need to write a configurator and provide it with a way to communicate with the extension First, we'll modify the extension as follows:
 
  
{| align="top"
+
You have now had a brief run through the various components available for use in OpenRocket. The next section will deal with an example rocket. <br/>
| <pre>
 
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
 
34
 
35
 
36
 
37
 
38
 
39
 
40
 
41
 
42
 
43
 
44
 
45
 
</pre>
 
| <pre>
 
package net.sf.openrocket.simulation.extension.example;
 
  
import net.sf.openrocket.simulation.SimulationStatus;
+
== A <em>Simple Model Rocket</em> Example ==
import net.sf.openrocket.simulation.exception.SimulationException;
 
import net.sf.openrocket.simulation.extension.AbstractSimulationExtension;
 
import net.sf.openrocket.simulation.listeners.AbstractSimulationListener;
 
import net.sf.openrocket.util.Coordinate;
 
  
/**
+
In this section we will look at the components used in the <em>A simple model rocket</em> example design. To get started, start OpenRocket and navigate to the main window. As a reminder it looks like this:
* Simulation extension that launches a rocket from a specific altitude.
 
*/
 
public class AirStartExample extends AbstractSimulationExtension {
 
  
    public void initialize(SimulationConditions conditions) throws SimulationException {
+
[[File:Main_window.png|thumb|800 px|center|The Openrocket <em>main window</em>.]] <br/>
        conditions.getSimulationListenerList().add(new AirStartListener());
 
    }
 
  
    @Override
+
==== Opening Example Designs ====
    public String getName() {
 
        return "Air-Start Example";
 
    }
 
  
    @Override
+
We'll begin by looking at how to find and load the example rockets within OpenRocket. Recall that this was also covered in the <em>Getting Started</em> section of this guide, but as a refresher the steps for doing this are as follows: <br />
    public String getDescription() {
+
<ul>
        return "Simple extension example for air-start";
+
<li>In the main window, click on the <strong>File</strong> menu at the top left.</li>
    }
+
<li>Scroll down to <strong>Open Examples...</strong> open, and expand that menu. Here you will see a list of the available rocket design examples.</li>
 +
</ul><br />
 +
Your screen should now look like this:
  
    public double getLaunchAltitude() {
+
[[File:OpenExample.png|thumb|800 px|center|Opening an <em> example rocket </em>]] <br/>
        return config.getDouble("launchAltitude", 1000.0);
 
    }
 
  
    public void setLaunchAltitude(double launchAltitude) {
+
Click on first example, our <strong><em>Simple model rocket</em></strong>. A <em>Rocket configuration</em> window should appear, with the <em>Design Name</em> (A simple model Rocket) and <em>Designer</em> (Sampo Niskanen) fields populated. The <em>Comments</em> and <em>Revision History </em> fields will be blank. Click <strong>Close</strong>. You should now have successfully loaded the rocket and be able to see a 2D schematic in the <em>Rocket Design</em> window.
        config.put("launchAltitude", launchAltitude);
 
        fireChangeEvent();
 
    }
 
       
 
    private class AirStartListener extends AbstractSimulationListener {
 
  
        @Override
+
[[File:After_complete_design.png|thumb|1000 px|center|Bottom half of the <em>Rocket design</em> window.]] <br/>
        public void startSimulation(SimulationStatus status) throws SimulationException {
 
  
            status.setRocketPosition(new Coordinate(0, 0, getLaunchAltitude()));
+
==== Components used in ‘A simple model rocket’ ====
        }
 
    }
 
}
 
</pre>
 
|}
 
  
This adds two methods to the extension (<code>getLaunchAltitude()</code> and <code>setLaunchAltitude()</code>), and calls <code>getLaunchAltitude()</code> from within the listener to obtain the configured launch altitude. <code>config</code> is a <code>Config</code> object, provided by <code>AbstractSimulationExtension</code> (so it isn't necessary to call a constructor yourself). <code>core/src/net/sf/openrocket/util/Config.java</code> includes methods to interact with a configurator, allowing the extension to obtain <code>double</code>, <code>string</code>, and other configuration values.
+
Now we will have a quick look through the components used in the example rocket. If you look towards the top left of the <strong>Rocket Design</strong> window you will see that there is a tree of components shown. By default they should all be fully expanded. If not, do so now.
  
In this case, we'll only be defining a single configuration field in our configurator, <code>"launchAltitude"</code>.
+
[[File:Structure.png|thumb|397 px|center|Top left-hand portion of the <em>Rocket design</em> window.]]<br/>
  
The <code>getLaunchAltitude()</code> method obtains the air-start altitude for the simulation from the configuration, and sets a default air-start altitude of 1000 meters. Our <code>startSimulation()</code> method has been modified to make use of this to obtain the user's requested air-start altitude from the configurator, in place of the original hard-coded value.
+
This image shows <em>A simple model rocket</em> at the top, followed by the <strong>Sustainer</strong>, which is <em>Stage 1</em> of the rocket. <br/>
  
The <code>setLaunchAltitude()</code> method places a new launch altitude in the configuration. While our extension doesn't make use of this method directly, it will be necessary for our configurator. The call to <code>fireChangeEvent()</code> in this method assures that the changes we make to the air-start altitude are propagated throughout the simulation.
+
If we look at the first component in the <em>Sustainer</em> stage we see that it is the nose cone. Double click on that now. This will bring up the <em>Nose cone configuration</em> window.
  
The configurator itself looks like this
+
[[File:ConfigNose.png|thumb|600 px|center|Nose Cone Configuration Window.]]<br/>
{| align="top"
 
| <pre>
 
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
32
 
33
 
34
 
35
 
36
 
37
 
38
 
39
 
30
 
31
 
42
 
43
 
</pre>
 
| <pre>
 
package net.sf.openrocket.simulation.extension.example;
 
  
import javax.swing.JComponent;
+
As we have already examined the <em>configuration window</em> we will not repeat ourselves here. However, you will see that in this example we have used an <strong>Ogive</strong> nose cone with a <em>Shape parameter</em> of 1.0. If you read the description of the component to the right in the configuration window, you will discover that a value of 1.0 produces a <strong>tangent ogive</strong>. <br/>
import javax.swing.JLabel;
 
import javax.swing.JPanel;
 
import javax.swing.JSpinner;
 
  
import net.sf.openrocket.document.Simulation;
+
Moving down the window, you will see that the <strong>Nose cone length</strong> has a value of 10, the <strong>Base diameter</strong> has a value of 2.5, and the <strong> Wall thickness</strong> has a value of 0.2. All of these parameters have been set, in this example, to use centimeters (<strong>cm</strong>) as their unit. You should also see that this component is using <strong>Polystyrene</strong> as its material with a <strong>Regular paint</strong> finish. As you can see, the material has a density of 1.05 grams per centimeter cubed, and the paint is 60.0 micrometers thick. In the bottom left, the component <em>weight</em> is currently 13.2 grams. Go ahead and play around with the sliders to see how the component changes, and then change them back when you are finished. <br/>
import net.sf.openrocket.gui.SpinnerEditor;
 
import net.sf.openrocket.gui.adaptors.DoubleModel;
 
import net.sf.openrocket.gui.components.BasicSlider;
 
import net.sf.openrocket.gui.components.UnitSelector;
 
import net.sf.openrocket.plugin.Plugin;
 
import net.sf.openrocket.simulation.extension.AbstractSwingSimulationExtensionConfigurator;
 
import net.sf.openrocket.unit.UnitGroup;
 
  
@Plugin
+
If you move over to the <em>Shoulder</em> tab, you'll be able to see the size attributes of the shoulder. Again, you can play around with the sliders if you want--as long as you change them back to the original settings when you are finished. For reference these are <strong>2.3, 2.0</strong> and <strong>0.2</strong> centimeters, respectively. Also have a look through the rest of the tabs to see what has been selected. The only other thing to note is that the appearance has been customized. If you were to change to the <strong>3D Finished</strong> view type, you will see how the finished model looks. <br/>
public class AirStartConfigurator extends AbstractSwingSimulationExtensionConfigurator<AirStart> {
 
 
    public AirStartConfigurator() {
 
        super(AirStart.class);
 
    }
 
 
    @Override
 
    protected JComponent getConfigurationComponent(AirStart extension, Simulation simulation, JPanel panel) {
 
        panel.add(new JLabel("Launch altitude:"));
 
  
        DoubleModel m = new DoubleModel(extension, "LaunchAltitude", UnitGroup.UNITS_DISTANCE, 0);
+
Moving on to the <em>Body tube</em>, you can access its various attributes by double-clicking on it in the <em>Rocket design</em> window. Note how its various attributes have been set to create the current size. This is all fairly straightforward and as we have already looked into the various components earlier, we will not go into great detail here. <br/>
  
        JSpinner spin = new JSpinner(m.getSpinnerModel());
+
Note the eight other components that have been placed onto the <em>Body tube</em>. In descending order these are: <br/>
        spin.setEditor(new SpinnerEditor(spin));
+
<ul>
        panel.add(spin, "w 65lp!");
+
    <li><strong>Trapezoidal fin set</strong></li>
 +
<li><strong>Inner Tube</strong></li>
 +
<li><strong>Centering Ring</strong></li>
 +
<li><strong>Centering Ring</strong></li>
 +
<li><strong>Shock Cord</strong></li>
 +
<li><strong>Parachute</strong></li>
 +
<li><strong>Wadding</strong></li>
 +
<li><strong>Launch lug</strong></li>
 +
</ul><br />
 +
The <em>Inner Tube</em> in this design is used as a motor mount. You will see this if you go to the <strong>Motor</strong> tab in the <em>Inner Tube configuration</em> window. This means that a motor has been fitting into this piece. Upon inspection we can see that the current motor name is displayed in the <strong>Flight configuration</strong> drop-down list, on the right side of the main OpenRocket window. You can open this drop-down menu to select other motors that are available for use in this simulation, as well as the other example simulations that you will see on the <em>Flight simulation</em> tab. <br/>
  
        UnitSelector unit = new UnitSelector(m);
+
The ninth component is place inside the <em>inner tube</em>. This is the engine block. If you look at the schematic of the rocket you will see that this is placed in front of the grey rectangle, which is the motor. To quickly address some of the other components, you will note that the recovery method used in this rocket is a <em>Parachute</em>: the red dashed rounded-rectangle near the nose cone of the rocket. Along with the parachute we have a <em>Shock cord</em>, which (as was discussed earlier) prevents loss of the nose cone upon deployment of the recovery system. This is shown as a long, black, dashed rounded-rectangle in the same general area as the parachute. The other black, dashed rounded-rectangle box is the <em>Wadding</em>, which is a mass component and is used here to bring the centre of gravity forward towards the nose. <br/>
        panel.add(unit, "w 25");
 
  
        BasicSlider slider = new BasicSlider(m.getSliderModel(0, 5000));
+
We have now looked through the components used within the simple model rocket example. If you would like to see other available components, see <strong>Appendix A</strong>. Now that we are familiar with what makes up the rocket we will go ahead and build one from scratch! <br/><br/>
        panel.add(slider, "w 75lp, wrap");
 
 
        return panel;
 
    }
 
}
 
</pre>
 
|}
 
  
After some boilerplate, this class creates a new <code>DoubleModel</code> to manage the airstart altitude.  The most important things to notice about the <code>DoubleModel</code> constructor are the parameters <code>"LaunchAltitude"</code> and <code>UnitGroup.UNITS_DISTANCE</code>.
+
== Building ‘A simple model rocket’ ==
* <code>"LaunchAltitude"</code>  is used by the system to synthesize calls to the <code>getLaunchAltitude()</code> and <code>setLaunchAltitude()</code> methods mentioned earlier. The name of the <code>DoubleModel</code>, <code>"LaunchAltitude"</code>, '''''MUST''''' match the names of the corresponding <code>set</code> and <code>get</code> methods exactly.  If they don't, there will be an exception at run time when the user attempts to change the value.
 
* <code>UnitGroup.UNITS_DISTANCE</code> specifies the unit group to be used by this <code>DoubleModel</code>. OpenRocket uses SI (MKS) units internally, but allows users to select the units they wish to use for their interface.  Specifying a <code>UnitGroup</code> provides the conversions and unit displays for the interface.  The available <code>UnitGroup</code>s are defined in <code>core/src/net/sf/openrocket/unit/UnitGroup.java</code>
 
  
The remaining code in this method creates a <code>JSpinner</code>, a <code>UnitSelector</code>, and a <code>BasicSlider</code> all referring to this <code>DoubleModel</code>.  When the resulting configurator is displayed, it looks like this:
+
In this section we will build up the example model from scratch. After you have completed this process, you should be able to apply what you've learned in order to make any basic rocket you want. So let’s begin... <br/>
  
[[File:Example_Configurator.png]]
+
Open a new project window so that everything is blank. The following are the steps that you will follow to create the rocket. <br/>
  
The surrounding Dialog window and the '''Close''' button are provided by the system.
+
1) <strong>Select the nose cone</strong>. Change its type to <strong>Ogive</strong>, if that isn't already selected. Make sure that <em>Shape parameter</em>, <em>Nose cone length</em>, <em>base diameter</em>, and <em>Wall thickness</em> values are set to <strong>1.0</strong>, <strong>10.0</strong>, <strong>2.5</strong> and <strong>0.2</strong>, respectively. The units are centimeters by default, so we should not need to change these. Finally, change the <em>Component material</em> to <strong>Polystyrene</strong>. <br/>
====Example User Extensions Provided With OpenRocket====
 
Several examples of user extensions are provided in the OpenRocket source tree.  As mentioned previously, the extensions are all located in <code>core/src/net/sf/openrocket/simulation/extension/example</code> and their configurators are all located in <code>swing/src/net/sf/openrocket/simulation/extension/example</code>.  Also recall that every extension has a corresponding provider.
 
  
{| class="wikitable" style="margin:auto"
+
2) Next, while still in the <em>Nose cone configuration</em> window, move to the <em>Shoulder</em> tab. Change the diameter to <strong>2.3</strong>, the length to <strong>2.0</strong>, and the thickness to <strong>0.2</strong>. Also, check the <strong>End capped</strong> box.<br/>
!Purpose!!Extension!!Configurator
+
 
|-
+
3) The last thing we have to do with the nose cone is to change its <em>Appearance</em>, so switch to that tab now. Leave the <em>Figure style</em> section unchanged but under the <em>Appearance</em> section, change the colour to one lighter than black. (Or to whatever you want, go crazy!) Then adjust the shine to 50%. That is all we need to change for now. <br/>
| Set air-start altitude and velocity||<code>AirStart.java</code>||<code>AirStartConfigurator.java</code>
+
 
|-
+
You should now see this in the view area at the bottom of the main OpenRocket window:
| Save some simulation values as a CSV file||<code>CSVSave.java</code>||''(none)''
+
 
|-
+
[[File:NoseComplete.png|thumb|600 px|center|Nose Cone]] <br/>
| Calculate damping moment coefficient after every simulation step||<code>DampingMoment.java</code>||''(none)''
+
 
|-
+
4) Next, add the <em>Body tube</em>. The measurements for <em>length</em>, <em>outer diameter</em>, <em>inner diameter</em>, and <em>wall thickness</em> are <strong>30.0</strong>, <strong>2.5</strong>, <strong>2.3</strong>, <strong>0.1</strong>, respectively. Note that it may be easier to enter the last two manually rather than use the spin boxes or sliders. Leave the <strong>Automatic</strong> and <strong>Filled</strong> boxes unchecked. The material should remain <strong>Cardboard</strong> and the finish should be <strong>Regular Paint</strong>. The only other thing you should change here is the appearance, but we'll leave that to you as an exercise. <br/>
| Print summary of simulation progress after each step||<code>PrintSimulation.java</code>||''(none)''
+
 
|-
+
You should now have this:
| Active roll control||<code>RollControl.java</code>||<code>RollControlConfigurator.java</code>
+
 
|-
+
[[File:BodyComplete.png|thumb|800 px|center|Nose Cone and Body]] <br/>
| Stop simulation at specified time or number of steps||<code>StopSimulation</code>||<code>StopSimulationConfigurator</code>
+
 
|}
+
5) Moving on, we next need to add a <strong>Fin set</strong>. Make sure you have clicked on the <em>Body tube</em> so that it’s highlighted then click on the <strong>Trapezoidal</strong> component type. The <em>Trapezoidal fin set configuration</em> window will have appeared. Leave the left side of the window alone: the settings there are fine as-is. However, we will need to change some things on the right hand side. First, change the <em>Fin cross section</em> to <strong>Rounded</strong>. Also, reduce the <em>Thickness</em> to <strong>0.2</strong>. That’s all we need to do in this tab. Now move to the <em>Appearance</em> tab and customize to your preference.
''Note:  documentation for adding user-created simulation listeners, without making use of the full extension mechanism, is also available at [[Simulation Listeners]]''
+
 
 +
[[File:FinsComplete.png|thumb|800 px|center|Nose Cone, Body, and Fins]] <br/>
 +
 
 +
6) The next component we need to add is the <strong>Inner tube</strong>. Once again highlight the body tube and then click on the <em>Inner tube</em> component button. There are a couple of attributes we should change here. First, increase the <em>Length</em> value to <strong>7.5</strong>. Also, increase the <em>Plus</em> value to <strong>0.5</strong>. Leave everything else the same. <br/>
 +
 
 +
Now go to the <em>Motor</em> tab. There are a few things we need to add here. To start, check the <em>This component is a motor mount</em> checkbox. This will allow us to add motors. The next few steps may seem complicated but do not be daunted by them. First, we will deal with the easy part: Increase the <em>Motor overhang</em> to <strong>0.3</strong>. Now click <em>Close</em> button to close the <em>Inner Tube configuration</em> window. <br />
 +
 
 +
<span id="motorconfig"></span>
 +
Now click on the <strong>Motors & Configuration</strong> tab towards the left upper corner of the main OpenRocket window, just under the menu bar. On the resulting page, note the <em>Motors</em> tab towards the left upper corner. Make sure the <em>Inner T...</em> box is checked, and then click on the <em>New Configuration</em> button in the top center portion of the upper panel. You should see that a new configuration has been added to the list of configuration.
 +
 
 +
[[File:MotorConfigs.png|thumb|1000 px|center|Motors & Configurations window]] <br/>
 +
 
 +
Left-click in the <em>Inner Tube</em> column, and then click the <strong>Select motor</strong> button just below the open panel on the right of the screen. The <em>Select a rocket motor</em> window now appears:
 +
 
 +
[[File:MotorSelection.png|thumb|1000 px|center|Motor Selection window]] <br/>
 +
 
 +
To make sure your window looks the same as the one above, follow these steps:<br />
 +
<ul>
 +
<li>Make sure the <em>Filter Motors</em> tab is selected in the top right corner of the window.</li>
 +
<li>Click "Clear All", then select only the <strong>Estes</strong> option in the <em>Manufacturer</em> list.</li>
 +
<li>Make sure that the <em>Total Impulse</em> slider is positioned over <strong>A</strong> (all the way to the left).</li>
 +
<li>Check both the "Limit motor diameter to mount diameter" and "Limit motor length to mount length" boxes.</li>
 +
<li>Look for the <strong>A8</strong> motor in list on the left side of the window. Click on it.</li>
 +
<li>In the <em>Ejection charge delay</em> field at the top left, enter the value <strong>3</strong>.</li>
 +
</ul>
 +
 
 +
Now click the <em>OK</em> button at the lower right corner of the window.<br /><br />
 +
 
 +
If everything went to plan, you have successfully added the <strong>Estes A8-3</strong> motor to your rocket. Now repeat these steps for the following motors, using a <em>New Configuration</em> for each new motor you add:<br/>
 +
<ul>
 +
<li><strong>Estes B6-4</strong></li>
 +
<li><strong>Estes C6-3</strong></li>
 +
<li><strong>Estes C6-5</strong></li>
 +
<li><strong>Estes C6-7</strong></li>
 +
</ul>
 +
<br />
 +
After you have added the rest of the motors, click back on the <em>Rocket design</em> tab just under the main menu. <br/>
 +
 
 +
 
 +
7) The next component we will add is the <strong>Engine Block</strong>. This time make sure that the <em>Inner tube</em> is highlighted and then add an engine block component. Change the <em>Inner diameter</em> to <strong>1.2</strong> and the <em>Wall thickness</em> to <strong>0.3</strong>. Also, change the <em>Position relative to:</em> <strong>Top of the parent component</strong>. The last change we will make is to increase <em>plus</em> to <strong>0.2</strong>. That is all we have to do for this component. <br/>
 +
 
 +
Your rocket should now look like this:
 +
 
 +
[[File:EngineBlockCompleted.png|thumb|800 px|center|Added  the Engine Block]] <br/>
 +
 
 +
8) We will now add two <strong>Centering Rings</strong>. Make sure the <em>Body tube</em> is highlighted in the list of components under <em>Rocket design</em>, then click on the <em>Centering ring</em> component type. The first one is fine as-is, so we will not make any changes. However, we will add the following line under the <em>Comment</em> tab: <strong>The centering ring automatically takes the outer diameter of the body tube and the inner diameter of the inner tube.</strong> <br/>
 +
 
 +
Now click <em>Close</em>, select the body tube again and add another <em>Centering ring</em>. This time all we have to do is to change <em>plus</em> to <strong>-4.5</strong>. Also, add the same comment as for the first ring.
 +
 
 +
[[File:CenteringRings.png|thumb|800 px|center|Added  Centering Rings]] <br/>
 +
 
 +
9) The next component we will add is the <strong>Shock cord</strong>. As usual, make sure the <em>Body tube</em> is selected before adding the shock cord component. After it has been added change the <em>Plus</em> value to <strong>2</strong>, <em>Packed length</em> to <strong>5.2</strong>, and <em>Packed diameter</em> to <strong>1.2</strong>. Again, we will add a comment to this component. Enter the following line to the <em>Comment</em> section: <strong>The shock cord does not need to be attached to anything in particular, as it functions only as a mass component.</strong>. Click the <em>Close</em> button to close the window, as the shock cord has now been completed.
 +
 
 +
[[File:ShockCordComplete.png|thumb|800 px|center|Added Shock Cord]] <br/>
 +
 
 +
10) Now we need to add the <strong>Parachute</strong>. With the body tube highlighted, add a parachute component. Change <em>Plus</em> to <strong>3.2</strong>, <em>Packed length</em> to <strong>4.2</strong> and <em>Packed diameter</em> to <strong>1.8</strong>. That is everything we need to do to the parachute. Click <em>Close</em> to close the window. You can see what your rocket should now look like below.
 +
 
 +
[[File:ParachuteAdded.png|thumb|800 px|center|Added Parachute]] <br/>
 +
 
 +
11) The second-to-last component to add is a <strong>Mass Component</strong>. Go ahead and add one to the body tube now. Adjust the <em>Mass</em> to <strong>2</strong> grams (g), the <em>Approximate density</em> to <strong>0.16</strong> g/cm^3, the <em>length</em> to <strong>3.0</strong>, the <em>diameter</em> to <strong>2.3</strong> and finally the <em>Plus</em> value to <strong>8.0</strong>. It may be easier to enter these manually. The last thing you have to do is to rename it from ‘Unspecified’ to <strong>Wadding</strong>. Leave everything else as it is and click the <em>Close</em> button.
 +
 
 +
[[File:AddedMass.png|thumb|800 px|center|Added Mass]] <br/>
 +
 
 +
12) Almost done! One final component left to add: the <strong>Launch lug</strong>. Add this to the body tube now. Change the <em>Length</em> to <strong>3.5</strong>, the <em>Outer diameter</em> to <strong>0.7</strong>, and the <em>inner diameter</em> to <strong>0.5</strong>. Leave the <em>Thickness</em> as it is. Also, change the <em>Radial position</em> to <strong>19</strong> degrees. Click <em>Close</em>.
 +
 
 +
[[File:LaunchLugAdded.png|thumb|800 px|center|Added Launch Lug]] <br/>
 +
 
 +
And that’s all there is to it. You have just completed building your first rocket within OpenRocket! From here you can use what you know to create more rockets, or you can proceed to the next section of the User Guide: [[Basic Flight Simulation]]. Have fun!
 +
 
 +
----
 +
<div style="text-align: center;">
 +
<div style="float: left;">[[Getting Started|&larr; Getting Started]]</div>
 +
<div style="float: right;">[[Basic Flight Simulation|Basic Flight Simulation &rarr;]]</div>
 +
[[Main Page|&uarr; Back to Contents]]
 +
</div>

Revision as of 08:32, 12 April 2023

↑ Back to Contents

The current User's Guide is very much a work in progress, any help would be greatly appreciated!
If you'd like to contribute something, just hit the 'Edit' tab at the top.



In this section we'll look at how to design a basic rocket by examining the A simple model rocket design example. After reading this section you should have an understanding of how to start designing your own rockets. If you already know how to design your rocket, you can jump to the next section.

We will start with a brief discussion on the selection of available components, and then the components used in the A simple model rocket example. Then we'll build a rocket from scratch to see how it’s done.

Component Configuration Window

There are several types of components available to you as a rocket designer, and you can either customize these to meet your specific needs, or simply load presets from the database.

To start, let's begin a new project: File -> New. It doesn’t matter what we call it at the moment, but go ahead and save the design straight away: File -> Save your design. At this point you should be presented with a blank design window in the bottom half of the user interface.

The OpenRocket main window.


When you first start a new rocket design you will see that there are four categories of components available in the Add new component panel:

  • Assembly Components
  • Body Components and Fin Sets
  • Inner Components
  • Mass Components


We would usually start building our rocket by selecting a nose cone but for the sake of this guide click the Body tube icon in the Body components and fin sets section. This will then open up a configuration window that we'll use to edit the parameters of the body tube.


The Body Tube’ Configuration Window

At this point you should see a new window titled Body tube configuration.

The Configuration Window.


This window allows you to either select a preset for the component type you are choosing, or make your own. Let’s start by examining how to customize it ourselves. If you have a look at the Body tube configuration window you will see that at the top there is a Component name field. Here we can change the name of the current component to anything we choose. (Note that this name will then appear in the design tree seen in the Rocket Design panel of the main program window.)

Just below Component name there are several tabs:

  • General: allows us to alter the basic attributes of the component.
  • Motor: allows us to make the body tube into a motor mount, and also edit the properties of the motor.
  • Override: allows us to manually set the mass or centre of gravity for the component.
  • Appearance: allows us to select colours, textures and other finishes.
  • Comment: allows us to enter any comments or notes about the component.


It should be noted that these tabs are specific to the component being designed. For example, a nose cone will not have a motor tab, but will instead have a shoulder tab. It will also have a description panel to tell you a bit more about the component you are choosing. After you learn how to navigate around one component configuration panel, the others should be relatively self-explanatory.


General Tab

The rest of the Body tube configuration window lists the different parameters for the current component type. As you can see, the General tab provides options to manually enter numbers, or you can also use the spin boxes (coarse control) or sliders (fine control) provided to adjust the parameter values. The Automatic checkbox will adjust the dimensions of the component automatically. Here you will also see a Filled checkbox. If this is checked you will notice that the inner diameter goes to zero, i.e., a filled (solid) tube. Note how the Component mass changes when this box is checked.

On the right hand side of the window you will see the Component material and Component finish drop-down menus. If you click on these you will be presented with a list of various materials and finishes, each with their own weight and thickness. If you are using the same finish for the entire rocket you can click the Set for all button to make each component use the same finish. The last notable feature in this window is in the bottom left. There you will see a live display of the Component mass. This will update automatically as you change parameter values. Experiment with the sliders to see how the component changes in the design window.

You may have noticed that, apart from the mass, there is no noticeable difference when either the inner diameter or wall thickness parameters are changed. To see those changes reflected in the model you will have to switch to a different View Type, by selecting the desired view from the drop-down list at the left of the main OpenRocket program window.

Motor Tab

Next to the General tab is the Motor tab. If you click on it you will see that most parameters are grayed-out, with the exception of one checkbox. As the label mentions, this is for when you want the body tube component to also be a motor mount.

The Motor tab of the Configuration Window.


Have a quick look at this if you wish, but we'll discuss changing flight configurations for a later section of the guide.

Override

We'll take a quick look at this tab, as it common to most components. For starting out though, you most likely will not need it.

The Override tab of the Configuration Window.


This tab would be used when you specifically wanted to override the mass and centre of gravity (CG) of the component.

Appearance

Everyone likes something shiny, don’t they? This tab allows you edit the appearance of the component.

The Appearance tab of the Configuration Window.


There are two sections here, the Figure style section and the Appearance section. Figure style changes what the 2D figure looks like, whereas Appearance will change what the 3D model will look like. If you wish to use any custom textures or images in your rocket design, you can load those through the Texture drop-down menu.

Comment

This section does not really need much explanation. If you want to write any comments or notes about your component (why you chose the values you did, etc.), then this is the place to do it.

The Comment tab of the Configuration Window.


Now that we have been through all of the tabs of the Body Tube component, click the Close button. You should now notice that the rest of the components are now unlocked in the top right of the Design window. This is because all component types can be added to a body tube. However, a Nose cone should be selected first if you are making your own rocket.

Let’s have a look at the full list of components. If you cannot click on the component type, try selecting the Body tube in the design window in the top left panel of OpenRocket.

Available Design Elements

As previously mentioned, there are 4 categories to choose components from within OpenRocket. These are split into four sections:

  • Assembly Components
  • Body Components and Fin Sets
  • Inner Components
  • Mass Components


The Component types menu.


Assembly Components

Although called components, Assembly Components are NOT physical parts. Rather, an Assembly Component is an attachment point on which the framework of the rocket is built (an Assembly Component is a container for physical parts), and each type has features unique to that attachment type. These framework elements are intended to contain physical components, and should NOT be left empty. As you will see in the image, the framework types are:

  • Stage: Every rocket has at least one stage, which is the basic framework element to which the rocket's physical components are attached. A Stage may be renamed, and has override and comment tabs. A stage should NOT be used if empty.
  • Boosters: A booster is a framework element to which physical components are attached, and may be used to build separate pieces of the rocket, such as a glider. Boosters may ONLY be attached to a body tube, and CAN separate during flight from the stage to which a booster is associated. Boosters may be renamed, and have separation, general, override, and comment tabs. A booster should NOT be used if empty.
  • Pods: A pod is a framework element to which physical components are attached, and may be used to build connected pieces of the rocket that are adjacent to the main airframe, such as side motors. Pods may ONLY be attached to a body tube, and CANNOT separate from the stage to which a pod is associated. Pods may be renamed, and have general, override, and comment tabs. A pod should NOT be used if empty.


The Assembly Components submenu.


Body Components and Fin Sets

Within Body Components and Fin Sets we have 8 component types. These components make up the external and main body of the rocket; everything else is inside the rocket. As you will see in the image the component types are:

  • Nose Cone: The very tip of the rocket. Usually, you will select this component first.
  • Body Tube: As we have seen, the body tube makes up the main section of a stage.
  • Transition: A component that usually joins one body tube to another (normally larger) tube.
  • Trapezoidal fin: A fin set that is in the shape of a trapezoid.
  • Elliptical fin: A fin set that is in the shape of an ellipse.
  • Freeform fin: This special kind of fin takes any shape you want. If you add it to your model it will open up a design window for you to alter the shape as desired.
  • Tube Fins Special fins, typically made from body tubes attached to the outside of the rocket body.
  • Launch Lug: This component usually goes on the outside of a body tube and is used while the rocket is on the launch pad.


The Body Components and Fin Sets submenu.


Inner Components

Within Inner Components we have 5 component types, and these components are all internal. As with Body components and fin sets we will now run through the list of components.

  • Inner tube: This component lets you add tubes to the inside of the main body tube.
  • Coupler: Used in multi-stage rockets, a coupler joins two sections together.
  • Centering ring: These can be used to support other components (e.g., a motor), in the centre of a larger tube.
  • Bulkhead: This is a block of material that forms a stop or barrier between two different areas.
  • Engine block: An engine block prevents the motor from moving forward in the motor mount tube.


The Inner Components submenu.


Mass Components

Within Mass Components we have 4 component types. They are:

  • Parachute: Like any good parachute, this component will stop your rocket from becoming scrap.
  • Streamer: Another component for keeping your rocket safe, a streamer creates drag as your rocket falls down to earth.
  • Shock Cord: A shock cord secures the nose cone to the body of the rocket so that it isn't lost when the nose is blown off to deploy the parachute/streamer.
  • Mass Component: This is a block of mass used to adjust the rocket's Center of Gravity (CG). You can name it to whatever you want it to represent.


The Mass Components submenu.


You have now had a brief run through the various components available for use in OpenRocket. The next section will deal with an example rocket.

A Simple Model Rocket Example

In this section we will look at the components used in the A simple model rocket example design. To get started, start OpenRocket and navigate to the main window. As a reminder it looks like this:

The Openrocket main window.


Opening Example Designs

We'll begin by looking at how to find and load the example rockets within OpenRocket. Recall that this was also covered in the Getting Started section of this guide, but as a refresher the steps for doing this are as follows:

  • In the main window, click on the File menu at the top left.
  • Scroll down to Open Examples... open, and expand that menu. Here you will see a list of the available rocket design examples.


Your screen should now look like this:

Opening an example rocket


Click on first example, our Simple model rocket. A Rocket configuration window should appear, with the Design Name (A simple model Rocket) and Designer (Sampo Niskanen) fields populated. The Comments and Revision History fields will be blank. Click Close. You should now have successfully loaded the rocket and be able to see a 2D schematic in the Rocket Design window.

Bottom half of the Rocket design window.


Components used in ‘A simple model rocket’

Now we will have a quick look through the components used in the example rocket. If you look towards the top left of the Rocket Design window you will see that there is a tree of components shown. By default they should all be fully expanded. If not, do so now.

Top left-hand portion of the Rocket design window.


This image shows A simple model rocket at the top, followed by the Sustainer, which is Stage 1 of the rocket.

If we look at the first component in the Sustainer stage we see that it is the nose cone. Double click on that now. This will bring up the Nose cone configuration window.

Nose Cone Configuration Window.


As we have already examined the configuration window we will not repeat ourselves here. However, you will see that in this example we have used an Ogive nose cone with a Shape parameter of 1.0. If you read the description of the component to the right in the configuration window, you will discover that a value of 1.0 produces a tangent ogive.

Moving down the window, you will see that the Nose cone length has a value of 10, the Base diameter has a value of 2.5, and the Wall thickness has a value of 0.2. All of these parameters have been set, in this example, to use centimeters (cm) as their unit. You should also see that this component is using Polystyrene as its material with a Regular paint finish. As you can see, the material has a density of 1.05 grams per centimeter cubed, and the paint is 60.0 micrometers thick. In the bottom left, the component weight is currently 13.2 grams. Go ahead and play around with the sliders to see how the component changes, and then change them back when you are finished.

If you move over to the Shoulder tab, you'll be able to see the size attributes of the shoulder. Again, you can play around with the sliders if you want--as long as you change them back to the original settings when you are finished. For reference these are 2.3, 2.0 and 0.2 centimeters, respectively. Also have a look through the rest of the tabs to see what has been selected. The only other thing to note is that the appearance has been customized. If you were to change to the 3D Finished view type, you will see how the finished model looks.

Moving on to the Body tube, you can access its various attributes by double-clicking on it in the Rocket design window. Note how its various attributes have been set to create the current size. This is all fairly straightforward and as we have already looked into the various components earlier, we will not go into great detail here.

Note the eight other components that have been placed onto the Body tube. In descending order these are:

  • Trapezoidal fin set
  • Inner Tube
  • Centering Ring
  • Centering Ring
  • Shock Cord
  • Parachute
  • Wadding
  • Launch lug


The Inner Tube in this design is used as a motor mount. You will see this if you go to the Motor tab in the Inner Tube configuration window. This means that a motor has been fitting into this piece. Upon inspection we can see that the current motor name is displayed in the Flight configuration drop-down list, on the right side of the main OpenRocket window. You can open this drop-down menu to select other motors that are available for use in this simulation, as well as the other example simulations that you will see on the Flight simulation tab.

The ninth component is place inside the inner tube. This is the engine block. If you look at the schematic of the rocket you will see that this is placed in front of the grey rectangle, which is the motor. To quickly address some of the other components, you will note that the recovery method used in this rocket is a Parachute: the red dashed rounded-rectangle near the nose cone of the rocket. Along with the parachute we have a Shock cord, which (as was discussed earlier) prevents loss of the nose cone upon deployment of the recovery system. This is shown as a long, black, dashed rounded-rectangle in the same general area as the parachute. The other black, dashed rounded-rectangle box is the Wadding, which is a mass component and is used here to bring the centre of gravity forward towards the nose.

We have now looked through the components used within the simple model rocket example. If you would like to see other available components, see Appendix A. Now that we are familiar with what makes up the rocket we will go ahead and build one from scratch!

Building ‘A simple model rocket’

In this section we will build up the example model from scratch. After you have completed this process, you should be able to apply what you've learned in order to make any basic rocket you want. So let’s begin...

Open a new project window so that everything is blank. The following are the steps that you will follow to create the rocket.

1) Select the nose cone. Change its type to Ogive, if that isn't already selected. Make sure that Shape parameter, Nose cone length, base diameter, and Wall thickness values are set to 1.0, 10.0, 2.5 and 0.2, respectively. The units are centimeters by default, so we should not need to change these. Finally, change the Component material to Polystyrene.

2) Next, while still in the Nose cone configuration window, move to the Shoulder tab. Change the diameter to 2.3, the length to 2.0, and the thickness to 0.2. Also, check the End capped box.

3) The last thing we have to do with the nose cone is to change its Appearance, so switch to that tab now. Leave the Figure style section unchanged but under the Appearance section, change the colour to one lighter than black. (Or to whatever you want, go crazy!) Then adjust the shine to 50%. That is all we need to change for now.

You should now see this in the view area at the bottom of the main OpenRocket window:

Nose Cone


4) Next, add the Body tube. The measurements for length, outer diameter, inner diameter, and wall thickness are 30.0, 2.5, 2.3, 0.1, respectively. Note that it may be easier to enter the last two manually rather than use the spin boxes or sliders. Leave the Automatic and Filled boxes unchecked. The material should remain Cardboard and the finish should be Regular Paint. The only other thing you should change here is the appearance, but we'll leave that to you as an exercise.

You should now have this:

Nose Cone and Body


5) Moving on, we next need to add a Fin set. Make sure you have clicked on the Body tube so that it’s highlighted then click on the Trapezoidal component type. The Trapezoidal fin set configuration window will have appeared. Leave the left side of the window alone: the settings there are fine as-is. However, we will need to change some things on the right hand side. First, change the Fin cross section to Rounded. Also, reduce the Thickness to 0.2. That’s all we need to do in this tab. Now move to the Appearance tab and customize to your preference.

Nose Cone, Body, and Fins


6) The next component we need to add is the Inner tube. Once again highlight the body tube and then click on the Inner tube component button. There are a couple of attributes we should change here. First, increase the Length value to 7.5. Also, increase the Plus value to 0.5. Leave everything else the same.

Now go to the Motor tab. There are a few things we need to add here. To start, check the This component is a motor mount checkbox. This will allow us to add motors. The next few steps may seem complicated but do not be daunted by them. First, we will deal with the easy part: Increase the Motor overhang to 0.3. Now click Close button to close the Inner Tube configuration window.

Now click on the Motors & Configuration tab towards the left upper corner of the main OpenRocket window, just under the menu bar. On the resulting page, note the Motors tab towards the left upper corner. Make sure the Inner T... box is checked, and then click on the New Configuration button in the top center portion of the upper panel. You should see that a new configuration has been added to the list of configuration.

Motors & Configurations window


Left-click in the Inner Tube column, and then click the Select motor button just below the open panel on the right of the screen. The Select a rocket motor window now appears:

Motor Selection window


To make sure your window looks the same as the one above, follow these steps:

  • Make sure the Filter Motors tab is selected in the top right corner of the window.
  • Click "Clear All", then select only the Estes option in the Manufacturer list.
  • Make sure that the Total Impulse slider is positioned over A (all the way to the left).
  • Check both the "Limit motor diameter to mount diameter" and "Limit motor length to mount length" boxes.
  • Look for the A8 motor in list on the left side of the window. Click on it.
  • In the Ejection charge delay field at the top left, enter the value 3.

Now click the OK button at the lower right corner of the window.

If everything went to plan, you have successfully added the Estes A8-3 motor to your rocket. Now repeat these steps for the following motors, using a New Configuration for each new motor you add:

  • Estes B6-4
  • Estes C6-3
  • Estes C6-5
  • Estes C6-7


After you have added the rest of the motors, click back on the Rocket design tab just under the main menu.


7) The next component we will add is the Engine Block. This time make sure that the Inner tube is highlighted and then add an engine block component. Change the Inner diameter to 1.2 and the Wall thickness to 0.3. Also, change the Position relative to: Top of the parent component. The last change we will make is to increase plus to 0.2. That is all we have to do for this component.

Your rocket should now look like this:

Added the Engine Block


8) We will now add two Centering Rings. Make sure the Body tube is highlighted in the list of components under Rocket design, then click on the Centering ring component type. The first one is fine as-is, so we will not make any changes. However, we will add the following line under the Comment tab: The centering ring automatically takes the outer diameter of the body tube and the inner diameter of the inner tube.

Now click Close, select the body tube again and add another Centering ring. This time all we have to do is to change plus to -4.5. Also, add the same comment as for the first ring.

Added Centering Rings


9) The next component we will add is the Shock cord. As usual, make sure the Body tube is selected before adding the shock cord component. After it has been added change the Plus value to 2, Packed length to 5.2, and Packed diameter to 1.2. Again, we will add a comment to this component. Enter the following line to the Comment section: The shock cord does not need to be attached to anything in particular, as it functions only as a mass component.. Click the Close button to close the window, as the shock cord has now been completed.

Added Shock Cord


10) Now we need to add the Parachute. With the body tube highlighted, add a parachute component. Change Plus to 3.2, Packed length to 4.2 and Packed diameter to 1.8. That is everything we need to do to the parachute. Click Close to close the window. You can see what your rocket should now look like below.

Added Parachute


11) The second-to-last component to add is a Mass Component. Go ahead and add one to the body tube now. Adjust the Mass to 2 grams (g), the Approximate density to 0.16 g/cm^3, the length to 3.0, the diameter to 2.3 and finally the Plus value to 8.0. It may be easier to enter these manually. The last thing you have to do is to rename it from ‘Unspecified’ to Wadding. Leave everything else as it is and click the Close button.

Added Mass


12) Almost done! One final component left to add: the Launch lug. Add this to the body tube now. Change the Length to 3.5, the Outer diameter to 0.7, and the inner diameter to 0.5. Leave the Thickness as it is. Also, change the Radial position to 19 degrees. Click Close.

Added Launch Lug


And that’s all there is to it. You have just completed building your first rocket within OpenRocket! From here you can use what you know to create more rockets, or you can proceed to the next section of the User Guide: Basic Flight Simulation. Have fun!


↑ Back to Contents