Week 9 and 11

 

Mechanical design and Machine design(Group Project)

 

This week is the beginning of our group project.

 

The task is1) MECHANICAL DESIGN :- Make a machine, including the end effector, build the passive parts and operate it manually.

2)MACHINE DESIGN (week 2 of 2):-Automate your machine. Document the group project and your individual contribution.

 

We have to plan and execute  well to finish our projects  within the time allowed. Firstly we made whole team as a single group.

Next we want to decide a group leader for the project, and separate wing to do their task. So that whole project will be finished easily.

 

 

Planning and Team

 

We made our friend Mohammad Almatori as group leader. We discussed many thing and many ideas came out from different members. finally planned to make  a 2 axis machine.For naming the project we discussed among different members and finally we got a name as “Find Me”.

 

 

The project description , phases carried out ,wings for different sessions, roles and responsibility.bill of materials,assembling,coding and testing is described in this link.

One of our team member brought old 3D printer(makerbot) and we dispatched the parts and taken out which can be used for our project.

WhatsApp Image 2017-05-14 at 12.47.14 PM.jpegWhatsApp Image 2017-05-14 at 12.47.26 PM.jpeg

The team structure is as follows,i came under testing and execution team.

Team.PNG

 

 

For the project the plan  and task was as following:

 

 

 

 

Tasks A

Tasks B

1

Start by doing sketch of the project

 

2

Build a bill of material

Start circuit schematic design

3

Start buying the hardware

Start PCB design

4

Start designing the 3d models

PCB Prototyping

 

5

test print

Testing electronic connections of circuit and Stepper motors

6

Check mistakes and reprint

Programming the Board

7

Get the hardware working smooth manually

Integrating Hardware and Electronics together

 

 

 

 

 

 

 

 

 

My contribution

Since i came under testing and execution team,I took the charge of coding as well as a participant testing.Which will be the more  patience and brainstorming session in the project.

Testing,assembling and other activities link are  as follows.

 

 

 

Video 1

 

 

Video 2:

 

 

 

The above videos are from the Group project videos. 

 

As my task comes under Coding and execution team,I started working on the Coding and electronics sections,Interfering the motors etc.

 

 

Since the project consisting of 2 stepper motor, We have to make the code which will control the motion of these two stepper motors.

 

I coded as follows. Each time i have to test part by part and verify it.It was little time consuming. But finally we got it.

 

Electronics Items Used

 

1- Arduino Duemilanove board

2-Jumper wires for connection

3-Breadboard to make connecting

4-LED

5-Stepper motors

6-push Buttons

 

 

 

Code

 

In code, I declared variables, pins for stepper motors,directions,LED pins.proceeded with step y step to move  and locate positions and thereby reaching final requirement.

 

 

#define dirPin 7

#define stepPin 6

#define enablePin 5

 

#define enablePin2 8

#define stepPin2 9

#define dirPin2 10

 

int j;

int G;

int Y;

int X;

int D;

int STPER1;

int STPER2;

 

const int buttonPin = 2;           // the number of the pushbutton pin

const int buttonPin2 = 3;

const int ledPin =  13;             // the number of the LED pin

int f1=0;

int f2=0;

 

// variables will change:

int buttonState = 0;     // variable for reading the pushbutton status

int buttonState2 = 0;

 

void setup() {

  // We set the enable pin to be an output

  pinMode(enablePin, OUTPUT);

  pinMode(stepPin, OUTPUT);

  pinMode(dirPin, OUTPUT);

 

 

  pinMode(enablePin2, OUTPUT);

  pinMode(stepPin2, OUTPUT);

  pinMode(dirPin2, OUTPUT);

   pinMode(13, OUTPUT);

 

  // then we set it HIGH so that the board is disabled until we

  // get into a known state.

  digitalWrite(enablePin, HIGH);

  digitalWrite(enablePin2, HIGH);

  Serial.begin(9600);

  Serial.println("Choose your box");

 

 

 

  Serial.print (" 1 BOX -- ");

  Serial.print(" 2 BOX -- ");

  Serial.println(" 3 BOX -- ");

 

  Serial.print (" 4 BOX -- ");

  Serial.print(" 5 BOX -- ");

  Serial.println(" 6 BOX -- ");

 

 

            Serial.print (" 7 BOX -- ");

  Serial.print(" 8 BOX -- ");

  Serial.println(" 9 BOX -- ");

 

 // Serial.println("Start With Distance:: 30000 are your intail distance");

 

}

 

void loop() {

///////////////////////////////////////////////////////////

//////////////////////////HOME/////////////////////////////////

 

            digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

            // digitalWrite(ledPin, HIGH);

            digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

   do{

  buttonState = digitalRead(buttonPin);

 

  if (f1 == 0) {

            Serial.print ("HOME 1");

   

  if(buttonState == HIGH) {

  

            digitalWrite(ledPin, HIGH);

   digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

            Serial.print (f1);

 

  }

  else if(buttonState == LOW) {

            // turn LED off:

            digitalWrite(ledPin, LOW);

            f1=1;

  };

  };

}while(f1<1);

  

  

 do{

  buttonState2 = digitalRead(buttonPin2);

 

  if (f2 == 0) {

            Serial.println ("HOME 1");

   

  if(buttonState2 == HIGH) {

  

            digitalWrite(ledPin, HIGH);

   digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            Serial.print (f1);

 

  }

  else if(buttonState2 == LOW) {

            // turn LED off:

            digitalWrite(ledPin, LOW);

            f2=1;

  };

  };

}while(f2<1);

  

///////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////// 

 

 

digitalWrite(ledPin, LOW); 

 

  // put your main code here, to run repeatedly:

while(Serial.available()) {

  char ST = Serial.read();

 

 

switch (ST) {

 

  ///////////////////////////////////////////////////////////

            case '1':

            Serial.println("ONE");

            Y=15000/3; //5

            X=15000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

 

////////////////////////////////////////////////////////////////////////   

            case '2':

            Serial.println("TWO");

            Y=8000/3; //5

            X=15000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

 

 

////////////////////////////////////////////////////////////////////////   

            case '3':

            Serial.println("Three");

            Y=(1000); //5

            X=15000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

   

////////////////////////////////////////////////////////////////////////   

            case '4':

            Serial.println("Four");

            Y=15000/3; //5

            X=9000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

////////////////////////////////////////////////////////////////////////   

            case '5':

            Serial.println("five");

            Y=(8000/3); //5

            X=9000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

////////////////////////////////////////////////////////////////////////   

            case '6':

            Serial.println("Six");

            Y=(1000); //5

            X=9000/3;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

////////////////////////////////////////////////////////////////////////   

            case '7':

            Serial.println("Seven");

            Y=15000/3; //5

            X=500;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

 

////////////////////////////////////////////////////////////////////////   

            case '8':

            Serial.println("Eight");

            Y=8000/3; //5

            X=500;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

 

  

   ////////////////////////////////////////////////////////////////////////   

            case '9':

            Serial.println("Nine");

            Y=(500); //5

            X=500;

             

  digitalWrite(enablePin, 0);

  digitalWrite(enablePin2, 0);

 

  delayMicroseconds(20);

  digitalWrite(dirPin, 0);

  digitalWrite(dirPin2, 0);

 

 

  for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

   //  Serial.println("X working");

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

 

            for (int u=0 ; u<= 2000 ; u++){

  delayMicroseconds(2000);

  digitalWrite(13,HIGH);

            } 

   digitalWrite(13,LOW);  

  digitalWrite(dirPin, 1);

  digitalWrite(dirPin2, 1);

 

            for (j = 0; j <= Y; j++) {

  digitalWrite(stepPin, LOW);

            delayMicroseconds(50);

   digitalWrite(stepPin, HIGH);

            delayMicroseconds(5000);

  }

 

            for (j = 0; j <= X ; j++) {

            digitalWrite(stepPin2, LOW);

            delayMicroseconds(50);

            digitalWrite(stepPin2, HIGH);

            delayMicroseconds(5000);

            }

             

   break;

}

}

   }

 

 

 

Assembling And Testing  Videos and progresses

 

 

·        Here  iam adding some more videos of testing at different levels and the problems while doing the testing. Some of them will be in arabic.I shooted some  moments only as I am busy with the code and testing. I think my collegues who are in charge of documentation and other things  have uploaded more on their pages.

 

There was problem with the Stepper motor driver. The motor was not moving and. I Checked with other as well. But both were not  working . So Then I checked with other one  remaining over here  . So it was fine.

This is in arabic. I was explaining to my collegues regarding the stepper driver problem and then what I done like that.

 

 

 

 

 

·        Here  iam adding other videos. In thtat  videos you can see various problems and  problem with the movement and making sound.

There are 9  positions for movement. I tested with respective positions and thetre was problem with the caliberation as well.Ineed to caliberate this by changing the values for position. You can see the changes. Clearing the sound by changing the mechanical things, Problem with the gliding mechanism, and then  fixing the sliding mechanism by the use of Other mechanical structure. , Checking the positions, caliberating and then fixing every thing can be seen in the following videos.

 

 

 

 

 

 

 

 

·        Testing video with reduced sound  and pending of belt mechanism.

 

 

 

 

 

 

 

 

 

 

·        Testing  finally with the positions and lights: Here you can see the machine moving to slot  5 as given in the serial monitor of Arduino program. Al so you can see the limit switch(Switch attached at the end).

 

 

.

 

 

 

 

 

Final working of project which I shows in  my personal instagram account is here. Instagram

 

 

 

 

 

 

 

Videos from documentation teams

 

 

 

 

 

Assembling Process

 

I am the person who is seeing In the above Video snap and speaks in english. I am explaining this things in vthe video. Here In this video you can see me,Our group leader along with the other members assembling the 3D printed Parts and testing for the machine.

 

 

 

 

Failure and solutions

 

 

 

Belt mechanism and attempts  of mechanism working

 

 

3rd attempt

 

 

Final video

 

 

 

The last video showing how the machine working and I am explaining the things.   This was how our project completed.

 

Results and conclusion:

 

Making of a two axis machine with a group was really shown me how a team work results and the implementing and testing at different level are very interesting. Achieving the Project completed state will  provide a great satisfaction  for whole group.

 

Points of improvement:

I think that we can start by:

1-     Adding a servo motor and grep instead of the LED.

2-     The code should be improved to pick up from start point to certain locations 

3-     The hardware should be redesigned to be more compact and faster