From a7a117f2e790e2effd116032326964781b1a3257 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 21 Nov 2019 02:09:38 -0800 Subject: [PATCH] Final draft for tonight. --- dd.latex | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/dd.latex b/dd.latex index d3eae41..d470405 100644 --- a/dd.latex +++ b/dd.latex @@ -20,6 +20,8 @@ for long-range interaction between animal-worn collars and a gateway device. Ths gateway device will also provide an HTTP-based JSON API to apply configuration changes to collars through an application built for Android mobile devices. + The MariaDB SQL database management system will be used to store the data + received from the collar for viewing and analysis. \end{abstract} \pagebreak @@ -27,14 +29,27 @@ \pagebreak -\section{Identification} -This document describes the design of the Fenceless Grazing Collar system, -following the IEEE Standard 1016-2009. It covers the design of all components -of the FGC system, namely the Smart Application, API Server, LoRa Gateway, -and the Collars. +\section{Introduction} +The Fenceless Grazing Collar system is designed to reduce the amount of manual +labor performed by farmers owning herds of livestock. By automating +the herding of animals such as cattle, farmers may be able to save a significant +amount of time and money. -This document is written by Danila Fedorin, Matthew Sessions, and Ryan Alder, -working on the project through Oregon State University. +The Fenceless Grazing Collar system consists of a smart application, +a "gateway", and individual collars to be placed onto animals. + +% Collars are attached to live animals that emit an auditory or electrical stimulus when the animal +% leaves its designated area, preventing it from traveling further outside +% the established grazing boundaries. +% TODO this is bad; improve later. + +\section{Glossary} +\begin{itemize} + \item \emph{LoRa:} A radio-based protocol for \textbf{Lo}ng\textbf{Ra}nge communication. + \item \emph{HTTP:} HyperText Transfer Protocol, which is currently the most popular standard + for web servers and APIs. + \item \emph{JSON:} JavaScript Object Notation, a language for encodings structured data. +\end{itemize} \section{Design Stakeholders and Concerns} The primary stakeholders for this project are farmers who may replace their @@ -328,9 +343,66 @@ to the collars. Similarly, the collars deliver location information and stimulus by sending them to the LoRa gateway, from which they are retreived by the application. \subsection{State dynamics view} -Each fenceless grazing collar is a state machine. It has multiple states, +Each Fenceless Grazing Collar is a state machine. The states are described as follows: +\begin{itemize} + \item \emph{Sleep:} This will be the most common state for the collar. As per the + \emph{Long battery life} design concern, it's necessary that the collars remain functional + for long periods of time without maintenance. By putting the hardware of the collar + into sleep, the system will lower power consumption, and thus improve battery life. + \item \emph{Awake; quiet} The device will be in this state when it is gathering and trasmitting + GPS data to the LoRa gateway, while the host animal is within the prescribed grazing area. + No sound or other stimulus is necessary in this state. + \item \emph{Awake; loud} The device will be in the state when the host animal is within + a small distance outside the prescribed grazing area, and had not spent a long + period of time there. In this state, the auditory stimulus will be active with the + intention of preventing the animal from further negative action. + \item \emph{Awake; shocking} The device will be in this state when the host animal has + traveled far outside the prescribed grazing area, or has remained within + a small distance of the area for a long time. The electrical stimulus component is active + in this state. +\end{itemize} + +The transitions between the states are as follows: +\begin{itemize} + \item Every 15 seconds, if the device is in the \emph{Sleep} state, it will transition + into the \emph{Awake; quiet} state. + \item In the \emph{Awake; quiet} state, if the GPS coordinates are within the prescribed grazing area, + the device will return into the \emph{Sleep} state. + \item In the \emph{Awake; quiet} state, if the GPS coordinates are within a 10ft distance + outside the prescribed grazing area, the device will transmit a stimulus activation report, + and transition into the \emph{Awake; loud} state. + \item In the \emph{Awake; loud} state, if the GPS coordinates are within the prescribed grazing + area, the device will transition into the \emph{Sleep} state. + \item in the \emph{Awake; loud} state, if the device has spent 30 seconds outside, but in + close proximity to, the prescribed grazing area, it will transmit a stimulus activation + report, and transition into the \emph{Awake; shocking} state. + \item in the \emph{Awake; loud} state, if the device is further than 10ft outside the grazing + area, it will transmit a stimulus activation report, and transition into the + \emph{Awake; shocking} state. + \item in the \emph{Awake; shocking} state, if the device is within a 10ft distance + outside the prescribed grazing area, it will transition into the \emph{Awake; loud} state. +\end{itemize} -\section{Design overlays} \section{Design rationale} +The LoRa communication protocol was used specifically to address the \emph{Support for large areas} +design concern: LoRa works over \textbf{Lo}ng \textbf{Ra}nge, and is bidirectional. These properties +make it ideal for the Fenceless Grazing Collar system. + +The LoRa gateway's API was chosen to be HTTP-based, rather than Bluetooth-based, to allow for +both remote communication and alternative clients (such as web interfaces). This necessitates +the use of a public-facing server (and likely a domain name to allow for DNS resolution). + +Kotlin was chosen over Java due to its superior type system, which helps mitigate the Million Dollar +Mistake [citation needed], as well as because of its capacity to reduce boilerplate. This is +an acceptable decision due to Google's official support of the Kotlin language. + +\section{Conclusion} +The Fenceless Grazing Collar system provides reliable, accessible, and scalable solution for replacing +manual labor in livestock herding. Through the use of physical collars attached to live animals, +providing auditory and electric stimuli, the system encourages animals to stay within prescribed +grazing boundaries without the need of direct human involvement. LoRa communication is used +to manage the collar devices spread out in the field, and both an HTTP JSON-based API +and a smart application are provided to expose the configuration and data collection functionality +of the collars to the user. \end{document}