Technical Data

Index of content


Design History


Original Idea

The idea described in the final project was something, about control emmited signals and receibe the echo to proces it an convert in an haptic sensation, mainly in form of vibration.

To carry out a demo, I was thinking about how to find money to do that, and then apears the solutions aobut crowdfunding, so we can find about 1600€, the idea in mind was to develop a fast demo, with pc bassed data adquisition systems, but the price for that systems was to high for the main public, and usualy are not an open design systems, so we decided explore a more open and low level solution, based in an open computing boards bassed on ARM architecture (BeagleBoard, RPi, APC, etc..) and linux operating system.

The basic original idea for the demo, was to be able to control the signal by a hand movements, then emit this signal by ultrasound transducers an capture the echo produced by objects and process to generate an haptic signal.


Idea evolution

Abstract:

The original idea has been modified during the development for many reasons. The main reason was to develop a system who can be reproduced by as much as people possible, and for using the acctual components in the market.

So we move to a pc-high level data adquisition systems to a cheap and open PC boards, also change the haptic feedback for an audible sound based system (first concept by using bone conduction technology, but this not is necessary for the development of the system who can be done by using a standard headphones. )



Explanation:

In the first system concept, was based on the university "work system" in wich the algorithms and systems are fast prototyped and tested in pc software platforms such as matlab (who alows fast prototyping).

The idea was to use an USB data adquisition/generation system such as elab-080 managed under matlab by using a .dll library with a c++ functions, this was tested with a good software results, but the hardware response don't fits the basic functionality... The next steep was to think in a professional data adqusition systems to achieve the objetives, then we make a budget based on this assumption and initiate the crowdfunding campaign, achieve the minumum, and the project begins.

We first consider the PC as a software development platform, so we consider many languages such as matlab, java and c++.
For the language c++ we consider many the integrated development environments (IDE) such as DEV-C++ who uses the gcc compiler and Borland C++ builder 6.

Also we begin to consider the options to configure the system:

-I/O: professionals sound cards and industrial data adquisition systems.
-Control: virtual reality gloves, "analog" controllers for pc.
-System feedback: haptic tiflotechnologies (braile technologies), non interfering sound technologies such as bone conduction.
-The ultrasound transductions system was defined from very early stages by using the doc: "A BIOLOGICALLY INSPIRED SONARHEAD" ( https://sites.google.com/site/sbeiprivate/tareas-demostrador-robotica/tareas-agosto/biosonar.pdf )

Then apears the chance to use a portable PC's with price unther 50€ to develop the application. sucha as APC via, RaspBerry Pi, and other chinese versions, so we begin to consider this as the main central system to develop the application.

Then, we study how to generate sounds with the pc and consider all the synthesizers technnology developed so far, this video ilustrates that http://youtu.be/Lt_0-GGQcp4 and also we consider the chance to emit ultrasounds with standard sound cards.

We take a lot of time studyng all the posibilities and the design chriteria, in his orientattion (most economically reproduccible, most functional and most optimal resources captured development), then begin the development with a combination of economical chriterias and optimization of the existing resources. So the idea was "use what is already available, and buy wat you need to develop the system to achieve the most economical, and reproductible result"

Then we begin to consider many options, in the control of the systema and in the feddback (midi control, bone conduction technology), we focus on c++ lenguage as the language for the application and study the sound drivers for PC and how to run in this language. We study the haptic technology, and conclude that today there is not an accesible technology in this way who fits the project specifications. So we decide to use the bone conduction technology, but may be in the future, we can use the haptic technology.




We begin to study the windows ASIO driver as a program interface, and define the first aproach system with defined components. With his hipotetical evolution. So we begin to buy some components. But only the clear options.

We search information to run the components, and to explore the posibility of use a standard sound card as a I/O system. We e-mail with providers about many posibility wotk combination of operating systems and hardware to run this option, but was hard to obtain information from this kind of providers because the company politics. 
        
We consider many options for the hipothetical embeeded systems, and contact with sound hardware companies. But discard this in many cases. Because is a sound designed hardware with sound banwithd limitations. So we consider digital buses such as I2C and SPI to carryout the comunication with the enviroment.
So we decide to try the fastest and cheapest PC based solution first and if not can be done, try the embeeded solutions with much more time spent. We adquire under test conditions a roland sound card to carry out ultrasound emision tests, with no positive results, so discard the solutions and return the sound hardware to his ouner.
We were forced to use a windows platform and microsoft IDE, to use the sound hardware at low level (c++ language) to test it.

As menthioned before, many computer systems were considered, to the next step solution ( embeeded computer system) chriterias were "open hardware" designs and price. Finaly we chose the raspberry pi because was the most cheapest and open solution (APC via, ofers their collaboration as a sponsor, but at this moment they were not a true option because they don't have a sutable connectivity in their board, months later, they build a better card.)

We install the Arch Linux operating system on RPi and begin to build a development system for this application, by downloading and test many IDE's for this hardware, compiling the source code for the pheriperals needed (P5 glove, sound card, etc...)

Using the embeeded solution we need to develop a "analog to digital" an viceversa, hardware interface between the transducer board and the RPi digital bus. So begin to search for chips who fit the desired specifications.

The bone conduction technology tested and evaluated in a real enviroment, (but only by myself) and aparently without autoamplification, this is not suitable enough to achieve the minimum level to be heard in all cases, any way we determine that there is the autoamplified bone conduction technology who can fit the specifications.
We spend a lot of time to control the SPI bus by software, and still there are things to do in that field. We need to even recompile the linux kernel to solve problems whith the real time communication through it.

The transducers sybsystem was tested, so we optimize it by mounting on a perfboard.

We design an active filters (Sallen-Key cells with operational amplifier base) for antialiasing (AD) and signal reconstruction (DA) pruposes. Using simulation and mounting on a protoboard.

We do many tests to manage the SPI bus by testing diferent available software libraries and even asking in forums about that question. The conclusion is perform the application unther RPi, bay progaramming it in "baremetal" (without operating system) like the microcontrollers or by using the DMA controller on RPi, this was the suitable choice because we need a lot of things from the operating system in our application. And this is the devolopment point in which we are.

Also comment that, the software development by functional modules, may produce a undesired result when you try to run together, and this needs to be redeveloped to achieve a suitable result.


Choosing the components

The main chriteria to choose the components were the price, the accesibility to the system, the openess level and the easy reproductivity condition. We were searching for many possible combinations, finaly, we choose a embeeded PC, such as RaspBerry Pi. The other components were selected under similar conditions, but basically the accesibility to the hardware at the lab.

Hardware Subsystems Technical Description


Main Processor

Bassed on RaspBerry Pi the main system on chip is runing by a bcm2835 chip, host a ARM architecture able to run systems such as linux and derivates. This could enable the system to run complicated applications and powered only by a battery without the necessity of other peripherals conected. The main problem is about runing real-time applications with systems managed by an operating systems, because we don't have full system control and we have to program in other ways such as DMA or bare metal.


Control system, Human-Machine Interface


In the first attempt we use a P5 Glove controller, using a c++ based code to write an application to control unther RPi platform, but this application were easy to simulate by keyboard inputs, because we only want to control four analog variables with values between 0 and 63.


Real-Time Input/Output System

Only left an bloc diagram to be completed

 

SPI Bus

The SPI bus has been selected to SBEI application for his fulduplex capability (send and receibe data at the same time) and high data rates (about 125Mhz serial data), an this standartd become popular for the IC's manufacturesr making chips compatible with this standard. So the most serial interface IC's for AC/DC pruposes are compatible with that bus.

Short wikipedia description

http://en.wikipedia.org/wiki/Serial_Peripheral_Interface

Analog to Digital Stage and Viceversa

The Analog to Digital converter hasen't benn proved, and the circuit hwo converts a bipolar signal to unipolar signal to feed it, also non tested. (from analog devices data sheet, application circuit)

The basic design has been considered with separated ADC/DCA lines...

The D/A line consist in a SPI bus connected to an 16 bit 500KSPS DCA chip with a reconstruction filter tuned to 100Khz connected to the analog autput of the IC, this is the tested part, and is functional for the software described here.

The other A/D line is the non tested part so far, and the basic design consist in a ADC chip connected to the SPI bus, with similar characteristics (16bit 500Ksps) and a "antialiasing" filter tuned also to 100Khz conected to his analog input. Usualy this line requires more chip stages because the ADC chips are unipolar and bupolar signals require an aditional circuit to convert this signal from bipolar to unipolar.


The Analog to Digital converter hasen't benn proved, and the circuit hwo converts a bipolar signal to unipolar signal to feed it, also non tested. (from analog devices data sheet, application circuit)

Power Amplifier and Transducer Stage

The ultrasound transductions system was defined from very early stages by using the doc: "A BIOLOGICALLY INSPIRED SONARHEAD" ( https://sites.google.com/site/sbeiprivate/tareas-demostrador-robotica/tareas-agosto/biosonar.pdf )



Human Sound System (Machine-Human Interface)

Actualy the system is based on the RPi soundcard, and the RtAudio and STK c++ software, and is only an audio feedback, there is not an haptic one. The software described so far has been released at the section "source code"

System Conectivity

The system has been designed to be accesible for the most popular standards to conect devices at low level, by using a hardware platform who alows that, the RPi hwo allows the conectivity whith chips by SPI, I2C, GPIO, etc...

This platform allows to acces to this peripherals by using the SO Arch linux. But there are many other ways to program it by using "Bare Metal" techniques (in the same way who is programmed in microcontrollers)

Cost (Price)


There are many reasons for not write a price for the initial development system, becaus is developed unther PC, platform, this could be developed in a any PC based system with a c++ compiler. My recomendation is to redesign the system using the experience in this project.



Observations and hints

The hardware have a high risk of non reproductible components due to many causes such as future unavailable parts, in this way the hardware is variable, and the design is mainly conceptual and concibed to be reproductible in the best conditions. We high recommend to redesign the system with your particular enviromental issues.



Software


Operating System.

Arch Linux (under B type RaspBerry Pi ARM architecture hardware) A type may be used also, but nos tested so far.

Development Tools.

-gcc compiler for PPi architecture (ARM)

-Text editors. (for edit the source code)

Source Code.

The code is in C/C++ computer language.

You may find all the source files used at the end of this page as a attached files.

Control module.

From many files generated we selected one here as the most representative and functional.


P5 source code



The following source code has been donloaded and compiled for the RPi ARM architecture:

http://code.google.com/p/libp5glove/source/checkout

Instructions about the specific hardware:

http://noisybox.net/computers/p5glove/

You should download and compile the same code for your particular system and architecture.

And included to be compilated by using the folloging CMakeList.txt

CMakeList.txt

project(gloveapp)

cmake_minimum_required(VERSION 2.8)

set (cmake_cxx_flags "-O3 -Wall") #posibles ubicaciones alternativas a /usr/lib  /usr/include para encontrar librerias.h y librerias.o binarias # -L/usr/local/lib comando que incluye librerias localdes.
include_directories (${gloveapp_SOURCE_DIR} /usr/include/stk)

add_definitions ( -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -D__LITTLE_ENDIAN__ )

add_executable(gloveapp p5main.cpp)

target_link_libraries(gloveapp rtaudio p5glove usb bcm2835 stk rtaudio asound m) #librerias binarias

install(TARGETS gloveapp RUNTIME DESTINATION bin)


Signal synthesis module.

From many files generated we selected one here as the most representative and functional.


Signal synthesis code


The following source code has been donloaded and compiled for the RPi ARM architecture:

http://www.music.mcgill.ca/~gary/rtaudio/

https://ccrma.stanford.edu/software/stk/

You should download and compile the same code for your particular system and architecture.

And included to be compilated by using the folloging CMakeList.txt (this file is designed for the hole application, so there are many libraryes not relevant for this section)

CMakeList.txt

project(sigproapp01)

cmake_minimum_required(VERSION 2.8)

set (cmake_cxx_flags "-O3 -Wall") #posibles ubicaciones alternativas a /usr/lib  /usr/include para encontrar librerias.h y librerias.o binarias # -L/usr/local/lib comando que incluye librerias localdes.
include_directories (${sigproapp01_SOURCE_DIR} /usr/include/stk)

add_definitions ( -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -D__LITTLE_ENDIAN__ )

add_executable(sigproapp01 sigpromain01.cpp)

target_link_libraries(sigproapp01 rtaudio p5glove usb stk rtaudio bcm2835 asound m) #librerias binarias bcm2835

install(TARGETS sigproapp01 RUNTIME DESTINATION bin)

SPI port module.

From many files generated we selected one here as the most representative and functional.


SPI source code


The following source code has been donloaded and compiled for the RPi ARM architecture:

http://www.open.com.au/mikem/bcm2835/

This only works under bcm2835 chip architecture. (ARM)

And included to be compilated by using the folloging CMakeList.txt (this file is designed for the hole application, so there are many libraryes not relevant for this section)

CMakeList.txt

project(spiapp17)

cmake_minimum_required(VERSION 2.8)

set (cmake_cxx_flags "-O3 -Wall") #posibles ubicaciones alternativas a /usr/lib  /usr/include para encontrar librerias.h y librerias.o binarias # -L/usr/local/lib comando que incluye librerias localdes.
include_directories (${spiapp17_SOURCE_DIR} /usr/include/stk)

add_definitions ( -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -D__LITTLE_ENDIAN__ )

add_executable(spiapp17 spimain17.cpp) 

target_link_libraries(spiapp17 pthread rtaudio p5glove usb stk asound m c2835arjan ) #librerias binarias  normalmente ubicadas en user/bin

install(TARGETS spiapp17 RUNTIME DESTINATION bin)


Signal processing module.

Not yet developed.

Main module.

From many files generated we selected one here as the most representative and functional.


MAIN SBEI source code


You should download and compile for your particular system and architecture all the code on the following links to run the code:

http://www.open.com.au/mikem/bcm2835/

http://code.google.com/p/libp5glove/source/checkout

http://www.music.mcgill.ca/~gary/rtaudio/

https://ccrma.stanford.edu/software/stk/


And included to be compilated by using the folloging CMakeList.txt

CMakeList.txt

project(mainapp03) # coment

cmake_minimum_required(VERSION 2.8)

set (cmake_cxx_flags "-O3 -Wall") #posibles ubicaciones alternativas a /usr/lib  /usr/include para encontrar librerias.h y librerias.o binarias # -L/usr/local/lib comando que incluye librerias localdes.
include_directories (${mainapp03_SOURCE_DIR} /usr/include/stk)

add_definitions ( -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -D__LITTLE_ENDIAN__ )

add_executable(mainapp03 sbeimain03.cpp) 

target_link_libraries(mainapp03 pthread rtaudio p5glove usb stk asound m bcm2835 ) #librerias binarias  normalmente ubicadas en /usr/bin c2835arjan

install(TARGETS mainapp03 RUNTIME DESTINATION bin)

Hints

To manage sd card image files you may use this tool:

    http://www.alexpage.de/usb-image-tool/download/

-You may find all the source files used at the end of this page as a attached files.


Experimentation and Conclusions

Many things to do yet, such as the optimization of the dma software and the ad-da hardware.

After that we will be able to perform small test to evaluate the original idea.


Development Kit


Introduction

Here will be described one system aproach to develop the desired application.

Kit Components

-RPi

-Mouse, Keyboard

-AD-DA interface hardware (download description here)

-Amplification and Transducer board as described in the doc: "A BIOLOGICALLY INSPIRED SONARHEAD" ( download here )

Kit price and possible providers

-We omite all the non esential components to develop the application, (controllers) who can be easily simulated by other input systems such as keyboard and mouse. The price is variable, because the components are continously changing his price. There are some component providers such as:

-Farnell

http://www.farnell.com/

-RS

http://www.rs-online.com

-Mouser

http://www.mouser.com

-DigiKey

http://www.digikey.com/

You should search for the desired components and determine the kit price in the tome you decide to buy it.

Technical instructions.

You can find technical instructiosn about the kit components at the following links:

-Raspberry Pi Type B Single Board Computer 512MB

http://www.raspberrypi.org/

-There is an Arch linux SO image designed to develop this application. There are compilers, some text editors, and more software tools usefull for this application. You may download at:

http://www.mediafire.com/?9bj8yp77ebcip

There are download managers to easily download the parts.

http://www.programasok.com/internet/gestor-de-descarga/

There are some parts with a sice of 200Mbytes to create a image file to record a SD card with a sice of 8Gbytes, all the parts sould be at the same directory to decompress that.

Some arch linux commands usefull to manage this operating system:

Mount and unmount an USB disk device:

--> mount /dev/sdb/pendrive

--> umount /dev/sdb/pendrive

Compile with

--> cmake -i

--> make

Update the system (not recommended)

--> pacman -Syu

Alsa Mixer:

--> alsamixer

Decompres a tar.gz file:

--> tar -zxvf file.tar.gz

Compile a C/C++ file:

--> gcc filesource.c -o filetarget

Sample commands to compile a library such as RtAudio

--> ./configure

--> make

--> make install

Binary libraries usualy are at:

/usr/lib (system space)

/usr/local/lib (user libraryes)

At *.cpp files

*.h files

contained between < > minds that libraryes are at /usr/include

contained between " " minds that libraryes are at the same directroy as the file

Compile with a CmakeList.txt file shoudl be done at "build" directory and using the command:

--> ccmake ../

then choose the "Release" option [C]onfigure [G]enerate and exit

You should configure the system for your particular IP adresses and so one, but even that you may experience some problems that can be solved by typong the command:

--> system ctl restart network

to list a commands about a issue, you should type:

--> apropos "issue"

and to veiw the manual instructions for a particular command you should type:

--> man "command"

To change the priority of a process you should type:

--> nice



You will need a SD image writer to charge the image file to the card a viceversa:

such as "USB image tool" you may download at:

http://www.alexpage.de/usb-image-tool/download/

and also at:

https://sites.google.com/site/sibiecin/descripcionsistema/usbit.zip

If you receive a message from the program who can't write the image due to some thing related to the sice you should activate the option "Truncate oversize images in device mode" It will allows to write the image even if this is bigger than the sice of your card, this will no t cause yo problems because the ext2 partition has been resiced to fit in all the 8 Giga SD card on the market.



-If you will use the P5 glove you may need the source code and instruction descrived here:

http://code.google.com/p/libp5glove/source/checkout

http://noisybox.net/computers/p5glove/

-To manage the SPI bus you may use the library:

http://www.open.com.au/mikem/bcm2835/

considering the hint commented at the following email:

http://mural.uv.es/efere/archivos/sbei/spi_email.pdf

and that:

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=71&t=19797



-For the ultrasonic stage you will need a ultrasonic transducers, such as:

http://www.avisoft.com/usg/microphones.htm

But for this prject we have considered the design descrived here:

"A BIOLOGICALLY INSPIRED SONARHEAD" https://sites.google.com/site/sbeiprivate/tareas-demostrador-robotica/tareas-agosto/biosonar.pdf

-To manage the signals unther C++ we have been using the:

http://www.music.mcgill.ca/~gary/rtaudio/

https://ccrma.stanford.edu/software/stk/

Yo may donwnload and compile the libraries, but this have already compiled at the image file descrived before.


Hints and advices for further development

You should consider that there are many alternative base boards such as APC via, beagleboard, PC 104, etc... and alternative low cost configurations (embeeded systems working only at audible frequencies)

For more info you may download the DVD of the project at:

http://www.mediafire.com/folder/y8wfumcnyvih3/DVDgoteo

And more technical info in spanish at:

https://sites.google.com/site/sbeiprivate


Internet sites for project data sources


General info

https://sites.google.com/site/sibiecin/technicaldataatgoteostage


Source Code

https://sites.google.com/site/sibiecin/technicaldataatgoteostage/SelectedSourceCode.zip


Open Hardware compilation.

https://sites.google.com/site/sibiecin/technicaldataatgoteostage/OpenHardware.zip


SBEI Work web

https://sites.google.com/site/sbeiprivate/