งานที่มอบหมาย ครูประภาส

บทความประกอบการเรียนรู้ => ไมโครคอนโทรลเลอร์ (Arduino) => ข้อความที่เริ่มโดย: admin ที่ พฤษภาคม 01, 2014, 04:07:53 PM

หัวข้อ: งานครั้งที่ 25 เขียนโปรแกรมควบคุมสเต็ปเปอร์มอเตอร์ผ่าน UART
เริ่มหัวข้อโดย: admin ที่ พฤษภาคม 01, 2014, 04:07:53 PM
เขียนโปรแกรมควบคุมสเต็ปเปอร์มอเตอร์ผ่าน UART
ฟังก์ชั่นอยู่ในกลุ่ม Serial http://arduino.cc/en/Reference/Serial (http://arduino.cc/en/Reference/Serial)
-Serial.begin() http://arduino.cc/en/Serial/Begin (http://arduino.cc/en/Serial/Begin)
-if (Serial) http://arduino.cc/en/Serial/IfSerial (http://arduino.cc/en/Serial/IfSerial)
-Serial.available() http://arduino.cc/en/Serial/Available (http://arduino.cc/en/Serial/Available)
-Serial.read() http://arduino.cc/en/Serial/Read (http://arduino.cc/en/Serial/Read)
-Serial.print() http://arduino.cc/en/Serial/Print (http://arduino.cc/en/Serial/Print)
-Serial.println() http://arduino.cc/en/Serial/Println (http://arduino.cc/en/Serial/Println)
-Serial.flush() http://arduino.cc/en/Serial/Flush (http://arduino.cc/en/Serial/Flush)

ฟังก์ชั่นทั่วไป
-pinMode() http://arduino.cc/en/Reference/PinMode (http://arduino.cc/en/Reference/PinMode)
-digitalWrite() http://arduino.cc/en/Reference/DigitalWrite (http://arduino.cc/en/Reference/DigitalWrite)
-delay() http://arduino.cc/en/reference/delay (http://arduino.cc/en/reference/delay)

โจทย์โปรแกรม
-เขียนโปรแกรมควบคุมการหมุนของมอเตอร์ผ่านทาง UART
-โปรแกรมรายละเอียดพิเศษรายกลุ่ม (แจ้งให้ทราบเมื่อถึงชั่วโมงเรียน)


วงจรที่ใช้ในการทดลองสำหรับผู้ที่ใช้บอร์ด Arduino
(http://www.praphas.com/PhotoForum/arduino/Lab-25-01.png)

วงจรที่ใช้ในการทดลองสำหรับผู้ที่ใช้ไอซี ATmega328 (ที่มี Boot Loader Arduino)
(http://www.praphas.com/PhotoForum/arduino/Lab-25-02.png)

บริเวณใช้งานบอร์ดทดลอง
(http://www.praphas.com/PhotoForum/arduino/Lab-25-03.png)

โมดูลสำเร็จรูป Motor Drive Module (L9110S)
(http://www.praphas.com/PhotoForum/arduino/Lab-23-a.png)
http://www.arduinoall.com (http://www.arduinoall.com/product/168/motor-drive-module-l9110s)

(http://www.praphas.com/PhotoForum/arduino/Lab-25-b.jpg)
สเปคของสเต็ปเปอร์มอเตอร์ 5V เบอร์ 28BYJ-48-5V

4 Phase 5 Wire Connection
-100% Brand New
-Phase : 4
-Current : 160 mA per winding (320 mA in 4-step mode) Measured: 250mA stopped, 200 mA running fast
-Resistance : 31 Ω per coil winding (from Red wire to any coil) (Some 24-28 ohms)
-Voltage : 5V DC
-Step Angle (8-Step sequence: Internal Motor alone): 5.625° (64 steps per revolution)
-Step Angle (4-Step sequence: Internal Motor alone): 11.25° (32 steps per revolution)
-Gear Reduction ratio: 1 / 64 (Not really exact: probably 63.68395.:1 )
-SO: it takes (64*64 = 4096 steps per output shaft revolution.. In 8-step sequence.
-SO: it takes (32*64 = 2048 steps per output shaft revolution.. In 4-step sequence.
-NOTE: Arduino "Stepper Library" runs in 4-step mode
-No-Load Pull-Out Frequency : 800pps
-No-Load Pull-In Frequency : 500pps
-Pull-In Torque : ≥ 78.4mN.m
-Wiring Instruction : A (Blue), B (Pink), C (Yellow), D (Orange), E (Red, Mid-Point)
-Weight : 30g