Tuesday, January 20, 2009

Next sensor idea

The next idea was to array them just facing to the right.  That means we wouldn't be able to switch walls to follow, but at this point following A wall is more important.  In order for the software to be able to correctly calculate the angle the wall is at, it needs to know precisely what angle the sensor is mounted at.  So I put in a lot more work machining a precision mount that put the sensors at exactly the angles I wanted.  Unfortunately, that also did not work at all.  The wires got in the way, the mill couldn't hold the part and still cut the angles.  Basically it was a lot of work for something that ended up failing completely.

It was then that I realized that I didn't need to know the angles beforehand, I only needed to be able to figure them out later.  So I took a simple piece of PVC pipe and eyeballed the mounts, generally at 0, 23, 45, 66, and 90 degrees.  After that it was a simple matter of putting a wall at exactly 90 degrees, then viewing the sensor data which let me calculate the triangle which gave me the angle the sensor was at!

Fortunately the code I had written to debug the previous two sensor ideas was robust, and it was a simple matter to change the angles the sensors were displaying at.  That verified that the angle displayed on screen was the same angle the wall was at.

No comments: