Shadow surprise in CSV

Recently I was asked to do the CSV for a comparator. Somebody explained the device to me in roughly these words:

Look, this is a very simple device. You place a couple of (medical) screw, which all should be equal, on a supporting plate. Then you simply press a button, a camera takes a picture, the picture is analyzed and the result is displayed, showing which screws are equal and which are different. The system is supposed to replace a manual process, in which an operator takes each single screw in his fingers, measures with a caliper the critical features of the screw and verifies that they all are within defined tolerances. This is a slow but quite stressful job requiring high attention and quickly causing fatigue. It therefore is error prone. And lot mix-ups are exactly what we do not want at all.

My intuition kind of raised the alarm bell and told me this beast is everything else than simple. And validating it will be a challenge. Not a huge one, but a challenge. When I expressed my concerns, I was told, come and see it in action. It´s really simple.

After having made an appointment I drove there. The father of the system, the Subject Matter Expert, who designed it and developed the software, gave the demonstration.

The system looks a bit like a scanner. It’s a relatively flat rectangular box in portrait mode with a flat screen. Below the flat screen is a single button with a tiny green LED. At the opposite end it has kind of a gibbet with a hidden camera above the upper part of the flat screen. After starting up the system by a single push of the button (when the PC is shutdown) the PC started up, Windows 7 logo was briefly displayed, the application started automatically.

After full application start a white rectangular frame was shown directly below the camera in the upper area of the flat screen. In the lower area, a large green rectangle was shown with a large figure 0, to the right a dash and the word “Good” and underneath another dash and the word “Bad”. This tells us the system found zero screws, nothing is good, nothing is bad in terms of screws. The demonstrator then placed a couple of screws on a supporting plate (plexiglass) slightly above the white rectangular frame. He pointed out that the screw in the upper left hand corner of the inspection area (the white rectangular frame, which actually is the field of view of the camera) is considered the reference screw. This screw must be known to be within defined tolerances for all critical screw features screw length, screw (head) diameter, thread pitch and thread diameter. Therefore, it has been manually measured with a caliper. He then pressed briefly the button again, the screen turned black for a moment, flashed up white for a very short moment and a few seconds later the lower part of screen was again shown in green, the figure 15 was shown, “15 Good” and below “- Bad”.

Underneath each screw a green rectangular covering the screw from below was shown. He then added a few more screws and pressed the button again. Same procedure as above. At the end the lower part of the screen was shown in red, the figure 28 was shown, “25 Good” and below “3 Bad”. 25 screws were marked with a green underlying rectangle and three with a red one. He then explained: the three screws with a red underlying rectangle are bad screws, they violate at least one the tolerance ranges for the critical features. He then removed these three screws, put them in the discard basket and pressed the button again. Shortly after the result showed 25, “25 Good”, “- Bad”. Now you take all screws except the reference screw away and put them in the basket for the good screws. Then you place the next group of screws in the inspection area and start over with the process. This is very simple and very fast and absolutely reliable.

Yes, it is true, for the operator the system is as simple and intuitive as it can be. And yes, it is smart, it is very smart. There must be a lot of logic and brilliant ideas behind it. To me it looks genius.

For writing up all the various CSV documents I dug deeper into this matter. There were long interview sessions with the SME during which I asked endless questions and got explanations over explanations. For him it must have been boring, for me it was just fun.

What a mindful observer can deduct from carefully watching the process is the following: The camera takes a picture of screw shadows on a flat surface (the flat screen) thrown by a bright light in the optical center of the camera. It is one single (almost) black and white image of screw shadows, which constitutes the basis for everything here. Now, we know that there are screws, i.e. almost perfectly rotationally symmetric objects, which throw the shadows. Everything of the screw except the thread is perfectly rotational symmetric. The thread needs a 360 degree turn to come back into its previous position, but still it is kind of rather symmetric. Furthermore, these screws have a flat surface on the top, which is rectangular to the screw axis. The screws can be stably placed on that top surface. We furthermore know the entire geometry of the system, such as the location of the camera over the field of view, the distance of supporting plate over the flat screen and so forth. These ingredients with the right math (geometry in three dimensional Euclidian space and plenty of vector and other calculations) lead finally to calculated features for the screws.

I´m glad that it took me a while to reach a decent level of understanding for all of this, because it proofs that my intuition regarding the complexity of the system was right. Bringing all this in readable form to paper is a decent pile of work. I enjoy it a lot because again I learn a lot and kind of feel home with my original profession. What is life without decent math? Let me know!

written by Otto Salecker

Dominated by the logic of mathematics, driven by passion, fascinated by the unknown and emotion, equipped with tons of experience, gone through many fires, always…

Find out more about this person