Top Banner
CINEMA CubeSat Flight Software Handling High Data Rates David McGrogan Space Sciences Laboratory University of California, Berkeley CubeSat Developer’s Workshop April 21, 2010
38

CINEMA CubeSat Flight Software - Cal Poly

Dec 11, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CINEMA CubeSat Flight Software - Cal Poly

CINEMA CubeSat Flight

SoftwareHandling High Data Rates

David McGrogan

Space Sciences Laboratory

University of California, Berkeley

CubeSat Developer’s Workshop April 21, 2010

Page 2: CINEMA CubeSat Flight Software - Cal Poly

CINEMA has been

brought to you by:

Principal Investigator

Robert Lin, SSL

System Engineer

David Curtis, SSL

STEIN Scientist

Davin Larson, UCB

MAGIC Scientist

Tim Horbury, ICL

Other contributors:

David Glaser, SSL

Dorothy Gordon, SSL

Peter Harvey, SSL

John Sample, SSL

Page 3: CINEMA CubeSat Flight Software - Cal Poly

CINEMA

• Monitor space weather

• Demonstrate self-orientation, miniaturized

sensors, CubeSat possibilities

• Main sensors: STEIN particle detector,

magnetometers

(CubeSat for Ions, Neutrals, Electrons and MAgnetic fields)

Page 4: CINEMA CubeSat Flight Software - Cal Poly

STEIN Particle Detector

STEIN: SupraThermal

Electron, Ion, Neutral

Four detector “pixels”,

≤30K counts/sec each

Range: few to 100 KeV

Resolution:

~1 KeV FWHM

Page 5: CINEMA CubeSat Flight Software - Cal Poly

Magnetometers

Magnetoresistive

magnetometers

minimize size

3 axes, inboard and

boom-deployed

Resolution: 2-10 nT

in science mode,

25 nT in ACS

mode

Fluxgate

mag.

MR mag.

(1-axis)

MR mag.

assembly

(3-axis)

Page 6: CINEMA CubeSat Flight Software - Cal Poly

Axis found via magnetometers,

solar panels, sun sensor

Spin speed and axis controlled

using torque coils (red)

Attitude Control System (ACS)

V-slit sun

sensor

Page 7: CINEMA CubeSat Flight Software - Cal Poly

Solid State Storage

Standard SD card

Shock and vibration

tested

Resistant to temperature

extremes (-25°C -

85°C)

Holds well over a week’s

worth of data (average)

Page 8: CINEMA CubeSat Flight Software - Cal Poly

System Modes

• Safe – Minimal Power Configuration, all

optional systems off; boots/resets to Safe

• ACS – Only SD card, torque coils, and low

speed MAG active; used to control attitude

• Science – SD card, STEIN, and MAG active,

radio transmit allowed, torque coils disabled

• Engineering – Everything enabled

Page 9: CINEMA CubeSat Flight Software - Cal Poly

Mission Plan

• Early operations

– Safe Mode until contact with ground station

– Deploy magnetometer boom

– Self-diagnostics, calibration

– Reorient spin plane to ecliptic, spin up

• Normal operations

– STEIN, mag. collecting data at full speed

– Ground contact at least once/day

Page 10: CINEMA CubeSat Flight Software - Cal Poly

Maximum Data Rates

• STEIN: 120K particles/sec peak, 16 bits/particle

• All data stored on SD card; must handle peaks

• RF downlink: 1 Mbps constant

• 10 MIPS processor limit (power consumption)

SD

card

SD

card

dsPIC33

Micro-

controller

dsPIC33

Micro-

controller

1.92 Mbps

>1.92 Mbps

10 MIPS

RadioRadio 1 Mbps

Page 11: CINEMA CubeSat Flight Software - Cal Poly

Dealing with Demands

• Using max-size blocks & interleaving

reading/writing requires almost 1/2 of processor

(peak)

• Doesn’t include SD card busy time fluctuations

• Ability of RTOS to regularly schedule this task

plus many others unknown, also overhead

• More deterministic solution desired

STEIN data

handlingOther work

STEIN data

handling Other work

Page 12: CINEMA CubeSat Flight Software - Cal Poly

Task Division

• Background tasks

• Run at specific times

• Must finish within a fixed time limit

• Command handling, ADC sampling, data transmission…

• Foreground tasks

• Run asynchronously, round-robin in remaining time

• No hard limit on execution time

• ACS calculations, SRAM scan, memory peek/poke…

Page 13: CINEMA CubeSat Flight Software - Cal Poly

Background Task Scheduling

0 1 2 3 4 5 6 7

0 STE TX STE STE TX STE

8 HSK STE TX STE STE TX STE

16 TM STE TX STE STE TX STE

24 CMD STE TX STE STE TX STE

32 STE TX STE STE TX STE

40 PWR STE TX STE STE TX STE

48 SSR STE TX STE STE TX STE

56 MAG STE TX STE STE TX STE

• Each task must

run with a given

frequency

• Fixed schedule

ensures this

• Tasks must

finish in allotted

time

Page 14: CINEMA CubeSat Flight Software - Cal Poly

Direct Memory Access (DMA)

• Sequential data moved between

peripheral and RAM automatically

• No processor time required

• 2 KB of DMA RAM in dsPIC33

Peripheral Data 1

Data 2

Data 3

DMA RAM

Page 15: CINEMA CubeSat Flight Software - Cal Poly

Serial and DMA

• Commands arrive quickly

• DMA replaces built-in serial buffer with

RAM

• Operates independent of current task

Serial in

from

Radio

Cmd 1

Cmd 2

Cmd 3

DMA RAM

Page 16: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

7654321076543210

Clock

Master Slave

Page 17: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

6543210765432107

Clock

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

Master Slave

Page 18: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

5432107654321076

Clock

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

Master Slave

Page 19: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

4321076543210765

Clock

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

Master Slave

Page 20: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

3210765432107654

Clock

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

Master Slave

Page 21: CINEMA CubeSat Flight Software - Cal Poly

Serial Peripheral Interface (SPI)

Inter-device shift register

7654321076543210

Clock

SD

card

SD

cardMicro-

controller

Micro-

controller

Clock

Data

Master Slave

Page 22: CINEMA CubeSat Flight Software - Cal Poly

SPI and DMA

• SPI slaves need an input to produce output

• Entire transfer can be automated

SPI1 in Data 1

DMA RAM

SPI1 out 0xFF SPI2 outRepeated

To SD

Card

To Radio

FPGA

Page 23: CINEMA CubeSat Flight Software - Cal Poly

SPI and DMA

• SPI slaves need an input to produce output

• Entire transfer can be automated

SPI1 in Data 1

Data 2

DMA RAM

SPI1 out 0xFF SPI2 outRepeated

To SD

Card

To Radio

FPGA

Page 24: CINEMA CubeSat Flight Software - Cal Poly

SPI and DMA

• SPI slaves need an input to produce output

• Entire transfer can be automated

SPI1 in Data 1

Data 2

Data 3

DMA RAM

SPI1 out 0xFF SPI2 outRepeated

To SD

Card

To Radio

FPGA

Page 25: CINEMA CubeSat Flight Software - Cal Poly

More DMA Channels

• 8 DMA channels

available

• Only one channel

per cycle moves data

SPI1 in Data 1

Data 2

Data 3

Cmd 2

DMA RAM

SPI1 out 0xFF SPI2 out

Cmd 1

…Serial in

RepeatedTo SD

Card

To Radio

FPGA

From Radio

Page 26: CINEMA CubeSat Flight Software - Cal Poly

Fudging the rules with DMA

• Combination of DMA with Background Task

Table lets background task actions continue

after task returns

• Transmit task could set up DMA and return

SPI1 in Data 1

Data 2

DMA RAM…

SPI1 out 0xFF SPI2 outRepeated

To SD

Card

To Radio

FPGA

Page 27: CINEMA CubeSat Flight Software - Cal Poly

Fudging the rules with DMA

• No conflict

concerns due to

fixed schedule

• Next task is

known, can be

programmed to

avoid conflict

• STE follows TX

0 1 2 3 4 5 6 7

0 STE TX STE STE TX STE

8 HSK STE TX STE STE TX STE

16 TM STE TX STE STE TX STE

24 CMD STE TX STE STE TX STE

32 STE TX STE STE TX STE

40 PWR STE TX STE STE TX STE

48 SSR STE TX STE STE TX STE

56 MAG STE TX STE STE TX STE

Page 28: CINEMA CubeSat Flight Software - Cal Poly

The Average Case

• Particle flux peaks should be rare

• Downlink capacity is ~8 Kbps average

• STEIN output thus limited, may be attenuated

• Other sensor inputs <1 Kbps

Ability to handle 2 megabit data flows will be

infrequently used, but will prevent data loss

Page 29: CINEMA CubeSat Flight Software - Cal Poly

HeliumHeliumCmds

Analogs

PWR.APWR.A

ACS.AACS.A

Sun

Sensors

Sun

Sensors

Torque

Coils

Torque

Coils

STEIN

Attenuator

STEIN

Attenuator

MAG

Elect

MAG

Elect

STEIN

Elect

STEIN

Elect

MAG.AMAG.A

STEIN.ASTEIN.A

SPI

SPI

S-Band

Tx

S-Band

Tx

TM.ATM.A

SDCARDSDCARD

STEIN

FPGA

POWER

Switches

Timers

MAG

FPGA

BKG.ABKG.A EXEC.AEXEC.A

SSR.ASSR.A

LD.ALD.A

CMD.ACMD.A

SRAM &

EEPROM

SRAM &

EEPROMHSK.AHSK.A

COMM

FPGA

FSW MAJOR MODULES

SimulinkSimulink

SPI

Flight Software Modules

Page 30: CINEMA CubeSat Flight Software - Cal Poly

Contacts

Visit us at:

http://ssl.berkeley.edu

For more information:

David McGrogan – dpmcgrog(at)eecs.berkeley.edu

Science questions:

John Sample – jsample(at)ssl.berkeley.edu

Page 31: CINEMA CubeSat Flight Software - Cal Poly
Page 32: CINEMA CubeSat Flight Software - Cal Poly

STEIN Detector

and Electronics

Cover

Sun

Sensors

STEIN

Collimator

Stowed

Stacer BoomBus Avionics MAGIC

Magnetometer

Stacer Boom

Release

STEIN

Attenuator

Deploy

Switch

Deploy

Springs

S-Band

Transmitter

Patch

Antennas

Solar

Panel

Page 33: CINEMA CubeSat Flight Software - Cal Poly

Even Better Multitasking

• DMA makes simultaneous data streams easier

• Communication routines can be simplified or

do other work (e.g. CRC)

SD

card

SD

cardMicro-

controller

Micro-

controllerData Data+CRC

DMA-driven Routine-driven

Page 34: CINEMA CubeSat Flight Software - Cal Poly

Maximum Data Rates

• STEIN: 120K particles/sec peak, 16 bits/particle

• All data stored on SD card; must handle peaks

• RF downlink: 1 Mbps constant

• 10 MIPS processor limit (power consumption)

SD

card

SD

card

dsPIC33

Micro-

controller

dsPIC33

Micro-

controller

1.92 Mbps

>1.92 Mbps

10 MIPS

RadioRadio 1 Mbps

Page 35: CINEMA CubeSat Flight Software - Cal Poly

Data Flow Requirements

• 10 MIPS limit due to power demand

• Must send or get 1 byte every 31.25 cycles

• Includes handshaking, SD card busy time,

pointer updates, all other tasks

SD

card

SD

cardMicro-

controller

Micro-

controller1.28 Mbps >1.28 Mbps

Page 36: CINEMA CubeSat Flight Software - Cal Poly

Background Task Scheduling

0 1 2 3 4 5 6 7

0 STE TX STE STE TX STE

8 HSK STE TX STE STE TX STE

16 TM STE TX STE STE TX STE

24 CMD STE TX STE STE TX STE

32 STE TX STE STE TX STE

40 PWR STE TX STE STE TX STE

48 SSR STE TX STE STE TX STE

56 MAG STE TX STE STE TX STE

• 512 bytes takes

0.8 ms to move

with SPI

• Run background

tasks at 1024 Hz

• Tasks must

finish in allotted

time

Page 37: CINEMA CubeSat Flight Software - Cal Poly

DMA and SPI

Page 38: CINEMA CubeSat Flight Software - Cal Poly

Stuff I need to know

• What’s the real peak sample rate of STEIN? 80K flat or 30K/detector * 4 detectors? (it’s the 120000)

• Switch slides 7,8

• Acronym explanation is good

• FIFO, SPI

• STEIN diagram?

• Block diag

• What have others done?

• 7min current; slow down

• SD card

• CINEMA specs/capabilities

• Why: detect solar particles, test ACS ability, show that students can do things, etc. Look at proposal, Glaser’s presentation last year

• Credit people