Browse Source

added the discussion chapter

Ondřej Hruška 1 year ago
parent
commit
3d8192644b
Signed by: Ondřej Hruška <ondra@ondrovo.com> GPG key ID: 2C5FD5035250423D
7 changed files with 74 additions and 11 deletions
  1. 52 1
      ch.discussion.tex
  2. 1 1
      ch.existing_solutions.tex
  3. 7 8
      ch.summary.tex
  4. 1 1
      ch.unit.sipo.tex
  5. 2 0
      thesis.acronyms.tex
  6. 11 0
      thesis.bib
  7. BIN
      thesis.pdf

+ 52 - 1
ch.discussion.tex View File

@@ -1,3 +1,54 @@
1 1
 \chapter{Discussion}
2 2
 
3
-\todo[inline]{TODO}
3
+The objective of this work was to develop an extensible platform allowing the user to interact with hardware modules and circuitry from high-level applications running on their \gls{PC}, or, to rephrase it, to ``bring the Raspberry Pi GPIO header to the \gls{PC}''. It was important to design the platform in such a way that a user without much experience with embedded electronics and low level circuitry could still use it with a reasonable level of comfort and confidence.
4
+
5
+\section{Solution Summary}
6
+
7
+We based the \textit{GEX} platform around STM32 microcontrollers from ST Microelectronics and developed the initial version for the STM32F072. This \gls{MCU} was chosen for its native \gls{USB} Full Speed support, its interesting set of peripheral blocks, and because it is a relatively recent model in the STM32F series, expecting it to be mature and without major flaws. A wireless connection was planned together with \gls{USB} and hardware \gls{UART}, for which we chose the nRF24L01+ transceiver from Nordic Semiconductor.
8
+
9
+In total, three custom hardware modules have been developed and realized for the project: GEX Hub, GEX Zero, and the wireless gateway. GEX Hub verified the designed schematic and general functionality of the module, after first testing the firmware on a STM32 Discovery development board. GEX Zero is more advanced and compact than GEX Hub, also offering wireless connectivity for field experiments; we re-used the form factor of the Raspberry Pi Zero for this board, which makes it compatible with many existing enclosures and add-on boards. In addition to custom hardware, the GEX firmware may be used with STM32 development boards (``STM32F072B-DISCO'').
10
+
11
+The initial version of the project presented in this paper provides access to digital communications interfaces \gls{SPI}, \gls{I2C}, \gls{USART}, and 1-Wire, is capable of loading data into NeoPixel RGB \gls{LED} strips and \gls{SIPO} shift registers, and implements additional measurement and signal generation features---analog signal acquisition, waveform generation, frequency, phase, and duty cycle measurement, and \gls{PWM} output.
12
+
13
+We developed a transaction-based binary protocol that is used by all three communication interfaces. As the implementation of the protocol would be an inconvenience for the user, we also developed software libraries in languages C and Python that implement it and provide high level access to the hardware module. It has been tested and verified that the Python library can be used from MATLAB scripts, should the user need MATLAB, e.g., for data processing or visualization.
14
+
15
+To make the devices easy to reconfigure for the user, the configuration options--- such as, which features to enable and what pins to use for them---are represented by entries in INI configuration files. The user can access these files through a virtual mass storage with an emulated FAT16 file system presented to the host \gls{PC} on the \gls{USB} port. Because the file system emulation relies on a certain pattern of behavior from the host, it may not work well in all cases. This is mitigated by providing a programmatic access to the configuration files also through the communication interface. 
16
+
17
+\section{Results and Possible Applications}
18
+
19
+The designed device, and the accompanying software stack, make a practical tool for the research and development in the field of embedded electronics, and may be used as a learning aid to demonstrate the timings and format of the various supported hardware buses. The inclusion of analog signal acquisition and generation features makes it possible to measure the analog characteristics of electronic components, or acquire data from physical phenomena. 
20
+
21
+The use in automation offers itself thanks to the programmatic control from high level programming languages on the \gls{PC}; this has an advantage over programming the embedded firmware itself in that the user can focus on the behavior of the device they are developing, rather than having to deal with low level implementation details, such as memory management, or interrupt priority configuration.
22
+
23
+As the GEX platform is open source~\cite{gex-gh}, our solution may be freely expanded and adapted to support other hardware platforms, to add new features, or to further optimize its performance. The platform is modular and may be extended by adding new, independent functional blocks.
24
+
25
+\section{Comparison with Existing Solutions}
26
+
27
+The integration of the \gls{PC} with low-level hardware is an appealing idea that has already been explored in several alternative solutions, which we listed in \cref{sec:prior_art}. It is our belief that the project offers enough unique features and qualities to find its place among the competition.
28
+
29
+Compared to the Raspberry Pi, GEX is less powerful and cannot be used as a stand-alone device without the host \gls{PC}. However, it is more straightforward to use, the required configuration is minimal, and it offers features not available in the Raspberry Pi, such as the \gls{ADC} and \gls{DAC}.
30
+
31
+The Bus Pirate excels as a bus analyzer and general purpose device and implements features we did not explore in this project, while having much fewer \gls{GPIO} pins, a lower resolution of the \gls{ADC}, and completely missing a \gls{DAC}. The two projects serve a slightly different purposes and appear to be complementary.
32
+
33
+It is clear that GEX does not pose a real threat to professional tools in terms of performance, but even at the prototype cost it is significantly more affordable. By integrating many diverse features, it can replace several such tools at once when its performance is sufficient for the particular application. 
34
+
35
+\section{Limitations}
36
+
37
+Our solution was designed with the expectation that the users are familiar with programming and the requirement to develop a control script or application will not pose a problem. However, is not universally true and some users who might benefit from the platform will be left unable to use it without a more user-friendly interface.
38
+
39
+The STM32F072 microcontroller proved sufficient for the verification of the designed architecture, and in most cases provides a sufficient performance. Future expansion of the project is, unfortunately, limited by its flash and \gls{RAM} capacity, which are already used at about 85\,\%, based on the size of the binary image and the amount of allocated memory. Further, the STM32F072 has a Cortex-M0 core without any hardware support for floating point arithmetics, making any calculations with those numbers slow and requiring additional library functions, further increasing the firmware image size. Its power consumption has not yet been measured or optimized, but the inclusion of a wireless connection capability predisposes the device to be used in battery-powered applications; the microcontroller choice and the power supply design may need to be revised for efficient battery operation.
40
+
41
+Another limitation concerns the support software; our client libraries have not been tested on MS Windows, with Linux being the development platform. The C library uses POSIX \gls{API} and is not portable to the non-conforming \gls{OS}. The Python library should work on MS Windows, provided libUSB is installed correctly. Further, on MS Windows prior to version 10, the virtual COM port functionality requires the ``STM32 Virtual COM port driver'' to be manually installed and assigned in the Device Manager. 
42
+
43
+\section{Future Development}
44
+
45
+Future development of the project might focus on expanding the number of supported hardware platforms, in order to overcome the limitations of the used microcontroller model. In particular the STM32L series of low-power devices should be investigated, as it may be a better choice when a battery-based operation is needed. The hardware implementation should further be revised to maximize power efficiency.
46
+
47
+The client libraries need to be tested on other operating systems, and the C library may be expanded to provide a higher level of comfort to the user. The library could be ported to more programming languages, such as Java or \CS, and graphical applications could be developed to make the device more approachable to users less familiar with programming.
48
+
49
+GEX Zero, with the Raspberry Pi Zero form factor, introduced the possibility of using Raspberry Pi add-on boards. It would be interesting to test the compatibility with different existing add-ons, and further to explore the possibility of designing custom ones. An add-on board could, for instance, implement the support circuitry needed for the \gls{DALI} bus, RS-485, or for current loop sensors. The \gls{CAN} bus has not been added to GEX because the hardware peripheral cannot be enabled at the same time as \gls{USB}; its addition with an add-on board, or a different microcontroller model, is an interesting possibility.
50
+
51
+
52
+
53
+
54
+

+ 1 - 1
ch.existing_solutions.tex View File

@@ -1,4 +1,4 @@
1
-\chapter{\label{sec:prior_art}Existing Solutions}
1
+\chapter{Existing Solutions}\label{sec:prior_art}
2 2
 
3 3
 The idea of making it easier to interact with low-level hardware from a \gls{PC} is not new. Several solutions to this problem have been developed, each with its own advantages and drawbacks. Some examples will be presented in this chapter.
4 4
 

+ 7 - 8
ch.summary.tex View File

@@ -1,6 +1,10 @@
1 1
 \chapter{Summary}
2 2
 
3
-We developed an open source software and hardware platform providing access to low-level hardware buses and circuitry from user applications running on a \gls{PC}. The platform consists of an embedded firmware for the STM32F072 microcontroller, three hardware prototypes (two models of a \gls{GPIO} module, and a wireless gateway), and software libraries in programming languages C and Python. The Python library can be used in MATLAB scripts through the MATLAB/Python integration, or directly in Python, with the SciPy scientific calculations library. The firmware may be used with STM32 Discovery development boards, and can be relatively easily ported to other STM32 \gls{MCU} models.
3
+We developed an open source software and hardware platform providing access to hardware buses (SPI, \IIC, USART, and 1-Wire) and low-level circuitry from high-level user applications running on a \gls{PC}. The platform consists of a firmware for the STM32F072 microcontroller, three hardware prototypes, and software libraries in programming languages C and Python, the latter also compatible with MATLAB. The firmware may be used with the custom hardware or STM32 development boards.
4
+
5
+The devices are connected to the \gls{PC} by one of three interfaces: \gls{USB} as a virtual COM port or using raw endpoint access, a hardware \gls{UART}, or a radio link with the nRF24L01+ transceiver.
6
+
7
+The firmware is configured by editing INI files exposed in a virtual file system through a \gls{USB} connection, or programmatically via the communication interface. The configuration may be stored permanently in the \gls{MCU}'s flash memory, or temporarily in its \gls{RAM}.
4 8
 
5 9
 \noindent
6 10
 The following features are available, implemented as independent functional blocks that can be used in one or more instances: 
@@ -39,11 +43,6 @@ The following features are available, implemented as independent functional bloc
39 43
 	\item \textbf{Capacitive touch sensing}
40 44
 \end{itemize}
41 45
 
42
-The firmware is configured by editing INI files exposed in a virtual file system through a \gls{USB} connection, or programmatically via the communication interface. The configuration may be stored permanently in the \gls{MCU}'s flash memory, or temporarily in its \gls{RAM}.
43
-
44
-The devices are connected to the \gls{PC} by one of three interfaces: \gls{USB} as a virtual COM port or using raw endpoint access, a hardware \gls{UART}, or a radio link with the nRF24L01+ transceiver. While the firmware has not yet been optimized for low power consumption, the wireless connection allows it to be used in battery-powered applications such as mobile robotics, or outdoor data harvesting.
45
-
46
-The developed platform is versatile and may be used as an learning tool, as an inexpensive development tool replacing expensive laboratory equipment, or for automatisation purposes, taking advantage of its hardware interfacing capabilities with a control program running on a PC.
47
-
48
-Future development shall focus on thorough testing and optimization of all existing features, porting the firmware to other hardware platforms (such as the STM32L073 for battery-based applications), improving the C library, and implementing client libraries in other programming languages, such as Java or \CS.
46
+The developed platform may be used as an learning aid, as an inexpensive development tool replacing professional laboratory equipment, or for automation purposes, taking advantage of its hardware interfacing capabilities with a control program running on a PC.
49 47
 
48
+Future development shall focus on expanding support to other hardware platforms, improving the software library, and adding support to other programming languages.

+ 1 - 1
ch.unit.sipo.tex View File

@@ -1,6 +1,6 @@
1 1
 \section{SIPO (Shift Register) Unit}
2 2
 
3
-The shift registers driver unit is designed for the loading of data into serial-in/parallel-out (SIPO) shift registers, such as 74xx4094 or 74xx595. These are commonly used to control segmented \gls{LED} displays, \gls{LED} user interfaces, etc.
3
+The shift registers driver unit is designed for the loading of data into \gls{SIPO} shift registers, such as 74xx4094 or 74xx595. These are commonly used to control segmented \gls{LED} displays, \gls{LED} user interfaces, etc.
4 4
 
5 5
 \noindent
6 6
 A SIPO shift register has the following digital pins:

+ 2 - 0
thesis.acronyms.tex View File

@@ -15,6 +15,8 @@
15 15
 \newacronym{DALI}{DALI}{Digital Addressable Lighting Interface}
16 16
 \newacronym{mbus}{M-Bus}{Meter Bus}
17 17
 
18
+\newacronym{SIPO}{SIPO}{serial in, parallel out}
19
+
18 20
 \newacronym{SSH}{SSH}{Secure Shell}
19 21
 \newacronym{NRZI}{NRZI}{Non Return to Zero Inverted}
20 22
 \newacronym{MSC}{MSC}{Mass Storage Class}

+ 11 - 0
thesis.bib View File

@@ -556,3 +556,14 @@
556 556
 	url = {https://pinout.xyz/},
557 557
 	urldate = {2018-05-19}
558 558
 }
559
+
560
+
561
+
562
+
563
+@online{gex-gh,
564
+	title = {GEX USB GPIO platform source code repository},
565
+	author = {Ondřej Hruška},
566
+	url = {https://github.com/gexpander},
567
+	year = {2018},
568
+	urldate = {2018-05-21}
569
+}

BIN
thesis.pdf View File