A Design of Bump Sensor Mechanism for Robotic Fish

Aims: This work aims at finding out the effectiveness of a commercial micro-switch as the base component for building bump sensor for a design of a robotic fish. Methodology: A pair of micro switch (the type commonly used in computer mouse and similar devices) were assembled between the robot fish tip (actually a cone with the Mackerel fish profile) and the body, such that when the robot collides with a hard object, the switches will be depressed thus sending signal to its controller. The void between the switches were filled with collapsed polyurethane foam. The switches contact are continuously poled and the side that closes first is the side the robot is steered away from. False signals due to mechanical contact bounce was suppressed via software switch debounce algorithm. Test was focused on the debounce algorithm and the load to activate the switches. Furthermore, a modified IFD (compressive tests) on 1cm 3 foam sample was perfomed. Results: A spectrum analyzer sampling of the undebouncce switches signal indicates the natural frequency of the vibration to be approximately 8.5kHz. Thus the controller will be sampling the switches contact at about 941.18 per second when operating at the design 8MIP (million instruction per second). The activation load test indicates that the minimum load to activate the left switch (3.42N) is less than that of the right (5.50N). The modified IFD test indicates that the force to Original Research Article Afolayan et al.; BJAST, 5(6): 568-579, 2015; Article no.BJAST.2015.055 569 compress the collapsed polyurethane foam by 50% is between 0.32N to 0.41N. A field test on the robot shows the robot respond well to the switch input as designed. Conclusion: The bump sensor as used in this research performed as expected despite the problems associated with mechanical switches. The limiting factor to this design as implemented is the minimum speed to activate the switches. The hydrodynamic drag force (0.00128N) is much less than the 5.86N force required to activate the sensor at the calculated minimum speed of 0.096 m/s. The force required to activate the switches is high due to the water proof coating used for them. The idea of the minimum speed to activate the bump switch is to ensure a fail safe operation when deployed. This design can be used for dark cave and also for cloudy water and where so much debris exists. It can also be used to augment other navigational techniques.


INTRODUCTION
Biological fishes and underwater creatures use a variety of methods to navigate and avoid obstacles. Notably, they use their eyes, tentacles/whisker (Octopus vulgularis and catfish), sonar (dolphin), lateral lines, electric field (e.g. catfish, platypus) [1,2,3], Black ghost knifefish (Apteronotus albifrons) [4]. In underwater vehicles, many researchers have focused on the use of sonar system augmented with inertial guidance's system like gyroscope, example is the work of Robert et al. [5]. The other method that is receiving attentions is the use of lateral lines to perform the sensing by adapting different hydrodynamic force sensing methodology [6,7,8,9]. The use of tentacle is being adapted for close range navigation. Some researchers like Solberg et al. [3] focuses their attention on electric field based navigation while others like Junaed et al. [10] worked on vision based navigational methodology.
In robotics, sonar systems are often used for ranging due to their low cost and small size [11]. The signal is sent out continuously or pulsed. The pulsed mode is used for eliminating frequent misreading caused by crosstalk or external sources operating nearby [12]. Sonar systems have been very attractive for underwater imagery being capable of longer range and are not affected by mucky or muddy water [13,14]. High power ultrasonic systems have been known to negatively affect underwater ecosystem [15]. Also very powerful Low frequency and activated sonar (and mid-frequency sonar) have been claimed to also affect marine life [16].
According to Fernandez [8], the fish lateral line is a versatile short-range sensor organ. The lateral line was said to be used for "mapping environments [17], identifying objects [18,19], tracking prey [6,7] and conserving energy while swimming in wakes" [20]. Various devices are being adapted to act as artificial neuromast -the main sensing organ in the lateral line. MEMS (microelectromechanical system) technology have being used for artificial lateral line [21,22], while another researcher used hot-wire anemometry [4]. Strain gauges, piezo-resistive, and piezo-electric sensors have being tried also [23].
According to Solberg et al. [3], object location using weak electric fields by some aquatic creatures are almost a century old. Also "the principle of biological active electrolocation is that objects that differ in impedance from the surrounding medium distort the self-generated field, and arrays of sensors (electroreceptors) on the body detect these distortions." [3] Other researchers [1,4,24] indicated that changes as small as 0.1% can be sensed. To imitate this biological navigation methodology, Solberg et al. [3] installed ordinary electric conductor on their test robot and perform object detection in fresh and salt water in a pre mapped environment.
This work aims at finding out the effectiveness of a commercial micro-switch as the base component for building bump sensor for a design of a robotic fish. Cheaper and distributed but dependable robots have being hyped by the like of brooks and flynn [25] as the next direction in robotic research. This is more so when the goal is to build swam robots or community of robots.
This article is further divided into the following sections; Materials and methodology used, the results obtained, discussion of the results, conclusions and recommendations. In the materials and method section, a description of the bump sensor is given and the potential problem with the design discussed immediately after it. The debounce problem associated with mechanical switches is then focused on in terms of the software solution, experimental tests and an experiment with a robotic fish in which the design was implemented. The effect of padding with collapsed foam and insulation with silicone (as implemented in the robotic fish) was documented and discussed.

Description of the Bump Sensor
The bump sensor presented here uses a pair of micro-switches (Fig. 1a), soldered to a PCB board (1cm by 4cm) and placed on each side of the haul of a robotic fish (Fig. 1b). Thereafter, collapsed polyurethane foam is used for filling the spaces between them and to level up the assembly (Fig. 2a). The switches were then water proofed with automotive gasket seal silicone. The switch tip area ( Fig. 2b) was filed down so as to reduce resistance to pressing when in operation. A nose cone is then attached to the haul as shown in Fig. 3. The switches were connected to a PIC18F4520 microcontroller using 3 cables. When there is collision with an object that cannot be detected by other means, the switches are closed and the rate of closure is measured by the microcontroller, this it use for determining whether to turn the robot to the left or right.

Potential Problems with the Design
There are two potential problems with this design; One is mechanical bouncing. The bump sensors are plain mechanical switches, therefore, there will be bouncing of their contact (the click noise). To the microcontroller running at 32MHz (or 8MIP for Microchip microcontrollers used for this work), a single click can be interpreted to mean millions of inputs. There is thus a need for debouncing, either in code or by introducing a damping device. The second option will make the assembly to be more bulky and perhaps unreliable. The other problem is uneven load between the two switches and the urethane backing such that a direct end on collision with obstacle may be misinterpreted as lopsided collusion.  Obstacle detection and avoidance pseudo code for Microchip PIC18F4520 In determining the parameters (such as timing) to be used for the code in the debounce algorithm, a test is needed to be carried out on the switches so as to get parameters like resonant frequency and frequency spectrum of the bouncing action using spectrum analyzer. Also, there is need to know by how much the switch and the collapsed polyurethane foam will skew signal received simultaneously by performing activation load test.

The Switch Debounce Test
This test involves using a condenser microphone to capture the sound (the click) output of the micro-switch when depressed. The frequency spectrum and time series value were captured by the TFD scope 2.0 spectrum analyzer and oscilloscope.

The Activation Load Test
The activation load test involved finding out the minimum force to actually cause a response (or to close the switch). The lower the force is, the likelihood of the switch closing when the robot hits an object especially at slow speed. The micro switch requires a minimum of 0.015N to depress according to the manufacturer [26]. Equipment for the switch debounce test includes CAMRY® load cell with digital output and 1cm 3 sample of the collapsed polyurethane foam used in between the haul and the cone. Using Fig. 5, the test was performed by depressing the nose cone on one side with the load cell below it until a click of the micro switch is heard. The load cell reading was then taken; both micro switches were tested 5 times to get an average reading.
Five samples of 1cm 3 polyurethane foams were also subjected to a compressive test by putting them on the CAMRY® load cell and depressed to 50% of its original height. The compressive test was performed for each side of the 1 cm 3 foam sample. This is a modification to Polyurethane Foam Association standard [27]. Polyurethane Foam Association uses IFD (Indentation Force Deflection) table which is defined as the amount of force, in pounds, required to indent a fifty square inch, round indentor foot into a predefined foam specimen a certain percentage of the specimen's total thickness. This modification allows the resistive force to compression to be determined.

Experimental Verification
To verify the debounce coding scheme cum obstacle detection algorithm, the following equipments were used; Microchip MPLAB IDE (integrated development environment), Microchip PICkit 2 (as debugger), TFD Scope 2.0 (as spectrum analyzer and oscilloscope). The MPLAB IDE was started and switched to debug mode. Then, the PICkit 2 was connected to the microcontroller and the computer hosting the MPLAB IDE. The nose cone of the robot was pressed slowly and then fast to see if the program execution will branch appropriately. Head on collision was simulated by pressing the cone at the tip firmly. The program branching were observed throughout. Also a field test was performed on the robot with the sensor mounted as shown in Figs. 1, 2 and 3. The robot was made to swim in a small water tank (60.96cm x 121.92cm x 60.96cm wooden box) filled with water to a depth of 30cm or pressure head of 2.91kPa (Fig. 6). A digital camera -Sony Cybershot digital camera (model DSC-S730) was set to VGA mode for recording the movements of the robot as it swims.

The Switch Debounce Test Result
The undebounced micro switch signal output is shown in Fig. 7, while Fig. 8 shows the spectrum analyzer output of the micro switch.

Switch Activation Load Test Result
The force to cause each button to be activated is shown in Fig. 9. Furthermore, Table 1 shows the mean and standard deviation of the minimum force to activate the left and right micro-switches.

Foam Compressive Test Result
The result of the modified IFD test (compressive tests) on five samples of the 1 cm 3 collapsed polyurethane foams is shown in Table 2 and Fig. 10.

Results of Experimental Verification
It was observed that the code branched as designed, for example, pressing the left switch causes code for left turn to be executed. Field test result is shown as sequence of still images of the robot (Fig. 11) making turn as it bumps into the wall of the pool.

The Switch Debounce Test
This test aimed at removing false signal input to the microcontroller due to switch contact bounce. From the spectrum analyzer display (Fig. 8), the switch bounce frequency is at 8.5khz approximately. From this information we can deduce the number of inputs to the microcontroller as where Microcontroller MIP = 8,000,000 (32MHz clock was used for this work) Therefore, the number of inputs to the microcontroller is 8,000,000/8,500 = 941.18 inputs per second, that is, one click of the switch will generate ≈ 941 inputs. In periodic notation, this is equal to T = 1/941.18 = 0.0010625 s= 1,062.5µs The microcontroller as designed will execute one instruction in 0.125µs, it implies that it will always have to wait or idle for T / 0.125 instructions before deciding whether the switch contact was closed or opened and is given as 1,062.5µs /0.125µs = 8,500 instructions Or (0x100)*(0x21) in hexadecimal notations.
Thus a delay or counting period must be set to 1,062.5µs or 8,500 instructions before deciding on if the switch was activated or not. In the debounce routine, the measurement is done 5 times with the delay set to the above value. Every 0.5s, the measurement is repeated.

Activation Load Test
From Table 1 and Fig. 8, the right button is stiffer, requiring 5.86N on average to activate it. This value is about 35% higher than the left button average activation force. From Table 2 and Fig. 9 it can be seen that the force to cause 50% compression ranges between 0.24N to 0.48N with the mean varying between 0.32 to 0.41. The standard deviation for three samples is 0.5 meaning the other two are skewed perhaps due to assembly errors -such as the glue entering into the foam pores. According to the manufacturer datasheet, 0.015N is required to activate the micro switches. The 0.32N to 0.41N require for the foam is 21 to 27 times additional load required to depress the micro switch. Therefore, the actual force required to activate the switch is These high values (compared to 0.015N by the manufacturer of the micro switches) are due to the water proof coating with silicone and due to assembly errors -such as the glue entering into the foam pores.
The question that arises is that, at what minimum speed should the robotic fish be moving so as to activate the bump switches. If we work by the right bump switch that requires maximum force to depress it i.e. 5.86N and hydrodynamic forces are ignored, then from Newton's second law of motion, impulse is defined as

F.t = mv 1 -mv 2
Where F is force acting, t is period of action, m is mass of the body, v 1 is final velocity after impact and v 2 is initial velocity before impact. Also, the minimum speed will be just enough to bring the robot to a standstill, that is v 1 = 0.
If m = mass of the robot = 592g and F = the total force required to depress the switch = 5. This is the minimum speed to activate the microswitches upon impact with an obstacle without hydrodynamic forces involved. Now, fish swimming inside water will experience hydrodynamic forces D v . The D v will be additional load the fish robot had to overcome in other to successfully depress the switch upon impact with an object. If we assume the fish is coasting, that is, no waging of tail, just sliding, then the standard drag equation (1) can be applied.
V is the fish forward speed and ρ is water density (1000kg/m 3 ), Cd is the drag coefficient which depends on the Reynolds number and is given as Cd = 1.328Re -0.5 + 0.074Re -0. 2 (2) Thus, Cd is the sum of laminar and turbulent components of the coefficient of drag derived from Reynolds number (Re) [28,29]. υ is the water kinematic viscosity (1.12 mm 2 /s) and L T is the robot length (0.394m),see Fig. 12.
Sa is the frontal area with which it impact the water with. The maximum cross-section is used in this work. Thus, Sa = π.a.b = π * 0.0584m* 0.0915m = 0.017m 2 where a and b are the minor and major axes of the maximum section of the robot fish as indicated in Fig. 12.
Since v 2 = 0.096m/s is the minimum speed to activate the micro-switches upon impact with an obstacle without hydrodynamic forces, then it must have also overcome the hydrodynamic forces D v in other to maintain this minimum speed. Thus V (the forward speed of the fish) will determine the D v experienced and is equal to v 2 or 0.096m/s. So from equation 1, 2 and 3 we have

CONCLUSION
The bump sensor as used in this work performed as expected despite the problems associated with mechanical switches. The limiting factor to this design as implemented is the minimum speed to activate the switches. The hydrodynamic drag force (0.00128N) is much less than the 5.86N force required to activate the sensor at the calculated minimum speed of 0.096 m/s. The idea of the minimum speed to activate the bump switch is to ensure a fail safe operation when deployed. This design can be used for dark cave and also for cloudy water and where so much debris exists. It can also be used to augment other navigational techniques.

RECOMMENDATION
The design/implementation in this work requires that the robot collide with a moderately solid object, the micro-switches can be modified into whisker as in fresh water catfish or tentacles so as to increase the impact range. A much more computational mechanism for decision making will ultimately be required for such design than the one presented in this work.