Thursday, 7 March 2013

Initial Prototyping - Day 6 and why i'm an idiot.

[This post is a bit of a rant and doesn't tell you much so feel free to skip it!]

Okay, so all my work was meant to be done in 5 days (a working week); that was the plan. But as expected, things never go as smoothly as you want them too, and although I had two optics and a lens mount made and ready to test, there was something severely bugging me.

On day 4, Thursday, I designed and made an ASPH plano-convex lens using the equations i'd skimmed off of a Korean University paper on ASPH lens design through numerical analysis. All went well so I thought, and having run the program on the CNC and buffed the lens to a near perfect finish I honestly expected to put it upto the camera and see everything looking crystal clear through it.



It did not. Hmm. Testing is a process of confirming what you think through the manufacturing of simple prototypes. I thought the lens would render an image free of spherical abberations, but when I held the optic upto the camera (without the mount as this was on Thursday evening. What can I say, i'm a little impatient?) it rendered bugger all. It was just a blur of colour! Usually I expect to see something maybe slightly out compared to what I expect, but this optic was just rendering nothing, you couldn't make out the scene. It was no where near correct, and that pissed me off. I had to know why, and fast because I only had limited time in the UK and if I needed to change the design and re-run it, I had very little time to do it!

So over Thursday evening, Friday during breaks, the weekend and finally Monday morning, I stared and thought and questioned why the damn lens didn't work. Job number one was simple. I expected it to render an image at around 50mm from the image plane (therefore a 50mm focal length as designed). If it didn't then the logical thing to do was find out what the actual focal length was. So I did the usual test, using a bright light (a window) at effectively infinity (meh 10m will do) projecting through the lens onto a piece of paper, and moving the optic further away until the projected image was focused. Result? Well firstly let me say it didn't focus properly, the closest thing to being in focus was a total mess, HOWEVER I could determine that the optimum focal distance was in the region of 120mm. That's a HUGE error. That's nearly a 150% error margin! Bad news indeed, this was obviously not going to be an easy fix.

So there are only a few things that can go wrong here. The focal length is totally off, so looking at the equations, something isn't right. The focal length is defined by me, that can't be wrong, it's the base variable. The refractive index of PMMA was taken from an internet database, the lens profile was driven by the formula, and the formula was processed by me. Wheres the weak link? It must be me! So off to the physics department I went, armed with all my calculations. After talking for half an hour we concluded that I, infact, got my numbers spot on (bit surprising, it would have been a lot easier if i'd just gotten it wrong!). So presuming the formula was correct (which you'd expect given the paper was published), the problem must be the RI. Maybe the numbers on the internet were wrong? OR maybe because I was using material I hadn't bought, it may not have been the material I thought it was... After all, if you look through clear PMMA and clear polycarbonate, who's going to tell the difference?

So with a flight back to France on Tuesday lunch time, I found myself returning unexpectedly to school again on Monday morning to find myself back in a GCSE science class with a block of polished material measuring the refractive index manually using a sodium d-line light. The process is simple, if not a little crude for my liking. Fire a line of light through an angled block of material with a polished front face, and mark where the light enters and exits. Measure the angles of the line at the start and end compared to the normals, plug it into the equation, and repeat with the block at a new angle. Do that 15 times and you can plot a graph to give you a mean average of the RI of the said material.



The number we got out was 1.4891 about 0.1 different to the numbers I had used to make the ASPH lens. Could that be enough to make such a huge difference?! Well it had to be, everything else had been checked. Was it a different material to PMMA? No. Polycarb has a totally different RI in the mid 1.50's. Looking back at the internet database I got my numbers from initially, I found out that the numbers were infact very similar if I adjusted the light wavelength to the sodium-d line (the RI changes slightly depending on the wavelength of light). Could the small difference in numbers I used be enough to throw the entire ASPH formula? Well I didn't have a clue but I had half a day left so it made sense to plug the numbers in again and redesign the lens, re-cut it, and see if it works.

Excel, full formula processing with 1 degree angle increments, transferred into mapping on SolidWorks, exported DXF, loaded onto the CNC.



And that's pretty much when it struck me. If anyone's still reading this, here's a life lesson from me. Don't over work yourself, you'll make mistakes! Making mistakes in fine and a part of life, but on a tight schedule it sometime just isn't an option. I realised mine just in the nick of time. In the end the error wasn't the RI, not the formula, not the calculations, not the material or the machine, it was ME! On Thursday I miss named the GCODE file that is generated when you import a DXF into the CNC machines system. In the end, the reason the lens was so badly out, was because it wasn't even the lens I thought it was; I clicked the wrong file and ran the wrong program. In the end, I had an exact half  of the the first lens I made first (the 50mm non ASPH one). Absolutely  fucking, useless. It didn't render an image, because it wasn't even a proper lens!

So at the end of my final day available to work, I hit run on the CORRECT program and now I have an accurate working ASPH lens.