Design of a Bio-Inspired Optical Compass for Education Purposes

. This study concerns the development of an optical compass inspired by the celestial compass of the desert ant Cataglyphis . This bio-inspired navigational instrument opens up new opportunities for navigation in the absence of GNSS or GSM coverage for locating outdoors. This pedagogical activity, through the design of the instrument, aims at understand different physical phenomena involved in optical heading detection: Rayleigh scattering of sunlight in the sky, polarization of light and measurement of heading from photosensors. The design and the fabrication of an experimental teaching device are both described. Experiments were performed to allow students (2nd year of master in robotics & IoT) to become familiar with bio-inspired engineering applied to optical heading detection. Students used an Arduino board (8-bit architecture) to address issues related to the real-time processing of microcontroller with limited computational capabilities. Finally, examples of measurements made by students are presented to demonstrate the pedagogical use of such an experimental device for heading measurement in robotics. Our prototype works in the blue visible light and has only 4 photosensors, each one covered with a different orientation of its polarizing filter.


Introduction
The aim of this study is to present an experimental setup to develop pedagogical activities around bio-inspired robotics.The setup relies mainly on a device, which is an optical compass that allows to measure a heading in relation to the state of polarization of the light in the sky [1].This type of compass has been recently used at the Institute of Movement Sciences (Marseille, France) on board a biomimetic robot, called AntBot [2,3], and on board a car [4], in an open source project 1,2 .AntBot was able to navigate without cartography, GNSS, GSM nor even a magnetometer in order to return to its starting point in a straight line like the desert ant Cataglyphis [5].This optical device was used with 2nd year students of master in robotics & IoT in the form of a tutored project lasting fifteen hours, where students acquired knowledge based on two scientific papers explaining two different methods of heading estimation [6,7].Then, students choose one of the two methods to work in pairs or in trinominal, and finally had to program it on board an Arduino board (8-bit architecture) to estimate the heading.A mechanical design phase was also planned during the project (3 hours of CAD design) to build a tray containing the photosensors used for heading estimation and an emitting blue LED covered with a polarizing filter playing the role of the artificial sky.

Polarized light from the sky
From a physical point of view, it is well known since Rayleigh and his work on the propagation of light in the Earth's atmosphere where there are interactions between photons and molecules in our atmosphere that lead to a linear polarization of the light from the sky in a regular and symmetrical pattern with respect to the solar meridian and whose spatial organization depends on the position of the sun in the sky [8].We therefore have on the one hand a well known and modelled physical phenomenon and on the other hand a biological principle exploiting this physical phenomenon for the measurement of the heading [8].
For navigational purposes, we know that desert ants [5], bees [8], monarch butterflies [9], and many other insects use polarized light from the sky to estimate their course, an essential component of navigation.Polarized light from the sky can be seen as vectors whose orientations (polarization angle) are distributed in concentric circles centered around the sun (Fig. 1).The orientation of each electric polarization vector (e-vector) is always defined with respect to the solar meridian.The vector pointing to the maximum polarization intensity I pmax in the sky is a vector perpendicular to the axis passing through the center of the Earth and the sun (solar vector).Thus, the polarized light from the sky is minimal when the sun is at zenith, and maximal at sunset and sunrise (Fig. 2).
Human beings are not sensitive to the polarization of light in the sky.Therefore, the sky appears uniform as shown in Fig. 1A.In this photograph of the sky, we only perceive the color gradient due to the position of the sun, here close to the horizon.On the other hand, if we observe the sky through a linearly polarized filter also known as an analyzer, we notice the presence of a sharp contrast (vertical dark line) in the sky (Fig. 1B,C).In practice, the orientation of this darker bar depends on the orientation of the polarizing filter.If the polarizing filter and the axis of the solar meridian (i.e., the semicircle passing through the sun and the zenith) are parallel (aligned), then the dark line will be perpendicular to the meridian.On the other hand, if the filter is oriented perpendicular to the meridian, then the dark line will be parallel to the solar meridian.This is due to the fact that e-vectors are always perpendicular to the solar meridian.Figure 3 shows the effect of the orientation of the linear polarizing filter on the sky light.Based on these observations, we can feel that there is a kind of straight line in the sky that could be used as a reference to orient oneself, like the Magnet North in a magnetic compass.If we place photosensors or photodiodes behind each polarizing filter, we can intuitively estimate the orientation of the solar meridian shown in Fig. 3 by measuring the distribution of light intensities, which can be modelled by the well-known Malus' law [11].This is the physical law on which our optical compass works to find its heading.

Description of the device
The device consists of a graduated turntable on which are distributed 4 photosensors, a support allowing to place 30 cm above the 4 photosensors and a blue LED simulating the polarized light coming from the sky.For this purpose, a piece of polarizing filter is placed just in front of the emitting blue LED.All the plastic parts have been laser cut (10 mm thick acrylic) and the wooden sup-Fig.2. Illustration of the distribution of polarized light in concentric circles around the sun (dotted circle).The angles φ0 (here 180 • ) and µ0 are the azimuth and the elevation of the sun, respectively.The angles φ and µ are the azimuth and the elevation of a point of the sky, respectively.The vector χ is an e-vector (see 2.1).From [8].
ports of the photosensors have been made of wood (Medium-Density Fibreboard -MDF).
We used an Arduino Leonardo board connected to a Light Sensor Grove board (shield board) for the acquisition of analog signals from each individual Light Sensor Grove.The advantage of this hardware is that it is very reliable, the software libraries are provided free of charge and the cost is very low (about e 100 in total for the components shown in Figs. 4 and 5).
In a mechanical CAD session, the students were asked after a training session with Fusion 360 software1 to make a 3D printout of a polarizing filter holder for each photosensor (Fig. 6) as well as a plate described in the next section.The main difference between a real sky and a blue source used for the educational model is its degree of polarization (a quantity used to describe the portion of an electromagnetic wave which is polarized ) does not vary over time, nor the angle of polarization, which usually changes with the position of the sun in the sky.Fig. 3. Photograph showing the more or less significant absorption of light from the sky as it passes through a bunch of linear polarizing filters.The angle equal to 45 • correspond to the angle between two adjacent polarized filters.Depending on the orientation of the linear polarizing filter, the light is more or less transmitted: the maximum transmission is obtained according to the orientation of the yellow arrow; the minimum is reached when the orientation is perpendicular to the e-vector as described by the green arrow.Credits: Colorado State University, from YouTube, Show Me Some Science!Polarization of the Sky, https://www.youtube.com/watch?v=TP5JOfrPguQ.

Heading estimation method
In the two methods described below, we neglect errors in the positioning of the polarizing filters and photosensors on the plate.However, this type of error can be taken into account in the processing as described in [7].From the two publications presented in class [6,7], we asked students to choose between the following two methods: -A distribution of two pairs (called 2-2 configuration) separated by an angle equal to 60 • assumed known by construction (Fig. 7A).-A circular distribution of the 4 photosensors with a known angle of 30 • between two adjacent light sensors (Fig. 7B).
The students also had to design two different mechanical supports according to the chosen method.The design of each support is shown in Fig. 7.The formalism associated with each method is clearly explained in [6,7].However, we can ask students to re-demonstrate it and provide the intermediate calculations.
In general, the model of the intensity delivered by a polarized photosensor is written as follows (Malus law): Fig. 4. Experimental device for learning methods of heading estimation from polarised light coming from the blue upper LED.The stage is rotated manually.The angular orientation of the compass with respect to the polarized blue light can be read directly from the graduated turn table.The photosensors can be arranged in two possible configurations (see Fig. 7).with i = 1 as shown in Fig. 7A (with ϕ 0 = 0) and i = 1, ..., 4 as shown in Fig. 7B (with ϕ 1 = 0), K i a gain to be identified by calibration, the variable I is the intensity of the source, the variable d is the degree of polarization, and the variable α i is the angle known by construction between each photosensor and ϕ the heading to be measured relative to the polarized light source.The first method (the orthogonal one 2-2, Fig. 7A) allows to discuss the usefulness of an adequate bio-inspired analog pre-processing (logarithmic division) based on the model proposed by Thomas Labhart [10].The second method (the circular one, Fig. 7B) allows students to become familiar with non-linear calibration methods such as Least Mean Squares (LMS) method.
We only introduce the algorithm of the first method to estimate an optical heading (Fig. 7A, details in [6]).To test the method, an angle ϕ 1 of 30 • can be chosen.From the signal outputs of each photosensor, logarithmic voltage values are calculated for both pairs of orthogonal photosensors: p 1 (ϕ) and p 2 (ϕ) are then linearized as follows: that gives: with ϕ o the angle between the pairs S 1 , S 2 and S 3 , S 4 (see figure 7A).
Then we can obtain the two variables y 1 (ϕ) and y 2 (ϕ) defined as follows: Then we can consider the two following vectors U and Y: Then we have: And thus, Then we can apply the following equations to obtain the optical heading ϕ and degree of polarisation d: and Thus, both the degree of polarization d and the optical heading ϕ, with respect to the reference axis (body axis) of the compass, can be calculated: However, given the nature of the expression of the equation ( 12) ( 1 2 factor and arctangent), the heading ϕ could only be determined between an interval [−45 • ; +45 • ].We can see in Fig. 8 an example of calibration performed on raw data acquired by the 4 sensors (Fig. 8A) in order to estimate the gain K i of each sensor and the real angles of the linear polarizers that were installed by hand.A non-linear LMS method (Fig. 8B) was used to estimate parameters K i and ϕ i on the basis of the Malus' law (see equation 1) for each photosensor.Results are summarized in Tab. 1.We can see in Fig. 9 an example of heading estimation programmed on board an Arduino Leonardo board, and an overview of the graphical user interface (GUI) developed by the students of the University of Toulon (Fig. 10) to better analyse their results in real time.
Table 1.Estimated gain and orientation angle of each photosensor with respect to the body axis of the device, and theoretical angles of each sensor axis.

Evaluation
The evaluation of the students was done in the form of a report as well as a 10-minute oral for the Aix-Marseille students, the final grade being in this case the average of the report and the oral.

Conclusion
We presented a new pedagogical device for implementing an optical compass based on the knowledge of the visual system of the desert ant Cataglyphis in order to train 2nd year students of master in robotics & IoTs.This experimental device allows to work on both theoretical concepts of physics and optics, but also highly highlighted points such as mechanical CAD and Arduino board programming to implement real time signal processing methods.All students were able to calibrate their own sensor and to program a method of heading estimation under the artificial light source mimicking the blue sky.Unfortunately, due to saturation of the photosensor (photoresistor) exposed to natural lighting condition, we were not able to test the principle outdoors in real conditions, so Fig. 9. Results by applying Eq. 11 to calculate the degree of polarization d and Eq. 12 to calculate the angle of polarization ϕ in comparison with the actual orientation tunable by hand.
they could see differences between controlled conditions indoors and real conditions outdoors.A major improvement of the device would be to use photodiodes coupled to logarithmic amplifiers instead of photoresistors.The signal processing algorithms can be extended to the Kalman filter and the implementation of advanced analog processing functions such as logarithmic amplification and signal division.As any robotic application, it allows a teacher to choose different focuses of studies for his/her students (3D-modelling, fabrication, programming and math methods, physics of processes).

Fig. 1 .
Fig. 1.Wide angle views of the sky.A Photograph taken without a linear polarizing filter.B,C Photographs taken with a linear polarizing filter under a clear, cloudy sky.In both cases, the filter is oriented along the solar meridian indicated here by the red dotted line in B. Credits: Nigel Howe, CC-BY.From aibolita website, Polarized Light in Nature, https://aibolita.com/eye-diseases/38640-polarized-light-in-nature.html.

Fig. 5 .
Fig. 5.The different components used to build the celestial compass.They are for the most part commercially available on shelves.(a) Arduino Leonardo, USB HID microcontroller board (e20); (b) Grove Base Shield (e5); (c) Grove Light Sensor with a peak wavelength at 540 nm, corresponding to visible green (e3 per unit); (d) Connection Wires for Arduino (e1 per unit); (e) Linear polarising filter (cut from a single sheet, e0.05/cm 2 ); (f ) Wooden supports, designed in the laboratory and made by laser cutting; (g) Filter support, designed with a CAD software (Autodesk, Fusion 360 free trial) and 3D printed.

Fig. 6 .
Fig.6.Individual photosensor composed of a Grove Light Sensor module (photoresistance on electronic card), two wooden supports, a white plastic support serving as optical insulator and support for the polarized filter placed above the photoresistance.Filters are cut precisely and glued.Only one filter is used at a time, placed according to two orthogonal directions.

Fig. 7 .
Fig. 7. Schematic representation of photosensors to illustrate the two configurations.Each light sensor is paired with a polarized filter, the orientation of which is represented by the corresponding gradient circle.(A) 2-2 orthogonal configuration ; (B) Circular pattern.Si is the intensity delivered by a polarized photosensor, ϕi is the orientation in space with respect to the body axis.

Fig. 10 .
Fig. 10.Overview of the graphical user interface (GUI) developed by the students of the University of Toulon in Python language and with the help of Tkinter, a graphical Python library.(A) The main window displays an animated compass indicating in real time both the heading and the angle of polarization (two rotations: the needle indicates the specific heading to follow, and the external crown that rotates accordingly to the angle of polarization, and allows to orientate and follow the specified heading by the needle.(B) The bottom center window is the monitor.It allows to see in real time the output responses of the 4 photosensors, as well as the current degree of polarization d and heading ϕ. (C) The settings window allows to configure the Arduino (Serial Port...), and set parameters for calibration (number of steps), monitor ect.(D) The right window allows for an easy and convenient semi-auto calibration.It goes further by computing the curve fitting and showing estimated gains Ki and angles ϕi (downloading dataset is also possible).