Giter VIP home page Giter VIP logo

firingpi's Introduction

FiringPi

This project is designed to be run on a Raspberry Pi connected to various peripherals, to act as both fire controller and datalogger for CUSF's White Dwarf hot and cold test fires. The utility files only run on linux, but you should be able to work out equivalent commands for windows if you need to (if you do this please do put them in a .bat file and pull request.).

Requirements

To build on your local machine, you will need a native cross-compiler such as gcc/g++ (You can change the compiler by editing the variable $(GXX) in a local copy of the makfile and specifying -f <local.makefile> in the make command. The project uses ncurses for its TUI, which works over standard ssh tty. You will therefore need to make sure you have at least libncurses5-dev and libncursesw5-dev installed. When running on the Raspberry Pi, WiringPi is used for gpio access, which will need to be installed on your local machine to compile if you wish to do so. The raspberry Pi also uses tmux to manage disconnects safely (the system leaving all of the valves open after an unhandled disconnect would not be good), so if you use the script /pi, then you will also require this. All of these are already installed on the flight computer.

Building and running

Clone the repo, then assert the directory is set up correctly with make clean. For a local build, use the makefile:

make && ./main

To build on the Pi, you need to have ssh access, and make sure you have updated its IP address in either /pi. This file contains a script to upload source code directly to the Pi (with scp, no need for a git sync) and execute it over ssh, forcing interactive terminal allocation, then building the project on the pi and executing it in a detatched tmux session. You can also just run the executable on the pi in tmux without building with ./pi -r or conversely to build without running ./pi -b

Using the Program {curly brackets mean TODO}

Once you have launched the TUI successfully, you must launch the system into SAFE mode by pressing s[afe]. The system may be armed by pressing , then {once you are satisfied that the system has booted correctly,} STARTUP mode may be entered by pressing . The computer will then enter STARTUP, followed by FIRING and SHUTDOWN {as it runs the preconfigured fire sequence}. An ABORT may be triggered by pressing {or automatically by the system detecting unsafe parameters}. ABORT mode can only be exitied by the computer, for safety reasons {currently press e[rror] to debug exit}. SHUTDOWN exits to SAFE, and ABORT exits to ERROR, from which SAFE mode can be entered by pressing s[afe]. To quit the program, the system must first be in the OFF state, entered by pressing o[ff] from SAFE mode, only then it will exit when q[uit] is pressed.

Project Structure

cft-controller
├── build
│   ├── Display.o
│   ├── main.o
│   └── State.o
├── include
│   ├── Display.hpp
│   └── State.hpp
├── main
├── Makefile
├── pi
├── README.md
├── src
│   ├── Display.cpp
│   ├── main.cpp
│   └── State.cpp
└── TODO.md

Useful Stuff

ncurses HOWTO

firingpi's People

Contributors

andriii25 avatar astro-zilla avatar ojagger avatar parthvader02 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

firingpi's Issues

Graphs

  • Should show maybe 3 graphs of pressure, with moving averages for last 10s, 30s available.
  • Some way of showing the P&ID would be great but not necessary
  • Add readouts for all sensors: 5xpressure, 4xtemp for the engine side, and 2xpressure 2xtemp for the cooling loop plus 3 load cells.
  • For load cells, rate of change is important as it representrs mass flow rate (could display total O/F reset after starting burn)

More sensor interfaces

  • More sensors will be added to read from i2c ADCs. Need the facility to add another pressure or temperature transducer (P OR T) somewhere within the PT class
  • there needs to be a choice of decode functions, for different models etc. Should be neat and maintainable

Valve control

  • valves need to have the option of manual control. Either press [m] to enter manual mode then use the numbers to toggle each valve, or use numbers/arrow keys to select a valve and the space bar/enter key to toggle it.
  • Need to have the option of storing and selecting different run configurations for different test types. This would manife4st as having more than one valve/state matrix system that could be selected. Would make sense to read these from a file
  • Control of igniter at T-3s, should require button press before T-0 as visual confirmation of ignitor success

Folder consitency

@andriii25 could you pls update your branch to use the main FiringPi folder? just for consistency when wee merge, it can't really run 2 instances at the same time anyway

Hangs on quit

On pressing "q" in OFF, the program halts but does not quit. Presumably this is due to the HX711 handler hanging and not being able to close itself. THis would probably occur if the I2C was able to hang but obviously it can't.

  • Need some way of stoping the HX711 thread if it is blocking (or to prevent it from blocking).

Network disconnect

Have some kind of timeout failsafe that will vent the tanks if no control inputs are received for 1 hour while in a pressurised state. Would require a warning before doing so, with the option to cancel. If there is a way to detect disconnection of the client stdin and stdout directly without just listening for keystrokes this would be ideal but don't spend too long researching if you don't find it straight away.

  • Detect disconnect by lack of keystrokes or otherwise
  • Add automatic venting after 1 hour of disconnect if in pressurised state for entire time

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.