Thursday, August 13, 2015

Test - Result Aug 11



1. Amplifying of the resulting signal failed to meet its desired mark therefore resulting in haphazard
    interference pattern except for the principle beam at inclination 0 degrees from the perpendicular
    to the plane of the transducers where the beams converge in phase by default ,thereby giving rise
    to constructive interference. This point produced a very feeble quiver sensation when kept against
    the palm at separation of 1cm. The reason for absence of a strong pressure point is clearly due to
    the circuits inability to amplify the amplitude modulated wave. Therefore the transducers were fed
    a signal of peak-to-peak voltage 2.3 V instead of the required 20V to feel a strong pressure point

2. Although the CMOS containing the complimentary pair of NMOS and PMOS seemed tempting
    at first due to its relative ease of isolation of source and load ( a much required necessity for
    Raspberry pi and to prevent interference of improper impedance matching at load from affecting
    the signal generation at the source) due to its voltage controlled gate rather than BJT's current
    controlled base, however a quick look shows the gain of CMOS to be very small as compared to
    the gain of BJT which can very greatly be enhanced and made linear by bypassing the emitter
    resistance with a capacitor. This increases the switching time of the BJT significantly beyond that
    of CMOS which is again a much  needed necessity.

3. The test showed a perfect correlation regarding the switching of the transistors upon stimulus from
     PI.

4. Link to the video demonstrating the test
    https://youtu.be/f9x8eXbNcak

Monday, August 10, 2015

Log Aug 4,5


1. Added support for linux with few minor modifications to Ultra_main.java to incorporate support
    for linux.
   
    Commits:

2. Added documentation to 8051_signal_generation.asm completely explaining each block and their
    need and operation.
    
    Commits:

3. Changed licensing from GPL to Apache 2
    
    Commits:

4. Resolved few other errors and minor modifications.
   
    Commits:
    
5. Added steps to compile and run from commandline for Linux users, please note /root/Inter_Haptics
    is the path where Inter_Haptics has been cloned to , if this varies then depending on which 
    directory you have cloned the repo to then change accordingly.
   
    Commits:

6. Added the test image to demonstrate the propagation
   
    Commits:

7. Added method to automate the process of selecting either to implement linear or grid algorithm for
    the selected arrangement of transducers 

    Commits:


Log Aug 1,2,3


1. Added the circuit design file detailing the PCB layout and pouring data.
    
    Commits:

2. Modified the adafruit_pwm_servo library for personalized operation , however since the need to 
    move from arduino to pi, pi can support 9 transducers directly through its GPIO's but should there
    be a need to add more, then they can be controlled through adafruit_pwm_servo_driver which in 
    turn is controlled by I2C by pi.

   Commits:

3. Due to difficulties in acquirement of certain parts, added a few more tested alternatives to the 
    readme.
   
   Commits:

4. Added documentation to explain the working and the need for PLL and decade counter
    in the circuit .
   
   Commits:

Log July 28,29,30,31

1. Added the arduino file , Now since i mentioned the drawback was due to the max clocking 
    frequency of arduino's digital pins being 33khz which is not sufficient to switch the transistors
    fast enough , i migrated to using Pi with wiringpi, due to compatibility between arduino's wiring 
    and wiringpi, it can be used out of the box with pi with few minor alterations.
 
    Commits:

2. Added provision for custom frequency generation in arduino(wiringpi) code
    
    Commits:

3. Added the code for frequency to change in the simulation upon selecting a frequency to transmit 
    and also for selecting a particular carrier and modulating frequency based on a standard list of
    frequencies using java.reflections and hashmap.
    
    Commits:

4. Moved certain blocks specific to signal generation and 8051 present in arduino/wiringpi to 
    separate headers and c++ files to improve code re-usability and easy implementation .
  
    Commits:

5. Updated readme with parts required and their description 

    Commits: 

6. Added grid array implementation to Ultra_main.java and scroll bar to change elevation above the
    transducer plane.

    Commits:




Log July 27


1. Added documentation regarding calculation of the values for signal generation and working of the 
    module as a whole.

    Commits:

2. Updated frequency.h with the hexadecimal values to be sent through UART to 8051 from PI
     inorder to generate frequencies of the desired value,( the calculations of the hex values are detailed
     in the above commits ).
     
     Commits:

Monday, July 27, 2015

Log July 22,23-26



1. Fixed segmentation error in the assembly code by removing few redundant clear operations.               
    Commits:

2. Added 8 data bit , no parity, 1 stop bit UART protocol for communication between 8051 and
    arduino. Commits:

3. Added Spatial impulse response for quicker and more efficient field modelling ,few minor 
    bugs are yet to be resolved. This approach is more cost effective regarding the processor's
    resources because like anyother Linear time invariant system ,it aims at realizing the system's
    response for one set of impulse or input and depending on that anyother transducers's output
    or response will be a time shifted version of the former and hence can easily be obtained by
    time domain convolution with unit_step_function(t-t0) where t0 is the time delay between 
    switching on the 2nd transducer relative to the first for which the response is modeled. Therefore
    once the response is computed ,that thread can be suspended and the computed data can be easily
    modified to find the response for other neighboring transducers thereby easing complexity. 
    Commits:

Log July 19,20



1. Added Documentation to the assembly code explaining the operation and the conditions involved 
    in communicating with the 8051 to generate the carrier and modulated waves. Commits:

2. Added Support for Ultra_virtual class to select the frequency required to  be generated for the            
    carrier and the modulating waves and send the same to the COM port. Commits:

3. Updated Frequency.h to recognize the frequency data incoming to the arduino and since strcmp           
    didn't work , I added another header to mimic its operation called comp.h. Commits:

Saturday, July 18, 2015

Log 17,18 July

1. Finished constructing the circuit for the 8051 signal generator to produce signals for the carrier
    and modulated waves. Updated the PCB layout on my PCB web account
    (Please check the PCB layout tab and  not the schematic(Its messy)).

2. Updated Connection_details.txt for information regarding the pin connections of the PCB layout
    Commits:

3. Few minor code fixes regarding the abstract class Frequency in Ultra_main.java
    Commits:

Log 16 July

1. Coded the algorithm for 8051 to generate the two sine waves for carrier and modulating waves.
  

    Structure of Operation


    1. Instead of using standard oscillators such as wein bridge , colpitts etc , I decided to use an
        8051 for generating the two sine waves since it allows us to change their frequencies 
        programmatically  without going through the tedious process of changing the resistors and                   capacitors supposing         at later point some other transducer is used.
    2. If any other microcontroller in charge of switching the transducers on and off intends to
        communicate with the 8051 to set the carrier and modulating frequencies. To first enable
        serial communication the INT0 pin that is P3.2 pin of 8051 must be transitioned from high to               low and held at low          for atleast a period of 4*(Duration of 1 Machine Cycle) .
    3. Upon doing this the serial communication interrupt is enabled on the 8051 and the MC can
        converse with it using UART. But the signal generation occurs only after both the carrier and
        modulating wave frequencies have been updated to the 8051 even if supposing we want carrier
        to remain unchanged and change the modulating still both have to be updated. 
    4. After updating the serial communication is once again disabled since the signal generation
        algorithm multiplexes TH1 register which is also required for serial communication.

Commits :

2. Coded the headers to be included by any MC in-charge of controlling the transducers. They                 basically implement structures and define few default constants to set frequency and grid pattern

Commits:

3. Added abstract class Frequency and child classes Carrier and Modulated to Ultra_main.java for 
   easy configuration of the frequencies to be used and sent to the MC for signal generation.

Commits:

Log 15 July

Fixed the Ultra_real class from freezing and synced it with the algorithm of Ultra_virtual class. Bifurcated the Ultra_real thread from the Ultra_virtual to improve code efficiency  and speed.
Updated the Readme with link to new video.

Commits:

Tuesday, July 14, 2015

Log July 14

Tested the circuit again today with linear arrangement. The decibel meter held about 1cm above the array showed a 1000 fold increase in comparison to the previous result.

Reasons:

The 1000 fold increase as per my conjecture can be attributed to a code fix wherein instead of sending the phase delays as they are to the transducers as done in the previous trial ,this time i sent the differences in the phase delays. This should make sense ,since all the delays that were computed were done so relative to the transducer closest to the focal point, hence while generating delays since the program at this stage is not multi-threaded it runs sequentially therefore adding up the delays generated at each stage. For example consider a linear array of transducers numbered 0-10, where 0 is excited first and let x0,x1,x2.. and so on be the phase delays computed for each transducer succeeding the 0th transducer relative to the 0th transducer. Therefore the delay x0 is added up with x1 for the 2nd transducer is the phase delays are sent, instead sending the difference of x1-x0 makes the delay for the 2nd transducer as (x0+x1-x0)=x1 which is what is required .

If delays are sent as they are then delay for 2nd transducer = x0+x1
If the difference of x1 and x0 is sent then the delay for the 2nd transducer= x0+(x1-x0)=x1

Therefore by sending the difference the correct phase delay is sent .

Apart from testing ,there were other code fixes included 
commits:

Also added Readme regarding project aim and usage:
commits:

Log July-12,13

Added method to implement Rayleigh-Sommerfeld-Integral

Rayleigh-Sommerfeld Integral

An Integral used to describe the diffraction of light or sound due to many elements constituting an aperture. It gives an almost perfect computation of the radiation pattern on a focal plane parallel to the plane containing the aperture.


The integral models the transducer taking into account everything right from attenuation to frequency.













Saturday, July 11, 2015

LOG - July 11

Today was basically spent on updating the code with other important and vital features .

Features Include:


Near Field Length: 

Method was added to compute the near field length. This is very essential since, ultrasonic waves emitted by transducers show uniform properties and attain maximum sound pressure level just beyond the near field length. Before this due to the intense proximity of the wavelets they tend to interfere among themselves and hence give distorted output,and so any tactile sensation must be programmed to be felt so that they are just beyond this length. Commit: https://github.com/1sand0s/Inter_Haptics/commit/559bcb16a5258592e04fbd6828d752f1a7da8074
 deals with this implementation.

As shown in the diagram , in the nearfield the amplitude variations are very abrupt in contrast with the far field variation.

Diffraction Angle

Added diffraction angle measurement for beam emitted by  a single transducer. This helps in accommodating different  transducers with ease if the need should arise. Commit : https://github.com/1sand0s/Inter_Haptics/commit/9aaf565e007dde547cf4e44d4292e8fb55db4057
deals with this implementation 



Sound Pressure and Acoustic Force 

Added method to dynamically calculate the sound pressure and acoustic force on the canvas at the point where the mouse is currently positioned and display it on the canvas. This helps in speculating and designing the type of array best suited for achieving different results like either a rectangular grid array or an annular array etc. Commit https://github.com/1sand0s/Inter_Haptics/commit/28b4c295b3e49f1143cd5d54c8dfb892dc23a88e 

deals with this implementation 














Friday, July 10, 2015

LOG - JULY 10th

Read up on the concepts required for the grid implementation. Added numerical integration to the code. Depending on the step count( number of terms) ,performance and accuracy required the code chooses the most optimum one suited for the purpose at hand.
Commits :  
https://github.com/1sand0s/Inter_Haptics/commit/4ca5fc5fa3a42b2df267d63afdb12ae493753a8d

1. Trapezoidal 

     Best suited for small step counts and generally when the stress is on performance rather
     than accuracy. Approximates the function curve using trapezoids.


2. Simpson's 1/3

    Best suited when the step count is even. Greater accuracy than that computed using trapezoidal.
    Approximates the function curve using quadratic polynomials(parabolas).



3. Simpson's 3/8

     Best suited when the step count is multiple of 3. Greater accuracy than that of trapezoidal.
     Approximates the function curve using cubic polynomials.

Thursday, July 9, 2015

Trial -1


I tested the circuit today. However , though the transmitters are working and the circuit is executing as it is designed to, no perceivable Haptic sensation was felt.

Possible Reasons


These are some of the possible reasons that might provide a plausible explanation for the failure.

1. I was unable to procure the MAX44250 20V opamp as earlier described , and hence had to resort 
    to the one I had in possession which was 741- 12 V opamp. Therefore since the murata MA40S4S 
    datasheet states the max voltage to be around 20V(peak to peak) for the transmitters, it might be
    possible  that the voltage after amplification fed to the transmitters, being of 12 V range was 
    insufficient for them to emit waves of SPL(sound pressure level)of required amplitude to be felt.

2. Secondly, the present algorithm is designed to calculate phase delays for a line of transmitters
    rather than for a grid and since atleast 16 transmitters are required for the amplitude pertaining to
    the constructive interference to be large enough to be felt, this was nearly impossible to achieve          
     using a line of 16 transmitters ,since as stated by the murata MA40S4S datasheet,they have a 
    directivity of about 60 degrees and hence get heavily damped towards the lateral direction ,
    therefore by the time the wave from the 16th transmitter reaches the first ,its barely strong enough
    to complement to the interference.

Possible Solutions


1. Firstly , replace the present 741 12V opamp with MAX44250 20V opamp and hence increase the      
    supply voltage to the transmitters.

2. Secondly, implement the algorithm for a grid of transmitters thereby cutting short the distance
    each wave has to travel to the point of convergence thereby ensuring the amplitude does not get 
    damped heavily. 

Saturday, July 4, 2015

Circuit :-


555-Timers

We use two 555's to generate the 40KHz square wave and 200Hz square wave, the 40khz is required to excite the transmitter with its resonant frequency of oscillation and 200hz to modulate the 40khz wave so that our hands can feel the pressure point. 
                So basically Tlow for the first 555 producing 200hz is= 1/(2*200hz)=2.5 ms
so 2.5ms=0.69*R1*C, choosing C as 0.1uf, R1=36k ohms approx.In order to get symmetric wave the charging and the discharging time constant of the capacitor should be the same therefore R1=R2=36k ohms, and during charging from 5v source ,both R1 and R2 is in path of C, therefore we bypass R1 with a diode , now the during charging ,C charges only through R2 since the diode acting as short bypasses R1. 
                The same goes for The second 555 timer, except here Tlow =1/(2*40khz)=12.5us,so 
12.5us=0.69*R1*C, choosing C as 0.1uf, R1=180 ohms approx.

AD633

The square wave outputs from the two 555's are then fed into the inputs of AD633 analog multiplier ,which amplitude modulates the two waves, meaning, the amplitude of the carrier(40khz) is modulated with the 200hz wave.

MAX44250

This is an high precision,low noise,minimal dc offset 20V rail-rail op-amp with bandwidth of about 10Mhz well above the required 40Khz. The timers produce an output wave of 5Vp, we need to amplify this to about 20Vp in-order to attain maximum sound pressure level from the transmitters, therefore for non-inverting config 
                                              1+(Rf/Ri)=Vout/Vin, Vin=5Vp,Vout=20Vp,
Therefore 1+(Rf/Ri)=4,or Rf/Ri=3, therefore choosing Rf as 3K ohm and Ri as 1k ohm, we obtain the desired gain.

Clamper

Although the wave is alternating, yet it has a peak voltage of 20V rather than a peak-peak voltage of 20V with peak voltage of 10v, therefore we employ a clamping circuit to increase the negative dc bias, in other words we shift the positive 20V peak ,10V below ,so that we have 10V peak symmetric wave with 20Vp-p


where 'V' is 10V,

BJT Switch

The output from the clamper ,is then fed to the transmitter via a bjt switch monitored by the digital pins of the arduino. When the digital pins are high, they forward bias the p-n junction between the base and emitter respectively therefore allowing collector voltage to reach the emitter or the transmitters.


Finished Circuit, haven't included the base and collector resistance for the transistor due to lack of
clarity, however they must be added or else the 5v supply from the digital pins of arduino will fry the transistors
















Thursday, June 25, 2015

Simulation Of Transmitters and Phase Delay Calculations

Pardon me , sir for keeping you in the dark for all this time but i needed to get something conclusive before submitting the results. I have completed coding the simulation for the ultrasonic transmitters which is also capable of calculating the phase delay for n number of transmitters (as of now limited to linear ,array not yet implemented) and also capable of transmitting this data to an arduino(still have to figure out the character encoding and flushing the serial buffer but the code is complete). The link to the code is https://github.com/1sand0s/Inter_Haptics/tree/master/IS_UltraSonic/src/IS_UltraSonic.

The link to the video showing the implementation is below:-
https://youtu.be/lzrv-VvoatU











As shown in the diagram , in order to change the directivity or the angle of the principle maximum ,the transmitters are excited at different instances thereby causing constructive interference at different points and hence changing the orientation of the maximum. Lx is the distance from the transmitter at nth position to the focal point and R is the distance from the central transmitter , so Lx is compared with R and the transmitter is either set back or advanced by a factor ((mod(Lx-R))/speed) and this phase delay results in a constructive interference at the desired point.




Friday, June 5, 2015

Material Read In First Week Of June

Through the various papers referred , i have inferred the following points

Transmission: 
 As specified before , i intended to use the 40khz ultrasonic transmitter  from murata-MA40S4S 
 (i have ordered in bulk after it perfectly suited the need for the project with the favorable directivity and sound pressure level) .For the sake of clarity i recapitulate ,they basically contain quartz crystals which undergo deformation upon application of an AC wave and if the frequency of the applied AC wave coincides with the resonant frequency of the crystal ,the amplitude of the output mechanical disturbance(ultrasonic wave) is maximum .However tiny receptors embedded in our skin called mechanoreceptors

are incapable of detecting vibrations at a frequency of 40khz, it is most sensitive in the frequency range

Therefore i plan to modulate the AC 40khz sinusoid with the amplitude of a 100-200 Hz sinusoid and hence creating a multi-frequency wave which is then amplified to 15Vp-p and fed to the transmitter

Focal Points
This is what i am focusing right now on, reading up material on phase-plane and basically try to correlate the points of constructive interference to the phase differences of the transmitter to form the focal point and eliminate the background noise 

Thursday, May 21, 2015

Designing and Structure

Key Points Understood and To Conform To 

Interactive spaces uses Osgi(Open services gateway initiative) allowing each activity to be deployed onto a controller, started stopped independently of other activities allowing large scale multi-threading and handling of several controllers independently of each other.


Each activity in the interactive space is modular in nature and can be described as a bundle inherently defined with a life-cycle possessing the four states startup,activate,deactivate and shutdown.

Therefore the project involving interfacing haptics with interactive spaces will have to be deploy-able in a modular form equipped with event listeners interrupting the dependent activities.