Wednesday, June 12, 2013

Explanation of the prototype

As for my assigned role for this group is together with Olivia to build up a prototype according to the design we have conducted. My main focus was to use Arduino to control a mechanic system for this automated shelf. The input of control for the motion of the servo and motor will be control by push button as a purpose to demonstrate the working mechanic, the interaction and automatic part will be demonstrate through Crysis environment.

However a few thing went wrong. The prototype and arduino did not 100% working due to the device we have chosen and the ability of it to pull of lift up an object in the prototype.

To come up with this final design, things that we considered to conclude this mechanic design was mainly the availability of the equipment we used, and the cost of the equipment. To make our prototype working perfectly our thought was to use a linear motor which can control the exactly position of  the moving plate.

Video below to show example of a linear motor.


Animation created by olivia

Due the the cost the size of this device we then thought of using something that is simple and low cost but then following up with the problem that it would not able to handle a curtain weight. Which was the problem in our design and we did not realise that in an earlier stage.

As the prototype is not the main element of the project. The aim for this prototype is to establish a brief understanding of our basic concept and basic ideas toward the design of mechanic system.

Summary of the mechanic system 

 So this is the mechanic system that is installed on the top place of the prototype. It consists of 2 DC motors, full rotation servo, electromagnet and the battery

The 2 wires from electromagnet is twined on the full rotation servo, those wires needed to connect to the battery to enable the electromagnet. The wires must pair up with the right core to enable to electromagnet. (positive with positive, negative with negative)


The servo control the length of the wire connected to the electromagnet. (servo is controlled to rotate in two direction)


 The two motor is used to pull the car left and write, the direction is controlled by L293D IC motor driver.


The electromagnet is made out of the piece of metal, wired around by very thing insulated copper wire. This needed to wire a number of time to strengthen the electromagnet to attract a steel better. (steel which is attached to the boxes) The copper wire then need to be connect to an insulated flexible wire to be able to twin into the servo.

Mechanic design with arduino

Taking the prototype into parts, the main mechanic that was included in this prototype is as followed;

1. The motor pulling the car (which has a full rotation servo and the electromagnet attach on top) left and right along the top rail of the prototype.

In terms of coding and making to to move left and right, I am able to assign code and control arduino to control the two DC motors to move left and right. The car was moving left and right according to the button pushes shown in below video.


To allow to arduino to control direction of the two motors and L293D IC was a best option available to me. As first, L293D does not cost mush it was only $3-5 a piece. With the option that I could have gone through is to use motor driver shield but that would cost us more to purchase. I did a research on how the L293D would work and came up with this two moving DC motors control by 2 set up of L293D to control each motor separately using 2 push buttons.

2. The full rotation servo

This is the part where it sit on the moving car. It is attached with the electromagnet and wire. to pull it up and down according to the two push button. Again I was successfully control to direction of the servo to go backward and forward. As in followed video


As in the demonstration in the presentation, this part of the prototype was working.

As consulting with Russell in the last week before a presentation he mentioned to me to use a stepper motor instead of the dc motor. I then did attempt to try get the stepper motor work.


But it did not seem to rotate in both direction. Please refer back to my previous post for the code and the circuit diagram. http://tharidarattanajaturonarch1392-2013.blogspot.com.au/2013/06/week-13-experiment-on-new-mechanic.html

As a lack of time and experience of using stepper motor I then decided not to put them into the prototype.

3. The boxes and the railing


The boxes were able to move quite smoothly along the rail. Thing that we did not mention in our presentation was why the rail was there and how is it constructed.

As the purpose of our design, the rail was to hold the box still, as we did not want the box to be freely lift in the air which a high chance for it to swing, the rail is there to keep boxes in place .

The way the rail and the boxes constructed is guided in olivia's design and interpretation of the technical drawing as followed;




Saturday, June 8, 2013

Blog summary

Weekly Progress


Week 1:
Curriculum Vitae (First week of the course)

Week 2:
Group allocation and roles (Assigned to group, project and roles)

Week 3:
Feedback on group back brief

Week 4:
Research on idea for electronic shelf
Group discussion and problems on design approach

Week 5:
Code Planning
Group meeting: New idea for mechanic system

Week 6:
Team discussion on new design approach
Group 1 review on PLANNING

Week 7:
Coding Idea
Group 2 review on COMMUNICATION

Week 8:
Group 3 and 4 review on INTELLECTUAL PROPERTY
Prototype progress (first draft)
Prototype progression
Individual Major Milestone

Week 9:
Feedback for Milestone and Presentation Preparation

Week 10:
Group 5 review on CONFLICT
Feed back for group presentation on 'Conflict'
Working with Kinect
Research on L293D IC

Week 11:
Progress on Arduino
Group 6 review on REMUNERATION

Week 12:
Project progress and problem
Working with Arduino
Prototype and Arduino

Week 13:
Experiment on STEPPER MOTOR
Video demonstrate mechanic system and prototype

Navigation



Group Wiki Page: http://kinectingtheboxes.wikispaces.com/Welcome

Group Review:
Group 1 review on PLANNING
Group 2 review on COMMUNICATION
Group 3 and 4 review on INTELLECTUAL PROPERTY
Group 5 review on CONFLICT
Feed back for group presentation on 'Conflict'
Group 6 review on REMUNERATION

Individual Major Milestone:
Individual Major Milestone
Feedback for Milestone and Presentation Preparation

Research:
Research on idea for electronic shelf
Research on L293D IC

Project contribution and progress:
Group discussion and problems on design approach
Coding Idea


Thursday, June 6, 2013

Week 13: Experiment on New Mechanic System: STEPPER MOTOR

As the mechanic system of our prototype does not work properly due to the limitation control on the DC motor. As at the early stage we were all agree on using DC motor as it save on cost and I do have a bit of knowledge of how to use DC motor however Russell advice us to use STEPPER motor for to drive to car on the top rail.

After discussing with the rest of the group we decided to create a new mechanic system using stepper motor. According to Russell advice email, he provided us a link to a tutorial as followed; http://garagelab.com/profiles/blogs/tutorial-controlling-the-displacement-of-a-stepper-motor-with-the and we realized that to control a stepper we need to have an "EASY DRIVER" which is needed to control the motor.

Russell has ordered the easy driver for us and predicted to be delivered by this Friday.

Meanwhile I have attempted tried to control the stepper motor with the L293D that I have as I found on this tutorial, http://itp.nyu.edu/~gg964/blog/archives/1369. As I have no idea how to control stepper motor I then search for a tutorial, I found the forum that contain the code that I need from this forum (http://forum.arduino.cc/index.php/topic,152747.0.html)


I then tried to wire up stepper motor to Arduino board and used the code in the forum as a guide but it did not seem to work properly.

This is the diagram of Arduino circuit that I made.



And this is the video of stepper motor that is control by the two push buttons. What it is meant to do is rotate in two opposite direction when the different button is pressed. But at the moment it is still going into the same direction.


And this is the code that I used:

// 4 wire bipolar stepper motor driver code for L293D which controlls the direction of the motor with two push buttons for each clockwise and counter clockwise direction. After completing the predefined steps in 'motorstep' waits for the new direction command will come from one of the push buttons

const int CW = 2;
const int CCW = 3;
const int ENA = 8;
const int ENB = 13;
const int black = 9;  // IN1 pin of L293D
const int brown = 10;  // IN2 pin of L293D
const int orange = 11;  // IN3 pin of L293D
const int yellow = 12;  // IN4 pin of L293D
int valA = 0; // counter clockwise button vallue
int stateA =0; // state of the counter clockwise button
int valB = 0;  // clockwise button value
int stateB = 0; //state of the clockwise button
int pause = 10; //delay between each step for slow rotation
int motorstep = 48; // number of steps when the buttons are once pressed

void setup(){
  pinMode(black, OUTPUT);
  pinMode(brown, OUTPUT);
  pinMode(orange, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(CW, INPUT);
  pinMode(CCW, INPUT);
}

void loop(){
  valA = digitalRead(CW); //reads the CW button value and writes to 'valA'
  if(valA ==HIGH){
    stateA = 1- stateA;
    delay(1000); // to get rid of button bouncing (arduino reads the buttons really fast!!)
    stateB = 0;
    reverse(motorstep); 
  }
 
  valB = digitalRead(CCW); //reads the CCW button value and writes to 'valB'
  if (valB == HIGH){
    stateB = 1- stateB;
    delay(1000); // to get rid of button bouncing (arduino reads the buttons really fast!!)
    stateA = 0;
    forward(motorstep);   
  }
} // end loop

void reverse(int i){
  // Pin 8 Enable A Pin 13 Enable B on
  digitalWrite(ENA, HIGH);
  digitalWrite(ENB, HIGH);
 
  while (1)   {
    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(pause); 
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(pause);
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(pause); 
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(pause);
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;
  }

  // all outputs to stepper off
  digitalWrite(ENA, LOW);
  digitalWrite(ENB, LOW);

}  // end reverse()



void forward(int i){

  // Pin 8 Enable A Pin 13 Enable B on
  digitalWrite(ENA, HIGH);
  digitalWrite(ENB, HIGH);

  while (1){

    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(pause);
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(pause); 
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(pause);
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;

    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(pause); 
    i--; // reduces the remaining 'motorstep' value as "motorstep-1" for each step
    if (i < 1) break;
  }

  // all outputs to stepper off
  digitalWrite(ENA, LOW);
  digitalWrite(ENB, LOW);

}  // end forward()

At the moment I think the part that is control the direction of the motor is the number 0 and 1 which is disable and enable the pin output from L293D. It is somehow need to be set correctly to find the right direction for the motor.


I still cannot find the right value for the motor to go forward and reserve but I think this could be the right track to go as when I change these value the motor seem to do different movement.

Saturday, June 1, 2013

Week 12: Prototype and Arduino

Setting up Arduino on the Protoype

Now we have put all the part of the prototype together and I have now set up the Arduino board to the prototype.


This is the front view of the prototype. The rail doe the motors and car is placed at the top of the timber and is covered by balsa wood and texture to tidy up for the clean look of the prototype.


The shelf is made for the Arduino board to be placed as well as other mechanic component for the prototype. The box is attached at the bottom is balance the prototype to stand on its own.


This is when the Arduino board is placed. There are 4 wires from the board attached to the two motors. Two 9 V batteries and a ser are place on the stand. The full rotation servo will be installed on the car.


Arduino will be plug into my laptop for the power source and to upload a code for the board.