Week 4

Cutting the box

This week we finally managed to do something concrete for our project: we cut the parts for the box with the laser cutter. It was bit challenging to find free time slot for the machine because it is so popular. We decided to use 6mm plywood instead of the MDF. In a hindsight it would have been better to use MDF but I don't think there even was 6mm MDF board available. So set up the machine and let it run through the process it took quite long, like 21 minutes or so, because there were many cuts it needed to do. After it finished we were a bit sceptical if it actually cut through the board but we decided to check. It was no way near. So we had to cur it again. But we had some trouble aligning the board the same way it was the first time. Finally we managed to place it close enough the original spot and ran the cutting process two more times. After that the parts came loose with help of some tools and reasonable amount of force. We put the box together but as we tried to attach the towers to the top part of the main box find a slight error in our design. The holes we cut in the top part were the same as the top parts of the towers when they should have been inverse. So we had to make a new plan for the top part of the main box. We also cut the arm with the box parts but found out that it also didn't work as intended. So we changed it slightly too. But we had to book a new time for the next week.

We also made the code the project with Arduino IDE. It is quite simple because there aren't that many things in our device. Here is a draft of the code with some values missing.

#include <Servo.h>
const int servoOutput = 11;const int infraSensor = A0;const int infraTrigger = ;const int ultraTrigger = ;const int ultraEcho = ;int infraValue = 0;long duration = 0;int distance = 0;
Servo Catapult;

void setup() { // put your setup code here, to run once: // set pin modes pinMode(servoOutput, OUTPUT); pinMode(infraSensor, INPUT);) pinMode(ultraTrigger, OUTPUT); pinMode(ultraEcho, INPUT); // set up the servo motor Catapult.attach(servoOutput); // move the catapult to the initial state Catapult.write(0); // set the ultrasound trigger off digitalWrite(ultraTrigger,LOW);}
void loop() { // if infrared sensor does not detect the signal infraValue = analogRead(infraSensor); if (infraValue < infraTrigger) { // if ultrasound sensor does not detect anything digitalWrite(ultraTrigger,HIGH); delayMicroseconds(10); digitalWrite(ultraTrigger,LOW); duration = pulseIn(echoPin, HIGH); distance = duration*0.034/2; if (distance < ) { // launch the servo-motor delay(1000) Catapult.write(90); // move the catapult back to initial state delay(1000) Catapult.write(0); } }}