Code Monkey home page Code Monkey logo

cysat-1-main's Introduction

CySat 1 - Make to Innovate at Iowa State University

Onboard Computer (OBC) firmware, Satellite Systems, and Ground Station Software - CySat M2I

Instructions

  1. Navigate to the CySat-1 CyBox folder and read the documents under /About CySat-1: README! to gain a basic understanding of the CySat-1 mission, objectives, and project structure
  2. Continue reading this README to know basic files, instructions, and applications for each subsystem
  3. Reference subsystem-specific setup instructions, guides, and data sheets to gain an understanding of your specific tasks found in the CySat 1 box folder under Subsystems -> [Subsystem]

ADCS - Attitude Determination and Control System

ADCS Testing Spreadsheets now in Box: Subsystems/ADCS/Tests

  • CubeADCS - Commissioning Manual [V3.06] - This document describes the activities related to the commissioning of a CubeSpace ADCS module in flight.
  • CubeADCS - Health Check [V3.15] - This document will provide the instructions and results of the health check of the CubeADCS unit. The instructions provided must be followed exactly and the observed results must be indicated as is.
  • CubeADCS - ICD [V3.08] - This document describes the characteristics of the CubeADCS unit as well as the mechanical and electrical interfaces to the bundle. CubeADCS units can be configured with different sensor and actuators for different mission requirements. This document covers all ADCS configurations and readers are to use their discretion in determining which parts are relevant to their various bundle configurations.
  • CubeADCS - Option Sheet (Y-Momentum) [V3.02]\_TGT - This document include the complete ADCS solution for Y-momentum control. A momentum wheel (in various sizes) is included in the solution and can be mounted either on the bundle or separately from the bundle, depending on the size of the wheel. CubeSpace’s fine sun and nadir sensor module, CubeSense, can also be added to the solution if more accurate attitude control is required.
  • CubeADCS - Reference Manual [V3.10] - This document serves as source of information to refer to when using the User Manual, Commissioning Manual, and other CubeADCS documentation. The document contains complete listings of TCs and TLMs, communications examples, and other reference examples to assist in designing a system which will interface with the ADCS.
  • CubeADCS - User Manual [V3.07] - This document provide the user with instructions of completing the initial setup of the CubeADCS unit for the health check, instructions for connecting the unit to an OBC, a guide to mounting sensors inside a satellite and calculating mounting transforms, a functional description of the control modes that the CubeADCS unit is capable of executing, general usage instructions for all major functionality, and an overview of the hardware included in this bundle and their performance.

CloneComm Ground Station

Command Manifest

See the full list of commands in CyBox

  • Place commands under their respective type
  • "#" marks the beginning of a subtype
  • cmd_id:com_desc:data_payload(1=True,0=False):gs_sendable(1=True,0=False)

10:OBC

0:Ping Response:1:0 1:Ping Request:0:1 2:Disable Beacon Response:1:0 3:Disable Beacon Request:0:1 4:Basic Health Check Response:1:0 5:Basic Health Check Request:0:1 6:Main Operating Response:0:0 7:Main Operating Request:0:1

30:EPS

0:Voltage Response:1:0 1:Voltage Request:0:1

40:SDR

0:Power Status Response:0:0 1:Power Status Request:0:1 2:Time Set Response:0:0 3:Time Set Request:1:1 4:Set RF Bandwidth Response:1:0 5:Set RF Bandwidth Request:1:1 6:Set Calibration 1 Response:0:0 7:Set Calibration 1 Request:1:1 8:Set Calibration 2 Response:0:0 9:Set Calibration 2 Request:1:1 10:Set DC Gain Response:0:0 11:Set DC Gain Request:1:1 12:Set fftsize Response:0:0 13:Set fftsize Request:1:1 14:Set Frequency Response:0:0 15:Set Frequency Request:1:1 16:Set Integral Response:0:0 17:Set Integral Request:1:1 18:Set Sample Rate Response:0:0 19:Set Sample Rate Request:1:1 20:Set spavg Response:0:0 21:Set spavg Request:1:1 22:Reset SDR to Default Values Response:1:0 23:Reset SDR to Default Values Request:0:1 24:SDR Values Response:1:0 25:SDR Values Request:0:1 26:Take Measurement Response:1:0 27:Take Measurement Request:1:1 28:Start Transfer Response:1:0 29:Start Transfer Request:1:1 30:File Finished Response:1:0

EPS - Electrical Power System

  • In this folder is all known versions of EnduroSat EPS documentation.
  • Some of the documents contain inaccuracies: discrepancies in the diagrams and tables, but the ones at the root level are mostly correct
  • The files in the Flash Drive folder are the ones that came directly from EnduroSat when the EPS was purchased, but there appear to be some inaccuracies here too, especially with the I2C manual
  • The folder labelled inaccurate documents is kept for the sake of posterity

OBC - Onboard Computer

The EnduroSat Onboard Computer Type II (Indicated as Type I on the OBC in the lab) includes the STM32F4x Microcontroller, various communication interfaces, peripheral I/O devices, a prototyping area, and a PC-104 stack connector. EnduroSat provides an Open Software SDK which is included in this repository in addition to the main CySat 1 mission program.

Environment Setup

  1. Dowloand GitHub Desktop from the web and clone the CySat-1-Main repository within the app
  2. Download and install STM32CubeIDE:
  • Go to: https://www.st.com/en/development-tools/stm32cubeide.html
  • Select "Get Software" for the version that corresponds to your computer’s operating system
  • Accept license agreement
  • Enter first and last name, email, and check "I have read and understood the Sales Terms & Conditions, Terms of Use and Privacy Policy"
  • Click "Download"
  • Check email and click "Download now" on email, redirecting you to the website
  • It might automatically start downloading. If it doesn’t, select "Get Software" again and it should start downloading
  1. Open the installer and follow the installation steps
  2. Launch STM32Cube and select a workspace folder that is NOT your GitHub repo location (the default location should be sufficient)
  3. Open the cloned repo: File > Open Project from File System > Directory > *navigate to repo location* > Make sure all folders are selected > Finish
  4. Update Software by going to Help > Check for Updates
  5. Build the project by clicking the "Hammer" icon on the toolbar at the top
  6. Happy Programming!

Debug/Run Code on the OBC

The following items are required to debug, run, and deploy a program on the OBC (see CySat inventory)

  1. Use the following:
  • Pumpkin Board (or equivalent test bed equipped with a PC-104 stack connector + interface)
  • Power Supply + barrell power cable for PSU (the OBC does NOT recieve power via its onboard USB interface, this is used for other purposes)
  • ST-LINK v2 In-circuit Debugger + SWD cable (OBC <-> ST-LINK) + Mini-USB cable (ST-LINK <-> Dev computer)
  1. Ensure the power supply is set to 7.8 V and connected as shown in the image. Simply launch STM32Cube and debug away!

OBC-Pumpkin-Setup

Then, in the STM IDE

  1. Ensure you have the OBC_SDK project selected and click the "Run" (play) button, that's it!
  2. For troubleshooting purposes, in debug/run configurations -> Debugger tab, make sure the ST-LINK S/N is filled in, the interface is set to SWD, and the reset behavior type is "Connect under reset"

Use PuTTY to debug OBC

The UART module on the OBC allows debug messages to be received using Serial protocol from a PuTTY terminal via use of the following function

debug_printf("Your message goes here", [variables]); // This function can be used exactly like printf(); from the C <stdio> library

Then, to receive messages, perform the following:

  1. Open and install PuTTY
  2. Configure settings under Session according to the below image. IMPORTANT: Look in device manager to determine which COM port is in use by the OBC

image

  1. Configure settings under Terminal according to the below image:

image

  1. Configure settings under Serial according to the below image:

image

  1. Save and load a custom CySat configuration for later use and click Open
  2. Start the program and observe debug messages!

Use Onboard LEDs to debug OBC

Set the green and amber LEDs to different states depending on the state of the program

debug_led_green(count, period); // Green light: Set the number of times the LED should flash (count)
                                // and the speed of the flash (period)
debug_led_amber(count, period); // Amber light

Payload SDR - Scientific Instrument + Radiometer Communication Device

UHF/Antenna

  • Antenna deployment tester Rev 1.2pdf - User manual designed to detail the antenna deployment tester. Can be useful for developing and testing I2C communications for the UHF antenna.
  • ES_UHF_Module_TestReport_0318TU211104.docx - Shows the tested values at certain temperature, humidity and power supply voltage.
  • UHF type_II_ESTTC_Protocol_Rev_4.pdf - This lists the commands we can supply to the uhf to receive the wanted values. Critical importance as they will be used for sending information out the antenna.
  • UHF_Antenna_II_User_Manual_data_interface_Rev_2.3.pdf - User manual for the antenna specifically I2C communications
  • UHF_Antenna_II_User_Manual_Rev1.4_23112018.pdf - General overview of the antenna. This lists its features and hardware layout in clear precise ways. (UHF band for communications is 435-438 MHz)
  • UHF_Antenna_III_Datasheet_Rev1.pdf - Very similar to the user manual listed above. however this is for the Antenna III instead of Antenna II.
  • UHF_type_II_Datasheet_Rev_1.6.pdf - Lists the features, Morse code is among them, as well as how to test this component on the earth and how it connects to the OBC and antenna.
  • UHF_type_II_UserManual_Rev_1.5_21112018.pdf - Explains the connections and the features exactly like the previous document. This may just be an older copy of the datasheet above.
  • PuttyLogs - This is the folder I have listed tests for. Working commands displayed in log files.

Documentation Discrepancies

  • In the EPS Datasheet, there are some extra pins such as the V_RTC and EPS_Reset which we do not believe we have for our hardware
  • In the Manual version 1.1, the LUP 5v says it is on pin H1-48, but we have measured it as swapped with LUP 3.3v. To clarify, LUP 5v is on pin H1-51 and LUP 3.3v is on H1-48
  • In the I2C manual version 2, there are diagrams showing hardware we do not have on our device.

cysat-1-main's People

Contributors

amlocati avatar em-bd avatar hcshires avatar m-m5 avatar matgyver avatar maxmayermader avatar sarahdematteis avatar ultimatesteve99 avatar vanessawhitehead avatar zander872 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cysat-1-main's Issues

Beacon Shut Off Request

The ground station will send a Beacon Shut off request, the UHF will need to recieve this signal, send it to OBC and turn off the beacon. The code for this needs to be created/ implemented in main.c.

This function is not entirely mission critical.

CloneComm Backend

Combine "Middleman SDR", "CloneCommGNU" and "CloneComm" (python) into a backend for the CloneComm v1 app

CloneComm Web UI

Web frontend sits on IASTATE network with backend linked to SDR. Talks to satellite

Interrupt based communications (I2C and UART)

Implement the transmission/reception architecture, and TEST IT with a full antenna -> UHF -> OBC test using the ground station application (which appears to be mostly functional). We also need to program and test the satellite startup procedures according to the Mock launch document: https://iastate.app.box.com/file/1030544150619

Thread 1 will wait until there is a message in the reception buffer, then execute the command contained within. If the function asks for an output pointer, a pointer to the transmission buffer will be input into the function.

Thread 2 will check the transmission buffer every so often, and will assemble packets with the data inside (assuming data exists) and then transmit them back to Earth.

Both threads will communicate over HUART1 (the OBC to UHF comms line) and will have to share a mutex.

Startup Detumbling Sequence

As seen in Mock_Mock Launch document, a detumbling sequence needs to be created and implemented into main.c.

ARMCC_V6: Check line

Location: OBC_SDK_new/Drivers/CMSIS/Include/cmsis_armcc_V6.h line 906
Check if code in line is ok for cortex >=3

BatteryCapacity: Implementation

Location: OBC_SDK_new/Appl/BatteryCapacity.c line 48
Implement the code that calculates the amount of energy regenerated by the solar cells between two given battery measurements

Location: OBC_SDK_new/Appl/BatteryCapacity.c line 60
Implement code that adds a new measurement to the start of the EPS measurement history array, popping off the oldest

Location: OBC_SDK_new/Appl/BatteryCapacity.c line 70
Implement code for a function that gets a new measurement from the EPS, calculates discharge & recharge, adds the new measurement to the history, adjusts the total battery capacity using the calculated discharge & recharge, then logs the occurrence to the system logs

ARMCC_V6: Check line

Location: OBC_SDK_new/Drivers/Include/cmsis_armcc_V6.h line 879
Check if code in line is ok for cortex >=3

BatteryCapacity: Add values

Location: OBC_SDK_new/Appl/BatteryCapacity.h line 23
Maybe need to add following values to the measurement:
* 5v bus voltage
* 5v bus current
* 3.3v bus voltage
* 3.3v bus current
* Solar array X axis voltage
* Solar array X+ axis current
* Solar array X- axis current
* Solar array Y axis voltage
* Solar array Y+ axis current
* Solar array Y- axis current
* Solar array Z axis voltage
* Solar array Z+ axis current
* Solar array Z- axis current

GroundStation.c Handle Commands

Implement and test commands in GroundStation.c Switch/Case Event Handler

Method: using the same format already existing in GroundStation.c, you can add additional functionality to handle new custom CySat Packet Protocol commands. Some suggested commands include, but are not limited to:

  • Alter beacon (text and period)
  • Get battery capacity
  • Get attitude telemetry data
  • Perform health checks

calculateBatteryDischarge is probably incomplete

In BatteryCapacity.h, the calculateBatteryDischarge function only reads voltage and current from the battery bus, ignoring the 5v and 3.3v buses. It is possible that I misread it and everything goes through the battery bus, the diagrams aren't super clear on that, but I think the other buses need to be taken into account (unless, of course, nothing is hooked up to them). Fixing this requires adding more values to the BatteryMeasurement struct (which I am working on right now).

Utilize a real time operating system (RTOS) - 5/5/20

  • Benefit: In order to ensure the longevity of the satellite and provide graceful degradation, an RTOS should be implemented
  • Method: There already exists a FreeRTOS middleware in the OBC SDK, whichcan be utilized to make tasks with a requested period.

Main.c tasks are non-responsive/out-of-order

The mutexes from CMSIS RTOS need to be created inside a thread. All of the startup procedures need threads and mutexes to exist. The main task in AppTasks.c will be used for startup procedures that require threading.

The threads using different priorities or that need delay need to use osDelay() and NOT HAL_DELAY(). It's ok to use HAL Delay before looping or thread initialization, but don't use it after as it doesn't let threads have processing time/takes priority over them (don't listen to them listen to ME only).

Finally, a mutex cannot be used before its corresponding thread is created.

Health Check Implementation

CySatHealthChecks.c File should be created and function created. As mentioned in the Mock_Mock_Launch document, the code should compile health check of EPS, ADCS, SDR, OBC, and UHF. This health check should then be transmitted to the ground station.
Not required for minimum viable product.

Mock Launch/Mock Mission

  1. Startup Mode
  2. Diagnostic Mode
  3. Main Operating Mode
  4. End of Life.

Complete a full flight simulation including:

  • Initial satellite deployment (without the antenna and magnetometer obviously)
  • Commanding the satellite (over the air via the ground station or ground station stand in) with each of the commands expected to be used on the mission and the ones that aren’t
  • Taking science data and returning it successfully to the ground station
  • Maintaining constant power for at least 24 hours (possibly by plugging in the EPS, leaving the satellite outdoors to actually gather solar power is not advisable) to verify there aren’t any obvious overflow bugs that will crash the satellite’s OBC
  • Do all of this in one power cycle without messing up

The “Mock Launch” includes phases one and two, while the “Mock Mission” handles phases 3 and phase 4.
"Mock" Mock Launch doc: https://iastate.box.com/s/rddq6s3dvz71jvbya0ji7c1ej28fyr68

Method: Using the “Mock” Mock launch plans, determine a list of tasks that need to be added to complete the full mock Launch. Complete those additional steps (mostly just communicating to the components of the satellite instead of just printing to the screen that you would) and then attempt the full Mock Launch, after that, you can begin to put together a plan for the Mock Mission, which should look similar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.