Autumn

When the leaves turn brown, the scent of the air is the best, you must be in autumn...

Winter

Suddenly tiny ice flakes fell down and all of places turn into romantic sites

Light Pageant

One of most beautiful site I visited in Japan

Line Follower Robot

Simple but very precious for me. Roughly speaking it does change my life up to now.

Laboratory card member

Currently student in Nakazawa Laboratory, Tohoku University. Lab's specialty is Ultrahigh speed optical communication.

Labortory Experiment

Ultrahigh Speed Optical Communication

Showing posts with label robotics. Show all posts
Showing posts with label robotics. Show all posts

Throwback Robotics Stuff


First of all I would like to say Thank you to my friends, my seniors in Universitas Indonesia, who helped me a lot to build and mobilize robot . Thanks for the courage, knowledge and time.
ありがとうー UI Robotics Team :)


My University's robotics club member. Full team in one frame.
TRUI! JUARA! JUARA! JUARA!
TRUI! JUARA! JUARA! JUARA!

1. When I was still a freshman student


I have been interested in one of club in my university, Robotics Club. My first year was begun by being supporter for my seniors to compete in Indonesian Robotics Contest. It was in 2013. I was hoping one day I can be the one who is being supported from podium. I wished I could be next year participant in sophomore year.
My first time watched National Robotics Competition

 2. My first time Programmed a Robot (Line Following Robot)

On my way to be accepted as part of UI Robotics team me and all of freshman participant need to build a line follower robot then we compete each other. My team was the only team consisting of all girls. They are amazing. My senior who is being our mentor is way too amazing too. Sleep was not an option for us at that time. We build our robot from the morning through the night. This time I began to be an amateur (very amateur) programmer. Thanks to everybody who helped me and us until we finally became the fourth winner (not bad tho). Thanks for the captain of first winner (who is my ex boyfriend) who helped me a lot quite a lot to be a programmer at that time.

our very first robot, without mechanic only 3 electricians and 1 programmer

we call it BIG BANG robot (can you guess why we named it so?)

3. Mini KRI

After finished first job to build a line follower robot, then the next challenge was to build mini manual-multitasking robot. The rule is simple. Each robot compete to take a cane and put it in a certain place. We can control the robot through joystick we made. This time every team was given mechanic. Mechanic is so important in building robot yet I have no skill on mechanics things at all.
As I remember my team gave the name to our robot "CIPUNG" (Cinta Kampung) It was because of me. I was the only programmer in that team but I ended up went back to my home town when the D-Day of match was started (hahaha can't helped it, I already purchase my ticket for going back to hometown)

4. KRI Regional 1 (Jakarta, Sumatera, West Java Region)

This is my first time took a part as a participant in National Robotics Contest. After passed the selection process to be  club member I started to work for team name ULUINO (this team is UI's representative for Abu Robocon Contest)

"Sleep is only for the weak"

how many nights I spent with no sleep during the process of making our robot robust? I didn't remember. To build one robot, not only work hard is needed but also pray hard and a very good team work. I still need to learn many things from programming. Debugging is a must. I tried not to make my friends disappointed (maybe I did, I'm sorry)

our precious robot!!!!
participant's card
full team's card
before match
the arena of match
full team



I thought we were being eliminated in that match but miracle did really happen. We were succeed to pass this stage and go to the National Level next two months!!! Thank you team! You're awesome!

5. KRI National Level (Jogjakarta, Indonesia - June 2014)

Thanks God ULUNO goes to National Arena. This time I didn't take a part as a participant (even I didn't change any code to prepare for the next match haha)
I was so happy at that time because I can travel with my close friends to Jogjakarta. It was fun to watch the match in National Level. They are all bright and hard worker student from all over part of Indonesia. I was so proud being one of them.



preparing air compressor for robot

only in Indonesia you can find Robot dances!

Dancing Robot

Basically I love programming yet I tried to change my specialty in telecommunication thingy. Yeah right now I am working in Optical Communication Laboratory. I have to learn so many things about optical. じゃな―ロボット^^


Thing I have learned a lot from building  robot is T.E.A.M (Together Everyone Achieves More)
This has been our Club's slogan for years.






















Controlling a Robot using PSX (Arduino based)

Here's the code about how I control the robot using PSX and arduino Mega 2560. I make the code in such a modular way(no need but it's ok, forgive me lol)

Some command is in Bahasa Indonesia.

1. Main Program which call every tabs

/* bismillahirrohmaanirrohiim
ALLAHUAKBAR
=====================18 APRIL 2014====================================*/
/*  MASTER
ChangeLog: 1. slider 2. single motor 3. otomatisasi
*/


#include  //PS2 Library
#define naik 0
#define turun 1

//initialization
PS2X ps2x;
int PS2_error = 0;
int PS2_AnalogLX = 0;
int PS2_AnalogLY = 0;
int PS2_AnalogRX = 0;
int PS2_AnalogRY = 0;
int translateX, translateY, rotateTheta;


void setup() {
  Serial.begin(57600);

  PS2_error = ps2x.config_gamepad(50,51,52,53, true, false);   //(clock, command, attention, data, Pressures?, Rumble?)
  if (PS2_error == 0) Serial.println("SIAP"); //stick detected
  else if(PS2_error == 1)  Serial.println("Gak ada stik, cek kabel");
  else if(PS2_error == 2)  Serial.println("Stik terdeteksi, tapi ga bisa nerima command");
  else if(PS2_error == 3)  Serial.println("Stik tidak bisa memasuki mode Pressure, hilangkan mode melalui kodingan");

  slaveInit();
  motorInit();
  seesawInit();
  gripperInit();
  sliderInit();
  liftingInit();
  pendorongInit();
  singleMotorInit();
}

void loop()
{

  if(PS2_error != 0)
  {
    delay(500);
    lifting(0,0);
    return;
  }
  else
  {
    ps2x.read_gamepad();          //read controller and set large motor to spin at 'vibrate' speed
 
    //kalo stik terlepas biar gak jalan sendiri
    if(ps2x.Analog(PSS_LY) == 255 && ps2x.Analog(PSS_LX) == 255 && ps2x.Analog(PSS_RY) == 255 && ps2x.Analog(PSS_RX) == 255)
    {
      PS2_AnalogLY = 0;
      PS2_AnalogLX = 0;
      PS2_AnalogRY = 0;
      PS2_AnalogRX = 0;
      Serial.println("STIK TERLEPAS");
      motorDrive(0,0,0);
      while(1);
    }

    else if(ps2x.Button(PSB_L2)) // turbo speed
    {
      PS2_AnalogLY = ((ps2x.Analog(PSS_LY) - 128));
      PS2_AnalogLX = ((ps2x.Analog(PSS_LX) - 128));
      PS2_AnalogRY = ((ps2x.Analog(PSS_RY) - 128));
      PS2_AnalogRX = ((ps2x.Analog(PSS_RX) - 128));
    }

    else if(ps2x.Button(PSB_L1)) // slow mo banget seperempat speed
    {
      PS2_AnalogLY = (int)((ps2x.Analog(PSS_LY) - 128)/4);
      PS2_AnalogLX = (int)((ps2x.Analog(PSS_LX) - 128)/4);
      PS2_AnalogRY = (int)((ps2x.Analog(PSS_RY) - 128)/4);
      PS2_AnalogRX = (int)((ps2x.Analog(PSS_RX) - 128)/4);
    }


    else  //normal speed
    {
      PS2_AnalogLY = (int)((ps2x.Analog(PSS_LY) - 128)/2);
      PS2_AnalogLX = (int)((ps2x.Analog(PSS_LX) - 128)/2);
      PS2_AnalogRY = (int)((ps2x.Analog(PSS_RY) - 128)/2);
      PS2_AnalogRX = (int)((ps2x.Analog(PSS_RX) - 128)/2);
    }

    //    Serial.print("Stick Values:");
    //    Serial.print(PS2_AnalogLX, DEC);
    //    Serial.print(" ,");
    //    Serial.print(PS2_AnalogLY, DEC);
    //    Serial.print(" ,");                  
    //    Serial.print(PS2_AnalogRX, DEC);
    //    Serial.print(",");
    //    Serial.println(PS2_AnalogRY, DEC);

    translateX= PS2_AnalogLX*2;
    translateY= PS2_AnalogLY*2;
    rotateTheta= PS2_AnalogRX*-2;  

    omniDrive(translateX,translateY,rotateTheta);  // kalo mau pake pwm master doang
    //slaveOmniPWM(translateX,translateY,rotateTheta);  // kalo mau pake pwm tp master slave
    //slaveOmniRPM(translateX,translateY,rotateTheta);  // kalo mau pake rpm master slave

    if(ps2x.ButtonPressed(PSB_PINK))
    {
       push();
    }

    if(ps2x.ButtonPressed(PSB_RED))
    {
      gripping(); // grip depan
    }

    if(ps2x.ButtonPressed(PSB_BLUE))
    {
      seesaw_on(); // ayunin jungkat jungkit
    }
 
    if(ps2x.Button(PSB_PAD_RIGHT))
    {
      slider(120,naik);
    }

    if(ps2x.ButtonReleased(PSB_PAD_RIGHT))
    {
      slider(0,turun);
    }
 
    if(ps2x.Button(PSB_PAD_LEFT))
    {
       slider(120,turun);
    }
 
     if(ps2x.ButtonReleased(PSB_PAD_LEFT))
    {
      slider(0,naik);
    }

    if(ps2x.Button(PSB_PAD_UP))
    {
       lifting(250,turun);
    }
 
    if(ps2x.ButtonReleased(PSB_PAD_UP))
    {
      lifting(0,naik);
    }
 
    if(ps2x.Button(PSB_PAD_DOWN))
    {
      lifting(250,naik);
    }
    if(ps2x.ButtonReleased(PSB_PAD_DOWN))
    {
      lifting(0,turun);
    }
 
    if (ps2x.ButtonPressed(PSB_GREEN))
    {
      push();
    }
 
 
    if (ps2x.ButtonReleased(PSB_GREEN))
    {
       motor(0,100,95,1,1,0,700);
       motor(0,0,0,0,0,0,100);
    }
 
//        if (ps2x.ButtonPressed(PSB_R1))
//    {
//  
//    }
 
 
    if (ps2x.Button(PSB_R1))
    {
       slider(130,naik);
       lifting2();
    }
 
    if (ps2x.ButtonReleased(PSB_R1))
    {
             slider(0,turun);
           lifting(0,naik);
    }
        if (ps2x.Button(PSB_R2))
    {
       slider(130,turun);
       lifting3();
    }
 
    if (ps2x.ButtonReleased(PSB_R2))
    {
             slider(0,naik);
           lifting(0,turun);
    }

//
//    if(ps2x.ButtonReleased(PSB_PINK))
//    {
//       //diisi nanti
//    }
//  
//     if(ps2x.Button(PSB_GREEN))
//    {
//       //diisi nanti
//    }
//
//    if(ps2x.ButtonReleased(PSB_GREEN))
//    {
//       //diisi nanti
//    }
//    if(ps2x.ButtonPressed(PSB_PAD_RIGHT))
//    {
//      ping(1);
//    }
//
//    if(ps2x.ButtonPressed(PSB_PAD_UP))
//    {
//      ping(2);
//    }
//    if(ps2x.ButtonPressed(PSB_PAD_LEFT))
//    {
//
//      ping(3);
//    }

  }
}


2.  Actuator's Contoller


#define GRIPPER_PIN 32

char grip;

void gripperInit()
{
  pinMode(GRIPPER_PIN,OUTPUT);
  digitalWrite(GRIPPER_PIN,HIGH);
}

void gripping ()
{
  if(grip==1)
  {
    grip=0;
    Serial.println("GRIPPER ACTIVATED");
  }
  else
  {
    grip=1;
    Serial.println("GRIPPER DEACTIVATED");
  }
  digitalWrite(GRIPPER_PIN,grip);
}

#define LIFTING_PWM_PIN 2
#define LIFTING_CS_PIN 26
#define MOTOR_CAP 255

void liftingInit()
{
pinMode(LIFTING_PWM_PIN,OUTPUT);
pinMode(LIFTING_CS_PIN,OUTPUT);
digitalWrite(LIFTING_CS_PIN,LOW);
analogWrite(LIFTING_PWM_PIN,0);
attachInterrupt(3,lifting2,CHANGE);
attachInterrupt(2, lifting3, CHANGE);
}

void lifting(int speed, int arah)
analogWrite(LIFTING_PWM_PIN,speed);
digitalWrite(LIFTING_CS_PIN,arah);
}

void lifting2()
analogWrite(LIFTING_PWM_PIN,250);
digitalWrite(LIFTING_CS_PIN,1);
}


void lifting3()
analogWrite(LIFTING_PWM_PIN,250);
digitalWrite(LIFTING_CS_PIN,0);
}

void lifting_d(int speed, int arah,int time)
analogWrite(LIFTING_PWM_PIN,speed);
digitalWrite(LIFTING_CS_PIN,arah);
delay(time);
}

#define PENDORONG_PIN 31

char pendorong;

void pendorongInit()
{
  pinMode(PENDORONG_PIN,OUTPUT);
  digitalWrite(PENDORONG_PIN,LOW);
}

void push()
{
  if(pendorong==1)
  {
    pendorong=0;
  //  Serial.println("GRIPPER ACTIVATED");
  }
  else 
  {
    pendorong=1;
   // Serial.println("GRIPPER DEACTIVATED");
  }
  digitalWrite(PENDORONG_PIN,pendorong);
}

#define SEESAW_PIN 30

char seesaw;

void seesawInit()
{
  pinMode(SEESAW_PIN,OUTPUT);
  digitalWrite(SEESAW_PIN,LOW);
}


void seesaw_on ()
{
  if(seesaw==1)
  {
    seesaw=0;
    Serial.println("SEESAW NAIK");
  }
  else 
  {
    seesaw=1;
    Serial.println("SEESAW TURUN");
  }
  digitalWrite(SEESAW_PIN,seesaw);
}

3. Motor Control


#define CSB 28
#define CSC 29
#define CSA 27
#define PWMB 4
#define PWMC 9
#define PWMA 3
#define CCW 1
#define CW 0
#define MOTOR_CAP 255 //max 255

int lastA = 0, lastB = 0, lastC = 0, last_delay = 0;
byte stopA = 0, stopB = 0, stopC = 0;


// MOTOR INIT
void motorInit()
{
   pinMode(CSA,OUTPUT);
   pinMode(CSB,OUTPUT);
   pinMode(CSC,OUTPUT);
   digitalWrite(CSA,CCW);
   digitalWrite(CSB,CCW);
   digitalWrite(CSC,CCW);
   
   pinMode(PWMA,OUTPUT);
   pinMode(PWMB,OUTPUT);
   pinMode(PWMC,OUTPUT);
}
//************************************
// Motor A
//************************************
void motor_A(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSA,CCW);
    analogWrite(PWMA,pwm);
    stopA = 1;
    if(lastA < 0) last_delay = 1;
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSA,CW);
    analogWrite(PWMA,-1*pwm);
    stopA = 1;
    if(lastA > 0) last_delay = 1;
  }
  else
  {
    if(stopA == 0) return;
    else if(digitalRead(CSA) == CCW)
    {
      digitalWrite(CSA,CW);
      analogWrite(PWMA,0);
      stopA = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSA) == CW)
    {
      digitalWrite(CSA,CCW);
      analogWrite(PWMA,0);
      stopA = 0;
      last_delay = 1;
    }
  }
  lastA = pwm;
}
//************************************
// Motor B
//************************************
void motor_B(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSB,CCW);
    analogWrite(PWMB,pwm);
    stopB = 1;
    if(lastB < 0) last_delay = 1;    
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSB,CW);
    analogWrite(PWMB,-1*pwm);
    stopB = 1;
    if(lastB > 0) last_delay = 1;
  }
  else
  {
    if(stopB == 0) return;
    else if(digitalRead(CSB) == CCW)
    {
      digitalWrite(CSB,CW);
      analogWrite(PWMB,0);
      stopB = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSB) == CW)
    {
      digitalWrite(CSB,CCW);
      analogWrite(PWMB,0);
      stopB = 0;
      last_delay = 1;
    }
  }
  lastB = pwm;
}
//************************************
// Motor C
//************************************
void motor_C(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSC,CCW);
    analogWrite(PWMC,pwm);
    stopC = 1;
    if(lastC < 0) last_delay = 1;
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSC,CW);
    analogWrite(PWMC,-1*pwm);
    stopC = 1;
    if(lastC > 0) last_delay = 1;
  }
  else
  {
    if(stopC == 0) return;
    else if(digitalRead(CSC) == CCW)
    {
      digitalWrite(CSC,CW);
      analogWrite(PWMC,0);
      stopC = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSC) == CW)
    {
      digitalWrite(CSC,CCW);
      analogWrite(PWMC,0);
      stopC = 0;
      last_delay = 1;
    }
  }
  lastC = pwm;
}

//************************************
//Motor Drive Function, -255 ~ 255
//************************************
void motorDrive(int va,int vb,int vc)
{
  motor_A(va);
  motor_B(vb);
  motor_C(vc);
  if(last_delay==1)
  {
    delay(100);
    last_delay = 0;
    Serial.println("delayed");
  }
}

void omniDrive(int x, int y, int rot) //putaran positif searah jarum jam
{
  int va,vb,vc;
  va = 0.333*x - 0.572*y + 0.333*rot;
  vb = 0.333*x + 0.572*y + 0.333*rot;
  //vc = -0.667*x + 0.333*rot;
  vc = -0.667*x + 0.333*rot;
  
  motorDrive(va,vb,vc);
  
  /*
  Serial.print(x,DEC);
  Serial.print("\t");
  Serial.print(y,DEC);
  Serial.print("\t");
  Serial.println(rot,DEC);
  */
//  Serial.print(va,DEC);
//  Serial.print(" ");
//  Serial.print(vb,DEC);
//  Serial.print(" ");
//  Serial.print(vc,DEC);
//  Serial.println();
  
}

You can get the full code. It's easy just subscribe my blog and left the comment. I'll give you the link