05/07/2018 at 10:04 •
To check the approach, I wrote a small program that performs the calculations and detected a serious problem with my approach.
While the IR sensor scans the area, the program cannot differentiate between the three transmitters. This means that Transmitter 1, 2 and 3 might be found in that sequence, but also in the sequence 2, 3, 1 or 3, 1, 2 as can be seen in the picture below.
Luckily not all angles result in valid robotpositions; the angle between transmitter 1 and 2 cannot be smaller than 45 degrees and it cannot be larger than 180 degrees. The same for the angle between transmitter 2 and 3, and the angle between transmitter 3 and 1 must be 360 - Angle1 - Angle2, and can never be smaller than 90 or larger than 270 degrees.
Alas, quite a lot of combinations prove to result in valid robot positions..
As an example, suppose the first angle the module finds is 108 degrees, the second angle is 135 and the third angle is 117. This would result in a robot position at (15,23).
If the angles were found in the sequence Angle2, Angle3, Angle1 however, the sequence would become 135, 117 and 108, which would result in a position of (15,12). The same holds for the sequence 117, 108 and 135 which would position the robot at (30,27).
A couple of solutions for this problem can be used, but I still have to decide what would be the most promising.....
I am thinking of using a magnetometer to find the orientation of the robot, or any trick that ensures the scanning always starts at IR transmitter 1.
Not sure yet....
05/03/2018 at 12:37 •
The first thing to do is to find/develop/build a rotating IR sensor. As I want to have a frequent update of the position of my robot, I prefer to have a sensor that continuously rotates, and not a system that scans 360 degrees, then turns 360 degrees the other direction and starts all over again, which should be necessary due to the twisting of the cables. I could not find an easy, affordable rotating connector, so I had to find another solution.
One approach could be a 180 degrees video camera connected to a Raspberry Pi, and using some qiute complicated image analysis finding the IR emitters and calculate the angle between them. This can be done, but has the drawback of being complex, energy consuming and relatively expensive.
For this reason I designed an IR sensor that is facing upwards towards a rotating mirror that is under an angle of 45 degrees. A modified servo is used to rotate the mirror.
In this way the sensor has an undisturbed view over the surrounding area, undisturbed by cables etcetera.
During one rotation of the mirror the sensor should "see" my three IR emitters, and based on time differences the angle between them can be calculated.