07.31.08

Pic Development on Ubuntu

Posted in PIC at 11:31 am by philwinder

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 ***

07.18.08

Voltage Amplifiers Vs. Charge Amplifiers for Hydrophones

Posted in Electronics, PhD An Acoustic Disdrometer at 2:03 pm by philwinder

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.

Charge Amplifier ResultsVoltage AmplifierVoltage Amplifier Zoomed

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.

07.08.08

Phased array V0.1 Finished :D Doesnt Work :(

Posted in Projects, Electronics, PIC at 9:45 am by philwinder

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:

  • to source some smaller transducers so that I can get 1/2 x wavelength spacing in a linear fashion. Possibly go higher in frequency to get a better z resolution.
  • use a dedicated ADC with 8 transducers, rather than 4. Get something with a faster sampling rate too.
  • remake the hardware :(
  • 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…

    05.15.08

    DAQmxReadAnalogF64 Intermittent Warning of 1

    Posted in Electronics, PhD An Acoustic Disdrometer, Programming, Qt at 8:12 pm by philwinder

    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…

    05.02.08

    Phased Array Data

    Posted in Projects, Electronics, PIC at 11:13 pm by philwinder

    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!

    4 Outputs!Accross TableRoof!

    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!

    04.25.08

    Phased Array PCB V0.1 Finished

    Posted in Electronics, Robotics, Future Project Ideas, ZBot at 3:23 pm by philwinder

    Not tested yet, but here are some images of the finished PCB!

    Image 1 img_0002.JPG Image 3 Image 4

    04.23.08

    PCB Manufacture notes and PreAmpV0.2 Died!

    Posted in Electronics, PhD An Acoustic Disdrometer at 8:57 pm by philwinder

    Just for future reference (because I always forget), using the naff double sided PCB, 3:30 exposure was enough, but by far and away the most important point was to remember to jam the acetate down to the exposure unit, to the point of stressing the joints. Too many times have I relied on the foam in the lid of the exposure unit only to find that the acetate has warped slightly so I get a blurring after developing. Argh! Never again!

    On the preamp front, it died! I dont know why, but I know what could have happened. Today in the lab, I came back from cleaning the “drop chamber”, as I like to call it, plugged it back in and it didnt work. I think it was because there was a DC spike on the output of the hydrophone which then knocked out the amplifier input. Here is my reasoning. I washed the hydrophone in hot water, boiling hot, since its the best way of getting rid of all the contaminants. I think this cause a charge build up in the peizoelectric material (either that or it was still hot, hence a wierd DC value) which then discharged (or stayed the same if it was simply due to the heat) and wiped out the input with a fair amount of voltage.

    So next PCB, remember the protection diodes! I didnt put them on this time because I couldnt be bothered, and I didnt think this would happen!

    p.s. Also, dont forget to place some text so you know which way round the acetate is supposed to go!  Plus that the text that is to be on the bottom layer should be flipped! Elementary I know, but always forgotten!

    01.27.07

    More thoughts, keep changing my mind!! - Inked

    Posted in Projects, PIC, Robotics, ZBot at 6:27 pm by philwinder

    Still havent had any time to do anything yet but:
    Ive decided to run multiple IR modules off one 18F pic then:

  • I can have a proper multi-master I2C configuration which means proper interrupts.
  • The IR module will now be smaller/cheaper because of the lack of another pic
  • Could put some extra fuctions on it too, like voltage/current monitoring etc.
  • This does still mean that the I2C routines will have to be written (boaring!) since that was what my motivation was dreading before.
    Also still love the idea of creating a phased array sonar system on it, but that will come later…
    Could look for some code on the net, see if that will help/save a lot of time. Just depends how its been written…

    Phil
    Image of options

    12.11.06

    Status of the ZBot

    Posted in PIC, Robotics, ZBot at 11:02 am by philwinder

    Ive finally had some time to do a little work on this projct.  Being someone that wants everything done right, and to learn, do everything by myself, where it would normally take a weekend to knock some crappy robot together takes a little longer!

    Firstoff, I have treated myself to a Robo Jr Chassis from www.active-robots.com, mainly because of the price.  The only quarm i have with it is that because it uses tiny 5V motors and tiny cogs not particullay securely mounted, it makes a right racket.  Maybe in the future it could be modded to use motors with internal step downs.

    On the code front, I still cant decide what to do with the IR proximity detectors.  I have wasted LOADS of time writing some cool I2C Multi-Master routines so that I can connect devices (the IR’s) to the I2C bus and address them whenever I want.

    The thing is, I still cant decide if its the best idea.  Since I also fancy, instead of using some IR transmitter reciever that I have built, to use one of them sharp distance finders and use that as a combined Proximity detect/range finder.   That would be cool.  I still might want to do it on the I2C bus though to make the comms wiring nice and simple.

    Hence, I have also built a simple proximity detector that literally takes uA’s to run.  This uses a pic to control the most power hungry device on the IR circuit, the TSOP38 blah… reciever.  With it permanently turned on, the curret will be about 800uA.  Which is poo.

    And also, I have done a VERY simple PWM test to test the motors.  Works good.

    Well there we are. Till next time….

    Phil

    11.09.06

    Start of the ZBot

    Posted in Projects, Electronics, PIC, ZBot at 8:55 pm by philwinder

    Basically want to create a cluster of robots using a mesh’ed ad-hoc network. This will be done using zigbee, but the problem is that I havent created any robots before so I will have to go through the motions before I get to the zigbee part.

    So far I have created a primitive IR proximit sensor with some 10F PIC’s. I have a few problems with the PIC’s themselves, for example: If you connect the pic back up to the ICD2 before turning off the main power, the PIC will burn itself out. Secondly, I had a load of problems with trying to program the damn thing, I think it was due to inproper driver installation. (Make sure you preinstall the drivers for the ICD2 FIRST!!)

    Next I am going to start on the actual motor control using some schematic I found on the net.