User:Mike Barnkob/Projects/Liquid handling robot

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(Week 2)
(Week 2)
Line 234: Line 234:
-
'''Thursday''': Worked on the forward and backward movement, which seems to be working fine. No sliding was observed after 10 runs.
+
'''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:
 +
 
 +
<pre>
 +
#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);
 +
}
 +
</pre>

Revision as of 12:41, 25 March 2010

Contents

Liquid handling robot

Introduction

Background

Ressources

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", because the upward movement is reset every time.

//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);
    }   
    
  }
}



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);
}
Personal tools