Summer 2016 CERN internship.

During the summer of 2016 I had a two week internship at CERN. During those two weeks I improved a model accelerator (pictures and a video below). The model accelerator worked by having a steel ball run through two plastic tubes. At one point along these plastic tubes there is an electromagnet. When the ball enters the magnet, it passes over a light sensor which turns on the coil. When the ball reaches the center of the coil the magnet switches off. However, since the coil is high powered, to turn it on there is a capacitor bank which is being charged by a 30v power supply. When the ball passes through the coil, the capacitors release a pulse that powers the magnet. There is also a 5v power supply to power the rest of the electronics.
During the first week I worked on the current accelerator mostly on the software side.  First, I familiarized myself with the code and improved its previously sub-par documentation.
I noticed that when I turned the accelerator on, sometimes it did not fire, and therefore failed to accelerate the ball. This happened roughly 1 in 10 times the ball passed through the magnet. After a closer inspection of the code, I determined that the code was simply not running fast enough to always detect the ball. To fix this issue I moved some of the nonessential parts of the code to a separate loop, which ran only every 100ms instead of as fast as possible. This allowed the main loop to run significantly faster (about every 0.8ms) and consequently improved the miss rate, so it only missed about 1 in every 200 runs.
Next I began to look at the hardware more closely. The accelerator was made of two plastic tubes, and one of the joints between these tubes was causing the ball to slow down significantly. To fix this I replaced the old, fixed joint with an adjustable one. To adjust the joint you simply turned a screw which can move the tube in and out. (pictures below). This greatly improved the efficiency of this joint.
Then we realized that sometimes when you turn on the machine, it was consuming up to 4 amps on the 30v supply. This happened when the 5v supply was not on, so I added a lead into the USB controller to check if the 5v was on, and display its status in the software.
During week two I modified the hardware and software to run on a NI  myRIO FPGA. The myRIO is basically a much more advanced version of an arduino. The main advantage of a myRIO is that it lets the accelerator run without a computer connected to it. This required me to entirely rewrite the software as well as making some small hardware improvements.

The internship was a great experience. During these two weeks I learned LabVIEW, as well as found creative solutions to the many problems that arose. Special thanks to Adriaan Rijllart for being my mentor during this internship. 
The Accelerator

For more pictures and videos go to