PIC Lesson: Servo Motor

April 12th, 2010  Posted at   PIC Lesson
, arrow   |   57 Commentsarrow

Servo motor adalah alat electromechanical. Ia adalah sebuah motor yang mempunyai feedback loop. Oleh itu ia sebuah motor yang boleh dikawal posisi dan kelajuannya tanpa feedback kepada microcontroller. Servo motor hanya berputar dalam lingkungan sudutnya sahaja, contohnya hanya boleh berputar pada 1800.

Servo motor mempunyai tiga wayar. Kebiasaannya wayar merah adalah supply positif, wayar hitam adalah ground manakala wayar ketiga adalah signal daripada microcontroller. Wayar signal mempunyai beberapa standard warna iaitu warna putih, kuning atau oren.

Servo motor bergerak mengikut pulse signal. Signal ke servo adalah berbentuk PWM dengan frequency lebih kurang 50Hz iaitu masa bagi satu cycle adalah 20mS. Posisi armature servo motor bergantung pada duty cycle PWM tersebut. Dengan mengubah-ubah duty cycle, servo motor akan bergerak atau berputar. Dengan ini juga, kelajuannya boleh di kawal. Contoh signal untuk menggerakkan servo motor berputar mengikut arah jam atau mengikut arah lawan jam seperti diagram di bawah.

Walaubagaimanapun, untuk memprogram servo, tidak boleh menggunakan PWM Module dalam PIC kerana PWM yang diperlukan adalah frekuensi rendah. Oleh itu, PWM boleh dihasilkan menggunakan counter di dalam timer interrupt. Kemudian, hanya perlu menetapkan nilai posisi servo tersebut.

Berikut adalah skematik untuk menggerakkan servo mnggunakan input analog.

Berikut adalah videonya.

Anda mungkin belum baca post ini

57 komen untuk PIC Lesson: Servo Motor

Pages: « 6 5 4 3 2 [1] Show All

  1. 10. Komen dari Goh pada 1:07 PM, 17th February 2011

    After I programmed the pic, just connect the pic to the sevo and variable resistor as shown in the schematic diagram? So the whole system just consists of a servo, pic, variable resistor and battery?

    Thanks

  2. 9. Komen dari Shahrul pada 10:12 AM, 16th February 2011

    I have update the schematic.

  3. 8. Komen dari Goh pada 11:46 AM, 13th February 2011

    Hi, can I get the schematic diagram? How the pic is connected? Thanks in advance.

  4. 7. Komen dari Shahrul pada 5:21 PM, 17th January 2011

    Leong, if use 6V from voltage regulator, it’s problem when the servo consumes high current that make the voltage regulator down. Further more, parallel 4 servo it’s need high current. So, must use direct 6V battery or use high current 5V/6V power supply.

  5. 6. Komen dari LEONG pada 4:56 PM, 17th January 2011

    I discover the problem y the servo motor is moving no according to the program. It is because of the current that i supplied from DC power supply. I have one problem now. It i use DC power supply i can control the current i wan. But when i use battery i cannot control the current i wan. Especially now i need to you 4 servo motor. So how i connect the servo motor to the battery? Any additional circuit to improve the current?

  6. 5. Komen dari Shahrul pada 1:07 PM, 24th November 2010

    You can try,
    Give 1ms ON 19ms OFF, repeat 20 cycle.
    Then give 1.5ms ON 18.5ms OFF, repeat 20 cycle.

  7. 4. Komen dari LEONG pada 12:51 PM, 24th November 2010

    I writing my program in assembly code. I have make 1mS on and 19mS off pulse. I test is with oscilloscope and get the result. But when i connect to the servo motor, it suppose to rotate to 0 degree, but it rotated to 180 degree. So may i know what is the problem? What can i do?

  8. 3. Komen dari kasim pada 12:17 AM, 28th October 2010

    apa kebaikan servo controller??

  9. 2. Komen dari Shahrul pada 6:04 PM, 9th August 2010

    ferus, variable resistor sambung pada PORTA<0> dan servo motor sambung pada PORTC<0>.

  10. 1. Komen dari ferus pada 6:00 PM, 9th August 2010

    salam bos boleh berikan saya mcm mana penyambungan antara vabriable resistor dengan servo motor tu ka

Pages: « 6 5 4 3 2 [1] Show All

Dah baca, tinggalkan komen anda disini

What is 4 + 3 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)