erellaz / seisberry

Code for Raspberry Pi seismograph, 3 components
MIT License
8 stars 3 forks source link

Output unit of measurement #1

Closed tommy15979 closed 4 years ago

tommy15979 commented 4 years ago

Hi, I just completed your awesome project. Now i can register all data on TXT, but i don't understand if the file contains the Voltage of geophone or, in some way, you convert this voltage to mm/s or m/s. In this case, i don't know how to modify main.c to consider geophone sensitivity (V/cm/s).

erellaz commented 4 years ago

Glad you made one! To your question:

8/22 edit: The hardware gain is removed as soon as the value is read and converted to 32 bits. The hardware gain is only used to have maximum precision with a 14 bit board before converting to 32 bits.

To calibrate to m/s: the product of the software gain by the geophone manufacturer sensitivity gives you the scale factor between the value written out by the program in the text file and the velocity measured by the geophone. Make this product equal to one by changing the software gain, and you are calibrated.

Here is how to QC this. Replace the geophone by a known calibrated constant voltage of a few millivolts (or the signal generator of an oscilloscope), and make sure what you record in the text file has exactly the value of the input voltage delivered by your calibrated source. If it does, introduce the geophone sensitivity in the scale factor and put the geophone back. If it does not match, adjust the gain.

I will leave this ticket open until I have rigorously verified the gain application in the C program and on the board -or if you confirm the problem is solved on your side.

tommy15979 commented 4 years ago

Ok. For example, my Geophone specs are (LGT-20D10): http://www.longetequ.com/geophone/5.htm So, making the product = 100 [cm/s] , I can modify parameters file using: Ampgain=64 Numgain=1,5625 In this case 64x1,5625 = 100 [cm/s]

then I can try to calibrate it with oscilloscope!

erellaz commented 4 years ago

8/22 edit: the hardware gain is removed as soon as the value is read from the board, so the hardware gain will not affect the calculation, and should not be taken into account.

I realize what I need is allow the user to enter the geophone sensitivity (straight from sensor manufacturer specs) in the param file, and optionally the pre-amplifier gain (for those who want to fine tune dynamic and over-scaling). Then the program should automatically calculate the electronic gain so the result is always calibrated in m/s.

I will do that and test it with the various geophones I have, but that make take a little time.

tommy15979 commented 4 years ago

Unfortunately i am able only to develop windows software (vb/c#). I think that a userform would be useful. For example, to start/stop logging and to set param file

tommy15979 commented 4 years ago

Hi, have you tried to modify config file? If you want i can do some test

erellaz commented 4 years ago

I took the time to go back to the C file today. -I finished implementing the gains and sample rates for all values permitted by the board (I had only implemented previously the values useful for the seismograph).

The new C file is available here: https://github.com/erellaz/RaspberryPi-seismograph/blob/master/Software/RaspberryCode/obj/main.c

So to be calibrated:

This would work with both versions (old and new). The new version has more AmpGain values implemented, as well as more sample rates.

erellaz commented 4 years ago

BTW, I also added a GUI: https://github.com/erellaz/seisberry/blob/master/SeismographGUI.py

erellaz commented 4 years ago

Here is a step by step tutorial to do the calibration and test the instrument with an oscilloscope. This was fully tested on 8/30/2020, and it works. https://erellaz.com/blog/seisberry/calibrating-a-seisberry/