Announcement

Collapse
No announcement yet.

Introduction into Robotics : My own Robot "Arduino"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Introduction into Robotics : My own Robot "Arduino"

    Asalam alykum warahmatullahi wabarakatuh,

    All praise due to Allah , May Allahs peace and blessing of Allah be upon his Messenger and May Allah have mercy on his family and his companions and may Allah guide this muslim ummah and straighten our way and enlighten our hearts,

    after this (a'ama ba'ad) dear reader,

    i want to introduce you to robotics , im working on this great Robot,its the beginners stage,im collecting experience in basic robotics and i was advised by people to work on this robot,due to the costs and time.
    Yet even i have chosen this i have my own version but the engine and system is that of arduino.



    or this




    Im facing two problems like everyone who enjoys his life,money and time.
    Due to some costs of certain sensors im not going forward,i look forward to present my robot via a youtube video when it is complete inshaAllah and inshaAllah my robot will be great.



    for some people i can advise you this instruction to work on your own robot,but required are the assembler language or c++ and some basic knowledge in electronics,and the most important is being experiemental.





    #define CENTER 1400
    #define CENTER_R CENTER
    #define CENTER_L CENTER+1
    #define LEFT CENTER-650
    #define RIGHT CENTER+650
    #define R_FULL_FORWARD R_STOP+300
    #define L_FULL_FORWARD L_STOP-300
    #define L_FULL_REVERSE R_FULL_FORWARD
    #define R_FULL_REVERSE L_FULL_FORWARD
    #define R_STOP 1450
    #define L_STOP 1450
    #define LEFT_TURN 0
    #define RIGHT_TURN 1
    #define QUARTER_TURN_DELAY 800 // in milliseconds
    #define DIST_ERR 50
    #define RSPEED R_STOP + 100
    #define LSPEED L_STOP - 110
    #define DEBUG 0
    #define BUMP_DELAY 125
    int leftDist = 0; // the average
    int rightDist = 0;
    int forDist = 0;
    int vision = 5;
    boolean goingLeft = true;
    boolean turnNow = false;
    int curDist = 0;
    int objDist = 0;
    int objDir = 0;
    #include .h>
    // create servo objects to control servos
    ServoTimer2 leftWheel;
    ServoTimer2 rightWheel;
    ServoTimer2 head;
    int leftSpeed = LSPEED; // variable to store the servo position
    int rightSpeed = RSPEED;
    int headPos=CENTER;
    void setup()
    {
    leftWheel.attach(10); // attaches the servo on pin 9 to the servo object
    rightWheel.attach(11);
    head.attach(9);
    rightWheel.write(rightSpeed); // Stop Wheels
    leftWheel.write(leftSpeed); // Stop Wheels
    head.write(headPos);
    Serial.begin(9600); // initialize serial communication with computer
    }
    /************************************************** *****
    * turn - Executes an in-place turn for miliseconds
    * QUARTER_TURN_DELAY gets you about 90 deg
    ************************************************** ******/
    void turn(int dir, int duration){
    // Store previous speeds
    //rightSpeed = rightWheel.read();
    //leftSpeed = leftWheel.read();
    if(dir == LEFT_TURN){
    rightWheel.write(R_FULL_REVERSE);
    leftWheel.write(L_FULL_FORWARD);
    }
    else {
    rightWheel.write(R_FULL_FORWARD);
    leftWheel.write(L_FULL_REVERSE);
    }
    delay(duration);
    // restore previous speeds
    rightWheel.write(rightSpeed);
    leftWheel.write(leftSpeed);
    }
    void go(){
    rightWheel.write(RSPEED);
    leftWheel.write(LSPEED);
    }
    void stop(){
    rightWheel.write(R_STOP);
    leftWheel.write(L_STOP);
    }
    /************************************************** *
    * scan - This function is called every cycle
    * it turns the head a click and records a distance and
    * heading. It only saves the closest object info.
    * objDist and objDir hold the closest object data
    ************************************************** **/
    void scan(){
    if(goingLeft){
    head.write(head.read()-10);
    }
    else{
    head.write(head.read()+10);
    }
    if(head.read() <= LEFT){
    goingLeft = false;
    forDist = 0;
    objDist = 0;
    turnNow = true;
    }
    if(head.read() >= RIGHT){
    goingLeft = true;
    forDist = 0;
    objDist = 0;
    turnNow = true;
    }
    curDist = analogRead(vision);
    if(curDist > objDist){
    objDist = curDist;
    objDir = head.read();
    if(DEBUG){
    Serial.print(”New close obj at Dist: β€œ);
    Serial.print(objDist);
    Serial.print(” heading: β€œ);
    Serial.println(objDir);
    }
    }
    delay(10);
    }
    /************************************************** ********
    * bump
    * Executes a nudge to a given side
    * Pass in LEFT_TURN or RIGHT_TURN
    ************************************************** *********/
    void bump(int dir){
    #define BUMP 100
    if(dir == LEFT_TURN){
    rightWheel.write(rightWheel.read()-BUMP);
    delay(BUMP_DELAY);
    rightWheel.write(rightWheel.read()+BUMP);
    }
    else {
    leftWheel.write(leftWheel.read()+BUMP);
    delay(BUMP_DELAY);
    leftWheel.write(leftWheel.read()-BUMP);
    }
    }
    /************************************************** ********
    * bumpSteer
    * Nudges us back on coarse if we see something off to the
    * side. Relies on objDist and objDir to be updated by scan()
    *
    ************************************************** *********/
    void bumpSteer(){
    // One bump per scan
    if(!turnNow || objDist < 470)
    return;
    if(objDir > CENTER){
    bump(RIGHT_TURN);
    }
    else if(objDir <= CENTER){
    bump(LEFT_TURN);
    }
    // No turn till next scan
    turnNow = false;
    }
    void lookAround(){
    head.write(LEFT);
    delay(400);
    leftDist = analogRead(vision);
    head.write(CENTER);
    delay(400);
    forDist = analogRead(vision);
    head.write(RIGHT);
    delay(400);
    rightDist = analogRead(vision);
    head.write(CENTER);
    delay(200);
    }
    int cornerNav(){
    if(objDist > 600 && objDir > CENTER - 350 && objDir < CENTER + 200){
    if( DEBUG ){
    Serial.println("Check:");
    Serial.println(objDist);
    Serial.println(objDir);
    }
    stop();
    lookAround();
    if(leftDist > rightDist + DIST_ERR){
    turn(LEFT_TURN, QUARTER_TURN_DELAY);
    }
    else {
    turn(RIGHT_TURN, QUARTER_TURN_DELAY);
    }
    go();
    objDist = 0;
    return 1;
    }
    return 0;
    }
    void loop()
    {
    scan();
    if(!cornerNav()){
    bumpSteer();
    }
    }




    This in green is the programm for the commands of the robot.


    And this instruction is only available for pro members of the website instructables ( a great place of ideas).
    Attached Files
    Last edited by Afghanistan2010; 02-15-2012, 12:39 PM.
    High achievement always takes place in the framework of high expectation.

  • #2
    you gonna make yourself a wife?

    Comment


    • #3
      ^ LOL hahaha
      ----------

      *You cannot climb the ladder of success with your hands in your pockets*

      Originally posted by Karachi
      like I said, there was only one reason I pretended to be pathan, for a girl, who was from Afghan forums and also registered here

      Comment


      • #4
        or buy one instead? lol
        ----------

        *You cannot climb the ladder of success with your hands in your pockets*

        Originally posted by Karachi
        like I said, there was only one reason I pretended to be pathan, for a girl, who was from Afghan forums and also registered here

        Comment


        • #5
          Which arduino is it ? What kinda compiler are you using ?

          If you have a flow chart for your design upload that, can't follow the code without that

          I usually use pic ucontrollers, although arduino is much much easier to interface I find

          Lemme know what kinda parts you need I'll see if I got some spare stuff, good luck !
          It's enough that I know, Our time had a home, In your heart..Was a place..But the glass always breaks..

          Comment


          • #6
            manana brother talal

            InshaAllah it has an Arduino Duemilanove microcontroller board,it is very simple for the future im rethinking using better microcontroller boards with larger space,i need a new board and a better engine,im rethinking using a engine of a fan from the computer.The code is by someone else,my code will be simple i will work with assembler,this above is c++.

            and as you know i have less time due to studies.

            for the future i want to work on this :

            http://www.instructables.com/id/How-...rvo-Robot-SER/
            High achievement always takes place in the framework of high expectation.

            Comment


            • #7
              If you dont mind, I will post some of my notes for robotics. Ive designed a mini-robot. :-)
              Even Adobe Photoshop can't change me.

              A line[Durrand line] of hatred that raised a wall between the two brothers -Hamid Karzai

              For generations, the Hindus of India prayed for deliverance from "the venom of the cobra, the teeth of the tiger and the vengeance of the Afghan."


              The men of KΓ‘bul and Khilj also went home; and whenever they were questioned about the MusulmΓ‘ns of the KohistΓ‘n (the mountains), and how matters stood there, they said, "Don't call it KohistΓ‘n, but AfghΓ‘nistΓ‘n; for there is nothing there but AfghΓ‘ns and disturbances." Thus it is clear that for this reason the people of the country call their home in their own language AfghΓ‘nistΓ‘n, and themselves AfghΓ‘ns. The people of India call them PatΓ‘n; but the reason for this is not known. But it occurs to me, that when, under the rule of Muhammadan sovereigns, MusulmΓ‘ns first came to the city of PatnΓ‘, and dwelt there, the people of India (for that reason) called them PatΓ‘nsβ€”but God knows!

              -Ferishta, 1560–1620

              Comment


              • #8
                I very welcome this brother , please go ahead and share.
                High achievement always takes place in the framework of high expectation.

                Comment


                • #9
                  http://www.telegraph.co.uk/news/ukne...bers-fear.html
                  ----------

                  *You cannot climb the ladder of success with your hands in your pockets*

                  Originally posted by Karachi
                  like I said, there was only one reason I pretended to be pathan, for a girl, who was from Afghan forums and also registered here

                  Comment


                  • #10
                    thats good man good luck with the project, the only thing i would say make it modular..and then plan each module with some end results in mind.

                    and then you can just work on the compiler for each component to see if it works .. Try using a proximity sensor for motion control, what motor are you using ? you might need a controller if you want to use a brushless one
                    It's enough that I know, Our time had a home, In your heart..Was a place..But the glass always breaks..

                    Comment


                    • #11

                      Replied : [Video] Mujahidin Ansar al Islam Rancang Robot Perang - YouTube

                      les robots moudjahidines du futur 2012 - YouTube

                      Last edited by Afghanistan2010; 02-16-2012, 11:17 AM.
                      High achievement always takes place in the framework of high expectation.

                      Comment


                      • #12
                        Originally posted by faye View Post
                        you gonna make yourself a wife?
                        I thought you were the eldest among us,how about behaving according to your age ?
                        High achievement always takes place in the framework of high expectation.

                        Comment

                        Working...
                        X