Skip to Main Content Skip to Search
Product Documentation

C280x/C2803x/C28x3x/c2834x eQEP - Quadrature encoder pulse circuit

Library

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2803x

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C280x

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C28x3x

Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2834x

Description

The enhanced quadrature encoder pulse (eQEP) module is used for direct interface with a linear or rotary incremental encoder to get position, direction, and speed information from a rotating machine for use in a high-performance motion and position-control system.

Dialog Box

General Pane

Module

If more than one eQEP module is available on your processor, select the module this block configures.

Position counter mode

The input signals QEPA and QEPB are processed by the Quadrature Decoder Unit (QDU) to produce clock (QCLK) and direction (QDIR) signals. Choose the position counter mode appropriate to the way the input to the eQEP module is encoded. Choices are Quadrature-count (the default), Direction-count, Up-count, and Down-count.

Positive rotation

This field appears only when you choose Quadrature-count in Position counter mode. Choose the direction that represents positive rotation: Clockwise (the default) or Counterclockwise.

External clock rate

This field appears only when you choose Direction-count, Up-count, or Down-count in Position counter mode. In these cases, you can program clock generation to the position counter to occur on both rising and falling edges of the QEPA input or on the rising edge only. The effect of choosing the former is increasing the measurement resolution by a factor of 2. Choices are 2x resolution: Count the rising/falling edge (the default) or 1x resolution: Count the rising edge only.

Quadrature direction flag output port

This check box appears only when you choose Quadrature-count in Position counter mode. Select this check box if you want to create a port on the block that gives access to the direction flag of the quadrature module.

Invert input QEPxA polarity, Invert input QEPxB polarity, Invert input QEPxI polarity, Invert input QEPxS polarity

Select any of these check boxes to invert the polarity of the respective eQEP input signal.

Index pulse gating option

Select this check box to enable gating of the index pulse.

Sample time

Enter the sample time in seconds.

Position Counter Pane

Output position counter

This check box is selected by default. Leave it selected to output the position counter signal PCSOUT from the position counter and control unit (PCCU).

Maximum position counter value

Enter a maximum value for the position counter. Enter a value from 0 to 4294967295. The value defaults to the maximum allowed value of 4294967295.

Enable set to init value on index event

Select to set the position counter to its initialization value on an index event. This check box is cleared by default.

Set to init value on index event

This field appears only when Enable set to init value on index event is selected. Choose to set the position counter to its initialization value on the Rising edge (the default) or the Falling edge of the index input.

Enable set to init value on strobe event

Select to set the position counter to its initialization value on a strobe event. This check box is cleared by default.

Set to init value on strobe event

This field appears only when Enable set to init value on strobe event is selected. Rising edge, the default option, sets the position counter to its initialization value on the rising edge of the strobe input. In the forward direction, Depending on direction sets the position counter to its initialization value on the rising edge of the strobe input. In the reverse direction, Depending on direction sets the position counter to its initialization value on the falling edge of the strobe input.

Enable software initialization

Select to allow the position counter to be set to its initialization value via software. This check box is cleared by default.

Software initialization source

This field appears only when Enable software initialization is selected. Choose Set to init value at start up (the default) or Input port to receive the control logic through the input port.

Initialization value

This field appears only when Enable set to init value on index event, Enable set to init value on strobe event, or Enable software initialization check box is selected. Enter the initialization value for the position counter. Enter a value from 0 to 4294967295. The value defaults to 2147483648.

Position counter reset mode

Choose a position counter reset mode, depending on the nature of the system the eQEP module is working with: Reset on an index event (the default), Reset on the maximum position, Reset on the first index event, or Reset on a time unit event.

Output position counter error flag

This check box appears only when Position counter reset mode is set to Reset on an index event. Select this check box to output the position counter error flag on error.

Output latch position counter on index event

This check box appears only when Position counter reset mode is set to Reset on the maximum position or Reset on the first index event. The eQEP index input can be configured to latch the position counter (QPOSCNT) into QPOSILAT on occurrence of a definite event on this pin. Select this check box to latch the position counter on each index event.

Index event latch of position counter

This field appears only when the Output latch position counter on index event check box is selected. Choose one of the following events to configure the eQEP position counter to latch on that event: Rising edge, Falling edge, or Software index marker via input port.

Output latch position counter on strobe event

This check box appears only when Position counter reset mode is set to Reset on the maximum position or Reset on the first index event. The eQEP strobe input can be configured to latch the position counter (QPOSCNT) into QPOSSLAT on occurrence of a definite event on this pin. Select this check box to latch the position counter on each strobe event.

Strobe event of latched position counter

This field appears only when the Output latch position counter on strobe event check box is selected. Choose Rising edge to latch on the rising edge of the strobe event input, or Depending on direction to latch on the rising edge in the forward direction and the falling edge in the reverse direction.

Speed Calculation Pane

Enable QEP capture

The eQEP peripheral includes an integrated edge capture unit to measure the elapsed time between the unit position events. Check this check box to enable the edge capture unit. This check box is cleared by default.

Output capture timer

Select this check box to output the capture timer into the capture period register. This check box is cleared by default.

Output capture period timer

Select this check box to output the capture period into the capture period register. This check box is cleared by default.

eQEP capture timer prescaler

The eQEP capture timer runs from prescaled SYSCLKOUT. The capture timer period is the value of SYSCLKOUT divided by the value you choose in this field. Choices are 1, 2, 4, 8, 16, 32, 64, and 128 (the default).

Unit position event prescaler

The timing of the unit position event is determined by prescaling the quadrature-clock (QCLK). QCLK is divided by the value you choose in this popup. Choices are 4, 8, 16, 32, 64, 128, 256, 512, 1024, and 2048 (the default).

Enable and output overflow error flag

Select this check box to enable and output the eQEP overflow error flag in the event of capture timer overflow between unit position events.

Enable and output direction change error flag

Select this check box to enable and output the direction change error flag.

Capture timer and position

Choose the event that triggers the latching of the capture timer and capture period register: On position counter read (the default) or On unit time-out event.

Unit timer period

This field appears only when you choose On unit time-out event in Capture timer and position. Enter a value for the unit timer period from 0 to 4294967295. The value defaults to 100000000.

Output capture timer latched value

Select this check box to output the capture timer latched value from the QCTMRLAT register.

Output capture timer period latched value

Select this check box to output the capture timer period latched value from the QCPRDLAT register.

Output position counter latched value

Select this check box to output the position counter latched value from the QPOSLAT register.

Compare Output Pane

Enable position-compare sync signal output

The eQEP peripheral includes a position-compare unit that is used to generate the position-compare sync signal on compare match between the position counter register (QPOSCNT) and the position-compare register (QPOSCMP). Select this check box to enable the position-compare sync signal output. This check box is cleared by default.

Sync output pin selection

Choose which pin is used for the sync signal output. Choices are Index pin is used for sync output (the default) and Strobe pin is used for sync output.

Compare value source

Choose the source of the value to use in the position comparison. Choose Specify via dialog (the default) to specify a fixed value or Input port to read the value from the input port.

Position compare shadow load mode

This field lets you enable or disable shadow mode for use in generating the position-compare sync signal (shadow mode is enabled by default). When shadow mode is enabled, you can also choose an event to trigger the loading of the shadow register value into the active register.

Choose Disable shadow mode to disable shadow mode. Choose Load on QPOSCNT=0 (the default) to load on the position-counter zero event. Choose Load on QPOSCNT=QPOSCMP to load on compare match.

Position compare value

This field appears only when you choose Specify via dialog in Compare value source. Enter a value from 0 to 4294967295. The value defaults to 4294967295. This value is loaded into the position-compare register (QPOSCMP).

Sync output pulse width

The pulse stretcher logic in the position-compare unit generates a programmable position-compare sync pulse output on the position-compare match.

Enter a value from 1 to 4096 to determine the pulse width of the position-compare sync output signal. The value defaults to 1.

Polarity of sync output

Choose a value to determine the polarity of the sync output signal: Active high (the default) or Active low.

Watchdog Unit Pane

Enable watchdog time out flag via output port

The eQEP peripheral contains a watchdog timer that monitors the quadrature-clock to indicate proper operation of the motion-control system. Select this check box to enable the watchdog time out flag.

Watchdog timer

Enter the time-out value for the watchdog timer. Enter a value from 0 to 65535 (the default).

Signal Data Types Pane

The image above shows the default condition of the Signal data types pane. Choosing any of a number of options in other panes of the eQEP dialog box causes a corresponding popup to appear in the Signal data types pane.

The following table summarizes the options for which you can set the data type in the Signal data types pane:

PaneOption
GeneralQuadrature direction flag output port
Position counterOutput position counter (selected by default)
Output position counter error flag
Output latch position counter on index event
Output latch position counter on strobe event
Speed calculationOutput capture timer
Output capture period timer
Enable and output overflow error flag
Enable and output direction change error flag
Output capture timer latched value
Output capture timer period latched value
Output position counter latched value
Watchdog unitEnable watchdog time out flag via output port

The fields that appear on the Signal data types pane are named similarly to these options. For example, Position counter value data type on the Signal data types pane corresponds to the Output position counter option on the Position counter pane.

For all data type fields, valid data types are auto, double, single, int8, uint8, int16, uint16, int32, uint32, and boolean.

Interrupt Pane

The image above shows the default condition of the Interrupt pane. Interrupts corresponding to specific events are enabled or disabled based on the settings in this pane.

Position counter error interrupt enable

Check this box to enable position counter error interrupts. This checkbox is cleared by default.

Quadrature phase error interrupt enable

Check this box to enable quadrature phase error interrupts. This checkbox is cleared by default.

Quadrature direction change interrupt enable

Check this box to enable quadrature direction change interrupts for changes in the counting direction. This checkbox is cleared by default.

Watchdog timeout interrupt enable

The eQEP Peripheral contains a watchdog timer that monitors the quadrature clock. Check this box to enable watchdog timeout interrupts. This checkbox is cleared by default.

Position counter underflow interrupt enable

Check this box to enable position counter underflow interrupts. This checkbox is cleared by default.

Position counter overflow interrupt enable

Check this box to enable position counter overflow interrupts. This checkbox is cleared by default.

Position-compare ready interrupt enable

Check this box to enable position-compare ready interrupts. This checkbox is cleared by default.

Position-compare match interrupt enable

Check this box to enable position-compare match interrupts. This checkbox is cleared by default.

Strobe event latch interrupt enable

Check this box to enable strobe event latch interrupts. This checkbox is cleared by default.

Index event latch interrupt enable

Check this box to enable index event latch interrupts. This checkbox is cleared by default.

Unit timeout interrupt enable

Check this box to enable unit timeout interrupts. This checkbox is cleared by default.

References

For more information on the QEP module, consult the following documents, available at the Texas Instruments Web site:

See Also

eQEP

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS