Tuesday 28 June 2011

Trust thy Model (and don't be an idiot).

The 3d model of my setup has been a great help in many ways, one of which is that it is easy to see if parts collide with each other. Great care was taken that there is enough space for all individual parts, with one exception: the projector. The projector has to be mounted from the ceiling as it would induce too much vibration into the setup if we mount it on the frame. Because I have raytracing diagrams I know exactly where the projector has to go and that's where it was placed in the model. It also showed me how it wouldn't fit in where I need the projector. In the picture below you can see the model and how it predicted impending doom. Somehow I was convinced if I just ignore the problem for long enough it will go away. After trying to hold the projector in the right location it became clear that it didn't.

The model showed how the parts would collide in the real world setup. Ignoring the problem didn't make it go away. The collision looks smaller than it really is because the projector holder requires more space than in the model.

To fix this, the origin of the picture and thus the location of the projector had to be moved. Now there is a spectrum of solutions for this, ranging from clever to... the other extreme. My first attempt was clearly located somewhere close to the opposite end of clever. To re-locate the projector I introduced a second mirror that would deflect the beam away from the black frame, here is the re-calculated diagram:

You can see the mirror + mirror holder at the top.
This new mirror would do two things: lower the point of origin and change the projector angle, both together mean the projector will not collide with the frame anymore.So I happily modelled the mirror holder, ordered it from a 3D printing company, got the new mirror and put it all together. The new mirror overlapepd the convex mirror at the back, but this wasn't going to be a problem since there is no screen behind the animal.
The new construction with the new mirror overlapping the convex mirror. This however is irrelevant because that section of the convex mirror is unused.
In theory this would work, in practice however this new change meant that the projector wouldn't focus on the screen anymore. I haven't investigated exactly why but my suspicion is, because I'm using normal household mirrors which essentially consist of a glass plate and a reflective coating at the back, the light was refracted in a way that made it impossible to focus.

Only then it occured to me that if I just change the angle of the flat mirror underneath the convex mirror by a few degrees I get a much simpler (read: much better) solution that actually works. Arranging the flat mirror in a steeper angle lowers the point of origin and moves it further away from the mirror, if you look at the first figure you can see that this will clear the frame easily. With the palm of my hand across my face I (virtually) tilted the mirror by only 5 degrees and started recalculating the path of light. The result of which you can see here:

The flat mirror was angled by 5 degrees (from 23 to 28 degrees) and lowered by 1.3cm, which moves the point of origin significantly. Right is before, left is after.
The only downside of this is that the experimenter might need to duck under the projector now while placing animals and exchanging electrodes, but otherwise there are no changes to the setup.

There was one benefit of the mistake I made however, the mirror holder for the second mirror was made on a 3d-printer by an external company. The cost was low (£30) and the quality ok. I wouldn't use it for anything that needs to be precise or clean, but it's ideal if you need something with an odd custom shape. Should I ever have similar requirements I know now where to go.

The next step is to set all of this up in the real world. The difficulty here is arranging all the parts correctly and at the right distances/angles from each other. With all the odd shapes it is difficult to use rulers, tape measures and spirit levels (I've actually got a digital one that gives me a angle readout). Further, getting the projector mount into the right location won't be easy either (how do you mark a point mid-air?). Once all that is done however I'll finally be able to test my virtual reality which I'm programming on the side right now.

Construction Notes

Calculating the requirements for the second mirror wasn't a great effort since the law of reflection is very simple. The centre line (red in the above pictures) was my starting point. I cut it at an arbitrary point somewhere in the top third and dragged the point of origin to a more suitable location. Based on the new angle I calculated the angle of the new mirror and did the raytracing for the entire cone (yellow lines).

The dimensions of the new mirror were calculated by constructing the light cone (see article Aperture Science) and intersecting it at the level of the mirror. This gave me the ellipse that needs to be deflected onto the round mirror underneath the convex mirror. Below you can see that process. What I didn't take into consideration at this point is that the reflective coating of the mirror is at the back, which A) alters the distance from the point of origin and B) refraction of the light changes the angle of the incident ray and therefore also the ray of the reflected ray. All this however was inconsqeuential due to the fact that the projector wouldn't focus on the screen anymore, which I think is too due to effects refraction. I haven't tested that suspicion though as my subsequent solution of changing the angle of the round mirror made the newly introduced mirror redundant.

Calculating the mirror dimensions. The pink triangel is the light cone, and the green lines represent the ellipse and the mirror dimensions respectively. The ellipse is very long and narrow due to the extrem angle at which the mirror is intersecting the cone.

Modelling the mirror holder was straightforward and it was very easy to order the part from the 3d printing company (3D Creations Lab) since all I had to do was upload the 3D model of the part on their website. The key requirement of the holder is to hold the mirror at the correct angle. The holes at the front are there to reduce the amount of 3D printing material, which lowers the overall cost. I used simple double-sided tape to put the parts together.

Model and reality.

Below is another view, holding the camera to the new point of origin. The calculations seem to be correct, from that point of view I can cleary see all of the round mirror, the convex mirror and all of the screen. However, it was difficult to focus the camera.

Placing the camera at the point of origin showed that the calculations were right, but focussing was difficult.

After I decided to abandon the new mirror in favour of the simpler solution mentioned earlier, I removed the mirror holder and mirror and everything was back to normal.

1 comment: