Microchip Technology dsPIC30F Скачать руководство пользователя страница 1

dsPIC30F Quadrature Encoder Interface Module

© 2005 Microchip Technology Inc.

Page 1

© 2005 Microchip Technology Incorporated. All Rights Reserved.   

dsPIC30F Quadrature Encoder Interface Module        

1

dsPIC30F Quadrature Encoder 

Interface Module

DS

Digital Signal Controller

Welcome to the dsPIC30F Quadrature Encoder Interface Module web seminar.

Содержание dsPIC30F

Страница 1: ...logy Inc Page 1 2005 Microchip Technology Incorporated All Rights Reserved dsPIC30F Quadrature Encoder Interface Module 1 dsPIC30F Quadrature Encoder Interface Module DS Digital Signal Controller Welcome to the dsPIC30F Quadrature Encoder Interface Module web seminar ...

Страница 2: ...eatures Overview O Programmable digital noise filters O Quadrature Decoder O The QEI as a Timer Counter These are the main topics we will address during this seminar First of all we will see the purpose of the QEI module is Then we will go through all the main functional blocks the digital noise filters the decoder and the position counter Finally we will see that this peripheral if not used as an...

Страница 3: ...d of rotors enabling closed loop control in many motor control applications like switched reluctance and induction motors Typically an encoder includes a slotted wheel attached to the motor shaft a light source a light sensing device and some logic During the rotation of the shaft the light passes through the slots and hits the sensing element generating electric signals The three digital outputs ...

Страница 4: ...erse the rotor rotation like in the lower part of the figure Phase B will lead Phase A so by detecting which rising edge comes first we are able to detect the direction of rotation The encoder outputs can only have four different states as indicated in the figure 01 00 10 11 Note that if we reverse the direction the sequence is reversed as well The index occurs only once per revolution and is used...

Страница 5: ... pulse if enabled O Reset on rollover underflow O Count error status bit The QEI will perform all the operations needed to effectively use the information coming from the encoder Since these signals are heavily affected by noise a digital filter is available on each input The filtered phase edges are counted by a dedicated 16 bit up down counter also referred to as the Position Counter To establis...

Страница 6: ...ic Tcy UPDN 16 Bit Up Down Counter DIR Quadrature Decoder Logic Clock Reset Max Count Register Timer Mode Timer Mode Comparator This block diagram depicts the internal architecture of the QEI modules We can see the input pins and the associated digital filters There is also an up down input pin that is mainly used when the unit operates as a counter The quadratrute decoder logic is responsible for...

Страница 7: ...tal filter generates latency The digital filters are responsible for rejecting noise from the three inputs The instruction cycle clock can be divided down by 2 4 16 32 64 128 256 before being used in the filter The lower the clock frequency the lower frequencies are rejected by the filter The prescaled clock is used to sample the input signal if and only if three consecutive samples have the same ...

Страница 8: ... 8 Digital Filters TCY QEA B Filter Here we can see that the input signal at the QEA or QEB pin is sampled using the selected clock in this case the instruction cycle period Tcy If at least three samples having the same value are detected the output is updated otherwise the input signal changes are disregarded Glitches and spikes can be efficiently filtered out by the digital filters ...

Страница 9: ...adrature decoder must determine the direction of rotation looking at the two incoming phase signals and generate the clock that will be used by the position counter We can select between two modes in the first one x2 the decoder only generates a clock impulse at the rising and falling edges of Phase A signal in the other mode x4 the clock pulses are generate at each edge of phase A and Phase B The...

Страница 10: ...hase B so that the counter is counting up Then in the second half the rotation of the rotor is reversed Phase B now leads Phase A and the counter is counting down This is why an up down counter is required in this application The count direction can be determined by reading the UPDN bit in the QEI control register but the UPDN pin can also be used to indicate the count direction status With the x4...

Страница 11: ...splacement and the number of phase pulses we get from the encoder This relation can be known in advance or can be measured during initialization by accumulating the total count for the maximum allowed displacement We can set a constant value in the Maximum Count register which is typically the number of pulse edges generated by one encoder revolution As soon as we have a match between the Position...

Страница 12: ...gister serves as a period register An additional feature compared to the general purpose timers is that the QEI counter is able to both increment and decrement its count thus providing up down counter functionality The timer clock can be either internal or external in the latter case the input pin is the QEA pin and the input clock after digital filtering will be synchronized with the instruction ...

Страница 13: ...ase Design Reference Document dsPIC30F Family Reference Manual DS70046 dsPIC30F Programmer s Reference Manual DS70030 MPLAB MPLAB C30 C Compiler User User s Guide DS51284 MPLAB ASM30 LINK30 Utilities User DS51317 dsPIC Language Tools Libraries DS51456 For more information here are references to some important documents that contain a lot of information about the dsPIC30F family of devices The Fami...

Страница 14: ...port Documents Device Specific Reference Document O dsPIC30F2010 Data Sheet DS70118 O dsPIC30F3010 3011 Data Sheet DS70141 O dsPIC30F4011 4012 Data Sheet DS70135 O dsPIC30F6010 Data Sheet DS70119 Microchip Web Site www microchip com For device specific information such as pinout diagrams packaging and electrical characteristics the device datasheets listed here are the best source of information ...

Страница 15: ... BLDC Control AN908 Using the dsPIC30F for Vector Control of an ACIM AN957 Sensored BLDC Motor Control Using dsPIC30F2010 We also have some application notes on motor control in which the peripheral is used All these documents can be obtained from the Microchip web site by clicking on the dsPIC Digital Signal Controllers or Technical Documentation link This wraps up the seminar on dsPIC30F QEI Tha...

Отзывы: