Microchip Technology dsPIC30F Manual
Microchip Technology dsPIC30F Manual

Microchip Technology dsPIC30F Manual

Quadrature encoder interface module
Hide thumbs Also See for dsPIC30F:

Advertisement

Quick Links

dsPIC30F Quadrature Encoder Interface Module
DS
Digital Signal Controller
dsPIC30F Quadrature Encoder
Interface Module
© 2005 Microchip Technology Incorporated. All Rights Reserved.
dsPIC30F Quadrature Encoder Interface Module
1
Welcome to the dsPIC30F Quadrature Encoder Interface Module web seminar.
Page 1
© 2005 Microchip Technology Inc.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the dsPIC30F and is the answer not in the manual?

Questions and answers

Summary of Contents for Microchip Technology dsPIC30F

  • Page 1 Quadrature Encoder Interface Module Digital Signal Controller dsPIC30F Quadrature Encoder Interface Module © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module Welcome to the dsPIC30F Quadrature Encoder Interface Module web seminar. Page 1 © 2005 Microchip Technology Inc.
  • Page 2 Programmable digital noise filters Quadrature Decoder The QEI as a Timer/Counter © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module 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.
  • Page 3 © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module A Quadrature Encoder (or incremental encoder, or optical encoder) is used to detect the position and speed of rotors, enabling closed loop control in many motor control applications like switched reluctance and induction motors.
  • Page 4 What is a Quadrature Encoder? Phase A leads Phase B Phase B leads Phase A © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module An example of the encoder output waveform is illustrated here. In the upper plot we see the Phase A and Phase B signals coming in on the QEA and QEB pins respectively.
  • Page 5 Reset on index pulse (if enabled) Reset on rollover/underflow Count error status bit © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module The QEI will perform all the operations needed to effectively use the information coming from the encoder.
  • Page 6: Block Diagram

    Max. Count UPDN Register © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module 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.
  • Page 7: Digital Filters

    Adjust clock divide bits to change noise filtering characteristics Use of digital filter generates latency © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module 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.
  • Page 8 Digital Filters QEA/B Filter © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module 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.
  • Page 9: Quadrature Decoder

    X 2 mode with reset by match X 4 mode Index Pulse reset X 4 mode with reset by match © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module As we have already seen, the quadrature 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.
  • Page 10: Timing Diagram

    +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 UPDN © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module This is an example of how the decoder works. We are using the x4 mode, where the clock pulse is at each edge of both phases.
  • Page 11: Position Counter

    Its value can be compared to MAXCNT register © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module The position counter can be used either for position or speed measurement. To measure motor position, we must know the relationship between the displacement and the number of phase pulses we get from the encoder.
  • Page 12 Quadrature Encoder Interface Module QEI as a 16 bit Timer/Counter © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module If the quadrature decoder functionality is not needed, the QEI peripheral module can be configured as an additional 16 bit counter/timer.
  • Page 13 Quadrature Encoder Interface Module For more information, here are references to some important documents that contain a lot of information about the dsPIC30F family of devices. The Family Reference Manual contains detailed information about the architecture and peripherals, whereas the Programmer’s Reference Manual contains a thorough description of the instruction set.
  • Page 14 Data Sheet DS70119 Microchip Web Site: www.microchip.com © 2005 Microchip Technology Incorporated. All Rights Reserved. dsPIC30F Quadrature Encoder Interface Module For device-specific information such as pinout diagrams, packaging and electrical characteristics, the device datasheets listed here are the best source of information.
  • Page 15: Related Material

    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. Thank you for your interest in the dsPIC30F Family of Digital Signal Controllers.

Table of Contents