Author Topic: Rip me a new one, how bad is my circuit? (Bang-O-Meter)  (Read 14471 times)

0 Members and 5 Guests are viewing this topic.

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #25 on: May 03, 2016, 11:49:51 pm »
Well... for those who are still interested in my ramblings i present the addet band pass filter:



And this is the frequency response:



That is ugly, not yet what i want but at least i got it gooing in the direction i want.
The filter adds considerable gain and i can not get the right shape i would like.

On the other side, the gain is just addet in the pass band, so this might actually be helpfull...

I have no idea if this is realy something that needs to be in there but... for some reason my head thinks that it is.

For now the filter stays in there but with the option to disable/change it during the first field test and compare it.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #26 on: May 04, 2016, 12:19:08 am »
One last for today, i ripped the next best "authentic" sounding 9mm gunshot of youtube, wich will be highly compressed, so not at all useable but this is the result:



That are two shots, i count it as a win, ignoring the compression it nearly looks like what i get out of the scope when i get my percussive maintenance tool and run a test with that on a real circuit.

One thing i was concerned about is, how fast the circuit responds but i realised, it does not matter if it takes 100mS to respond.
But it has to take consistend 100mS to respond, the rest can do the software.

Since the used electret capsule more then saturates at the involved SLP with gunshots, i do not need a real recording.
But i need one that is not as badly compressed.
Looks like i have to haul my scrope, laptop and microphones to the range at some point and hope i get a bit of piece and quiet to my self on the lane (no pun intendet).
« Last Edit: May 04, 2016, 12:22:23 am by PeterFW »
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #27 on: May 04, 2016, 02:22:56 am »
This must be geting quite booring, in case someone still reads along...

Now that it works, the questin becomes, is it actually worth it?

This is the half wave vs the full wave peak detector.


There are some spots were the ratio between the peaks and lows does make quite a difference. Over all... it almost seems not worth the hussle.
Wich would eleminate the quite a few components along the need for a dual supply i think.

What i dit learn however is that the filter seems to make quite a difference.
Or something elese causes that that i do not know of yet, so... i might be wrong on it:

 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 29214
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #28 on: May 04, 2016, 07:51:41 am »
This must be geting quite booring, in case someone still reads along...
Intently  ;) please keep posting.  :)
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #29 on: May 04, 2016, 11:17:10 am »
Intently  ;) please keep posting.  :)

Well then... :)
This is what i should have done in the first place, i took a look at the recording of a 9mm handgun i found on youtube.
So, this is not realy reliable data but i will take that as a first starting point:



That is a spektrogram of one shot, more white blotches meanslouder, the higher up the blotches are the higher the frequency.
There is a decaying amount of high frequency content and, for this recording, it seems that a focus on the 1.5Khz region seems to work well.

On the other hand, we start of with a decent amount of high frequency content, that could indicate that if i were to focus on the higher up ones, i would get a better dynamic range.

But... the frequency response of a typical electret capsule is far from linear, they all start to increase sensitivity around 10Khz.
That on the other hand could be the reason the spektrogram of the above shot looks like it does.

I tried ploting the frequency response of my measuring microphone, but i can not get this to work, this is what a typical electret capsule looks like:

https://www.gearslutz.com/board/attachments/remote-possibilities-acoustic-music-location-recording/185100d1280435602-omni-capsule-question-dpagrid.jpg

The compensation file for my measuring microphone shows a peak of 10dB at 10Khz.

If this is good or bad... that could maybe used to my advantage.
Echo is a problem and the high frequency decays *MUCH* faster, wich is good.

The best course of action for now would be to select a random capsule, build a preamp for it, take it to the range with the notebook and take a few measurements.
Along with my calibrated measuring microphone and the other uncalibrated ones i have to get a comparison.
« Last Edit: May 04, 2016, 11:19:57 am by PeterFW »
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #30 on: May 04, 2016, 04:17:09 pm »
Ok... Friday is range day, then i will pack up a few different guns, mics, electronics and take some actual measurements.

For now i have twiddeled with the LM324 as a comparator, got frustrated and switched it out for a real comparator.
Works way, way better.



Not much else has happens so far.

Edit: Oh... yea, full wave rectification seems to be a waste of components and board space.
But i will reserve final judgement after practical tests.
« Last Edit: May 04, 2016, 04:20:40 pm by PeterFW »
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #31 on: May 04, 2016, 08:26:39 pm »
I will close this damn program now, take a step back and have a drink before i take a bite out of the keyboard.
Why? Why you ask?

You see... i cobbeled together a simulation of my initial circuit... see for yourself:



Take a guess wich one of the waveform looks better and wich is from my initial circuit.
I still hold hopes for some filtering though, to improve things.

While there is some negative voltage at some points, it is nowere near important bits and the current that flows is under a -100µA.

Btw... that is exactly what i saw on my scope when i tested the original circuit first.
What i learned however is, that i really do want a dedicated comparator.
So, i will take that as a small win.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #32 on: May 04, 2016, 11:23:43 pm »
Look at that... yep, that looks pretty.
Only question remaining, will it behave like this in the real world and how will it respond to different SPL / Microphone positions / enviromental conditions and calibers.



I am happy for now.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #33 on: May 05, 2016, 12:55:07 am »
Not in the mood to talk... here is a video to proof it works :)

 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #34 on: May 05, 2016, 02:57:04 am »
I give up, can someone give me a "for stupid people" guide on how i can get a LM393 dual comparator into LTSpice?
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #35 on: May 06, 2016, 12:40:37 am »
My brain is stuck in a loop, it had an idea, but is has no clue what this idea could be good for.
But i have this feeling this could be a good idea but can not think of a reason why it is a good idea.

Stick two comparators on the output, feed each other with a different trigger voltage and put both of them into a logic gate.
For some odd reason i want to do that but can not think of a good reason what that could be good for besides that i have one left over comparator and one left over output of the pot left over...
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #36 on: May 06, 2016, 02:43:13 pm »
Still reading.... :=\

I give up, can someone give me a "for stupid people" guide on how i can get a LM393 dual comparator into LTSpice?

Just use LM339.sub & LM339.asy.

I don't think you need to go over the top with your filters and peek detectors for this application, you can eliminate low frequency and wind noise simply by using much too small coupling caps.

I've built a few sound operated thingybobs. Have a play with this. This was a sound operated flash, I've added multiple inputs and reduced the 555 on-time so it looks more like your application.

.  That took much longer than I thought it would.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #37 on: May 07, 2016, 07:31:14 pm »
I don't think you need to go over the top with your filters and peek detectors for this application, you can eliminate low frequency and wind noise simply by using much too small coupling caps.

Thank you! :)

Gunrange trip got cancelled due to work, been tinkering with passives.
Trying to keep it as simple as possible but unsure of how to approach it due to lack of measuring data.
Once i have seen how a gunshot looks on the spektrum viewer i will know wich route to take i think.
Had not thought of wind noise till now, the Mic will be recessed in the enclosure with a bit of foam in front, that might keep out some.

Usually i just stick furr on the mic with an agressive high pass, that gets all the wind out when recording sound ;^^

Got the case and component layout mostly figured out by now and the board mounting/interconnect.
Got a problem were to put the RTC clock backup battery though... i will either have to switch to SMD switches (what i really do not want to do) or... find some other way.
« Last Edit: May 07, 2016, 07:33:29 pm by PeterFW »
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #38 on: May 07, 2016, 07:36:04 pm »
Oh... yea... with the static sound file i am using you can made the wave form look real pretty.
But in the real world it would take a cough in the general direction to make it completely not work :)



I will not show the circuit for this one :-P
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #39 on: May 07, 2016, 10:16:55 pm »
Going by the waveforms in this pdf, I'd think you have no choice but to detect the initial +ve going muzzle blast or shock wave and then don't listen for 35ms. The mic and electronics would take a short while to recover after such a pressure wave before they could detect any of the much lower level sounds.

If you do manage to produce a real life .wav recording you can use it as the actual input source on your LT simulation!

http://www.montana.edu/rmaher/publications/maher_ieeesafe_0407_109-113.pdf
.  That took much longer than I thought it would.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #40 on: May 07, 2016, 10:36:44 pm »
Going by the waveforms in this pdf, I'd think you have no choice but to detect the initial +ve going muzzle blast or shock wave and then don't listen for 35ms.

Ha, i know that PDF!
Gave that a good read before i seriously started with this whole thing :)

35ms is plenty, that would give me 20 shots per minute.
What i aim for is about 50ms to 100ms between shots.
My finger manages about 10 per second with the rifle, that is the highest i can test.

What id like to do is, manage that with analog circuitry so i can just use a edge triggered interrupt on the µC.

I could use a on board comparator on the µC or use a ADC match interrupt but i would prefer to get a clean signal into the µC.

I thought as well about just switching to something beefy and do everything in software but i have not come across a single Smartphone app that works reliably and i am a lazy programmer who barely scrapes by with his code. ;^^

My proof of concept thingy works on the range, so i have that gooing for me.
My main goal right now is to make is as reliable as it can be with as much SNR as possible.

Quote
If you do manage to produce a real life .wav recording you can use it as the actual input source on your LT simulation!

Yep, that is the next step!
I will try to get a recording wich my calibrated microphone of a few different shots/weapons/calibers (well, the mic is not calibrated but i have a compensation file for it) to get the spectrum as best as i can.

And a recording out of the actual circuit at different nodes to feed into the simulation.
My audio interface claims to handle +40dB inputs, so that should be no problem. Although i doubt that figure a bit :)
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #41 on: May 09, 2016, 08:45:30 pm »
Went to the Range today, i will just post the pictures for now.
I will have to think about a few things.

The micro is intentionally mounted in the worst possible position, i thought about takeing some proper readings but for one i do not have access to an outdoor range and for the other, i actually want real world examples and not ideal data points :)

Setup:


From the circuit:




Microphone:


 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #42 on: May 09, 2016, 10:33:42 pm »
I think you've just found out why they usually end up just gluing a piezo to the barrel.

I didn't know you were inside, a messy noise for 160ms is a long time.
F7FnFE8.jpg looks to me to be terribly AGC'd.
7bI0Nqp.jpg looks like you'd be able to detect the peaks even if they were only 50ms apart.
.  That took much longer than I thought it would.
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #43 on: May 09, 2016, 10:48:32 pm »
I think you've just found out why they usually end up just gluing a piezo to the barrel.

All this mess started a few years ago, with piezos glued to steel plates, how to detect impacts with them i have down quite well :)

Quote
I didn't know you were inside, a messy noise for 160ms is a long time.

Most ranges are sadly indoors, outdoor ranges are quite rare in germany, it adds a extra challenge.

Quote
F7FnFE8.jpg looks to me to be terribly AGC'd.

It should not be, i used a external usb mic amp that should do nothing with the signal except digitise is, if i remember correctly the signal just goes through a few opamp for amplification/atenuation and they feed directly into the ADC. But it has been a few months sinde i had the thing apart:
http://miditech.de/en-218-produkte-audiolink-III

To my calibrated ear it sounds authentic ;^^
The mic used whas a phantom powered omnidirectional condenser from a DBX RTA.

Quote
7bI0Nqp.jpg looks like you'd be able to detect the peaks even if they were only 50ms apart.

Yea, once i saw that trace i was quite happy and had a few ideas how to change my aproach. I will try cobble together something that might work better then what i am using now.
The signal out of the first op amp is horribly compressed, it sounds quite bad to the ear but for once, that works to my advantage i think.
« Last Edit: May 09, 2016, 10:51:07 pm by PeterFW »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #44 on: May 09, 2016, 11:48:57 pm »
All this mess started a few years ago, with piezos glued to steel plates, how to detect impacts with them i have down quite well :)
I need to know how long a piezo takes to detect impact from a steel ball for my gravity measuring machine,  :) I'm thinking it's about 2uS.

Quote
Most ranges are sadly indoors
We're not even allowed to look at your photos.


Quote
F7FnFE8.jpg

I somehow think that even with reflections 0.4sec should be plenty long enough to see exponential amplitude decay. Perhaps it's limiting rather than AGC.

If you look at the dips which occur right after the 4 peeks onF7FnFE8.jpg the dips are mirrored exactly on the bottom negative side. It looks like a cycle or 2  of high amplitude ~6Hz, but it might be just the electronics recovering from the limited peak, it takes until 2:31.90 until the waveform looks normal again - which is longer than the shot to shot time.
.  That took much longer than I thought it would.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #45 on: May 10, 2016, 12:20:51 am »
Quote
This turned out to be a long read.

I think you may have over-done it, as an AFE to a digital instrument. Assuming that the sound output (ac) has sufficient swing, I would feed it to a mcu's digital input, as a trigger for two clocks / counters. The first one to measure time elapsed between shots and the 2nd one to suppress echos and subsequent output from the mic/mic amp. Once the 2nd clock overflows, the mcu would listen for the 2nd shot, which will terminate the first clock,  and trigger a display.

This can be done by a dual opamp, to implement adjustable gain / sensitivity for the afe. If you hang an rc filter on its output, you can get away with using only one clock / counter in the mcu.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #46 on: May 10, 2016, 12:37:33 am »
This is what I was thinking about.

U1's the mic's pre-amp. R2/R3 controls the gain.

U2 is the threshold control - by setting V3. R5/C1 controls how fast the rising edge is, and R7/C1 controls how slow the falling edge it.

triggering a timer by a ST input pin on C1 and you are ready to go.
================================
https://dannyelectronics.wordpress.com/
 

Offline PeterFWTopic starter

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: Rip me a new one, how bad is my circuit? (Bang-O-Meter)
« Reply #47 on: May 13, 2016, 07:54:39 pm »
Hello and thank you everybody for the replys,
greatly appreciated!

For now i will just leave a few more pictures here, later on i will be back with a proper reply for your posts :)

http://imgur.com/a/Dxohv
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf