Subscribe to rss feed

Improving the USOFS software | Project planning and misc | Forum

 
You must be logged in to post user permissions login Login register Register


Register? | Lost Your Password?

Search Forums:


searchicon 






Minimum search word length is 3 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

topic

Improving the USOFS software

print
small tagNo Tags
UserPost

12:27 am
January 24, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
1
+1
ratedowngrey
rateupgrey

Since appearing on spacehack.org, we've had a nice influx of new members, a few of whom are software people and have expressed an interest in helping to improve the currently quite basic USOFS software.  This thread is supposed to be a place where (i) I can present these new people with the information they need to start working on USOFS and (ii) the entire community can throw around ideas on what sort of improvements/features USOFS could really stand to have.

First things first:  What is USOFS?  USOFS, or Uncontrolled SubOrbital Flight Simulator, is a program for simulating the trajectories of uncontrolled rockets on suborbital trajectories (i.e. trajectories with maximum altitudes exceeding 100km, hence "in space", but with maximum velocities too low to achieve orbit).  It is primarily intended to help plan the construction of the OHKLA rocket.  It's fairly simple, conceptually: the underlying physics model includes simply gravity (which is modelled as constant across altitudes), a constant acceleration from the rocket engine, and drag computed according to the standard drag equation.   The equations of motion are solved numerically using a 4th order Runge Kutta algorithm.

So: Where is USOFS?  It's in the Mercurial repository of the CSTART Google Code Project.  You can view the trunk source code in your web browser.  It's written in Python (2.x).

How can you work on USOFS?  The standard procedure is for you to create a clone of the Mercurial repository.  This is a complete duplicated of the official repository which you can work on however you like without any kind of fear of breaking anything, like your own personal sandbox.  You can do so from this page by using the link under the "Create your own clone" header – note that you must be signed into a Google account to do so.  Once you've got something that you think is good committed to your clone (if you're new to Mercurial and need help using it, check out this tutorial or just Google around), you can contact anyone who has committer access to the official repository (currently myself, brmj and rpulkrabek) and ask us to have a look at your work (in the case of USOFS I am probably the best person to contact).  If it's good, one of us will merge your work into the main repository.  If you make a few good contributions to the repository in this manner and you seem generally trustworthy, you'll eventually be offered committer access yourself.

What sort of stuff would it be useful for you to do on USOFS?  Some preliminary ideas:

  1. GUIfication.  Currently USOFS is command line only.  While I think it would be good to maintain the ability to run it from the command line, a GUI option as well would be handy.  This shouldn't be too hard, it is mainly just a case of giving the user a way to enter some numerical values and then having some "go" buttons and a nice way to present the data.  This last part leads into…
  2. Graph generation.  Currently USOFS spits out big text files full of figures in a CSV format.  I have been using the gnuplot program to create graphs so far.  It would be very nice if USOFS could generate its own graphs (displaying them onscreen when running in GUI mode and saving them to a .png file when running in command line mode).  The matplotlib library for Python seems like the obvious solution to this.
  3. Different thrust profiles.  Currently USOFS makes the fairly inaccurate assumption that the rocket engine produces constant thrust for the entire duration of its burn.  While we should keep this option as a fall back, it would be good if we could have people specify different profiles, e.g. a linearly decreasing thrust from some initial maximum to some final minimum, exponentially decaying thrust, etc.  This is the one proposed modification so far which would require an actual understanding of how the physics code works, not just the interface it presents.  I'm happy to advise anybody who wants to tackle this problem on how to go about making these changes.
  4. Better supersonic drag simulation: this would require somebody with more knowledge than the current CSTART team seems to have collectively about aerodynamics.  If you are such a person or know such a person, please speak up.

I realise this has been written fairly briefly and there is probably a lot to absorb in a short time.  If anybody has any specific further questions, please ask and I will do my best to clear them up to the point that you can do some work

We're very keen to see some progress made on this front, so if anything is troubling you please speak up and we will try our best to accommodate you.  If you can't or don't want to figure out how to work Mercurial, we can work something out where you just email .py files to someone and they'll put them in the repository for you or something like that.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

6:17 pm
January 24, 2010


Elleo

Aberystwyth, United Kingdom

Member

posts 10

followme

offline
link
print
2
0
ratedowngrey
rateupgrey

 I've implemented the beginnings of a GTK based GUI in this branch: http://code.google.com/r/mikes…..art-usofs/ (along with a couple of small bug fixes).

 I wasn't entirely sure what all the spec variables stood for (the usage string is currently "Foo" sf wink) so the same variable names are currently used in the GUI labels, these could do with being changed to something more descriptive by someone who knows what they are.

 To run in comand line mode the user can append the "-c" option, my reasoning being that first time users are more likely to want a simple GUI as the default action, rather than the CLI mode being the default naturally this could be changed to having an option to start the GUI instead if people prefer.

7:22 pm
January 24, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
3
0
ratedowngrey
rateupgrey

Wow, that was quick work!  I have a tonne of work to take care of today so I can't check this out just now, but I will certainly have a play with this later tonight – I'll use that as motivation to get my work done quicker. :)  Thanks very much for such a quick contribution.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

8:42 am
January 25, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
4
0
ratedowngrey
rateupgrey

Nice work!  This is a good start.

To help you out a bit, these are the meanings of the various spec variables:

  • t_B is the duration of the rocket burn, in seconds.
  • T is the constant thrust produced by the rocket burn, in Newtons.
  • m_E is the empty mass of the rocket, i.e. the mass when 100% of the fuel has been burnt.
  • m_F is the full mass of the rocket, i.e. the mass when the rocket is fully fuelled.
  • m_P is the mass of the payload on top of the rocket.
  • A is the cross-sectional area of the rocket (it may be more user friendly to ask for a radius or diameter and compute the area from that input)

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

12:18 pm
January 25, 2010


kksm19820117

Member

posts 4

offline
link
print
5
0
ratedowngrey
rateupgrey

@Luke:

I'd like to take on point 3: Are there any resources I could refer to for this?

I'll be a bit busy this week (I am prepping for a few interviews), but I should be able to attack this problem Feb onwards.

3:00 pm
January 25, 2010


brmj

Rochester, New York, United States

Member

posts 402

offline
link
print
6
0
ratedowngrey
rateupgrey

kksm19820117 said:

@Luke:

I'd like to take on point 3: Are there any resources I could refer to for this?

Not Luke, but I may be able to help you a little here. I just found a page with links to the resources that OpenRocket used to design their model rocket simulation code. Here's the page, just so everyone has the link. It is full of great resources for aerodynamics and rocket design, but the link that is most relevant to your particular project is thrustcurve.org. They have a lot of data, including thrust curves, for commercially available model and amateur rocket engines, incluing a large number of large-ish hybrid engines. They also have a bit of info on the underlying physics, as well as an explanation of the measures used to define the performance of a rocket engine. I'm not sure how much help this will be, but it ought to at least show you some reasonable thrust curves for hybrid rocket engines.

The Copenhagen Suborbitals also have a few thrust curves here for their motors. These ought to be a reasonable analog for what we might expect.

I think it might be sensible to be able to accept data files with thrust curve information, like most model rocket simulators seem to be able to. That way, we could start out using numbers derived from those for HATV, for example, and as our engine design progresses we could input data from the latest successful static tests.

I home some of that was at least a little helpful.

Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)

6:16 am
January 26, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
7
0
ratedowngrey
rateupgrey

brmj said:

I home some of that was at least a little helpful.


You've answered it better than I was likely to!  I had only some very simple curves in mind (e.g. linearly decreasing), but if there are standardised file formats for exchanging thrustcurve data then it absolutely makes sense to include the ability to load those.

As for actually including arbitrary thrust profiles in the code, for the purposes of simulating a flight where all specifications are given (i.e. the "simualte_flight" function), I think it should simply be sufficient to replace the reference to "specs.T" on line 163 with a call to a thrust function accepting the variable "t" as its only argument.  However, the "search" fuction (which calls "simulate_flight" with a range of spect.t_B and spec.T values to determine the requried burn time for any given constant thrust to obtain an apogee > 100 km) would take some more effort to update.  It doesn't make much sense as a function unless the thrust is either constant or a very simply parameterised function.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

10:17 pm
January 27, 2010


kksm19820117

Member

posts 4

offline
link
print
8
0
ratedowngrey
rateupgrey

@brmj:

Thanks! I'll start working on it this weekend.

6:25 pm
February 9, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
9
0
ratedowngrey
rateupgrey

kksm19820117 said:

@brmj:

Thanks! I'll start working on it this weekend.


How did it go?  Were you able to make some progress?  If you want any help getting started please don't hesitate to ask.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

1:43 pm
February 13, 2010


Elleo

Aberystwyth, United Kingdom

Member

posts 10

followme

offline
link
print
10
0
ratedowngrey
rateupgrey

Commited some graph support to my branch along with a few fixes for the GUI stuff and more friendly labels.

usofs graphsmouse

4:17 am
February 14, 2010


brmj

Rochester, New York, United States

Member

posts 402

offline
link
print
11
0
ratedowngrey
rateupgrey

Good work! It's great to see more progress on this front. I'll have to try and get this running and play around with it a little.

Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)

2:22 am
February 15, 2010


rpulkrabek

Member

posts 348

offline
link
print
12
0
ratedowngrey
rateupgrey

I also think this is good work. It allows a simple way to view these calculations. It's especially nice for people such as myself that aren't familiar with the language it was written in. Thank you.

4:42 am
February 15, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
13
0
ratedowngrey
rateupgrey

This is great work!  Thank you very much.

A few quick thoughts:

  • Looking at the graphs has given me quite some concern about the simulation accuracy.  i notice that before the huge sudden drop in acceleration at engine burn-out (which is to be expected), there is a small sudden drop in acceleration, which seems a little weird.  I also notice that the altitude appears to go negative after launch and only eventually turns positive, which is obviously wrong.  I remember having a problem with negative altitudes while writing OHKLA, but I was certain I had fixed it.  Anyway, when I get back home in a few days I will look into these issues.  They certainly aren't your fault, so don't let this detract from the praise you rightly deserve for your work.
  • It would be fantastic if, in addition to the graphs, the GUI could give some basic, important summary statistics.  Maximum altitude,  maximum velocity, maximum acceleration (in m/s and in g) and maximum dynamic pressure come to mind as obvious candidates, along with the times at which these things occur.  Knowing these maxima will be important in making sure things are built properly.

Sorry I don't have time right now to provide more comment, but once again, great work and thank you.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

8:32 am
February 15, 2010


brmj

Rochester, New York, United States

Member

posts 402

offline
link
print
14
0
ratedowngrey
rateupgrey

I wouldn't be too suprised if Elleo's fork of USOFS and the main line might have devirged before some of Luke's fixes. This might be as straitforward as just merging a few changes into it to fix it.

Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)

10:43 pm
February 15, 2010


Luke Maurits

Adelaide, Australia

Admin

posts 1483

offline
link
print
15
0
ratedowngrey
rateupgrey

This is certainly possible.  It's also possible I did something stupid like fixed the problem and committed to my local repository without pushing it to Google's servers.  i am sure I will be able to fix this quite quickly once I get home.

Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.

10:19 am
February 19, 2010


brmj

Rochester, New York, United States

Member

posts 402

offline
link
print
16
0
ratedowngrey
rateupgrey

Post edited 10:21 am – February 19, 2010 by brmj


I'm currently looking over the USOFS source code, and I hate to be a prick about this, but could we please at least try to add in a few comments? Our code is full of highly abreviated variable names, for which a one line explaination would greatly help people get started. I can make time to do this myself with our current code, if I can figure out what everything stands for, but I'd kind of like new additions to not get like this in the future.

All prickery aside, we will also want to add in the standard "This program is Free Software…" GPL comment.

Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)

5:10 pm
February 26, 2010


craiggers

Cambridge, MA

Member

posts 7

followme

offline
link
print
17
0
ratedowngrey
rateupgrey

Just found CSTART through brmj and I'd love to help out.  I'm a software person and this seems like the primary software focus of the project currently, but it also looks like the points up above except for 4 (which I don't think I'm qualified to do) are already being worked on.  What still needs to be done?  I've got a full week of nothing to do ahead of me and I'd love to help in any way I can.

P.S. This sorta thing might be a great use of the tracker that Google code has.

8:16 pm
March 1, 2010


craiggers

Cambridge, MA

Member

posts 7

followme

offline
link
print
18
0
ratedowngrey
rateupgrey

I cloned Mike's clone and added some information about maxima here:  http://code.google.com/r/wolfz…..fs-clone2/

I can add units and anything else that might seem useful, as long as someone can tell me what those units might be.  It's been a little while since I've taken physics.

11:46 pm
March 1, 2010


craiggers

Cambridge, MA

Member

posts 7

followme

offline
link
print
19
0
ratedowngrey
rateupgrey

Screenshot for the above change:

maxima

7:33 am
March 2, 2010


Elleo

Aberystwyth, United Kingdom

Member

posts 10

followme

offline
link
print
20
0
ratedowngrey
rateupgrey

Looks good, well done, I'll see about merging your changes into my branch when I get a bit of spare time.

small tagNo Tags

About the CSTART – Collaborative Space Travel and Research Team Forum

Forum Timezone: UTC -6

Most Users Ever Online: 59

Currently Online:
6 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 4
Forums: 36
Topics: 512
Posts: 3809

Membership:

There are 1133 Members

There are 2 Admins

Top Posters:

Rocket-To-The-Moon – 685
brmj – 402
rpulkrabek – 348
DenisG – 69
antinode – 64
J. Simmons – 46

Recent New Members: jmwright, uhwuggawuh, seikialice88, bishvabis, alijayadv, harris

Administrators: Luke Maurits (1483 Posts), Rizwan (170 Posts)



 
share save 120 16