Saturday, 24 December 2011

OpenChrono - Cheap and Simple Airsoft Chronograph

This project is about making a chronograph cheap and easy to build. This is achieved by taking the same basic concept of any commercial chronograph - 2 (optical) sensors spaced a fixed distance apart are tripped by a bb and the time between them being tripped determines the speed of the passing projectile. Speed = Distance / Time.

The simplification comes from offloading the processing from a microprocessor, which are fairly daunting to program and onto a regular computer, which can have the software installed like any other program and the software can be patched, updated and generally is a lot easier to work on by all.

The slightly clever bit is how to connect the hardware to the software - In the past this has been done by using a serial port, but, come on, what is this, the 90s?

No I shall be using a mic port to do the data transfer, as pretty much all computers have one. AND this opens up the ability to integrate a USB sound card and convert the entire thing to a single USB slot.

Naturally, as with all simple ideas, it's been done before, but the analysis is never really properly automated.  There is a fantastic "how-to" on the hardware principles written by Jim. His method involves recording the shots on Audacity and then doing a quick bit of math on the peaks of audio. However this is slow, tedious and is obviously possible to automate. But the concepts are sound. Thanks Jim!

There was also one guy that saw the same problem and actually tried to build this software, but his hardware was based on a serial port (urgh) and the software has got lost in the ether. I can't even find the link to his blog now, but you get the idea.

So, lets take a look at this in more detail...

Hardware
Other than the computer itself, the hardware consists of 2 parts. The light source and the receptor.

Light Source
In essence this is simply a pair (or more) IR LEDs connected to USB's 5v supply, dropped down to the correct voltage.

Receptor
The receptor consists of a pair (or more) of IR Phototransistors, which capture light from the LEDs. The bb passes between the two and creates a voltage spike down the wire. This is then captured via the sound card through a standard 3.5mm TRS connector. Although not yet tested, I see no reason why you couldn't use both the ring and the sleeve as separate (stereo) channels, just to make it easier to separate out the first and second spikes. Also using 2 channels means you can have up to 4 completely distinct spikes which are very easy to separate out without any overlap.

Software
The software itself is being written in C# using WinForms, just because it's a really easy language to use and there are some really nice audio libraries out there as well, such as NAudio. It listens to the 2 channels of the Mic port and when the volume is tripped over a certain level (a spike is heard) a timer is started. A timer is then stopped by the second sensor and we have the time. The distance is defined via the settings (stored as XML) and the speed is simple math!

Rate of fire can also be calculated by counting how often one of the sensors is hit.

This can be extended further to log these values, tag them as various rifles and configuration and even be used as a before and after results of work done on a rifle.

Links
Hardware 

  • [Pending] Upverter Electronics development
  • [Pending] Google Sketchup hardware assembly


Software

Tuesday, 29 November 2011

Airsoft Thermostat - Design

Background

As a user of gas blow-back replicas, many skirmishers know the annoyances of cool-down due gas expansion within the magazines.
If not, here's a quick explanation. The way a gas blowback mechanism works, is by taking a liquid propellant, typically stored in the magazine, and boiling it to convert it to a gas, to be used as a propellant and fire the bb. This boiling process is triggered by a pressure change, due to a hammer knocking a valve and releasing some of the gas.
Now the boiling process needs to get its energy from somewhere, and that is the surrounding heat. This is the very cause of cooldown. As things cool down, the internal pressure drops, gas usage increases and this leads to poor efficiency, lower power and much more gas being kicked out and wasted.
There are of course 3 ways to deal with this:
  1. Don't fire. No pressure change, no trigger, no cool-down and usually results in you either cowering a corner somewhere or being shot in the face several times.
  2. Build the pistol with enough tolerance to still function reasonably well with the effects of cool-down. This is down to the build material (e.g. plastic frames and light slides/bolts on pistols and rifles are poor conductors of heat and thus raise efficiency) however this is not possible on all replicas for various reasons.
  3. Add a control system to help battle the cooldown and keep the magazine and internal workings of the pistol at a constant temperature.
This project is mainly inspired by me being both as unsatisfied as I was experienced with methods 1 and 2, and is a good way for me to (finally) put my degree to use.

Specifications and Requirements

My plan is to design a small, scalable system, which will have the following features:
  • Powered by Lipo batteries due to their compact size, range of form factors and light weight
  • Include a built in charger and reliable under-voltage protection.
  • Automatically turn off at an adjustable temperature cutoff
  • accept additional external power sources.
  • Be applicable to pistol grips, GBBR bodies/mag-wells, magazine pouches and holsters
  • Be as energy efficient as possible
Simply put, the goal is to create a completely stand-alone thermostat-come-heater-come-lipo-charger design and stick it everywhere, where there is gas nearby.
The complexity comes with me setting the rather ambitious goal of using a Detonics replica as the pistol to house this within. It is one of the smallest pistols on the market. If I can fit this in here, it proves that it is possible pretty much anywhere. It also, like most 1911-based replicas, has a really convenient little window between the mags and the grips to attach the heating element into... but that's getting ahead of things

Elements of this device

Here is the most up to date design of the unit and below I will walk you through, from left to right, the aspects of this build

The charger

Thankfully this bit is quite easy. Thanks to mobile phones and cameras and pretty much all modern electronics having switched to li-ons, the chargers are common and cheap. Only hard bit was picking one! And I picked the MCP73831T, as it's common, cheap, easy to customise and better still, is available in loads of electronics libraries, even including Upverter. Yay!

The protection

As mentioned before, this is tricky. I have gone through several different designs for this, discarding them one by one for being too complex, too expensive or just too.. awkward. I think I have settled with a method which employs a very low reference voltage set by a 2.something Zener diode. Using the remaining 3 pins on our LM393 comparator, we compare it to the voltage of the cell, voltage-divided down to be at the same value as the zener at 3.3v. Nifty, eh? Well, not yet.
It has the potential to start vibrating on and off when the power gets low, as activating a power drain drops the voltage of a battery slightly, so we will need to add a bit of hysteresis into the mix to stop this happening. How much? Don't know yet, but enough to stop that happening.

The power source

For this project, the chosen power source is a 1s?p, 3.7v Lithium Polymer cell. Lipo's, as a power source are almost in every way superior to your typical NiMh/NiCad etc. cells. They are small, powerful and come in a load of different sizes. Great, right? As always, with great power comes with great responsibility, as this post explains in gory details. In short, they need to be charged safely, not allowed to go above 4.2v or below 3v. Fail to do any of those there and they have a chance of exploding in a rather impressive ball of fire and poisonous gas. And this thing will be pressed up against your hand.
Finding a way to tame this cell is the reason why I have struggled with this project and all the existing items are, shall we say, inadequate to put it lightly. 2.7v cutoff points are completely unacceptable. I expect to be able to use this over and over and over, not simply 'prevent an explosion'...

The heat control unit itself

The control circuit itself must serve one function: To flick the heater on when the mag is cold and off when it's hot. This can all be done electrically with an NTC Thermistor as one half of a potential divider circuit and a trim-pot as the other half, to set the cutoff temperature. Compare the two resulting voltages with an LM393 comparator and you are done :)
It has been mentioned here the a comparator only kicks out a very limited amount of current, so it may be a good idea to connect it to a mosfet's gate and use it as a signal instead. Will have to see.

Aaaand Finally. The Heater itself

Almost forgot this bit! You guys are probably interested how I will make the heat itself, which is fair enough. Well, originally I bought a couple of sets of cheap usb powered hand warming gloves, and after taking them apart, unsurprisingly, the heat source is from a set of very thin wires, called resistance wire. This will bring costs down and make the shape more easily customisable.
And that is that! I will be updating this as I go along. Once the build itself begins, a new entry will be made to cover the many issues I am sure I will bump into there. Thanks for reading! Nikolay.

Tuesday, 5 April 2011

Table of Contents

General

- Introduction
Introduction to this blog

Software Development

- Drawings that Come to Life
Development of a simple physics-based video game, developed to encourage arm movement for the purposes of post-stroke rehabilitation.

- Exploring 3D Modelling, Animation and AI with OpenSceneGraph
Using a swarm of spiders as a testbed, I create a scene which demonstrates the basic concepts of creating a scene graph, body manipulations, collision detection and explores the concept of agent-based swarms.

Hardware Development

- Exploration of HMD-based Augmented Reality
Explores various forms of sensor fusion, to create a HMD, capable of displaying large amounts of field data and improving/extending your sight, without being obtrusive or distracting.

- Home Made CNC Machine
Research and development of a scratch-built CNC machine, capable of cutting aluminium. Completion of this project with enable the start of man others.
DIY Chronograph, based on minimal hardware, reading data via a sound card port, with C# Forms based GUI.

Airsoft Development

- HK79 Grenade Launcher
Full Steel airsoft replica of the iconic German 40mm Grenade launcher, sticking as closely to the original as possible.

- Night Vision Scope
DIY IR Night vision device and exploration of PIC-Based Composite Signal Manipulation.
Development of a control circuit which would help all Gas Blowback replicas to better handle the ever-present problem of cooldown without interfering operation or blowing the mags up...

- Simple Land Mine
Development of a land mine, powered by party poppers to create a cheap, simple and safe multi-bang IED. Also messing around with 40mm grenade based solution.