While playing with my can crusher, I noticed that a can placed off center tended to be pushed out of the solenoid. A little searching of the patent literature convinced me that I had inadvertently created a very poor, single stage, coil gun. Presented below is a summary of what I have found so far.
Propellant powered guns are typically limited to muzzle velocities on the order of 2,000 meters per second. This limit is inherent to the use of expanding gas to drive the projectile down a barrel. Barrels simply can't withstand the temperatures and pressures required for higher expansion rates of the propellant combustion products (normally CO2 and NOx). One attempt at a gun for higher velocities used differential pistons (a large one, driven by methane/oxygen combustion, connected to a small one for compression of the drive gas) to provide a high pressure of hydrogen gas (hydrogen is the lightest, and hence fastest expanding, of all gasses). While some success was achieved, the apparatus was cumbersome and the velocities were still limited. For some applications, particularly orbital launching, this is insufficient (earth escape velocity is 11,200 m/s).
Two basic types of electromagnetic gun are described in the patent literature, the rail gun and the coil gun. Both use stored energy sources to produce a large magnetic field and a high electric current through a driving armature. The interaction of the current with the magnetic field generates a force which propels the armature (and any projectile connected to it). Beyond that, they differ substantially, and each has practical difficulties which has prevented them from being more than laboratory curiosities.
The coil gun operates as a linear induction motor. A series of solenoid coils are sequentially connected to sources of stored electrical energy (capacitors) generating a magnetic field which travels down the bore of the gun. The rapidly changing magnetic field induces a current in a ring shaped armature, opposite in direction to the current in the solenoids. The induced current in the armature, within the magnetic field of the solenoids, generates a force which propels the armature down the barrel.
The main problem with rail guns is the sliding electrical contact between the rails and the armature. If the armature is a solid metal conductor, the high currents involved are often sufficient to weld it to the rails. One solution to this is to use a very thin aluminum armature which vaporizes to form a plasma armature as soon as current is applied. However, the plasma tends to severely erode the rails. A second problem which can occur is arcing between the rails, which prevents the applied energy from being converted to motion.
In order for a coil gun to function at reasonable efficiency, the solenoids must be energized just as the armature exits the solenoid. Various timing and detection circuits have been described, relying on optical or inductive sensing of the armature position and fast semiconductor switches. These all become prohibitively expensive at the current levels needed to accelerate a useful payload.