Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing...

31
Modular Infrastructure for Rapid Flight Software Development Craig Pires NASA Ames Research Center https://ntrs.nasa.gov/search.jsp?R=20100038430 2019-08-28T11:07:30+00:00Z

Transcript of Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing...

Page 1: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Modular Infrastructure for Rapid Flight Software Development

Craig Pires NASA Ames Research Center

https://ntrs.nasa.gov/search.jsp?R=20100038430 2019-08-28T11:07:30+00:00Z

Page 2: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Overview

•  Background •  Flight Software Development Process •  Simulink Model Overview •  Integration with cFE

Page 3: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Background

•  Small Spacecraft Investigation –  Modular CommonBus Spacecraft

•  Hover Test Vehicle (HTV) Development •  Next Step - Lunar Atmosphere and Dust

Environment Experiment (LADEE) –  Joint ARC/GSFC Mission –  Lunar Orbiter, Launch 2012

3

Page 4: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Flight Software Infrastructure Development

•  Model Based Approach for Application Unique Software

•  Latest Developments –  Mathworks Simulink/RTW Embedded Coder –  Integration of GSFC ITOS GDS Tool –  Integration of GSFC Core Flight Executive (cFE) –  Demonstrated on HTV

Page 5: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Hover Test

5

Page 6: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Flight Software Development Process Overview

Page 7: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

FSW Process Overview

7

•  Model Based Development Approach –  Develop Models of FSW, Vehicle, and Environment in Simulink –  Automatically generate Software using RTW/EC. –  Integrate with hand-written and heritage software. –  Iterate while increasing fidelity of tests – Workstation Sim (WSIM), Processor-In-The-

Loop (PIL), Hardware-in-the-Loop (HIL)

Requirements

Design/Algorithm Development

Flight Software Modeling

Vehicle & Environment

Modeling

Heritage Software

Workstation Simulations

(eg. Simulink) Code

Generation

Integrated Tests

Processor-in-the-Loop Hardware-in-the-Loop

Verification

Heritage Models

Iterate Early and Often

Page 8: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Automatic Code Generation

• Simulink supports two way trace-ability between models and generated code • Code Easy to read, well commented

8

Page 9: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink Model Overview

Page 10: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink HTV Architecture

10

FSW Auto-Coded and integrated with CFE

Page 11: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink FSW Model

Command Processing: - Receives commands via CDH (TCP/IP or RS422). - Compiled in script allows flexible sequencing. - Processes and Sets Control Modes.

Vehicle Health Monitoring: -Command Checking -Sensor Limit Checking - Hardware status

State Estimation: - Receives sensor data. - Low Pass Filters - Auto generated Kalman Filter.

Telemetry: Passes data to the CDH so that it can be transmitted via TCP/IP or RS422.

GN&C: - Guidance System sets desired angles based on position error. - Guidance System maintains desired vertical velocity. - Control System uses Bang-Bang approach to maintain desired angle.

Prop Management: - Fires thrusters based on commands and control mode.

11

Simulink Bus Creator

Page 12: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink Flight Hardware Model

Thruster dynamic forces and torques.

Mass and Inertia Characteristics of Vehicle

Sensor Models -Analogs (Temperature, Pressure) - LN200 IMU - VIZ Camera System

12

Page 13: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink Environment Model

6DOF Position and Rotational Propagation

Command and Downlink Delays

Vehicle Initial Conditions

External Forces on Vehicle (Tether, platform)

Gravitational Forces

13

Page 14: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Integration

Page 15: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE – Core Flight Executive

•  Goddard Space Flight Center Developed •  Derived from Legacy Missions •  Flexible infrastructure for Space Flight

Software •  Components:

– Executive Services – Event Services – Time Services – Table Services – Software Bus Services

15

Page 16: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Development Goals

•  Utilize cFE with no changes •  Automate process during Code

Generation. •  Subsystem Blocks generate to cFE

Applications that run at desired rates •  Simulink Apps/Blocks Communicate via

cFE Software Bus

16

Page 17: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Layered Architecture Approach

Payload Manager GN&C Thermal State

Estimation

Analog Acquisition cPCI RS-422

Physical (Hardware) Layer

OS Services Layer (VxWorks OS, GSFC OS Abstraction Layer)

System Support Layer (GSFC cFE)

Simulink Generated Mission Unique Application Layer

Processor BRE 440

Non-Volatile Memory

Volatile Memory

VxWorks OS Bootstrap Loader

Memory R/W Driver

Software Bus Exec & Task Services

Time Management

Event Handler

Table Management

Digital I/O

Timer Driver

PCI Driver

Timers Comm.

Generic Services Layer (GSFC cFS) & Hand Code

Propulsion Management Telemetry Power Vehicle Health

and Monitoring Command Processing

MOAB Driver RS422, I/O, COMM, HK

File Mgmt

Memory Mgmt

House Keeping

17

Cmd Ingest

Telem Output

HW I/O

Master Timer

Page 18: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Key Ideas

•  Modular Tasks (vs. Monolythic) –  Pros:

•  More Flexible •  Simplifies Task Replacement •  Easier Debugging – can look at messages between tasks

–  Cons: •  Harder to implement •  More overhead due to more tasks and messages

•  Mathworks Template (TLC) File –  Executed during Code Generation Process –  Allows customization of created code –  Leveraged to autocode cFE Apps from Simulink

18

Page 19: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Implementation

•  Simulink Bus translates to cFE Message •  RTW/EC generates Task Description •  Master Timer Generates “Tick” to

Schedule Apps and generate Output Messages

•  Receive Structure Msgs update local App Input Values

•  Apps also Respond to Other Command and Housekeeping Messages

19

Page 20: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Autocode Process

20

Telemetry

Sequencer

VHM

State Est.

Thermal

Payload

Prop Pyro

Power

GN&C

FSW

Telemetry.c + IF.h

Sequencer.c + IF.h

VHM.c + IF.h

State_Est.c + IF.h

Thermal.c + IF.h

Payload.c + IF.h

Prop_Pyro.c + IF.h

Power.c + IF.h

GNC.c + IF.h

CFE_inteface.c Drivers.c

HC_Module.c

Compile & Link

cFE

HTV Bus Description

RTW/EC

ITOS DBX

Page 21: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulink Bus becomes cFE Message

'lns_msg', ... '', ... sprintf(''), { ... {'lns_delta_velocity_counts', 3, 'int16', -1, 'real', 'Sample'}; ... {'lns_delta_angle_counts', 3, 'int16', -1, 'real', 'Sample'}; ... {'lns_status', 1, 'int16', -1, 'real', 'Sample'}; ... {'lns_mode', 1, 'int16', -1, 'real', 'Sample'}; ... {'lns_data', 1, 'int16', -1, 'real', 'Sample'}; ... {'lns_counts', 3, 'int16', -1, 'real', 'Sample'}; ... {'lns_checksum', 1, 'int16', -1, 'real', 'Sample'}; ... } ...

21

Page 22: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink Message Flow

22

Sequencer

State Est.

Prop Pyro

GN&C

100 Hz Tick

Sequencer

Prop Pyro

GN&C

100 Hz Tick

Messages

State Est.

Telemetry

Sequencer

State Est.

Prop Pyro

GN&C

10 Hz Tick

100 Hz Tick

Page 23: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE Simulink App Loop

Struct App_Inputs In Struct App_Outputs Out App_Init() {

Initialize_App_Inputs() Subscribe_SB_Msgs(Tick, AppMsgs,…) Simulink_Init(In, Out)

} App_Main(){

App_Init() while(1) { sb_receive_msg(msg, timeout) if (msg == tick) { Simulink_Step(dt, In, Out) sb_send_msg(Out) /* app update */ } else { If (msg == app_update) /* Process other App Msgs */ App_Update_Inputs(msg, Out) else Process_Msg(msg) /* HK, Cmds, etc… */ } }

}

23

Page 24: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

New Efforts

•  3DOF Simulator •  Command Queueing •  Parameter Tables •  Command & Telemetry Dictionary - XTCE •  Snapshot/Snapshot Recall •  Latency Reduction

–  Output Message triggers “Step” of Next Module –  Retains Modularity

24

Page 25: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Summary

•  NASA Ames developing infrastructure for rapid flight software development

•  Model based process leverages Mathworks Simulink, RTW-EC

•  Developed modular approach to integrate auto-generated code with GSFC’s cFE.

•  Successfully demonstrated on HTV •  Being Utilized on NASA’s LADEE mission

Page 26: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Backup

26

Page 27: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

cFE IMU App Loop

IMU_Main(){ while(1) { struct imu_input_str imu_in read_msg_que(imu_in, timeout) /* VxWorks Msg Que */ sb_send_msg(imu_msg) Send_tick() }

}

Cnt = 0; Send_tick() {

sb_send_msg(400HZ_Tick) /* Do we need 400HZ Tick or key off of IMU Data? */ if ((Cnt % 2) == 0) sb_send_msg(200HZ_Tick) if ((Cnt % 4) == 0) sb_send_msg(100HZ_Tick) if ((Cnt % 40) == 0) sb_send_msg(10HZ_Tick) if ((Cnt % 400) == 0) sb_send_msg(1HZ_Tick)

Cnt++; }

/* Note: Other Apps same as IMU without the Send_tick() */

27

Page 28: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Simulation

Workstation Simulation

Local Workstation

Spacecraft Model

Flight Software

C&DH

Dyn

Eff Sens Telem Sim

Model Library

• Simulink/SystemBuild Only (No Autocode) • Early in development process • Algorithm Development • Requirements Analysis

28

Page 29: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

PIL Flight Box

Processor-in-the-Loop Simulation

Command and Telemetry Software

(ITOS?)

Commands and Telemetry Spacecraft Model

Flight Software

Dyn

Eff Sens Local Telem Server

Model Library

C&DH

SharedMem SharedMem

cPCI Chassis

COTS “Flight” Processor

Sim Processor

• Models autocoded and running on RT processors • Inexpensive “flight-like” processor • Tests autocoding process & integration with C&DH software • Integration with Telemetry Software allows early

development/testing of downlink • Can be used for initial code size and resource utilization analysis

29

Page 30: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Flight Box “TIC”

Hardware-in-the-Loop Simulation

Command and Telemetry Software

(ITOS ?)

Commands and Telemetry

Spacecraft Model

Dyn

Eff Sens

Local Telem Server

Common Model Library

VME Backplane

VME Chassis

Sim Processor

cPCI Chassis

Flight Software

C&DH

MOAB

Analog Out

Analog In

Discrete I/O

RS422

SACI

PAPI

PAPI

• Flight code runs on Flight Avionics EDU • Provides testing of FSW with Avionics I/O • Definitive answers on resource utilization • Highest fidelity simulations for verification/validation

30

Page 31: Modular Infrastructure for Rapid Flight Software Development · • NASA Ames developing infrastructure for rapid flight software development • Model based process leverages Mathworks

Motivation for Moving to Simulink

•  Industry appears to be moving that direction. •  Mathworks Extensive support network. •  Mathworks tools for Requirements management,

Documentation, and V&V. •  Bus concept makes model management easier. •  Monolithic SystemBuild models not conducive to

Reuse and V&V.

31