/* i have made this code for the LMD18245 motor controller,
i have merged the pid code of Josh Kopel
whith the code of makerbot servo-controller board,
you can use this code on the some board changing some values.
Daniele Poddighe
external ardware require a quadrature encoder, timing slit strip and a dc motor,
all you can find inside an old printer, i have took it from canon and hp printers(psc1510)
for motor controll you can choose different type of H-bridge, i have used LMD18245,
you can order 3 of it on ti.com sample request, the hardware needed is explained on the datasheet but i'm drowing
the schematic and PCB layout on eagle.
read a rotary encoder with interrupts
Encoder hooked up with common to GROUND,
encoder0PinA to pin 2, encoder0PinB to pin 4 (or pin 3 see below)
it doesn't matter which encoder pin you use for A or B
is possible to change PID costants by sending on serial interfaces the values separated by ',' in this order: KP,KD,KI
example: 5.2,3.1,0 so we have KP=5.2 KD=3.1 KI=0 is only for testing purposes,
but i will leave this function with eeprom storage
/* i have made this code for the LMD18245 motor controller,
i have merged the pid code of Josh Kopel
whith the code of makerbot servo-controller board,
you can use this code on the some board changing some values.
Daniele Poddighe
external ardware require a quadrature encoder, timing slit strip and a dc motor,
all you can find inside an old printer, i have took it from canon and hp printers(psc1510)
for motor controll you can choose different type of H-bridge, i have used LMD18245,
you can order 3 of it on ti.com sample request, the hardware needed is explained on the datasheet but i'm drowing
the schematic and PCB layout on eagle.
read a rotary encoder with interrupts
Encoder hooked up with common to GROUND,
encoder0PinA to pin 2, encoder0PinB to pin 4 (or pin 3 see below)
it doesn't matter which encoder pin you use for A or B
is possible to change PID costants by sending on serial interfaces the values separated by ',' in this order: KP,KD,KI
example: 5.2,3.1,0 so we have KP=5.2 KD=3.1 KI=0 is only for testing purposes,
but i will leave this function with eeprom storage
การแปล กรุณารอสักครู่..

/ * * * * ผมได้รหัสนี้สำหรับ lmd18245 มอเตอร์ควบคุม ,
ฉันได้รวมรหัส PID ของจอช bath
ด้วยรหัสของคณะกรรมการควบคุม servo MakerBot
, คุณสามารถใช้รหัสนี้ในบางบอร์ดเปลี่ยนแปลงค่า
ardware Daniele poddighe ภายนอกที่ต้องการพื้นที่เข้ารหัสแถบปาดช่วงเวลาและกระแสตรง มอเตอร์ ,
ทั้งหมดคุณสามารถค้นหาภายในเครื่องพิมพ์เก่าผมเอามาจาก Canon และ HP เครื่องพิมพ์ ( psc1510 )
มอเตอร์ควบคุมคุณสามารถเลือกประเภทที่แตกต่างกันของ h-bridge ผมใช้ lmd18245
3 , คุณสามารถสั่งซื้อของบน ti.com การร้องขอตัวอย่าง , ฮาร์ดแวร์ต้องการจะอธิบายบนแผ่นแต่ผมยึดติด
วงจรและ PCB รูปแบบ Eagle .
อ่าน เป็นโรตารี Encoder กับขัดจังหวะ
Encoder ควงทั่วไปพื้น
encoder0pina ขา 2encoder0pinb ขา 4 ( หรือ pin 3 ดูด้านล่าง )
ไม่สำคัญ Encoder ซึ่งขาคุณใช้ A หรือ B
เป็นไปได้ที่จะเปลี่ยนไอดี costants โดยส่งในอินเตอร์เฟซอนุกรมค่าที่คั่นด้วย ' , ' ในคำสั่งนี้ : KP KD - , * คิ
: 5.2,3.1,0 ดังนั้นเรามี KP = 5.2 กิโล = 3.1 กิ = 0 เป็นเพียงการทดสอบ ,
แต่ผมจะปล่อยให้ฟังก์ชั่นนี้กับ EEPROM กระเป๋า
การแปล กรุณารอสักครู่..
