Stand Integration

## Stand Integration Overview

The stand integration of electronics is a large, arduous task that's broken into several components. The main components necessary for this task is actuation and data logging. Actuation is vital in controlling the stand's electronic solenoid valves that are used for remote coldflows and ignitons. Data acquisition is mainly used to interface with pressure transducers and thermocouples that provide pressure and temperature data at different points along the test stand. For these tasks, we have developed an actuation board and data acquisition testbeds. There's also an interfacing board that aids communication between boards, a microcontroller, and the stand operator. We go into more detail on each component below, specifically, its use in the stand environment, and its integration with the other components.

P.S. It's important to have the git repo installed for this project as a lot of the schematics, source code, and pcb files are on this repo. Link: https://github.com/liquid-rocketry-illinois/Electronics-23\_24. DM Dhruv Satish on slack if you need a link.

### Actuation Board

The actuation board controls solenoid valves on the test stand based on user inputs. The specifics of the user interfacing is dependent on definitions in the control firmware, however, the communication protocols to and from the board as well as the power it requires to actually actuate valves is independent of firmware.

The digital communication to the board is fed via a dsub de-9 connector that brings in a differential I2C communication line, digital power and ground, and a digital energize signal. DI2C (differential I2C) is a more noise resistant variant of I2C which is relevant in the high-vibration, high-temperature environment on a test stand. Digital power is a 5V input that drives the digital logic ICs on the board. The energize pin is a digital input that has to be pulled high to activate actuation. The goal of the energize pin is to serve as an emergency shutoff that can be triggered remotely in a case where actuation needs to be turned off. Since all our solenoids are normally closed, this shutoff is typically left high as the depressurizing solenoids need to always be open.

There are two required power inputs to and one power output from the actuation board. The main power in is a 24V differential that's redirected to the solenoids via a mechanical relay. This power source is vital as it provides the voltage and current necessary to drive the solenoids. On average, each solenoid takes 24V in at a current of 1A, so this amounts to a minimum capacity of 24W\*16 = 384W provided by the battery. The second input is a 12V arming voltage. This voltage has a similar role as the energize pin in that it's an emergency manual shutoff. The intended idea was to wire the 12V through a switch that can be turned off in an emergency, however, since the depressurizing valves need to be always open, it's okay to directly wire the 12V to arm. Finally, we have the output, Vbus. This output is a power-protected 24V signal that can be redirected as needed. In the case of stand electronics, it's used by the data acquisition testbeds as the power source for the pressure transducers.

### Data Acquisition Testbeds

The data acquisition testbeds are basic analog to digital processing devices. In essence, they take analog outputs from sensors such as PTs or thermocouples and decode them into binary information. Then, we can translate these binary readings to usable data through firmware. The key aspects of the daq are device power, digital power, SPI communication, and peripheral sensor interfacing.

The device power is drawn from the 24V Vbus provided by the actuation board. This input is used to power the sensors, which requires a voltage between 9-36V. The digital power line powers the onboard ADC.

The communication to and from the daq runs on an SPI bus. The SPI bus works on a shared information line that can be used by multiple peripheral devices at once. Each device also has a unique chip select input that chooses which device can send back information to the master device. As such, both daqs require the same SCLK, MOSI, and MISO line, but unique CS line.

Finally, we have the interfacing with sensors. Each testbed has 2 thermocouple channels, 2 pressure sensor channels, and 2 external channels. The difference in each channel has to do with the way each of the sensors sends back information. Since the pressure transducers send back a signal in terms of current, the PT channel only has one current input. This current is driven through a 56Ohm resistor; the voltage drop across this resistor is read by the ADC and sent back to the master device. The external channels have 2 inputs, but they can be repurposed to a PT or thermo channel by emulating the corresponding channel schematic. The thermocouple channel takes a voltage differential as provided by the thermo sensor.

### Interfacing board

The interfacing board was an in-between board who's goal was to interface between the STM-32 and actuation/daq. Rather than sending out jumpers to each board from the STM32, we send it to the interfacing board and connect the rest of the boards using a dsub de9 connector. While the interfacing board intended to make connections easier, the reality of the situation is that it relied on the fact that we'd have only one actuation board and one daq. Since we use two daqs in our system, these need to be wired independently of the interfacing board.

On the actuation end, we can wire a I2C line from the STM32 to the interfacing board. The board handles separating the line into DI2C and sending to the actuation board. We also need to wire digital power and ground, and an energize gpio.

### Microcontroller

The microcontroller used for this setup is the STM32 F446RE nucleo board. This board is essentially a complex breakout board that includes other ICs to add programming, clock, and external communication functionalities to the on-board STM32 F446 microcontroller. The board is capable of handling several I2C, SPI, and UART protocols at once, so it's a perfect fit for our project. The pin diagram for the board can be found here.

In terms of connectivity and programming, we use STM32 cubeide to assign roles to the pins used for a project and also program the UI for these pins. For our specific project, the cubeide files are accessible in the github. Key files from the project are the .ioc and .main files. The .ioc file shows a pin map with the roles of all pins used for the project. These range from SPI MOSI and MISO pins to I2C CLK pins to GPIO pins. By referring to the communication lines in the previous sections and the interfacing information in the next section, one can decode the necessary connections from the STM32 that drive the project.

### Electronic Interfacing (Board to Board Connections)

Electronic Interfacing outlines the connections between each of the boards in the electronics setup. Functionality and explanations of these connections are provided in the previous section. To figure out corresponding pins from the .ioc file to the physical nucleo, refer to the f446 mbed. Here's a list of pins and what they're connected to:

**STM32 F446RE**

* SPI
	+ SCK to both daqs
	+ MISO to both daqs
	+ MOSI to both daqs
* I2C
	+ SDA to interfacing board
	+ SCL to interfacing board
* UART
	+ TX to raspberry pi
	+ RX to raspberry pi
	+ UART can be communicated without TX and RX via USB device flashing code to the STM32
* GPIO
	+ Input 1 that reads DRDY from daq 1
	+ Input 2 that reads DRDY from daq 2
	+ Output 1 that serves as CS for daq 1
	+ Output 2 that serves as CS for daq 2
	+ Output 3 -> energize signal for actuation board

**Interfacing Board**

*SDA, SCL, and energize from STM32*

* 5V digital power
* Digital GND
* 24V power from actuation board
* GND for power

**Data Acquisition Board(s)**

*MOSI, MISO, and CS from STM32; DRDY to STM32*

* 24V device power from interfacing board
* Device GND from interfacing board
* 5V digital power from STM32
* Digital GND

**Actuation Board**

*I2C, Energize and Digital pwr/gnd from interfacing board (DSUB)*

* 24V Bus out to interfacing board
* GND to interfacing board

### Stand Interfacing (Electronics to Stand Connections)

Beyond the board-to-board connections, there are also several connections that need to be made to the devices on the test stand. These include the solenoids, PTS, and batteries.
**STM32 F446RE**The only connection is the usb cable to the programming device.
**Actuation Board**

* Solenoids
	+ 16 possible channels & 2 types of solenoids (Wired via XT60 connectors)
		- 12V, 3A solenoids - The 24V output from the actuation board is stepped down to 12V via a buck convertor.
		- 24V, 1A solenoids
* Power
	+ 24V power and ground
	+ 12V arm and ground

**Data Acquisition Board(s)**

* Pressure Channels
	+ PTs have 3-4 pins, but only 2 are active
		- One is power; other is ground(output)
		- Pins are outlined on a label on the side of each PT
	+ Orientation in connecting to the daq matters; can be seen via schematics or trail and error;
* External Channels
	+ Each output is a channel lead
	+ Can be repurposed to a PT channel by emulating the schematic of one