summaryrefslogtreecommitdiff
path: root/software.mdwn
blob: c9522ff276c353f5ee14cc348d3f1bde56b243cf (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# PSAS Software

**Our code is on [github](https://github.com/psas)!**

[[!toc levels=3]]

## Software at PSAS

Our biggest challenge at PSAS is making a rocket, in theory, steerable. This 
requires a monumental effort in all the major engineering fields. In addition
to having an actual rocket one needs excellent electronics to provide sensor
measurements and to actuate controls, and the software to run all of it. In
order to write software like this you also need testing frameworks and some kind
of simulation of flights to debug the main flight software. These layers of
complexity make up the software project at PSAS.


### The Problems With Spaceflight

Why are rockets hard? One of the most interesting things about building a space
program from scratch is finding out that the problem often isn't where you think
it is. Could you just build a giant rocket motor and light it? Yes, you could.
But it won't do what you want. Instead of going up will arc in an unpredictable
direction. The parachutes wont fire at the right time, and you'll never find it
again because you won't be able to track it.

> The hard part about rockets is often everything **around** the rocket

This is a truth of building a space program. How are you going to handle
communication? Sensors? What are you going to program? How are you going to
test that? How are you going to test your test framework?


### Current Design Philosophy at _PSAS_

We've been attacking all these problems and more in different ways for years.
We're now starting to bring this experience together into a cohesive design.


#### Testing

We spend 98% of our time on the ground. That is, not actually launching a
rocket (launches are expensive and only happen once a year). But we still want
to be able to run all of our software _as if_ we're actually above the ground.
This means we spend a lot of energy trying to design a good, usable test
framework. We also need a simulator for almost every aspect of the rocket. We
also like to be able to run as much software as possible on generic hardware
so people can work on ideas on their laptops or test boards and do not need
the expensive, one-of-a-kind, flight computer to get work done.

#### Launch Operation

When it's time for a launch we have to disable all the testing bits, and make
sure we're in a good launch configuration. We can drop all the simulation and
testing work and boot the real flight computer. We need logs of everything
during a launch so we know what happened after the fact and can plan better
for future launches.

Therefore, most PSAS software has some kind of production switch.


### Major Softwares

This is the list of major software and what it's used for. Items in **bold** are
written by PSAS.

 - **Flight computer**: [av3-fc](https://github.com/psas/av3-fc)
 - **Telemetry viewing/recording**: [telemetry](https://github.com/psas/telemetry)
 - **Launch tower**: [launch-tower-comm](https://github.com/psas/launch-tower-comm)
 - **Launch control**: [launch-tower-comm](https://github.com/psas/launch-tower-comm)
 - Launch simulation: [OpenRocket](http://openrocket.sourceforge.net/)
 - **Flight computer testing**: [fc-test](https://github.com/psas/fc-test)
 - Operating System: Linux
 - RTOS: [ChibiOS](https://github.com/psas/ChibiOS-RT)

The high level view of programs running in the two modes look like this:

#### Testing

[[!img highlevel_testing.png size="800x800" alt="testing software layout_"]]

#### Launch Operation

Compile everything for flight. Set all flags to flight, watch data in real
time on telemetry viewer.


# Flight Computer (FC)

[[AV4|avionics]] is an Intel Atom based flight computer, connected via Ethernet
to Cortex M4-based sensor nodes.  Wireless 802.11 telemetry to the ground
during flight.




## Flight Computer Code: psas/av3-fc <https://github.com/psas/av3-fc>

The PSAS portion of the flight computer code is written by us in C. This is 
what is running during flight. It culls data from various sensors and sends
live telemetry to the ground. This is where all real-time state estimation
and control algorithms are contained.

 - clone: `git clone https://github.com/psas/av3-fc.git`
 - download current master: [av3-fc-master.zip](https://github.com/psas/av3-fc/archive/master.zip)
 - releases: <https://github.com/psas/av3-fc/releases>
 - documentation: <http://psas-flight-computer.readthedocs.org/>
 - issues: <https://github.com/psas/av3-fc/issues>
 - build status: [![Build Status](https://travis-ci.org/psas/av3-fc.png)](https://travis-ci.org/psas/av3-fc)




## FC Environment: psas/fc-environment <https://github.com/psas/fc-environment>

The flight hardware is running debian based linux. Kernel config, custom udev
rules and other environment info are here.

 - clone: `git clone https://github.com/psas/fc-environment.git`
 - download current master: [fc-environment-master.zip](https://github.com/psas/fc-environment/archive/master.zip)




## FCF - Flight Computer Framework: psas/elderberry <https://github.com/psas/elderberry>

The main flight computer uses a framework that was developed by the 2013 CS
Capstone group. 

The main flight computer has code for each task, and each piece is highly
modular. For example `arm.c` only has code for handling the arm/safe state.
'Elderberry' is a python code generator that with the help of some config files
creates an event based main that calls the modules. This way we can hand someone
one piece of functionality to develop without worrying about integration into
the rest of the code. This is handled automagically!

 - clone: `git clone https://github.com/psas/elderberry.git`
 - download current master: [elderberry-master.zip](https://github.com/psas/elderberry/archive/master.zip)
 - releases: <https://github.com/psas/elderberry/releases>
 - documentation: <http://psas.github.io/elderberry/>
 - issues: <https://github.com/psas/elderberry/issues>




## FCFTF - Flight Computer Framework Test Framework: psas/fc-test <https://github.com/psas/fc-test>

Because there are lots of moving parts, a test framework has also been built to
help run the FC locally.

 - clone: `git clone https://github.com/psas/fc-test.git`
 - download current master: [fc-test-master.zip](https://github.com/psas/fc-test/archive/master.zip)



Our previous avionics experiments were with CAN (not developer-friendly) and USB
(bad latency).

[Event-driven flight computer simulator](https://github.com/psas/event-driven-fc) is for experimenting with control algorithms, like Bayesian Particle Filtering



# Launch Tower

The rocket is placed on a guiding rail for launch. There is a small embedded
computer at the base of the tower that is control of the ignition of the rocket
motor. We also have an umbilical cable that attaches the rocket for power and
data up until the launch.


## Launch Tower Computer (LTC): <https://github.com/psas/launch-tower>

[[Launch tower computer|GroundTeamHome/Launch_tower_v2]] uses Phidgets for
sensor nodes and a Beagle board to serve them.  Unlike previously, there will
be direct ethernet connection between the launch tower computer and rocket
while on the pad, used for bringing up and controlling the avionics pre-flight.
Wireless 802.11n/g between launch tower computer and telemetry consoles and
launch control consoles.

This repo has mostly hardware specs.

 - clone: `git clone https://github.com/psas/launch-tower.git`
 - download current master: [launch-tower-master.zip](https://github.com/psas/launch-tower/archive/master.zip)




## Launch control: psas/launch-tower-comm <https://github.com/psas/launch-tower-comm>

Console software written in Python 2.7 with Kivy UI framework <http://kivy.org>.
Phidgets python drivers also required. Linux recommended.

This runs on a laptop in mission control. It has a screen that can read and
update the sensors and switches in the launch tower computer.

i.e., this is the big red launch button.

 - clone: `git clone https://github.com/psas/launch-tower-comm.git`
 - download latest master: [launch-tower-comm-master.zip](https://github.com/psas/launch-tower-comm/archive/master.zip)
 - releases: <https://github.com/psas/launch-tower-comm/releases>
 - issues: <https://github.com/psas/launch-tower-comm/issues>

Helpful links:

 - Kivy framework: <http://kivy.org/#download>
 - Kivy documentation: [old](http://kivy.org/docs/guide-index.html), and [new](http://kivy.org/docs/guide2-index.html)
 - Phidgets Python support: <http://www.phidgets.com/docs/Language_-_Python#Quick_Downloads>
 - Previous UI spec: [[RocketViewLaunchPanel]], [[LaunchControl]] (Java, CAN-over-sockets)


# Ground Software

## Telemetry Viewer: psas/telemetry <https://github.com/psas/telemetry>

A summer 2013 CS Capstone group helped us build a real time telemetry viewer.
This software is designed to run on one machine on the mission control network
and then allow multiple clients to view custom telemetry pages in near real time
via a web interface.

 - clone: `git clone https://github.com/psas/telemetry.git`
 - download current master: [telemetry-master.zip](https://github.com/psas/telemetry/archive/master.zip)
 - releases: <https://github.com/psas/telemetry/releases>
 - documentation: <http://psas-telemetry-server.readthedocs.org>
 - issues: <https://github.com/psas/telemetry/issues>


# Miscellaneous 

#### PSAS Admin Tasks (plz ignore)

- [[SudoSetup]]


# Software History

Old version of this page: [[Software Team History|software/history]].

This has lots and lots of very, extremely out of date information and ideas!
However the previous requirements, communications protocols, and UI designs
could be instructive for current projects.