The premise of a coilgun is simple: a ferromagnetic or paramagnetic projectile is attracted towards any strong magnetic field it encounters. By switching on a strong magnetic field inside a solenoid, we can attract the projectile into the coil of wire. When the projectile is inside the wire, the field is switched off and the projectile continues on the path it was following as it was sucked into the field.
This prototype has only a single stage, meaning that only a single solenoid accelerates the projectile; However, it can easily be scaled up. By placing another stage just like it in the path of the projectile, we can accelerate the projectile faster and faster. The projectile will break the laser beam for the next unit, then the magnetic field in the next solenoid will be turned on thus accelerating the projectile further.
I can achieve this multistage coilgun by placing a clear plastic barrel down the center of my solenoids, then shining the laser through the barrel.
My charging circuit, a Delon voltage doubler. |
My charging circuit is a simple Delon voltage doubler. The voltage doubler uses a 12VA transformer to convert the 120V AC from a normal US wall outlet to 24V AC. The capacitors only need to be 24V, but I happened to have 35V capacitors on hand. To protect my Arduino from any reverse bias that might be introduced by the relay coil, I include a 1N4937 diode in my design for protection.
My Arduino laser tripwire module., modified from my earlier design. |
The firing module for my prototype coilgun. |
Complete schematics for my prototype, generated with KiCad. |
int ledPort = 13; int laserPort = 12; int tripPort = 11; int notTripPort = 10; int timerToggle = 1000; int timerCount = 0; boolean timerState = false; int onLevel = -1; int offLevel = -1; int currentLevel = -1; boolean tripped = false; void setup() { pinMode(ledPort, OUTPUT); pinMode(laserPort, OUTPUT); pinMode(tripPort, OUTPUT); pinMode(notTripPort, OUTPUT); digitalWrite(tripPort, LOW); digitalWrite(notTripPort, HIGH); // Check the state of the phototransistor with the laser on // and off. digitalWrite(laserPort, LOW); delay(1000); offLevel = analogRead(A0); digitalWrite(laserPort, HIGH); delay(1000); onLevel = analogRead(A0); } // An alive signal that appears on the arduino, // just to let me know the program is running. void timer() { timerCount++; if (timerCount == timerToggle) { timerCount = 0; timerState = !(timerState); if (timerState) { digitalWrite(ledPort, HIGH); } else { digitalWrite(ledPort, LOW); } } } void loop() { delay(1); timer(); if (!(tripped)) { currentLevel = analogRead(A0); if (currentLevel < onLevel - (onLevel - offLevel) / 10) { tripped = true; digitalWrite(tripPort, HIGH); digitalWrite(notTripPort, LOW); } } } |
Source code for my coilgun, as uploaded to my Arduino Uno.
Finally, you may check the YouTube video below to see how it works!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.