Go Down

Topic: Ballistic Chronograph (Read 3045 times) previous topic - next topic

JAR4x4

Hello!

I'm new to this forum, and fairly new to electronic projects. I have been playing a little bit with Raspberry Pi and sensors in drone relatated projects and some IoT projects.

But now I want to try something else. I want to construct and build i ballistic chronograph that can detect a bullet in flight at 900m/s +.

The main idea is to have two sensors placed at a known distance apart that the bullet flies over. This starts and stops a timer and the speed can be calculated. This is usually achieved by using two phototransistors, like in this project:

https://hackaday.io/project/9378-diy-ballistic-chronograph


In my project I want to use two magnetic fields that the bullet flies over to trigger the start/stop of the timer. This is where I get into problems. Is it possible to use a permanent magnet and a coil and use the change in the PM's magnetic field as the bullet flies over to trigger the timer part of my idea?

There is a commercial product that utilizes this:
http://www.outdoorlife.com/blogs/gun-shots/magnetospeed-next-gen-chronograph


Any tought on the topic are welcome!


Alex
Norway

mikb55

#1
Apr 28, 2017, 11:25 am Last Edit: Apr 28, 2017, 04:24 pm by mikb55
For a ferrous projectile try a couple of $7 pickups from an electric guitar. You'll probably have to lower the number of windings to get the required frequency response.
No idea if it will work with with non-ferrous projectiles.

My suspicion is that your electronics and wiring will be shaken to pieces over time unless potted in epoxy.

robtillaart

#2
Apr 28, 2017, 01:37 pm Last Edit: Apr 28, 2017, 01:39 pm by robtillaart
900 m/sec
distance between sensors lets say 20 cm?
So the Arduino must recogize 2 pulses rougly 200uSec apart

As the standard micros() counts in steps of 4 usec you would get this lookup table.

Code: (table) [Select]
uSec   M/sec
200    1000,00
204    980,39
208    961,54
212    943,40
216    925,93
220    909,09
224    892,86
228    877,19
232    862,07
236    847,46
240    833,33
244    819,67
248    806,45

Note the stepsize is in the order of 2%

To improve the timing you should use
- use interrupts to detect the pulses.
- a hardware timer

The Arduino Uno has 2 interrupt pins on pin 2 and 3
read - https://www.arduino.cc/en/Reference/attachInterrupt

(to be continued)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

Using interrupts and a hardware timer you can get precision up to 1/16 uSec.

This will give the following table (assuming the distance between sensors is 20cm)
Code: (table 1/16 usec) [Select]

221,0000 905,0
221,0625 904,7
221,1250 904,5
221,1875 904,2
221,2500 904,0
221,3125 903,7
221,3750 903,4
221,4375 903,2
221,5000 902,9
221,5625 902,7
221,6250 902,4
221,6875 902,2
221,7500 901,9
221,8125 901,7
221,8750 901,4
221,9375 901,2
222,0000 900,9
222,0625 900,6
222,1250 900,4
222,1875 900,1
222,2500 899,9


So that is 0.3m on 900m/sec is in the order of 0.5‰. This is very precise in theory but in practice there are a few possible problems.
1) if the distance between the sensors is 0.5% off (20.1 cm iso 20.0 cm) the calculated speed will also be 0.5% off
2) if one sensor reacts slower than the other you will get an additional penalty
3) if the clock of the Arduino is not 16.000.000 Hz but 1‰ off, the calculated speed will also be 1‰ off.

So although in theory you can get an accuracy of 0.5‰, in practice it will be around 1% at best.
Calibrating the numbers used in the math can help to maximize the accuracy.



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

Wrote a timeMeasurement sketch that uses rising pulses on pin 2 and 3 as resp start and stop signal.
Might help to build your system

Code: [Select]
//
//    FILE: timeMeasurement.ino
//  AUTHOR: Rob dot Tillaart at gmail dot com
// VERSION: 0.0.1
// PURPOSE: timeMeasurement Arduino UNO between 2 interrupts on pin 2 and 3 using timer1
//     URL: http://forum.arduino.cc/index.php?topic=473669
//
// HISTORY:
// 0.0.1 - 2017-04-28 initial version
//

volatile bool inprogress = false;
volatile bool dataReady = false;
volatile uint32_t ticks = 0;
volatile uint32_t overflows = 0;

const float ticksPerSecond = 16000000.0;
const float sensorDistance = 0.2;


void setup()
{
  Serial.begin(115200);
  Serial.println(__FILE__);
  Serial.println();

  pinMode(2, INPUT);
  pinMode(3, INPUT);

  attachInterrupt(digitalPinToInterrupt(2), startTimer, RISING);
  attachInterrupt(digitalPinToInterrupt(3), stopTimer, RISING);
}

void loop()
{
  if (dataReady && inprogress)
  {
    // MATH
    float duration = ticks / ticksPerSecond;  // seconds
    float distance = sensorDistance;          // meter
    float speed = distance / duration;        // meter / second

    // OUTPUT
    Serial.print("time: ");
    Serial.print(ticks / 16.0, 2);    // 2 decimals
    Serial.print(" usec ");
    Serial.print("\tspeed: ");
    Serial.print(speed, 3);           // 2 decimals
    Serial.println(" m/s");

    // PREPARE NEXT MEASUREMENT
    inprogress = false;
  }
}

ISR (TIMER1_OVF_vect)
{
  overflows++;
}

// note startTimer code itself takes
void startTimer()
{
  // prevent start interrupt when in progress
  if (inprogress) return;
  inprogress = true;
  dataReady = false;

  TCCR1A = 0;             //
  TCCR1B = 0;             // stop
  TCNT1 = 0;              // reset counter, overflows at 65536
  overflows = 0;          // reset overflowCount
  OCR1A = 1;              // clock pulses per increment TCNT1
  TIMSK1 = bit(TOIE1);    // set overflow interrupt
  TCCR1B = bit(CS10);     // start
}

void stopTimer()
{
  if (dataReady) return;  // prevent additional stop interrupt
  dataReady = true;

  TCCR1A = 0;
  TCCR1B = 0;
  TIMSK1 = 0;
  ticks = overflows * 65536UL + TCNT1;    // calculate clockticks.
}

// ---END OF FILE ---


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jremington

#5
Apr 28, 2017, 05:20 pm Last Edit: Apr 28, 2017, 05:21 pm by jremington
Quote
In my project I want to use two magnetic fields that the bullet flies over to trigger the start/stop of the timer.
This won't work.  Most people use photogates.

jrdoner

A lot of bullets are not ferrous.  There are plenty of lead projectiles, many copper, and some actually made of a plastic composite with metal particles.   If you try to do this using magnetic fields, you'll be limited to a small subset of all ammunition.

Boardburner2

I believe the magneto speed works with any metal.
Not sure how though.

jremington

#8
Apr 28, 2017, 08:33 pm Last Edit: Apr 28, 2017, 08:39 pm by jremington
What is "magneto speed"? 

A nonferrous, electrically neutral bullet would have no effect on a static magnetic field. Basic physics.

The National High Field Magnet lab has a tutorial article on how to measure bullet speed. They suggest to use foil strips, which are broken by the bullet, and (strangely enough for people who spend their working days using magnets) make no mention at all of magnets.

Boardburner2

What is "magneto speed"? 

A ballistic chronograph.

Patent mentions magneto resistive sensors.

Boardburner2

#10
Apr 28, 2017, 10:02 pm Last Edit: Apr 28, 2017, 10:34 pm by Boardburner2
The default bullet setting is copper with lead core.
There is also a setting for lead slugs.

Instructions mention the signal is weaker with these, there is a setting for steel core which gives a much stronger signal.

EDIT

The instructions mention that with a steel core the signal is inverted so maybe there is a clue there.

I certainly cannot figure it out.

Bullet speed is important too , less than 1000 FPS and it does not work as well.
Thicker copper jacket also improves things.

My best guess is that the bullet travelling through  a magnetic field generates current in the bullet which causes a detectable change in the field.

JAR4x4

Thanks for your replys!

I will do som sensor benchtesting over the weekend when I get home.

robtillaart, thank you so much for your code example. I will look into that aswell :)

Any other suggestions regarding sensor. Will a gituar pickup magnet and coil style sensor also pickup a non ferrous metal? Or is better to go with a doubble coil, metal detector style sensor?

Alex 

Johnny010

Using interrupts and a hardware timer you can get precision up to 1/16 uSec.
Completely agree with the accuracy. Assuming manufacturing tolerances. Accuracy is the closeness to the "true value". On the assumption the OP uses all equipment to the manufacturing standards, the method will be faily accurate. They *could* use the "propagation of errors" formulae for a more tangible idea if they want.

Precision on the other hand: https://en.wikipedia.org/wiki/Accuracy_and_precision

Precision is pretty much the deviation between measurements of the same unknown indepedent. If you have the exact same scenario, any measurement WILL vary somewhat. Precision is the "closeness" of individual measurements of a similar unknown.

Being able to measure with intervals of 1/16uS is resolution. Resolution is the smallest measurable change of an independent variable.

Boardburner2

Any other suggestions regarding sensor. Will a gituar pickup magnet and coil style sensor also pickup a non ferrous metal? Or is better to go with a doubble coil, metal detector style sensor?

Alex 
Do not know.
I do not think anyone here knows how this device functions.
Arduino is unlikely to be enough. Analogue electronics is probably needed and it would be better to use hardware for timing accuracy.

JAR4x4

Hello again!

I've done some more internet research... What about using a pulse induction metal detector circuit as the sensors?

A pulse induction metal detector can detect non ferrous metal.

Any toughts on that?


Go Up