BIRS Midterm Documentation

Assignment Overview

The goal of the midterm project was for us to create robotic implementations of a living organism. We had to choose an animal behavior and program our Kittenbots to mimic that behavior.

Animal Behavior

In my research, I looked at a variety of different insects because I was fascinated by their movement patterns, from ant farms to synchronous fireflies. I finally decided to model my project after termite behavior, specifically the termite ink experiment. I found it fascinating that termites communicate solely by smelling and secreting pheromones, which can be manipulated by drawing a line of ink on a surface.

Programming Process

My plan of action was to make my Kittenbot wiggle along a line, which is a seemingly simple task, but I did experience challenges along the way. I chose a simpler behavioral concept because my goal was to make sure that I have a working project, and also become comfortable with programming the Microbit, and Robotbit. 

During my first trials, my robot would not recognize the line correctly and spin around in circles instead. It also moved backwards. This confused me because I had downloaded the code online.

https://youtu.be/W_mZL39oZ88

However, I then took the time to tinker with the code on the MakeCode editor, and test it out with each change I made. This really helped me become more comfortable with programming, and understand how each component worked together. I also had to consider the track I was creating for the robot. I build my line track out of electrical tape. My first iterations had problems because I did not build a proper track. I had to make sure that the track was wide, with obtuse angles at the turning points. I also had to ensure that the entire track was on one surface, with an adequate contrast between the tape and the surface.

Final Product

Below is the finished project:

https://youtu.be/u5Bpz235uis

BIRS Midterm Research Proposal

I’ve decided to model my midterm project after the behavior of termites. A unique behavioral aspect about termites is how they communicate. A little-known fact about them is that they are blind, and so they only communicate through pheromones and vibrations (Traniello 1995). Pheromones are chemical signals that help termites recognize nest mates, a trail of food, or even the presence of danger. A fascinating experiment that has been done to see these communication methods in action, involves drawing an ink trail which the termites then follow and move around (Kershner 2018).

The video below demonstrates the experiment:

I will model my KittenBot after this by using Arduino and RobotBit to create a robot that follows a line too, as shown below:

Sources:

Traniello J.F.A., Robson S.K. (1995) Trail and Territorial Communication in Social Insects. In: Chemical Ecology of Insects 2. Springer, Boston, MA

Kershner, Ariel M., “Termite Trail-Following Behavior Elicited by Ballpoint Pen Ink” (2018). Faculty Curated Undergraduate Works. 49. 
https://scholarworks.arcadia.edu/undergrad_works/49

Lab 4: Physical Implementation of Braitenberg Vehicles

Part A

Step 1: Plan

The Braitenberg vehicle I would like to model my KittenBot after is Insecure, which is the wall follower. A brief description of this robot would be that it roams freely until it hits a wall or obstacle, upon which it would turn out and roam again until it encounters another obstacle and so on. I chose this implementation because I find it really interesting and it has noteworthy real-life applications, such as the Roomba automated vacuum cleaner. I guess I would need further understanding on how to implement the turtle motor system and program it in Python, but I’m excited to develop my skills and try it out. The first thing I would do is assemble to motors and wire them together. Then, I would have to do a lot of research and figure out how to code it in Python, which would require a lot of trial-and-error, and I would also have to conduct several tests and flash several programs into the KittenBot.

Step 2: Program

Our code can be found on GitHub:

https://github.com/bishchand/BIRS-Lab4/blob/master/InsecureRobot.py

In order to mimic the behavior of the “Insecure” Braitenberg vehicle as much as possible, we programmed it according the following rules. The program was in a continuous while loop, because the robot’s purpose was to keep moving and exploring the environment indefinitely. The robot would move forward in one direction, until the distance sensor detects an object 30mm ahead in its path. Once an object is detected 30mm away, two events follow. First, the motors stop for a few seconds, and the servos controlling the direction of the robot turn by 90 degrees.

https://youtu.be/dOH_EyowOqw

Step 3: Document

During this lab session, we set out to complete one task. It was to program our KittenBot to mimic the behavior of the Braitenberg vehicle, Insecure. We met our objective, and the end result was a robot that could explore the environment, while accurately detecting and circumventing any obstacles in its path. 

Below is a video of our robot navigating its way around the classroom.

https://youtu.be/2CwiCZqwDBw

Part B

Step 4: Draw

Step 5: Analyze

My robot’s depth perception and its tendency to steer away from obstacles mimics a biological that is present in all animals, albeit in varying degrees. That trait is instinctive behavior, or more specifically fear of harm. The robot autonomously prevents itself from crashing into the objects in its path, which could damage it. In the same way, animals have an instinct to protect themselves from harm and you would not normally see healthy living beings intentionally crashing into obstacles or putting themselves in harm’s way.

Step 6: Remix

The first successful iteration of my robot did what it was supposed to do, but did not mimic realistic movements, like an actual biological organism. The robot would move forward towards an obstacle and then almost crash into it. As soon as it encountered an obstacle, it would first stop, evaluate its surroundings, and then make a turn. Real living beings would turn away almost automatically instead. So, we removed the delays and that’s what made its turns and movements much smoother and seemingly more intuitive.

I also have conceptual ideas that are currently not within my capacity as a programmer. It would be interesting to add a tracking element to the robot, to replicate social behaviors and a child’s instinct to follow their mother. Using infrared sensors and emitters we could set up a wireless beacon for the robot to find. The idea is that as soon as the robot detects the beacon within range, by detecting the infrared signal, it will move towards finding the beacon.

Step 7: Reflection

Both readings taught two aspects of animal behavior, and the process of implementing it towards robots. The Braitenberg Creatures reading focused more on the mechanical part, and the rules that would set determine the robot’s movements and decisions. Whereas the Experiments in Synthetic Psychology reading explored the cognitive functions and inherent motivation behind such animal behaviors, that would help us further understand what we are trying to accomplish with the rules and behaviors we want our robot to demonstrate.

BIRS Lab 2: Robot Brain

Step 1: Getting Started

This was our first time working with the micro:bit. To start off, we went on the online Microsoft simulator <www.makecode.microbit.org> and downloaded the original source code. It was pretty easy to figure out, and we found the first easter egg which was a game of Snake, pretty quickly.

Step 2: Simple Sequential and Looping Displays

After familiarizing ourselves with the basics of micro:bit, we used the simulator to program a simple sequence. When we shake it to start, it displayed a message that said “Hello!” and then a flashing pattern of a box getting smaller. We came up with this sequence by playing around with the Basic and Leds sections. It was helpful to have the virtual micro:bit display because we could test out the different patterns and shapes before finalizing the code and uploading it onto our actual micro:bit.

Step 3: Programming the Brain

This part was really fun because we were able to get really creative with what loops and sequences we wanted to put together.  We decided to have a sequence of icons display when button A is pressed, and numbers displayed in a loop when button B is pressed. On the first try, we did fail, because button A worked but when button B was pressed it only displayed a 0. It turns out, we used the wrong function.

We replace the while loop with a for loop and then it worked perfectly. When button A was pressed it displayed a series of icons (heart, smiley face, person) and then stopped after one iteration. When button B was pressed, it displayed a continuous loop of the numbers 1 and 2, one after the other.

Step 4: Using the Sensors

This was a little tricky because we weren’t sure where all the sensors were on the micro:bit, but we decided to use brightness as our independent variable. When the surroundings are bright, the micro:bit would play a sound, and stop when it’s dark. This was harder to pull off because we couldn’t control the brightness in the classroom, but in the end, the code worked.

Step 5: Creating A Basic Animal Behavior System

Our initial idea was to create a game mimicking the behaviors of chickens. One of the LED dots would represent a chicken and move along the grid, one would be a fox chasing it, and one would represent corn which the chicken would move towards to eat it. However, it was difficult to achieve because the LED dots only lit up in one color, so it would be confusing to know which dot represents what. So, we changed our idea to fish behavior, inspired by a scene in Finding Nemo where the little girl shakes Nemo in a plastic bag. Basically, at the start, a fish will appear and a message saying “Hello I’m Nemo” will display. Then, if one presses button A, it will feed the fish and a heart will appear accompanied by a positive sound. However, if one shakes the micro:bit, a sad face will display accompanied with a negative sound because one should not shake fish.