P18102: RIT Launch Initiative Hybrid Rocket
/public/Engine Specifications/Controller/

Control System

Table of Contents

Subsystem Requirements

  1. Control feed system valves
    1. Setup: Oxidizer loading, flushing, and system pressurization
    2. Flight: Ignition, control valves
  2. Monitor health of engine through sensors
  3. Communicate with flight controller
    1. Receive commands from avionics
    2. Compile and send data to avionics
  4. Battery control
    1. Facilitate battery charging via charge controller
    2. Facilitate power distribution

Controller Selection

Initial Requirements:

Microcontroller Diagram, Initial Design

Microcontroller Diagram, Initial Design

The Pugh chart below shows the thought process behind the decision to use a Teensy 3.6. Highlights of the Teensy 3.6 include an ARM core with 62 GPIO pins, 25 ADC inputs, fast clock speed, and the ability to program in the Arduino IDE.

Microcontroller Pugh Chart

Microcontroller Pugh Chart

Shown below is the Teensy 3.6 pinout. An additional valve has recently been added to the feed system and this change has not been reflected in the pinout yet. Also currently one the regulators is placed at Pin 13 which is connected to the on-board LED. The placement of the regulator may be changed to avoid using the LED-connected pin. All necessary components will fit on the microcontroller with room for additional parts if needed. A document of all pins and their respective functions for the controller can be found here: Pinout Document

Teensy 3.6 Pinout

Teensy 3.6 Pinout

Controller Functions

Shown below is a table of the controller functions. The implementation of a throttle control valve listed under motor control was originally part of the desired functions for the controller, however after discussion with experts in the subject, it was decided that the task of thrust control would not be put on the controller. More information about this decision can be found below in the Throttle Control section.

Controller Functions

Controller Functions

The newest revision of the controller functional flowchart reduces the number of functions from the previous and includes a mode for testing the various engine components prior to launching. In test mode, the controller receives messages from the flight computer and carries out the instructions of each message. The test function will allow for testing of the valves, thermocouples, pressure transducers, and battery charge read. Test mode is exited upon message from the flight computer.

Initial Powering

Initial Powering

Test Mode

Test Mode

Controller Function Mapping

Controller Function Mapping

Initial Powering State: When the controller is first turned on, it waits for a signal from the flight controller to proceed. From here the flight controller can continue into its launch sequence, or it can go into a test mode so that the various engine components can be tested before launch.

Pre-Ignition/Ignition When the controller receives the appropriate signal, it enters its flight mode. This signal will be sent after the engine has been set up on the launch pad. During pre-ignition, the controller will be waiting for instructions from the flight computer to open and close the fill/drain valves to load the propellant. It will also take readings from the thermocouples and pressure transducers and send them to the flight computer, and read the battery charge at the request of the flight computer. After the propellant has been loaded, the controller waits for the signal from the flight computer to open the N2O valve and begin launch.

In-Flight: While in flight, the controller is continually taking sensors readings and forwarding them to the flight computer. The controller is also checking the battery charge regularly, and awaiting instruction from the flight computer to close the N2O valve. After the N2O valve is closed, the controller continues to take sensor readings and check the battery until the flight computer signals that the flight is over.

Post-Flight: After the flight is over, the controller carries out instructions received from the flight computer, such as valve control for tank draining.

Individual Valve Control Function: This function is called by a signal from the flight computer telling the controller to open or close one of the individual valves.

Battery Monitoring Function: This function is called by a signal from the flight computer asking for an update on the current battery charge.

Shutdown Function: This function is called when the flight computer or controller decides that something is wrong and the engine must be shut down. The two main reasons for an early shutdown is insufficient battery charge and concerning sensor readings.

Emergency Shut-Off Interrupt: The emergency shut-off interrupt flag is raised at the discretion of the flight computer. It is a backup to the shutdown function in case something goes wrong.

Safety must be considered when writing the controller code. An in-progress list of safety measures to be programmed can be found here: Factors of Safety

Integration of Teensy with Peripherals

Pressure Transducer

The pressure transducer represents the pressure with an output voltage in the range [0.5V, 4.5V]. A voltage divider was used to halve the voltage on the input Teensy pin because it cannot safely take more than 3.3V. This reduces the range of the output voltage to [0.25V, 2.25V]. The Teensy represents each voltage with a unique 10-bit number. This results in a resolutions of about 3.2 PSI/bit. The theoretical bit to pressure mapping is pressure=3.225(bitvalue)-250.

To calibrate the pressure transducer, the sensor was connected to the regulator which was attached to the nitrous oxide tank. The Teensy 3.6 continuously took readings from the pressure sensor while the pressure was adjusted from 150 to 650 PSI in 50 PSI increments using the regulator. The data was put into Matlab and the polynomial fit function was used to extrapolate the bit to pressure mapping. The mapping of the bits to pressure is pressure=3.54(bitvalue)-315, which is similar to the theoretical equation.

The pressure transducer has been used in small hot fire tests, with the Teensy 3.6 sending the live data to an external computer via USB.

Pressure vs. Bit Value

Pressure vs. Bit Value

The pressure transducers had to be recalibrated with the PCB, and the calibration equations were found to be the following.

Thermocouple

The Adafruit Universal Thermocouple Amplifier MAX31856 Breakout was purchased for integrating the thermocouple with the microcontroller. The converter works with a variety of thermocouple types and communicates over 4-wire SPI. The functionality of the thermocouple with the breakout board and Teensy has been verified. The board does not require any calibration to understand the temperature readings which makes it easy to integrate. Other Adafruit boards were considered for thermocouple integration. The AD8495 has an analog output and the MAX31850K communicates over 1-wire. The advantage of these two boards is that they would use fewer pins on the Teensy 3.6, however they also have smaller temperature range compared to the MAX31856 board. The analog output board was purchased and tested, but the temperature readings were consistently lower than expected.

The thermocouple with the 4-wire SPI board has been used in small hot fire tests, with the Teensy 3.6 sending live data to an external computer via USB.

Solenoid Valve The control of the solenoid valve was tested with the Teensy. The valve is controlled using a GPIO pin on the microcontroller and the valve circuit, the documentation of which can be found on the Power Distribution page. The default state of the valve is closed, and is open when energized. The valve was used in a hot fire test to control the flow of nitrous oxide. For the test, the valve was controlled by the Teensy 3.6, which opened and closed the valve when it received a signal from an external computer via USB.

Battery The battery charge was read using an ADC. If the battery charge drops below a threshold value, the controller turns the engine off.

Communications

SPI was originally chosen as the communication protocol for its low complexity. This choice was later changed to RS422. RS422 is a differentially signaled asynchronous communication standard that can allow signals at longer distances, increase resistance to noise, and will better align the communication capabilities with Launch's future design plans.

Initial Communications Pugh Chart

Initial Communications Pugh Chart

RS-422 Pinout on a DB9 Connector

RS-422 Pinout on a DB9 Connector

Communication will be implemented in full duplex with error detection to prevent incorrect data and unsynced packets. The goal is to send a continuous stream of health information and floating point data to avionics, while receiving instruction words from avionics.

Test Plan

The test plan for the software and its integration with the hardware is currently in the works and can be found here: Test Plan Doc. Ideally the testing will go in order of the spreadsheet and the flowchart shown below, however many of the tests are dependent on when their necessary hardware arrives as well as the timing of their integration with the physical engine for testing.

Ideal Software Test Flowchart

Ideal Software Test Flowchart

The weekly plan up until the test fire at the end of Week 12 is as follows. The big goal is to have all work that doesn't require the PCB to be completed by the time the PCB arrives, so that efforts can be focused on the integration of the Teensy and the PCB.

Week 9: Program and test communications with flight computer. Build hot-fire test code.

Week 10: Continue building code for hot-fire test.

Week 11: Extensively test hot-fire code. Test all fail-safe modes on bench. Begin integration with PCB.

Week 12: Integrate controller with PCB and test thoroughly. Assist with test stand electronics.

Controls Performance During Testing

The Teensy 3.6 was mounted on the PCB for the full scale hot fire test. The Teensy 3.6 was connected to a Raspberry Pi, which was then routed to the external control computer via Ethernet cable. The external control computer displayed a GUI with live pressure, temperature, and battery charge data, as well individual control for each valve. The Teensy 3.6 performed the following duties during testing.

PCB and Teensy 3.6 in Bunker

PCB and Teensy 3.6 in Bunker

Areas for Improvement:

Throttle Control (Removed from Design)

The purpose of the throttle control is to maintain a constant thrust to achieve the desired altitude. Thrust and chamber pressure are two options for feedback in the throttle controller. During flight, thrust is measured using acceleration and rotation rates of the rocket. Having to couple the controller with vehicle dynamics significantly complicates the controller. Using chamber pressure as the feedback results in a simpler controller. Chamber pressure has a generally linear relationship to thrust. The block diagram below shows a high level design of the closed-loop throttle controller.
Throttle Closed-Loop Control Block Diagram

Throttle Closed-Loop Control Block Diagram

The throttle valve for the system must have excellent on/off control as well as flow control. The valve should also be size and weight efficient for the engine. The two best options for the throttle valve are a ball valve and a butterfly valve. The ball valve offers less resistance to flow when fully open, but the butterfly valve offers better flow control for throttling. Other things to consider when selecting a valve include materials and port size. Titanium is the material of choice, as it is light and durable. Titanium is also expensive. Steel offers durability at a lower cost, but is significantly heavier. Aluminum is light and inexpensive, but is not as durable.

After discussing the throttle control with a engineer, it was determined that throttle control is not necessary for this application. To adjust the desired thrust of the engine, the pressure of the oxidizer tank can be changed which results in a change of flowrate of the liquid through the injector. The removal of the control valve also significantly simplifies the controller.

Throttle Valve Pugh Chart

Throttle Valve Pugh Chart