CubedOS: A SPARK Message Passing Framework for CubeSat Flight Software SPARK/Frama-C Conference - Copyright 2017 Carl Brandon & Peter Chapin

Similar documents
Dr. Carl Brandon & Dr. Peter Chapin Vermont Technical College (Brandon),

The Use of SPARK in a Complex Spacecraft CubeSat Developer s Workshop - Copyright 2017 Carl Brandon & Peter Chapin

NASA ELaNa IV Launch

From Physicist to Rocket Scientist and How to make a CubeSat that Works! Copyright 2018 Carl Brandon

NASA ELaNa IV Launch

Interplanetary High Reliability CubeSat Software with SPARK/Ada Copyright 2013 Carl S. Brandon

CubeSat Navigation System and Software Design. Submitted for CIS-4722 Senior Project II Vermont Technical College Al Corkery

KySat-2: Status Report and Overview of C&DH and Communications Systems Design

HYDROS Development of a CubeSat Water Electrolysis Propulsion System

SPACE. (Some space topics are also listed under Mechatronic topics)

NASA s X2000 Program - an Institutional Approach to Enabling Smaller Spacecraft

University. Federal University of Santa Catarina (UFSC) Florianópolis/SC - Brazil. Brazil. Embedded Systems Group (UFSC)

CubeSat Proximity Operations Demonstration (CPOD) Vehicle Avionics and Design

ARMADILLO: Subsystem Booklet

Tropnet: The First Large Small-Satellite Mission

Near Earth Asteroid (NEA) Scout CubeSat Mission

NanoSwarm: CubeSats Enabling a Discovery Class Mission Jordi Puig-Suari Tyvak Nano-Satellite Systems

Picture of Team. Bryce Walker. Charles Swenson. Alex Christensen. Jackson Pontsler. Erik Stromberg. Cody Palmer. Benjamin Maxfield.

PAYLOAD DESIGN FOR A MICROSATELLITE II. Aukai Kent Department of Mechanical Engineering University of Hawai i at Mānoa Honolulu, HI ABSTRACT

David M. Klumpar Keith W. Mashburn Space Science and Engineering Laboratory Montana State University

CubeSat Integration into the Space Situational Awareness Architecture

Jet Propulsion Laboratory, California Institute of Technology

In the summer of 2002, Sub-Orbital Technologies developed a low-altitude

CubeSat Proximity Operations Demonstration (CPOD) Mission Update Cal Poly CubeSat Workshop San Luis Obispo, CA

Ground Station Design for STSAT-3

The Virtual Spacecraft Reference Facility

A Lightweight Open Source Command and Control Center and its Interface to Cubesat Flight Software

Lunar Exploration Communications Relay Microsatellite

Platform Independent Launch Vehicle Avionics

Analysis of Potential for Venus-Bound Cubesat Scientific Investigations

The Hawaii Space Flight Laboratory and the LEONIDAS Program

A CubeSat-Based Optical Communication Network for Low Earth Orbit

Integrating Advanced Payload Data Processing in a Demanding CubeSat Mission. Mark McCrum, Peter Mendham

A Systems Approach to Select a Deployment Scheme to Minimize Re-contact When Deploying Many Satellites During One Launch Mission

The Evolution of Nano-Satellite Proximity Operations In-Space Inspection Workshop 2017

The Future for CubeSats Present and Coming Launch Opportunities 18th Annual AIAA / USU Conference on Small Satellites CubeSat Workshop

Proximity Operations Nano-Satellite Flight Demonstration (PONSFD) Overview

The STU-2 CubeSat Mission and In-Orbit Test Results

Introduction. Satellite Research Centre (SaRC)

CubeSat Standard Updates

Orbicraft Pro Complete CubeSat kit based on Raspberry-Pi

The Aerospace Corporation s Concept Design Center

Moog CSA Engineering CubeSat Payload Accommodations and Propulsive Adapters. 11 th Annual CubeSat Developer s Workshop 25 April 2014

Design of a Remote-Cockpit for small Aerospace Vehicles

First Results From the GPS Compact Total Electron Content Sensor (CTECS) on the PSSCT-2 Nanosat

ELaNa Educational Launch of Nanosatellite Enhance Education through Space Flight

Brazilian Inter-University CubeSat Mission Overview

2009 ESMD Space Grant Faculty Project

Sara Spangelo 1 Jet Propulsion Laboratory (JPL), California Institute of Technology. Hongman Kim 2 Grant Soremekun 3 Phoenix Integration, Inc.

PROCEEDINGS OF SPIE. Inter-satellite omnidirectional optical communicator for remote sensing

FlexCore: Low-Cost Attitude Determination and Control Enabling High-Performance Small Spacecraft

Verification and Validation Methods for the Prox-1 Mission

Cyber-Physical Systems

Open Source Design: Corvus-BC Spacecraft. Brian Cooper, Kyle Leveque 9 August 2015

FLIGHT SUMMARY REPORT

The FAST, Affordable, Science and Technology Satellite (FASTSAT) Mission

Microwave Radiometers for Small Satellites

SABRE-I: An End-to-End Hands-On CubeSat Experience for the Educate Utilizing CubeSat Experience Program

Lunar CubeSat Software Architecture Analysis

Real-Time AOCS EGSE Using EuroSim and SMP2-Compliant Building Blocks

Space Radiation & Charging Cube Satellite (SPARCCS) Project

National Aeronautics and Space Administration Jet Propulsion Laboratory California Institute of Technology

Dan Dvorak and Lorraine Fesq Jet Propulsion Laboratory, California Institute of Technology. Jonathan Wilmot NASA Goddard Space Flight Center

GeneSat-1 Quick Look Mission Report

From the Delfi-C3 nano-satellite towards the Delfi-n3Xt nano-satellite

AstroBus S, the high performance and competitive Small Satellites platform for Earth Observation

Phoenix. A 3U CubeSat to Study Urban Heat Islands. Sarah Rogers - Project Manager NASA Space Grant Symposium April 14, 2018

CubeSat Propulsion using Electrospray Thrusters

I SARA 08/10/13. Pre-Decisional Information -- For Planning and Discussion Purposes Only

GEM Student Tutorial: Cubesats. Alex Crew

University of Kentucky Space Systems Laboratory. Jason Rexroat Space Systems Laboratory University of Kentucky

Copyright 2012, The Aerospace Corporation, All rights reserved

Space Challenges Preparing the next generation of explorers. The Program

2013 RockSat-C Preliminary Design Review

Deep Space cubesats a nanosats at JPL. Tony Freeman Jet Propulsion Laboratory, California Institute of Technology

Developing the Miniature Tether Electrodynamics Experiment Completion of Key Milestones and Future Work

HEMERA Constellation of passive SAR-based micro-satellites for a Master/Slave configuration

FRL's Demonstration and Science Experiments (DSX) rogram Quest for the Common Micro Satellite Bus

CubeSat Launch and Deployment Accommodations

The Nemo Bus: A Third Generation Nanosatellite Bus for Earth Monitoring and Observation

Figure 1. Proposed Mission Operations Functions. Key Performance Parameters Success criteria of an amateur communicator on board of Moon-exploration

Dynamics and Operations of an Orbiting Satellite Simulation. Requirements Specification 13 May 2009

Fault Management Architectures and the Challenges of Providing Software Assurance

NASA s Space Launch System: Powering the Journey to Mars. FISO Telecon Aug 3, 2016

The TEXAS Satellite Design Laboratory: An Overview of Our Current Projects FASTRAC, BEVO-2, & ARMADILLO

Understand that technology has different levels of maturity and that lower maturity levels come with higher risks.

launch probability of success

Small Sat Conference Utah State University Logan UT

MarCO: Interplanetary Mission Development on a CubeSat Scale

SPACE-BASED SOLUTIONS & ANALYTICS

Model Based AOCS Design and Automatic Flight Code Generation: Experience and Future Development

Cubesats and the challenges of Docking

A novel spacecraft standard for a modular small satellite bus in an ORS environment

Electric Solar Wind Sail tether payloads onboard CubeSats

3-Axis Attitude Determination and Control of the AeroCube-4 CubeSats

Space Technology Mission Directorate. NASA's Role in Small Spacecraft Technologies: Today and in the Future

Satellite Technology for Future Applications

KySat1 Mission Review

Introduction to MATE-CON. Presented By Hugh McManus Metis Design 3/27/03

Modeling and Simulation Made Easy with Simulink Carlos Osorio Principal Application Engineer MathWorks Natick, MA

Transcription:

CubedOS: A SPARK Message Passing Framework for CubeSat Flight Software SPARK/Frama-C Conference - Copyright 2017 Carl Brandon & Peter Chapin Dr. Carl Brandon & Dr. Peter Chapin carl.brandon@vtc.edu peter.chapin@vtc.edu Vermont Technical College +1-802-356-2822 (Brandon), +1-802-522-6763 (Chapin) 025226763 Randolph Center, VT 05061 USA http://www.cubesatlab.org

Why We Use SPARK/Ada ELaNa IV lessons for CubeSat software: NASA s 2010 CubeSat Launch Initiative (ELaNa) Our project was in the first group selected for launch Our single-unit CubeSat was launched as part of NASA s ELaNa IV on an Air Force ORS-3 Minotaur 1 flight November 19, 2013 to a 500 km altitude, 40.5 o inclination orbit and remained in orbit until reentry over the central Pacific Ocean, November 21, 2016. Eight others were never heard from, two had partial contact for less than a week, and one worked for 4 months. The Vermont Lunar CubeSat tested components of a Lunar navigation system in Low Earth Orbit

Vermont Lunar CubeSat It worked until our reentry on November 21, 2015: We completed 11,071 orbits. We travelled about 293,000,000 miles, equivalent to over 3/4 the distance to Jupiter. Our single-unit CubeSat was launched as part of NASA s ELaNa IV on an Air Force ORS-3 Minotaur 1 flight November 19, 2013 to a 500 km altitude, 40.5 o inclination orbit and remained in orbit until November 21, 2016. It is the only one of the 12 ELaNa IV university CubeSats that operated until reentry, the last one quit 19 months earlier. We communicated with it the day before reentry We are the only successful university satellite on the east coast Follow our project at cubesatlab.org

Vermont Lunar CubeSat SPARK 2005 software 5991 lines of code 4095 lines of comments (2843 are SPARK annotations) A total of 10,086 lines (not including blank lines) The Examiner generated 4542 verification conditions All but 102 were proved automatically (98%) We attempted to prove the program free of runtime errors Which allowed us to suppress all checks The C portion consisted of 2239 lines (including blank lines) Additional provers in SPARK 2014 would improve this

Vermont Lunar CubeSat Vermont Lunar CubeSat (10 cm cube, 1 kg)

ELaNa IV Launch Minotaur 1 Wallops Island November 19, 2013, 8:15 PM First two stages are Minuteman II, third and fourth stages are Pegasus second and third stages

Vermont Lunar CubeSat Our first picture of Earth, The North coast of Western Australia

Vermont Lunar CubeSat Clouds over the ocean, June 2015, 19 months after launch.

Software Development Comments for our first CubeSat SPARK caught errors as we refactored the software as we developed greater understanding of the hardware SPARK helped the discipline of the software during turnover as some students graduated and were replaced Although we did not have a formal development process, without SPARK we probably would not have completed the project with the limited personnel resources and tight time constraint Although the CubeSat is limited to 1.3kg, the paperwork is unlimited Conference 2017

Four aerospace software failures that would have been prevented with SPARK/Ada: Mars Science Laboratory Sol-200 Memory Anomaly Ariane 5 initial flight failure Boeing 787 generator control computer shutdown Boeing 787 avionics reset

Mars Science Laboratory Sol-200 Memory Anomaly Six months after landing on Mars, uncorrectable errors in the NAND flash memory led to an inability of the Mars Science Laboratory (MSL) prime computer to turn off for its normal recharge session. This potentially fatal error was apparently due to two pieces of its C software having pointers which pointed to the same memory. Curiosity has about 3.5 MLOC written in C. (One would expect about 35,000 errors.) SPARK/Ada would have prevented this almost fatal error in a 2.5 billion dollar spacecraft.

Ariane 5 initial flight failure: Bad, 37 seconds later Good

Ariane 5 initial flight failure: Software reused from Ariane 4, written in Ada The greater horizontal acceleration caused a data conversion from a 64-bit floating point number to a 16-bit signed integer value to overflow and cause a hardware exception. Efficiency considerations had omitted range checks for this particular variable, though conversions of other variables in the code were protected. The exception halted the reference platforms, resulting in the destruction of the flight. Financial loss over $500,000,000. SPARK/Ada would have prevented this failure

Boeing 787 generator control computer: There are two generators for each of two engines, each with its own control computer programmed in Ada The computer keeps count of power on time in centiseconds in a 32 bit register Just after 8 months elapses, the register overflows Each computer goes into safe mode shutting down its generator resulting in a complete power failure, causing loss of control of the aircraft The FAA Airworthiness Directive says to shut off the power before 8 months as the solution There is now a second 787 reset problem SPARK/Ada would have prevented this

Lunar IceCube (10cm x 20cm x 30cm) (14 kg) Lunar IceCube 6U CubeSat, Morehead State University, PI., Goddard (BIRCHES IR Spectrometer), JPL (Iris 2 data & nav radio) & Vermont Tech (Flight software). Busek ion drive with 1.5 kg Iodine propellant, Pumpkin photovoltaic array (120 W).

Hardware Controlled by Flight Software A photovoltaic (PV) panel orientation drive for aiming the panels Broadband Infrared Compact High Resolution Exploration Spectrometer (BIRCHES), Goddard Space Flight Center Blue Canyon XACT attitude determination and control system (ADACS): star tracker camera, CPU, and 3 momentum wheels Iris-2 X-band data & nav radio by NASA s Jet Propulsion Lab Busek BIT-3 iodine propellant ion drive (first use in space), controlling thrust and gimbals Spiral Thrusting (developed at JPL) for 3-axis momentum wheel desaturating Flight software will run on a Space Micro Proton-400 dual core PowerPC, radiation hardened CPU board

Hardware Controlled by Flight Software Flatsat ADACS Emulator Iris-2 X-Band Radio Emulator Power Supply CPU BIT-3 Ion Drive Emulator

Busek Ion Thruster BIT-3 Iodine Propellant 75W, 1.15 mn, 2.5 cm beam width, I SP = 2,000

Lunar IceCube Flight Software based on CubedOS Intended to be a general purpose framework for CubeSat flight software Written in SPARK; proven free from runtime errors Provides inter-module message passing framework Provides services of interest to flight software Can integrate existing Ada or C runtime libraries Uses a Low Level Abstraction Layer (LLAL) to abstract OS/hardware Conceptually similar to NASA s cfe/cfs except written in SPARK (not C).

Lunar IceCube Software Environment VxWorks 6.9 on PowerPC SPARK 2014 with Ravenscar runtime Current Development Team VTC: 2 faculty, 5 students (2 MS, 3 BS) Morehead State University: 1 faculty, 1 student

CubedOS/IceCube Verification Goals No flow errors Show freedom from runtime error Other correctness properties as time allows CubedOS/IceCube Testing Unit tests with AUnit (x86) Some additional test programs (x86) Hardware development system (PowerPC) Hardware FlatSat (PowerPC)

Continuous Integration We use Jenkins-CI (https://jenkins.io/) Every night builds & executes unit test programs does SPARK flow analysis does SPARK proofs Build considered to have failed if unit tests fail Requiring successful proofs for successful build too high a bar

Software Architecture Collection of modules that pass messages Each module reads messages from exactly one mailbox Each module contains a message processing task Modules all execute concurrently Collection of libraries Passively called from multiple modules

Software Architecture CubedOS comes out-of-the-box with: A set of standard server modules Timing services Publish/Subscribe services File system interface Communication protocols (e. g., CFDP) etc A set of library facilities CRC, Packet encoding/decoding, data compression

Lunar IceCube Flight Software A CubedOS application Application modules for: Device drivers for subsystem hardware Spacecraft state manager ( main module that initiates and coordinates other activity) Command scheduler Implementation of CubedOS standard file system interface

CubedOS Mailboxes generic Module_Count : Positive; Mailbox_Size : Positive; Maximum_Message_Size : Positive; package CubedOS.Generic_Message_Manager is type Message_Record is record Sender : Module_ID_Type; Receiver : Module_ID_Type; Message_ID : Message_ID_Type; Mostly for future expansion Priority : System.Priority; Size : XDR_Size_Type; XDR encoded message parameters Payload : XDR_Array; end record; type Message_Array is array(message_index_type) of Message_Record; protected type Mailbox is end Mailbox; Mailboxes : array(module_id_type) of Mailbox; end CubedOS.Generic_Message_Manager;

CubedOS Mailboxes Each instantiation of the message manager creates a communication domain Multiple communication domains possible Each module has unique ID within its domain Each module has a single task that reads its mailbox and handles/dispatches messages Message parameters are encoded/decoded at runtime into octet streams and installed into the receiver s mailbox

CubedOS Modules Each module is a hierarchy of packages Complex modules might have multiple private child packages to support implementation Some_Module.API Contains subprograms for encoding/decoding messages Generated automatically by the XDR2OS3 tool (under development) from a high level message specification Some_Module.Messages Contains the message loop and message handling

CubedOS Modules Module communication is point-to-point Sender names receiver explicitly Receiver learns sender ID from message header Replies returned via (dynamically specified) ID Server modules Can be written without knowledge of clients Provided by third party libraries

Advantages Lots of behavior deferred to runtime Flexible and dynamic communication patterns Easily extensible via module libraries OOP-like behavior Many different implementations of the same module API are possible; clients need not know which implementation they are using

Disadvantages Lots of behavior deferred to runtime! Message encoding/decoding overhead (space and time) Loss of type safety (compare with well-typed protected object entry calls) Not the SPARK way! But type safety issue mitigated somewhat by XDR2OS3

Modified XDR Message Specification typedef unsigned int Channel_ID_Type range 1.. 16; typedef enum { Success, Failure } Status_Type; constant Max_Data_Size = 1024; message struct { Channel_ID_Type Channel; } Subscribe_Request; message struct { Channel_ID_Type Channel; Status_Type Status; } Subscribe_Reply; message struct { Channel_ID_Type Channel; opaque Data<Max_Data_Size>; } Publish_Request;

XDR2OS3 Specification Output package CubedOS.Publish_Subscribe.API is type Channel_ID_Type is range 1.. 16 type Status_Type is (Success, Failure); Max_Data_Size : constant := 1024; type Message_Type is (Subscribe_Request, Subscribe_Reply, Publish_Request); function Subscribe_Request_Encode (Sender : Module_ID_Type; Channel : Channel_ID_Type; Priority : System.Priority) return Message_Record with Global => null;... end CubedOS.Publish_Subscribe.API;

XDR2OS3 Specification Output package CubedOS.Publish_Subscribe.API is... procedure Subscribe_Request_Decode (Message : in Message_Record; Channel : out Channel_ID_Type; Status : out Status_Type) with Global => null, Pre => Is_Subscribe_Request(Message), Depends => ((Channel, Status) => Message); end CubedOS.Publish_Subscribe.API;

XDR2OS3 Body Output package body CubedOS.Publish_Subscribe.API is function Subscribe_Request_Encode (Sender : Module_ID_Type; Channel : Channel_ID_Type; Priority : System.Priority) return Message_Record is Message : Message_Record := Make_Empty_Message (Sender, ID, Message_Type'Pos(Subscribe_Request), Priority); Position : XDR_Index_Type; Last : XDR_Index_Type; begin Position := 0; XDR.Encode (XDR.XDR_Unsigned(Channel), Message.Payload, Position, Last); Message.Size := Last + 1; return Message; end Subscribe_Request_Encode;

Problem with Mailboxes SPARK won t track information flow through arrays high: multiple tasks might queue on protected entry "message_manager.mailboxes.receive We suppress this message! Can t track flow between modules We must take responsibility for initialization, etc. But this allows flexible communication Full strength of SPARK within modules NOTE: Must ensure modules have unique IDs!

Why not NASA s cfe/cfs? cfe/cfs = Core Flight Executive / Core Flight System Similar architecture Uses publish/subscribe (not point-to-point) Uses CCSDS space packets for messages cfe written in C. Not verified We hope to eventually offer CubedOS as a competing SPARK platform for spacecraft software

Lunar IceCube Launch Vehicle NASA s Space Launch System 2018

At the Moon

One of Our Ground Stations The 70m Dish at Goldstone, California

21m Dish at Morehead State University The 70m Dish at Goldstone, California

Acknowledgements NASA Vermont Space Grant Consortium Vermont Technical College AdaCore, Inc. (GNAT Pro, SPARK Pro) Morehead State University (Spacecraft) Applied Graphics, Inc. (STK) Busek (BIT-3 Iodine ion drive) Pumpkin, Inc. (PV-panels, gimbals, battery, EPS) NASA Jet Propulsion Lab (Iris-2 Radio) NASA Goddard Space Flight Center (BIRCHES)

A SPARK 2014 Book is Available

CubedOS: A SPARK Message Passing Framework for CubeSat Flight Software SPARK/Frama-C Conference - Copyright 2017 Carl Brandon & Peter Chapin Dr. Carl Brandon & Dr. Peter Chapin carl.brandon@vtc.edu peter.chapin@vtc.edu Vermont Technical College +1-802-356-2822 (Brandon), +1-802-522-6763 (Chapin) 025226763 Randolph Center, VT 05061 USA http://www.cubesatlab.org