Skip to content

Repository files navigation

Sun Devil Embedded Control (sdec)

Description:

sdec is a python-based terminal program which allows the user to access all functionality available on Sun Devil Rocketry PCBs.

Installation:

The Terminal-Control program requires a functional python installation and the pyserial module, which can be installed using pip. The program is run within a single terminal, and may be invoked from the command line using the python interpreter. Support is currently available for Windows and Linux operating systems.

Supported Boards:

L0002: Liquid Engine Controller (Rev 3/Rev 4/Rev 5)

A0002: Flight Computer (Rev 2)

L0005: Valve Controller (Rev 2)

For more information on usage of the above hardware with the Terminal-Control program, please refer to the board's firmware documentation

Developer Information:

Commands which communicate with an embedded board inlcude a 1 byte opcode, which is the first byte transmitted to the board when a command is issued. Opcode 0x00 is reserved as the nop command. Nop commands are ignored by the embedded board.

General Commands:

clear

Description: clears the terminal window

help

Description: displays all terminal control commands and options

exit

Description: exits the program

comports

Description: allows the user to connect to a device over USB

Usage: comports -[OPTION] [INPUTS]

Options:

  • -c [PORTNAME] [BAUD]: connect to port [PORTNAME] with baudrate [BAUD]
  • -d : disconnect the device currently being used
  • -h : display comports options
  • -l : list all available devices

ping

Opcode: 0x01

Description: transmits a byte over the serial port and awaits response from board

Usage: ping -[OPTION] [INPUTS]

Options:

  • -t [TIMEOUT]: set the timeout of the serial connection to [TIMEOUT].
  • -h : display ping options

connect

Opcode: 0x02

Description: Establishes a serial connection with an SDR supported board. A connection must be established before running any controller-specific commands.

Usage: connect -[OPTION] [INPUTS]

Options:

  • -p [PORT]: establish a connection using serial port [PORT].
  • -h : display connect options
  • -d : disconnect from active serial port

General Hardware Commands:

ignite

Opcode: 0x20

Description: Direct control of ematch ignition circuitry. Requires an active connection to the engine controller or flight computer.

Usage: ignition [SUBCOMMAND]

Subcommands:

fire: Triggers the engine ignition ematch (Engine Controller)

main: Triggers the main parachute deployment ematch (Flight Computer)

drogue: Triggers the drogue parachute deployment ematch (Flight Computer)

cont: Displays continuity information on ignition components

help: Shows supported subcommands and descriptions

sensor

Opcode: 0x03

Description: Get readings from on-board sensors/ADCs. Requires an active connection to a Sun Devil Rocketry board.

Usage: sensor [SUBCOMMAND] -[OPTIONS] [INPUTS]

Subcommands:

dump: Polls all onboard sensors and displays readings in console

poll: Displays readings from a specified sensor(s) in real time

plot: Plots data-logger data produced by flash extract

list: Displays all sensors and associated codes for the currently connected board

help: Shows supported subcommands, options, and descriptions

Options:

  • -n [SENSOR NUM]: Specify a sensor for the sensor poll subcommand
  • -h : display sensor usage information

flash

Opcode: 0x22

Description: Read from and write to the external flash chip. Requires an active connection to the engine controller or flight computer.

Usage: flash [SUBCOMMAND] -[OPTIONS] [INPUTS]

Subcommands:

enable: Disables the flash write-protection to allow writing to the chip

disable: Enables the flash write-protection to make the chip read-only

status: Displays the contents of the flash chip's status register

write: Write data to the flash chip

read: Read data from the flash chip

erase: Erase the entire flash chip

extract: extract all data from the flash chip and export to a text file

help: Shows supported subcommands, options, and descriptions

Options:

  • -b [BYTE] : Write byte [BYTE] to flash memory.
  • -s [STRING] : Write string [STRING] to flash memory.
  • -n [NUM] : Read [NUM] bytes from flash memory.
  • -a [ADDRESS] : Use the address [ADDRESS] as the base address for write/read operations.
  • -f [FILENAME]: Use file [FILENAME] to record output read data or input write data. Files are stored in the input/ output directories.
  • -h : display flash usage information

A0002 Flight Computer Commands:

dual-deploy

Opcode: 0xA0

Description: Allows the user to probe and test the flight computer's dual deploy system. Requires a connection to a flight computer running the dual deploy firmware.

Usage: dual-deploy [SUBCOMMAND]

Subcommands:

status: Report the altimeter main chute deployment altitude, drogue delay, and event detection sampling rates.

extract: Retrieve all flight data from the computer

plot: Plot flight data and events from latest flight

help: Shows supported subcommands and descriptions

L0002 Liquid Engine Controller Commands:

power

Opcode: 0x21

Description: Direct control of the engine controller power supply. Requires an active connection to the engine controller.

Usage: power [SUBCOMMAND]

Subcommands:

source: Determines whether the MCU is being powered by the buck converter or USB

help: Shows supported subcommands and descriptions

L0005 Valve Controller Commands:

acstat

Opcode: 0x50

Description: Checks whether AC power for solenoid actuation is detected by the MCU.

sol

Opcode: 0x51

Description: Actuates a solenoid.

Usage: sol [SUBCOMMAND] -[OPTION] [INPUTS]

Subcommands:

sol on : Asserts the acutate solenoid signal of the MCU to supply power to the solenoid. The open/close state of the solenoid depends on whether the attached solenoid is normally open or closed.

sol off : Deasserts the acutate solenoid signal of the MCU to return the solenoid to its default state. The open/close state of the solenoid depends on whether the attached solenoid is normally open or closed.

sol open: Opens the specified solenoid

sol close: Closes the specified solenoid

sol toggle : Changes the solenoid state. The open/close state of the solenoid depends on whether the attached solenoid is normally open or closed.

sol reset : Resets all solenoids to the default state. The state of each solenoid depends on whether the solenoid is open or closed. No options

sol getstate: Returns the states of the solenoids

sol help : Displays sol usage information. No options.

Options:

  • -n [SOLENOID]: operate on solenoid [SOLENOID]. Valid [SOLENOID] inputs range from 1 to 6.
  • -h : display sol usage information

valve

Opcode: 0x52

Description: Actuates a servo-actuated ball valve.

Usage: valve [SUBCOMMAND] -[OPTION] [INPUTS]

Subcommands:

valve enable : Enable the valves to be actuated

valve disable : Disable the valves

valve open : Opens the specified valve

valve close : Closes the specified valve

valve calibrate : Calibrates the valves by finding and setting the closed position

valve list : Lists valid valve names

valve help : Displays valve usage information

Options:

  • -n [VALVE]: operate on valve [VALVE]

About

Command line tool for testing SDR embedded hardware

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages