The Missing Umbrella EGR 314 · Team 205

Software

Software Implementation

Our software proposal outlines the steps for the program to effectively operate. It begins by initializing all sensors and drivers and establishing a secure connection with each of them. The program then monitors sensor values and compares them with predefined thresholds to determine the appropriate actions, including controlling the motors. By following these steps, our software will enable smooth and reliable operation of the system.

Check Appendix G - Software Proposal for more information

Software Proposal

MPLABX Peripheral Overview

See the following figures for the peripherals and pin GPIO structure utilized in the MPLAB Code Configurator

MPLABX_Peripherals_and_Pin_Setup_1-1

MPLABX_Peripherals_and_Pin_Setup_1-2

MPLABX_Peripherals_and_Pin_Setup_1-3

Topic Table

Below is our table summarizing all the published and subscribed messages for our topic:

Team 205 · The Missing Umbrella

EGR314/Team205/Hall_Effect
Publishes
Hall Effect Sensor (Michael)
Subscribes
Michael, Enoch, Deepit
Separator
;
Field Value 1Value 2 (optional)
NameHall_Raw_PosWind_Speed
DescriptionHall Effect Raw PositionLinear Velocity calculated by using Rotational Hall Effect Position and internal clock timer
Unitsdecm/s
Minimum00
Maximum4096inf.
Typeuint16uint16
Format string%i%5.5f
Unique identifierhhh

Combined exampleh22047;hh00001.04375

EGR314/Team205/Temp_Sensor
Publishes
Temperature Sensor (Enoch)
Subscribes
Michael, Enoch, Deepit
Separator
N/A
Field Value 1Value 2 (optional)
NameTemp_Read_FTemp_Read_C
DescriptionAmbient Temperature In FAmbient Temperature in C
UnitsFahrenheitCelcius
Minimum-104-40
Maximum257125
Typeuint8uint8
Format string%u%u
Unique identifierttt

Combined examplet77;tt25

EGR314/Team205/Motor_Controller
Publishes
Motor Driver (Deepit)
Subscribes
Michael, Enoch, Deepit
Separator
;
Field Value 1Value 2 (optional)
NameMotor_Fault_Readdeploy_state
Descriptionfault valuesdeploy state of the motor(on/oof)
Unitsboolbool
Minimum00
Maximum2551
Typeuint8bool
Format string%u%u
Unique identifiermmm

Combined examplem00101001;mm1

EGR314/Team205/PIC
Publishes
PIC (Michael)
Subscribes
Michael, Enoch, Deepit
Separator
;
Field Value 1Value 2 (optional)
NameThresh_ValueCLK_TMR
DescriptionInternal Counter for Repeated Threshold Triggers. Important as to not activate motor system due to accidental outlier sensor readout.Readout of internal Clock Timer
Unitsintsec
Minimum00
Maximum5 (Non-Static)inf.
Typeintdouble
Format string%u%0.3f
Unique identifierccc

Combined examplec3;cc26.075

Feedback Controller Diagram

Below is our feedback controller diagram which outlines the simplistic software loop to actuate our motors based on measured sensor data

Feedback Controller Diagram

Future Software Design Changes

The current system uses an OLED screen for displaying data via bar charts. Adding additional user interface elements on top of our button, such as more complex read-only ESP32 commands, would allow the user for more interactivity and control.

The code performance can be optimized for smaller-scale embedded systems such as these which have minimal processing energy and memory. Utilizing simpler functions, algorithms, and smaller data types will reduce memory usage and optimize the overall hardware platform. Small changes such as declaring constant variables and reducing utilization of global variables will also create a better performance impact.

Given that our microcontroller only has 10kb of programmable memory, we could consider writing data to an onboard SD card if more peripherals and sensors were added to the system. With our current design, we were exceeding 90% capacity so external memory could be a valid option. The PIC Microcontrollers have slower processing speeds so utilizing interrupt service protocols (ISP) in our code algorithms will significantly improve performance and reduce the apparent lag of our single-threaded code capacity.