Sunday, February 13, 2011

Stepper Motor Menggunakan Bascom AVR (Tugas Mikroprosesor)

Motor stepper mengubah pulsa-pulsa listrik yang diberikan menjadi gerakan-gerakan diskrit rotor yang disebut langkah (steps). Nilai rating dari suatu motor stepper diberikan dalam langkah per putaran (steps per revolution). Motor stepper umumnya mempunyai kecepatan dan [torsi] yang rendah.

Motor stepper bekerja berdasarkan pulsa-pulsa yang diberikan pada lilitan fasanya dalam urut-urutan yang tepat. Selain itu, pulsa-pulsa itu harus juga menyediakan arus yang cukup besar pada lilitan fasa tersebut. Karena itu untuk pengoperasian motor stepper pertama-tama harus mendesain suatu sequencer logic untuk menentukan urutan pencatuan lilitan fasa motor dan kemudian menggunkan suatu penggerak (driver) untuk menyediakan arus yang dibutuhkan oleh lilitan fasa.

Elemen-elemen berikut menentukan karakteristik suatu motor stepper:
  1. Tegangan, motor stepper biasanya mempunyai tegangan nominal. Tegangan yang diberikan kadang-kadang melebihi tegangan nominal untuk mendapatkan torsi yang dibutuhkan, tetapi dapat menyebabkan panas berlebih dan mempersingkat usia motor. 
  2. Hambatan, karakteristik lainnya adalah hambatan-per-lilitan. Hambatan ini akan menentukan arus yang ditarik oleh motor, dan juga mempengaruhi kurva torsi dan kecepatan kerja maksimum motor.
  3. Gambar Rangkaian dengan Proteus ISIS
  4. Derajat per langkah (step angle), faktor ini menentukan berapa derajat poros akan berputar untuk setiap langkah penuh (full step). Operasi setengah langkah (half step) akan melipat-gandakan jumlah langkah-per-revolusi, dan mengurangi derajat-per-langkahnya. Derajat-per-langkah sering disebut sebagai resolusi motor.
  5.  
    Pada tutorial ini akan membahas tutorial stepper motor dengan menggunakan Bascom AVR dan Proteus ISIS.





    Berikut code bas-nya :

    $regfile = "m16def.dat"
    $crystal = 1000000

    Config Kbd = Portb
    Config Lcd = 16 * 2
    Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , Rs = Portc.0 , E = Portc.1
    Config Portd = Output
    Config Porta = Input

    Dim A As Byte , B As Byte , Key As Byte , C As Byte , D As Byte , E As Byte

    Cls
    Cursor Off

    B = 0
    D = 1

    Q:
    Locate 1 , 1
    Lcd "Direction:"
    Locate 2 , 1
    Lcd "Speed:"
    Do
    '************Read Keyboard
    A = Getkbd()
    If A > 15 Then
       Goto Q
    Else
       Key = Lookup(a , Dta)
         If Key <= 9 Then
               B = B * 10
               B = B + Key
    '*************Direction
              If D = 0 Then Lcd B
                       Waitms 270
                   Elseif Key = 10 Then
                       Locate 1 , 11
                       Lcd "Left"
                       C = 1
                       D = 0
                       B = 0

                   Elseif Key = 11 Then
                      Locate 1 , 11
                      Lcd "Right"
                      C = 2
                      D = 0
                      B = 0
    '****************reset
                   Elseif Key = 13 Then
                      Cls
                      D = 1
                      B = 0
                      Portd.0 = 0
                      Portd.1 = 0
                      Waitms 50
                      Goto Q
    '****************Enter key
                   Elseif Key = 14 Then
                       If D = 0 Then
                           Select Case C
                              Case 1 : Gosub R
                              Case 2 : Gosub T
                           End Select

                       End If
             End If

    End If

    Wait 1

    Loop

    End

    Dta:
    Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 13 , 0 , 14 , 15

    R:
    Do
    Portd = &B00000001 : Waitms B
    Portd = &B00000011 : Waitms B
    Portd = &B00000010 : Waitms B
    Portd = &B00000110 : Waitms B
    Portd = &B00000100 : Waitms B
    Portd = &B00001100 : Waitms B
    Portd = &B00001000 : Waitms B
    Portd = &B00001001 : Waitms B
      If Pina.0 = 1 Then
          Locate 2 , 1
          Lcd "Speed:"
          B = 0
          Lcd B ; "          "
          Return
      End If

    Loop

    T:
    Do
    Portd = &B00001001 : Waitms B
    Portd = &B00001000 : Waitms B
    Portd = &B00001100 : Waitms B
    Portd = &B00000100 : Waitms B
    Portd = &B00000110 : Waitms B
    Portd = &B00000010 : Waitms B
    Portd = &B00000011 : Waitms B
    Portd = &B00000001 : Waitms B
       If Pina.0 = 1 Then
           Locate 2 , 1
           Lcd "Speed:"
           B = 0
           Lcd B ; "          "
           Return
       End If

    Loop




    Dan ini video tutorialnya :





    BASCOM TEAM :
    1. Yoga Mustofa (41408120004)
    2. Andri Kamiludin (41408120030)
    3. Odih Harjum (41408120001)
    4. Andi Nurcahyadi (41408120036)
    5. Agus Dwiyanto (41408120003)
    6. Ronald Jackson Manuhutu (41408120057)
    7. M. Ady Nurs (41408120014)
    8. Jeffry Klau
    9. Agustinus Sigit  
     

      continue reading

      Thursday, February 3, 2011

      Trigonometry

      Trigonometry (from Greek trigōnon "triangle" + metron "measure" or from Sanskrit trikon "triangle" + miti "measurement" = trikonmiti) is a branch of mathematics that studies triangles and the relationships between their sides and the angles between sides. Trigonometry defines the trigonometric functions, which describe those relationships and have applicability to cyclical phenomena, such as waves. The field evolved during the third century BC as a branch of geometry used extensively for astronomical studies.

      continue reading

      Complex number

      A complex number is a number consisting of a real and imaginary part. It can be written in the form a + bi, where a and b are real numbers, and i is the standard imaginary unit with the property i 2 = −1. The complex numbers contain the ordinary real numbers, but extend them by adding in extra numbers and correspondingly expanding the understanding of addition and multiplication.

      continue reading

      Telecommunication

      Telecommunication is the transmission of information, over significant distances, for the purpose of communication. In earlier times, telecommunications involved the use of visual signals, such as beacons, smoke, semaphore telegraphs, signal flags, and optical heliographs, or audio messages via coded drumbeats, lung-blown horns, or sent by loud whistles, for example. In the modern age of electricity and electronics, telecommunications now also includes the use of electrical devices such as telegraphs, telephones, and teletypes, the use of radio and microwave communications, as well as fiber optics and their associated electronics, plus the use of the orbiting satellites and the Internet.

      continue reading

      Mathematics

      Mathematics is the study of quantity, structure, space, and change. Mathematicians seek out patterns, formulate new conjectures, and establish truth by rigorous deduction from appropriately chosen axioms and definitions.
      Through the use of abstraction and logical reasoning, mathematics evolved from counting, calculation, measurement, and the systematic study of the shapes and motions of physical objects.

      continue reading

      Philosophy

      Philosophy is the study of general and fundamental problems, such as those connected with existence, knowledge, values, reason, mind, and language. It is distinguished from other ways of addressing such problems by its critical, generally systematic approach and its reliance on rational argument. The word "philosophy" comes from the Greek φιλοσοφία (philosophia), which literally means "love of wisdom".

      continue reading