Demo 3 – The Conversation

Henry Zhang, Vivek Anand

(Partner – Henry Zhang)

The mechanism built consists of two robots that push switches to interact with each other. Each robot consists of a table with a pushrod attached to a wheel driven by a servo motor. When one of the buttons are pushed, the motion is initiated. One robot pushes on its respective switch, which tells the second robot to push its switch. This causes the first robot to disengage the switch and soon afterwards the second one follows suit. the first robot receives the signal that the second robot’s switch is not pressed, and so it pushes its switch. This cycle continues until the Arduino board is switched off.

The mechanism is created using 6mm laser cut plywood. A revision to the design would be to make sturdier connections between the panels and a ramp to support the pushrod when disengaged. These are the reasons as to why much tape was used. Additionally, due to the weak interlocking system for panels, the switches could not be bolted down as the force from the pushrod would collapse the support for the switches.

VIDEO:

CODE:

#include <Servo.h>
const int SERVOA_PIN = 10;
const int SERVOB_PIN = 11;

Servo servoA;
Servo servoB;

bool servoA_run;
bool servoB_run;

void setup() {
// put your setup code here, to run once:
pinMode(8, INPUT); // Switch A
pinMode(9, INPUT); // Switch B
servoA.attach(SERVOA_PIN);
servoB.attach(SERVOB_PIN);

// initialize servo_run to false
servoA_run = false;
servoB_run = false;

// initialize servo postion
servoA.write(10);
servoB.write(30);

// debug serial stream
Serial.begin(9600);
}

void servoA_push() {
servoA.write(90);
delay(500);
}

void servoA_retrieve() {
servoA.write(10);
delay(500);
}

void servoB_push() {
servoB.write(130);
delay(500);
}

void servoB_retrieve() {
servoB.write(30);
delay(500);
}

void move_servo() {
if (servoA_run) {
servoA_push();
} else {
servoA_retrieve();
}
if (servoB_run) {
servoB_push();
} else {
servoB_retrieve();
}
}

void loop() {
// put your main code here, to run repeatedly:
int switchValA = digitalRead(8);
int switchValB = digitalRead(9);
if (switchValA == 1) {
// Servo2 start
Serial.println(“servo B start”);
servoB_run = true;
} else {
servoB_run = false;
}
if (switchValB == 1) {
// Servo1 start
Serial.println(“servo A start”);
servoA_run = true;
} else {
servoA_run = false;
}

move_servo();
delay(500);
}

NOTEPAD LINK TO FORMATTED CODE:

Demo3 CODE

SOLIDWORKS PARTS:

Demo3 Solidworks