07.31.08
Ubuntu Radeon 9800 Pro Installation
I tried to get the open-source drivers working, but it just messed things up. So I used this guide to install the propriatey drivers.
My Blog, with Stuff on.
I tried to get the open-source drivers working, but it just messed things up. So I used this guide to install the propriatey drivers.
I am about to try PikLab with SDCC (Both available via Synaptic Package Manager) and an ICD2. To install the IDC2 I followed this tutorial. It’s supposed to be for the Pic Kit 2, but its just about the same for the ICD2. SDCC also requires GPUtils, so install that too.
One problem so far is that you cannot have spaces in the path of the project being used. Complication will fail and report:
Segmentation fault
+ "/usr/bin/gplink" -I"/usr/bin/../share/sdcc/lib/pic16" -I"/usr/share/sdcc/lib/pic16" -c -m -w -r -o xxxxxxxxxxxxxx
*** Exited with status: 1 ***
Background:
I am using a Buffalo WLI-U2-KG54 USB wireless device and the default linux USB driver (the rt2500usb) would not support WPA encryption and it would not work at all. After days of searching through other drivers including the ndiswrapper route/hack I found that USB devices based upon the rt25xx chip should use the rt2570 driver. Note that this guide should also work with the real rt2500 driver and its varients. Just replace filenames and identifiers where nessecary.
Assumptions:
A Fresh Install of Ubuntu 8.04.1 (Hardy Heron)
No Local internet access (but access from another computer)
Using WPA TKIP encryption. For any other type of encryption you will have to make some changes. But what they are I dont know.
Lets Go!
auto rausb0 # place your card name instead of all rausb0's
iface rausb0 inet dhcp
pre-up ifconfig rausb0 up
pre-up ifconfig rausb0 down
pre-up ifconfig rausb0 up
pre-up sudo iwconfig rausb0 mode Managed
pre-up sudo iwpriv rausb0 auth 3
pre-up sudo iwpriv rausb0 enc 3
pre-up sudo iwconfig rausb0 essid "<your ssid from before>"
pre-up sudo iwpriv rausb0 wpapsk <your wpa password>
pre-up sudo iwconfig rausb0 essid "<your ssid from before>"
Note the quotes around the ssid. The reason why you have to put the ssid twice is so that the wpapsk key can be generated properly. I think that all of my problems were because of this. I was only doing it once for ages. The up down stuff at the start seems to make it more stable. The auth 3 means wpa and the enc 3 means TKIP. If yours is different then take a look at the iwpriv-readme in the driver folder.
Now restart and that should be it. Next time it reboots the dhclient should find you an address!! yay. Note that running “/etc/init.d/networking restart” also restarts the network, but doesnt always work. The first time it seems to, but after that I dont get any DHCP offers. Dont know why, restart and it should be ok.
Hope that helps. Ive spent 3 whole days doing that. And I mean whole days.
I have come to the conclusion that voltage amplifiers are better than charge amplifiers. Equations state that the gain should be the capacitance of the hydrophone divided by the capacitance of the integrating capacitor. When creating two circuits with (about) the same gain, the voltage amplifier always outperforms the charge amplifier.
This could be because of a few things. Firstly, the capacitance of the hydrophone stated in the datasheet may not be true, or the capacitance undesirably alters with frequency. Or secondly, it could be because the hydrophone, as a model, is a better voltage source than it is a charge source, however this is implicitly the same thing. I.e. When the structure of the ceramic changes, a charge is formed via electrons jumping into non-stable spaces. This forms a potential between the terminals on either side of the ceramic and when one side is connected to ground and the other to a load, a current flows.
So, in reality, for hydrophones at least, the two circuits are attempting to accomplish the same thing. However, I would be worried that the integration in the charge amplifier would cause the signal to be altered from the delta like pulse to some sinc wave; single-handedly demolishing the drop size-impact pulse relationship.
Feel free to correct me if I am wrong, and here are some images of the results. The charge amplifier simply didnt have enough gain to get the required results.
Incidently, a differential configuration did not work very well at all. I thought a differential amplifier would remove a lot of the mains noise, but it didn’t. Most of the mains must be picked up in the actual circuit, rather than the wire. To remove the noise I would have to use a DC servo, adding complexity and possibly more capacitors in the path of the signal.
I have implemented a new microcontroller that has simultaneous sampling and a slightly higher sampling rate. I could then interpolate the data with pretty good results using a simple padding + band pass filtering technique. The higher the SNR the better it worked.
However, I have hit a great big wall. It all boils down to the fact that I have used 2 rows of transducers to make the spacing 1 wavelength.
For the following results, Consider the situation where x is the horizontal plane, y is the vertical plane and z is the distance between the source and the target. If the target is slightly elevated in the y plane, the top and bottommost transducers would receive an echo at different times. Furthermore, due to multipath dispersion I am also receiving further echoes from different y directions. So to counteract this, I would have to scan not only in the x plane, but in the y plane too, and this was accomplished by summing all of the results in the y direction to produce a plot of the targets in the x plane. However, by delaying the signals in the y plane, the x plane in some situations became erroneous. It looks like I am getting some sort of aliasing in the x plane. I think that this is because of instead of having a beam pattern from 4 transducers, I am getting 2 x 2 transducer patterns, so not only do I now have a very very wide beam width, I will have some nasty sidelobes too (since if you just consider the 2 transducers, the spacing is 2 x wavelength.)
On the up side, the hardware works great!
So all around, this was pretty much a disaster, and I am not looking forward to remaking all of the hardware. So for beta 2 I will need:
The hardest thing I see is sourcing the peizoceramics from somewhere. Does anyone know of where I can get any cheaply online? Self enclosed transducers would be ideal, but I would be willing to mess with the naked ceramics myself if I had too…
I’ve had a very serious problem recently regarding the long term stability of the NI-4462.
Problem:
Everything works fine for about 20-inf secs but then all of a suddent the DAQmxReadAnalogF64 function returns a 1 rather than a 0.
Solution:
The errors were buffer overrun errors (annoying that the 4462 almost always returns 1 as an error. Not very informative!). This, I eventually figured out, seemed to be happening every time my cpu hit 100% load. Then the DAQ would stop acquiring, post an error of 1 and quit. To fix this I manually set the sampsPerChanToAcquire setting in the DAQmxCfgSampClkTiming function.
Just a bit of background, I am using continuous acquiring, so the sampsPerChan… variable set the hardware buffer size. I am also interrupting every 50000 samples. So setting this value to 200000 or above (i.e. 4x your interrupt generation) seems to get rid of all my intermittent problems!! Woo!
Hope this helps someone in the future…
I’ve been working on decomposing the different parts of the signal received, trying to figure out what each bit is and how to get rid of it.
The main conclusions of which are that bottom->surface reflections are the most predominant in the signal.
The attached two graphs of experiments where I was comparing the signals in a bucket to the signals in the tank, and in the tank at different heights.
The first test shows that side reflections constitute a fair amount of the signal but after the primary reflections have passed the main residing component is the reflections from the surface. (Although they can still be seen in the signal - just). The bottom->surface reflections have slightly different path lengths due to the odd shape of the bottom of the bucket and that the hydrophone protrudes by a few cm’s. These two paths constructively and destructively interfere to produce the remaining oscillatory signal.
The second experiment was to make sure that the remaining signal was produced by surface reflections and not by some resonance in the hydrophone itself. It can be seen that the cycles following the initial spike occur at a different time depending on the depth. The deeper the water, the longer it takes the reflection to return back to the hydrophone. This can be roughly seen but is shrouded by the different path lengths of the other reflections (because the drop wasnt directly over the hydrophone).
This seems to indicate that if we were to dampen the bottom->surface reflections using a lining then a lot of this type of “noise” could be removed.
I also noted that the oil used for this experiment was left in the tank a few days. It looked like the cooking oil had started to coagulate, and did not behave as intended. (the semi-solid pieces were not recombining quick enough to “heal” the patch where the drop had just landed.)
This also helps to answer another question: How thick does it need to be?
Well this roughly depends on how quick/much it is raining. If there is a thin film (about 2mm) then when a drop hits the surface it forces the oil away from the impact site. If another drop was to hit the same place then there would be no oil to stop the bubble noise. If the film is 2cm deep then the drop doesn’t have enough energy to break through the oil into the water, so if another drop did land in its place, there would still be enough oil left to inhibit bubble noise. So the only worse case scenario is when one drop hits and another drop at practically the same time hits exactly the same place in the same orientation. If this happened then a collision between the new drop and the old drop could occur and probably create some strange results.
Having a thicker film also helps to stop the oil coagulating. So basically, the thicker the better. BUT we have to make sure that we dont make it too big because reflections will occur on the boundary of the water and the oil and the speed of sound will be different, affecting the TDOA’s.
If you ever get the error:
In file included from c:/Qt/4.3.4/include/QtCore/qcoreevent.h:1,
from c:/Qt/4.3.4/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:48,
from c:/Qt/4.3.4/include/QtCore/qcoreapplication.h:1,
from c:/Qt/4.3.4/include/QtCore/QCoreApplication:1,
from src\qpnwsettings.cpp:3:
c:/Qt/4.3.4/include/QtCore/../../src/corelib/kernel/qcoreevent.h:52: error: `QtValidLicenseForCoreModule’ does not name a type
mingw32-make[1]: *** [build/qpnwsettings.o] Error 1
mingw32-make: *** [release] Error 2
This is due to a semicolon not being present at the end of a class definition in a header file when #ifdef and #endif statements are used. So for example:
#ifndef __FOO_H__
class foo
{};
#endif
works fine (note the semicolon after the last bracket).
Got the first incarnation of the Phased array working now. Had a few hiccups along the way, but managed to get most of them sorted. Main problems included not having enough RAM to store a significant amount of data, so I fixed that using a simple compression technique (I say simple, took me ages to get it working!) and using a circular buffer.
The main problem is that the PIC30F’s can only acquire data sequentially, i.e. not simultaneously. This means that each acquire takes 1Tad to sample, therefore 4 sequential acquires takes 4Tad. This means that the actual sampling speed is Fad/4=50ksps max! Rubbish. So Ive ordered some PIC33f’s to try because they are simultaneous and work up to 1Msps!
Also need to desolder the power lead for the transmits because they should have their own separate power supply. Not the on board one.
Finally, some data!
Errata: Slight cock up, in the second image the pulse labeled reverbaration is not reverbaration. I think it was a reflection from something about 45 degrees out. This poses an interesting question, how do I stop signals that are out of phase by exactly 1 cycle adding up to a large number? I will have to consult the literature to figure this one out!
Not tested yet, but here are some images of the finished PCB!