วันศุกร์ที่ 14 พฤษภาคม พ.ศ. 2553

ลักษณะของ OVDCON register

OVDCON: override control register
bit 15-8 POVD4H-POVD1L: pwm output override bits
1=output on PWMxx i/o pin is controlled by the pwm generator
0=output on PWMxx i/o pin is controlled by the value in the corresponding POUTxx bit
bit 7-0 POUT4H-POUT1L: pwm manual output bits
1=PWMxx i/o pin is driven ACTIVE when the corresponding POVDxx bit is cleared
0=PWMxx i/o pin is driven INACTIVE when the corresponding POVDxx bit is cleared
---------
---------
OVDCON register ประกอบด้วย
<15:8>
POVD4H, POVD4L, POVD3H, POVD3L, POVD2H, POVD2L, POVD1H, POVD1L
<7:0>
POUT4H, POUT4H, POUT3H, POUT3L, POUT2H, POUT2L, POUT1H, POUT1L
บิต POVD เป็นตัวเลือกว่าให้ควบคุมโดย pwm generator (set 1) หรือ manual (set 0) ส่วน POUT เป็นตัวเลือกว่าจะให้ช่องใหนควบคุมแบบ manual

PWM output override

บิต pwm output override อนุญาตให้ผู้ใช้งานขับ pwm i/o pin โดยตัวผู้ใช้งานเอง เพื่อระบุ logic state โดยเป็นอิสระจากชุด duty cycle comparison บิต pwm override มีประโยชน์เมื่อต้องควบคุม electrically commuted motors หลายชนิด
บิตที่ใช้ควบคุม pwm output override ทั้งหมดบรรจุอยู่รีจิสเตอร์ OVDCON ครึ่งบนของรีจิสเตอร์ OVDCON ประกอบมี 8 บิต (POVDxx) เป็นตัวเลือกว่า pwm i/o pins ใหนจะถูก override ส่วนครึ่งล่างของรีจิสเตอร์ OVDCON มี 8 บิต (POUTxx) เป็นตัวเลือกว่า pwm i/o pins เพื่อทำการ overrid ผ่านบิต POVDxx
บิต POVD เป็นบิตแบบ active-low เมื่อเซตบิต POVD บิต POUTxx ที่สมพันธ์กันจะไม่มีผลต่อเอาต์พุตของ pwm เมื่อบิตใดบิตหนึ่งของ POVD ถูกเคลียร์ เอาต์พุตของ pwm i/o pin ที่ถูกสัมพันธ์กันจะขึ้นอยู่กับสภาวะของบิต POUT เมื่อบิต POUT ถูกเซต สัญญาณ pwm จะอยู่ในสภาวะ active และเมื่อบิต POUT ถูกเคลียร์ สัญญาณ pwm จะอยู่ในสภาวะ inactive

Independent PWM output mode

independent pwm output mode ใช้ขับโหลดดังแสดงในภาพที่ 15-17 ซึ่ง pwm output pair จะแยกกันทำงานใน independnet output mode โดยการเซตบิต PMOD ใน PWMCON1 register ตัว dead time generators จะไม่ทำงานในโหมดนี้และไม่มีผลต่อสภาวะของ output pin pair

Dead time distortion

สำรับ pwm ที่ความถี่สูง อัตราระหว่าง dead time กับเวลาที่ pwm อยู่ในสภาวะ active อาจมีค่าสูง ในกรณีที่มากเกินไปถ้า duty cycle น้อยกว่าหรือเท่ากับ programmed duty cycle จะไม่มีการสร้างสัญญาณ pwm กรณีนี้ dead time ที่แทรกอยู่จึงจะเริ่มรบกวนสัญญาณจาก pwm module ผู้ใช้งานมั่นใจได้ว่า dead time distortion จะมีผลน้อยมากถ้ารักษาระดับ pwm duty cycle ไว้อย่างน้อย 3 เท่าของ dead time และยังสามารถแก้ไข dead time distortion ได้หลายทาง เช่น ใช้ closed loop current control
ผลกระทบแบบเดียวกันนี้เกิดเมื่อ duty cycle เข้าใกล้ 100% ดังนั้นค่า duty cycle สูงสุดของ pwm sinal ควรมีช่วงสภาวะ inactive ที่น้อยที่สุดเป็นอย่างน้อย 3 เท่าของ dead time

Dead time ranges

Dead time A และ dead time B ถูกกำหนดด้วยค่า input clock prescaler และค่า dead time ความละเอียด 6 บิตแบบไม่นับเครื่องหมาย เพื่อให้ได้ค่า dead time ที่พอดีอิงตามความถี่ของอุปกรณ์ขณะทำงาน จะมี input clock prescaler ให้เลือก 4 ค่า และตัว clock prescaler สามารถกำหนดได้อิสระในแต่ละ dead time โดยใช้บิต DTAPS และ DTBPS ใน DTCON1 SFR และแต่ละ clock prescaler ดังกล่าวมีค่า:

  • Tcy
  • 2Tcy
  • 4Tcy
  • 8Tcy

ตารางที่ 15-5 แสดงตัวอย่างขนาด dead time ตาม clock prescaler และความถี่ของอุปกรณ์ขณะทำงาน

Dead time assignment

note: ตัว dead time assignment logic ใช้งานได้กับเฉพาะ DSC dsPIC variants ที่ประกอบด้วย 8-output pwm module ส่วน 6-output pwm module ใช้ dead time A เท่านั้น
ตัว DTCON2 register มี control bit ที่ใช้อนุญาติ dead time ให้ทำงานในแต่ละ complementary outputs จะมีสองบิตใช้กำหนด dead time ของแต่ละ complementary outputs ตัวอย่างเช่น บิต DTS1A และ DTS1I ใช้กำหนด dead time ให้กับ PWM1H/PWM1L complementary output pair บิตคู่ดังกล่าวกล่าวได้ว่าเป็นบิต 'dead-time-select-active' และ 'dead-time-select-inactive' ตามลำดับ หน้าที่ของแต่ละบิตเป็นดังนี้:

  • DTSxA control bit ใช้กำหนด dead time ที่แทรกอยู่ก่อนที่ high-side จะเปลี่ยนสถานะเป็น active
  • DTSzI control bit ใช้กำหนด dead time ที่แทรกอยู่ก่นที่ low-side จะเปลี่ยนสถานะเป็น active

ตารางที่ 15-4 รวมหน้าที่ของแต่ละบิตควบคุม dead time

วันพฤหัสบดีที่ 13 พฤษภาคม พ.ศ. 2553

Dead time generators

แต่ละ complementary output pair ของ pwm module มีตัวนับลงขนาด 6 บิต ใช้สำหรับสร้าง dead time ดังแสดงในภาพที่ 15-15 dead time แต่ละชุดมีตัวตรวจจับ rising และ falling edge ต่อเข้ากับ duty comparison output
หนึ่งในสอง dead time ถูกโหลดไปที่ตัว timer ใน pwm edge event ที่ตรวจจับได้ ขึ้นกับว่า pwm edge จะเป็นช่วงขาขึ้นหรือขาลง การทำงานของ complementary output สัญญาณหนึ่งจะถูกหน่วงจนกระทั่ง timer นับลงไปถึง 0 แผนภาพเวลาชี้ dead time ที่แทรกใน pwm output pair แสดงในภาพที่ 15-16 การใช้ dead time 2 แบบทั้งขอบขาขึ้นและและขอบขาลงได้ขยายความไว้ในภาพเพื่อความกระจ่าง