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.

Friday 3 June 2011

Silence and Simplicity

what could pass as some sort of advert slogan is really just my attempt to improve the treadmill.

Prof. Hans-Jürgen Dahmen, one of the main people who designed the very first rodent virtual reality system (Hölscher et.al. 2005) has given me a lot of advice and information since I started the project and I'd like to thank him at this point for that. Part of his advice was that having 8 air inlets is unwise, which, after some thought, made perfect sense. Here is why: according to Bernoulli's Principle a larger tube diameter means slower fluid/gas speed. This in turn means less noise which is beneficial as it causes less stress in the animal.

So instead of 8 inlets with an outer diameter of 6mm I now have one single inlet at the southpole with 12mm outer diameter. The surface area of a 12mm crossection is still smaller than the surface area of eight 6mm tubes, however one has to consider that wall thickness on 6mm tubes is the same as on 12mm tubes, which makes a significant difference.

Single 12mm inlet at the southpole instead of 8 inlets.

Regardless of all that though, I found out that by far the biggest source of noise is the valve which regulates air-flow from the compressor. After disconnecting the treadmill and just opening the valve I realised that the noise produced is almost deafening and for a mouse that must be the equivalent of having a jet engine blowing right into it's ear - continuously.

The company that sells the connectors and tubing also sells noise silencers but after a brief test I can say that the efficiency of these units is questionable. However, another useful tip from an engineer worked a lot better: put a generous amount of tubing between the source of the noise and the output point. In my case that is between the valve and the treadmill:
A 20m coil of 8mm tubing between the valve and the treadmill reduces noise significantly. The valve with the red handle is the main source of noise.
The result is a much quieter treadmill, here are two videos to compare the amount of noise, first the loud one:

And here the dampened one:


It's still not exactly quiet, but it certainly has taken off a lot of noise. Should this amount still be a problem I can still think of other ways to reduce the noise.Using a 12mm or 16mm inlet tube and 20 metre 'buffer tubing' of the same diameter for example would probably take noise down another notch. The ball starts turning by itself in the videos but that is purely because I haven't inserted the tube into the cup straight, it just needs some clamping down of the tube to make and keep it straight.

The single inlet at the south pole works well. Because the surface of the cross section is if anything a bit smaller than that of eight 6mm tubes there isn't much difference in terms of performance as far as I can tell. Dr. Dahmen noted that 3-4cm would probably be ideal for me and I might do that at some point should there be a need to improve this treadmill design, but for now I like the simplicity and efficiency of a single inlet.

Single inlet treadmill. Works very well and is much more efficient than the complicated 8-inlet system. I like efficiency.


With this improvement of the treadmill I hope that a mouse will have the pleasent experience of a cool summer breeze stroking its fur rather than the feeling of sitting on a jet engine.


References:
 
Hölscher, C., Schnee, A., Dahmen, H., Setia, L., & Mallot, H. A. (2005). Rats are able to navigate in virtual environments. Journal of Experimental Biology, 208(Pt 3), 561-569. Co Biol. Retrieved from http://www.ncbi.nlm.nih.gov/pubmed/15671344