User:Mike Barnkob/Projects/Liquid handling robot: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 15: Line 15:
| Model||
| Model||
|-
|-
| Technology|| LEGO Mindstorm NTX 2.0
| Technology|| LEGO Mindstorm NTX 2.0 and ROBOTC
|-
|-
| Price of all materials||
| Price of all materials||
|-
|-
| Size ||
| Size || 420 mm (Width) x 375 mm (Depth) x 500 mm (Height)
|-
|-
| Weight ||
| Weight ||
|-
|-
| Area of movement||85 mm (Width) x 298 mm (Depth) x 62 mm (Height)
| Area of movement||85 mm (Width) x 200 mm (Depth) x 62 mm (Height)
|-
|-
| Speed||
| Speed||

Revision as of 04:22, 12 April 2010

Liquid handling robot

Introduction

Background

Specifications

The table below outlines the specifications of the machine.

' Metric
Model
Technology LEGO Mindstorm NTX 2.0 and ROBOTC
Price of all materials
Size 420 mm (Width) x 375 mm (Depth) x 500 mm (Height)
Weight
Area of movement 85 mm (Width) x 200 mm (Depth) x 62 mm (Height)
Speed
Accuracy

Ressources

LEGO

Software

Hardware

Knowledge

Ideas

Notebook

Week 1

Monday: Worked on the primary handling operation with a very simpel design and set up the lab space.

The linear actuator works up to aboout 1,6 cm, putting a limit on how much the pipet can be pushed down. Solutions might be: using two actuators, using a rail-design instead or adding more power to the actuator.

The design is becoming quite big. Solution might be to use the power function powers, which are smaller.

The pipet needs to be tested for accuracy.

Tuesday: Checked the pipet for accuracy, and it was way of. Found another one, Eppendorf 200 ul.

Continued working on the dispensing handling. Created a successful design with two motors that press down on the pipet. I'm a bit nervous about the stress on the motor, but for now they seem to do fine.

The battery in one of the NTX bricks already ran out. I've ordered a rechargeable battery - but no transformer, since they are not sold here. Hopefully the inlet will accepts other transformers as well.

Programmed two aspiration and dispensing programs, called 'asp & disp 1 and 2 (16-03-10).c'. The code for asp & disp 2 is:


#pragma config(Motor,  motorA,          motor_A,       tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  motorB,          motor_B,       tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//DECLARING FUNCTIONS

//Control of the dispenser
void DispensControl (int DCmotor, int DCencode, int DCpause) {

  //Syncronizing motors
  nSyncedMotors = synchAB;
  nSyncedTurnRatio = +100; // Left motor turns 100% of right motor
  //Power up

  while( !(nMotorEncoder[motor_A]==DCencode) ) {
    motor[motor_A]=DCmotor;
    nxtDisplayClearTextLine(5);
    nxtDisplayClearTextLine(6);

    nxtDisplayString (5,"%d, %d", nMotorEncoder[motorA],nMotorEncoder[motorB]);
    nxtDisplayString (6,"%d, %d", DCencode, DCmotor);
    wait1Msec (1);
  }

  motor [motorA] = 0;

  //End pause if any
  wait10Msec(DCpause);
}


//MAIN TASK
task main () {

  nxtDisplayString (1,"DISPENSING 2");
  nMotorEncoder [motor_A] = 0;

  //Air-out
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Air-out");
  DispensControl(30, 30, 0);
  DispensControl(70, 60, 250);

  //Aspiring
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Aspiring");
  DispensControl(-15, 0, 250);

  //Dispensing
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Dispensing");
  DispensControl(30, 40, 0);
  DispensControl(70, 80, 250);

  //Resetting
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Resetting");
  DispensControl(-15, 0, 250);

}

Wednesday: Started designing the holding bay for the pipet. This will control the downward and upward motion of the pipet, but should also be able to be pulled either left or right. Decided to work with only one motor, since this would make it possible to control the entire robot with two NTX's.

Friday: Continued work on holding bay design.

Week 2

Monday: Worked on holding bay design and horizontal control. The design right now uses one motor for the horizontal control, which seems to be working fine. One motor is also used for the lateral control, which is a bit bumpy: the pipet holding and the motors need to be adjusted.

First code for lateral and horizontal control (Horizontal control (22-03-10).c):

#pragma config(Motor,  motorB,          motor_B,       tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  motorC,          motor_C,       tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//DECLARING FUNCTIONS

//Horizontal control, ie. left and right
void HorizontalControl (int Hmotor, int Hencode, int Hpause) {

  //Power up
  while( !(nMotorEncoder[motor_C]==Hencode) ) {
    motor[motor_C]=Hmotor;
    nxtDisplayClearTextLine(5);
    nxtDisplayClearTextLine(6);

    nxtDisplayString (5,"%d", nMotorEncoder[motor_C]);
    nxtDisplayString (6,"%d, %d", Hencode, Hmotor);
    wait1Msec (1);
  }

  motor [motor_C] = 0;

  //End pause if any
  wait10Msec(Hpause);
}

//Lateral control, ie. up and down
void LateralControl (int Lmotor, int Lencode, int Lpause) {

  //Power up
  while( !(nMotorEncoder[motor_B]==Lencode) ) {
    motor[motor_B]=Lmotor;
    nxtDisplayClearTextLine(5);
    nxtDisplayClearTextLine(6);

    nxtDisplayString (5,"%d", nMotorEncoder[motor_B]);
    nxtDisplayString (6,"%d, %d", Lencode, Lmotor);
    wait1Msec (1);
  }

  motor [motor_B] = 0;

  //End pause if any
  wait10Msec(Lpause);
}


//MAIN TASK
task main () {

  nxtDisplayString (1,"HORIZONTAL CONTROL");
  nMotorEncoder [motor_C] = 0;

  //Move to the left-most position
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Going left");
  HorizontalControl(30, 600, 250);

  //Reset
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Going right");
  HorizontalControl(-30, 0, 250);

  //Move to the left-most position
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Going down");
  LateralControl(-20, -250, 80);

  //Up and down
  nxtDisplayClearTextLine(3);
  nxtDisplayString (3,"Going up");
  LateralControl(33, 0, 0);


}

Tuesday: Horizontal control: did a test at 40% motor power, with 50 movements back and forth. The bay slides a bit to the right, 0,2 cm after 50 turns. Lateral control: gravity is playing games and the movement changes alot over time. Redid the pipet-holding and added larger wheels. The first testing seems good.

Wednesday: Added a touch sensor to the lateral movements. After 50 runs it seem to "slide", but solved this by adding a touch-sensor, that makes sure the movement is reset after each movement (ie. moves to the same position).

//MAIN TASK
task main () {

  int i;
  for ( i=0; i<=10; i++) {

    //Down
    nMotorEncoder [motor_B] = 0;
    LateralControl(-55, -100, 140, false);

    //Up
    nMotorEncoder [motor_B] = 0;
    LateralControl(55, 100, 0, true);

    //Reset - go up until the sensor is not pressed anymore
    while( !(SensorValue(sensor_1) == 0) ) {
      motor[motor_B]=55;
      wait1Msec (1);
    }   
    
  }
}


<html> <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Dv-0IIxN1yg&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Dv-0IIxN1yg&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> </html>


Thursday: Worked on the forward and backward movement, which seems to be working fine. No sliding was observed after 10 runs. Used the following code:

#pragma config(Motor,  motorA,          WallE_A,       tmotorNormal, PIDControl, encoder)
#pragma config(Motor,  motorB,          WallE_B,       tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//Forward and backward control
void ForwardControl (int Fmotor, int Fencode, int Fpause) {

  //Sync'ing motors A and B
  nSyncedMotors = synchAB ; 
  nSyncedTurnRatio = +100; 
  
  //Power up
  while( !(nMotorEncoder[WallE_A]==Fencode) ) {
      motor[WallE_A]=Fmotor;
      nxtDisplayClearTextLine(5);
      nxtDisplayClearTextLine(6);

      nxtDisplayString (5,"%d", nMotorEncoder[WallE_A]);
      nxtDisplayString (6,"%d, %d", Fencode, Fmotor);
      wait1Msec (1);

  }

  motor [WallE_A] = 0;

  //End pause if any
  wait10Msec(Fpause);
}

<html> <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Xhi2GBqtNMM&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Xhi2GBqtNMM&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> </html>

Naming conventions: I'm current using two NTX's with the names WallE and R2D2. The motors will be called WallE_A, WallE_B, WallE_C, the sensors WallE_1, WallE_2, ect.

Tested bluetooth with the following two small programs:

BT send test 1 (25-03-10).c


//MAIN TASK
task main () {

  
  //Sending BT message - WallE is set up as master, R2D2 as slave.

  int i , x2 , x3;

  x2 = 0; // dummy
  x3 = 0; // dummy

  for ( i=0; i<=10; i++) {
      sendMessageWithParm (i ,x2 ,x3 );
      wait1Msec (2000); // wait one -tenth of a second
  }
  
}

BT receive test 1 (25-03-10).c



//MAIN TASK
task main () {
  
  while ( true ) {

    if ( bQueuedMsgAvailable () ) {
      
      eraseDisplay ();
      nxtDisplayCenteredTextLine (3,"%d",
      messageParm [0]);
      ClearMessage ();
    }

    wait1Msec (500);
  }

  
}

Saturday: Worked on improving the bluetooth connection.

Week 3

Monday: Continued working on the bluetooth connection, which is now finished. Tweaked the different functions that move the robot, so that the distances fit. Did a simple test with liquid handling, 200 ul.

Tasks: Plan and do a advanced experiment where water from 50 wells are moved to 50 other wells.

<html> <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/IOQqZ7yG2VQ&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IOQqZ7yG2VQ&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> </html>

Thuesday: Build loading bays and pipet-tip removal bay. Built resetting mechanism but since the cables are not long enough, the robot has no reset for the back-forward movement and the dispensing. These two movements are very stable, but will have to look into making longer cables.

Discussed experiment with Martin. Decided to drop 50 well experiment for now and instead focus on emulating real experiment. 800ul, 5ul and 5ul liquid has to be loaded on small glass plate.

Wednesday: Continued working on experiment. Made improvements to the master-slave code. Made a reset-mechanism for the back-forward movement. The space in which the robot can move is quickly becoming crammed; also the pipets movement up and down, are being pushed to their maximum. For future development it would be nice with a longer holding-arm and bigger up-down possibilities. For now the robot is okay though.

Tasks: Make a map over the plate with encoder distances, for easier programming of different assays. Order another transformer.

Week 4

Monday: Finished the platform. The working area is small: 85 mm wide, 58 mm high and 298 mm long. For the first experiment it will be okay, although a bigger width and height is desirable.

Messured motor encoder distances: full width (85 mm) = 1590 rotations (18,71 rotations pr. mm); full hight (58 mm) = 337 rotations (5,81 rotations pr. mm); full depth (298 mm) = 2950 rotations (9,90 rotations pr. mm).

Made a new pipet holder, so that the movement is more stable. Created and tested tip-removal.

Tuesday: Worked on improving the depth movement, which is off. Constructed new feet, but are still having trouble creating a precise movement.