Skip to content

Mainboard [Software|Hardware]

Flynsky edited this page Oct 19, 2024 · 8 revisions

Software

All code running on the Microcontroller is written in C/C++. Currently i am using the arduino ide with pico arduino packages, but i am planning to change to pico SDK for reliability purposes.

Multithreading

The Rp2040 has 2 cores, so the load will be splitted after some performance testing.

Temperature Probes

You are able to switch between the 6 temperature probes trough a multiplexer. After selecting the right one, it is connected to Vcc and a grounded resistor. The Voltage between those changes with the temperature of the probe and is read in trough a ADC pin and converted in a temperature value.

Oxygen Probes

Up/Downlink

The up/downling is provided via BEXUS. Our project is using the payload as client and the groundstation as server. The client stays connected and will periodically send data down or recieve command from the groundstation. All data from the payload will be save in a struct named packet.

struct packet {  // struct_format L L 6L 6f 6f 6i i f 2i 80s
  unsigned long id = 0;
  unsigned long timestampPacket = 0;

  unsigned long timestampOxy[6] = { 0 };

  float oxigen[6] = { 0.0f };
  float tempTube[6] = { 0.0f };

  int heaterPWM[6] = { 0 };
  int error = 0;

  float tempCpu = analogReadTemp(3.3f);
  unsigned long power[2] = { 0 };

  char info[80] = { 0 };
};

Every packet has an individual id and timestamp. These are followed by some sensor data. Power is the voltage and current of the battery. The char info[80] will save errors and infos about the programms running on the microcontroller as well as return values of the commands.

Commands

Commands can be used from the groundstation to read or change data on the payload. This is the typical Syntax:

type/value:||char      | char      | char      | ":"       | char[16] | "\r" |
function:  ||Command_A | Command_B | Command_C | Seperator | Param    | end
  • Status:
type/value:||'s'       | 'r'       | 'o'       | ":"       | NoParm   | "\r" |
function:  ||Command_A | Command_B | Command_C | Seperator | Param    | end

returns

Returns:|| 'sro' | uint32_t status |  "\r" |

uint32_t status is a a 32bit integer which can be decoded to read out the status of the Module.

function:  ||default 1 |sd init check | sd struct write check| sd struct read check |      cableTest     | TCP setup Check | HeaterTestAuto  |
pos of bit:||     31        30                  29                      28                      27                   26            25-19

PID: Disable:

PID Controller

UML Diagramm

uml missing stand 25.3.24

Hardware

Prozessor

RP2040 is a 32-bit dual ARM Cortex-M0+ microcontroller by Raspberry Pi Ltd. In January 2021, it was released as part of the Raspberry Pi Picoboard.

Uplink/Downlink

A W5500 Ethernet chip manages the LAN link to the ground station.

Heating

Heating elements are connected to the battery voltage. In series, PROFET smart switches controlled by PWM modulation are used. They switch slower than true MOSFETs, but limit the current to 200mA in case of a short circuit, avoiding damage. For added redundancy, an additional PTC fuse is used for each heating element.

Power

diagramm missing

Temperature Probes

NTC probes are used, and with a multiplexer, it's possible to read up to six probes using just one ADC connection. An operational amplifier circuit amplifies the voltage drop across the voltage divider to optimally use the ADC range.

Oxygen Probes

Two options are available:

  • Atlas liquid oxygen probes with an I2C protocol are easier to implement but lack internal temperature sensors.
  • PreSens probes communicate via RS-485, which makes communication more complex. They include internal temperature probes, but are significantly more expensive. Hardware for both protocols is installed, allowing for easy switching between them.

Circuit Diagrams

Elements crossed out with a red X are not on the board and are included only for completeness and understanding. -circuit diagramm missing -circuit diagramm missing -circuit diagramm missing -circuit diagramm missing -circuit diagramm missing -circuit diagramm missing -circuit diagramm missing

Clone this wiki locally