Autonomous Robot Part 2 – Ella and Chase

Group Members: Becca Epstein, Becca Wolfinger, Zade Delgros

Roles: Becca Epstein as Tutor, Becca Wolfinger as Scribe/Integrator, Zade Delgros as Designer

Introduction

We have created two autonomous robots that share a common pivot to which they are constrained. They rotate about this central point and are therefore forced to come into contact with one another. When they get close to one another, each robot reacts in a different way. One will completely stop and then start to chase the other. When the other robot gets too close to its counterpart, it lashes in the other direction. These behaviors get interesting when a robot runs away from the other, it eventually runs back into it since they are both constrained around this central pivot.

Why We Did This

It would have been easy to have both robots controlled from the same micro controller. We decided not to take this short cut because we wanted each robot to have its own autonomy. We chose compact circuity and housing so that all of the electronic components could fit on the narrow arm of each robot. The clear acrylic bodies of the robots lets us observe the autonomy and independence of the two robots. As such, we programmed each robot’s “brain” (Arduino Nano) with different speed, acceleration, and response parameters. These parameters serve as personality traits for the robots’ behavior. Their current behavioral goal is to not come into direct contact with one another. Each robot has its own way of achieving this goal. What makes it interesting is the fact that they are frequently forced to come into contact, which perpetuates the cycle but in a way that is slightly different each time they come into close contact.

Moving Forward

For the next iteration of this project, we want to get a little more out of the behavior. We want to reconsider the “goals” we are programming into each robot. Right now they’re desperately trying not to run into each other but maybe one of the robots wants to bump into the other from time to time. Maybe we want them to have different goals. One robot could be trying to catch some moving target that is independent of its robot counterpart. Maybe their personalities can be variable based on stimuli we give them beyond just each other. Maybe we could control them with music or light or physical obstacles. We will continue to brainstorm ideas and explore different behaviors until we find something more interesting to do.

Video

Technical Notes

Our circuit consisted of an arduino nano, a drv883 h-bridge, a motor, a proximity sensor, an n-chan mosfet, a switch, and a 9-volt battery. The switch and 9-volt battery powered the entirety of the circuit, and the mosfet stepped the battery down to a useable 5-volts. The proximity sensor was connected to analog pin 2 to send the arduino specific distances. The arduino was connected by pins 5 and 6 to the h-bridge to send logic to the motor to have it switch directions when the proximity sensor gave values after a specific threshold.

Photos

Autonomous Robot: Part Two - Top View

Autonomous Robot: Part Two – Top View

Autonomous Robot: Part Two - In motion shot

Autonomous Robot: Part Two – In motion shot

Autonomous Robot: Part Two - In motion shot continued

Autonomous Robot: Part Two – In motion shot continued

Autonomous Robot: Part Two - detail shot

Autonomous Robot: Part Two – detail shot

Autonomous Robot: Part Two - side view of chaser

Autonomous Robot: Part Two – side view of chaser

Autonomous Robot: Part Two - Close up of pivot structure

Autonomous Robot: Part Two – Close up of pivot structure

Autonomous Robot - Fritzing Circuit

Autonomous Robot – Fritzing Circuit

Code

A sample of our code. Some of the numbers were tweaked in order to have the cars demonstrate different behavior.

#define MOTOR1A 5
#define MOTOR1B 6
#include

DistanceGP2Y0A21YK Dist;
int distance;

void setup()
{

Dist.begin(A2);
pinMode(MOTOR1A, OUTPUT);
pinMode(MOTOR1B, OUTPUT);
Serial.begin(9600);
}

void loop()
{
/*
PWM 0 Forward PWM, fast decay
1 PWM Forward PWM, slow decay
0 PWM Reverse PWM, fast decay
PWM 1 Reverse PWM, slow decay
*/
distance = Dist.getDistanceRaw();
int sensorValue = analogRead(A3);
if((sensorValue > 300)){
analogWrite(MOTOR1A, 50);
digitalWrite(MOTOR1B, HIGH);
delay(50);
}else {
analogWrite(MOTOR1B, 255-stay);
digitalWrite(MOTOR1A, HIGH);

if(stay < 250){ stay = stay+50; } if(stay > 250){
stay = 250;
}
}
delay(500); //make it readable
}