summaryrefslogtreecommitdiff
path: root/software.mdwn
blob: 516d8df7873e9b0d41bade28800550e954e13e23 (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
# 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.

There are two basic modes for our program:

 1. Testing
 1. Launch Operations

#### 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.

To this end, 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


# Flight Computer (FC)

## The Flight Computer

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

The user space flight computer code is written by us in C:

 - FC repository: <https://github.com/psas/av3-fc>


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

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

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


### FCF - Flight Computer Framework

The main flight computer uses a framework that was developed by a 2013 CS Capstone group. This code creates the event loop that calls modules of code written to do particular tasks. That way the software team can focus on functionality.

 - FC framework <https://github.com/psas/elderberry>


### FCFTF - Flight Computer Framework Test Framework

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

 - FC test framework <https://github.com/psas/fc-test>



## Launch Tower Computer

[[Launch tower computer|GroundTeamHome/launch tower v3]] 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.

 - Repository: <https://github.com/psas/launch-tower>

## Launch control

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

- Repository: <http://git.psas.pdx.edu/launch-tower-comm.git>
- 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)


## Telemetry Viewer

A summer 2013 CS Capstone group helped us build a real time telemetry viewer.

 - Telemetry: <https://github.com/psas/telemetry>


Pretty much everything below is obsolete. The previous requirements, communications protocols, and UI designs could be instructive for current projects.

## Admin

- [[SudoSetup]]


# History

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