marXperts Quadrature Decoder for Incremental Encoders User Manual

August 10, 2024
marXperts

marXperts Quadrature Decoder for Incremental Encoders

Product Information

Specifications

  • Product Name: marquadb
  • Version: v1.1
  • Type: Quadrature Decoder for Incremental Encoders
  • Manufacturer: marXperts GmbH

Product Information

The marquadb is a quadrature decoder designed for incremental encoders. It features hardware components including the marquadb controller box. The device allows for the connection of up to 3 incremental encoders via a USB-B connector and a D-Sub9 connector.
The default voltage settings are LOW at 0.0 Volt and HIGH at 3.3 Volt, with the option to reverse the levels if needed. The device is not real-time and has a switching time between LOW and HIGH of around 5 microseconds, which can be adjusted for longer output signal duration.

FAQ

  • Q: Can the voltage levels be reversed on the marquadb?
    • A: Yes, it is possible to reverse the voltage levels on the marquadb if desired.
  • Q: How many incremental encoders can be connected to the marquadb?
    • A: The marquadb can connect up to 3 incremental encoders via the D-Sub9 connector.

How to use this manual

Before you start to operate the marquadb box please read the User Manual and the Technical Documentation included in the documentation package carefully.

Declarations

Europe

The instrument complies with the EMC Directives 2014/30/EU, the Low Voltage Directive 2014/35/EU as well as the RoHS directive 3032/2012.
Compliance was demonstrated by conformance to the following specifications listed in the Official Journal of the European Communities:

  • EN61326-1: 2018 (Electrical Safety)
  • EN301 489-17: V3.1.1: 2017 (EMC for radio equipment and services)
  • EN301 48901 V2.2.3: 2019 (EMC for radio equipment and services)
  • EN300 328 V2.2.2: 2019 (Wideband transmission system in the 2.4 GHz band)
  • EN6300: 2018 (RoHS)

North America

The instrument has been found to comply with the specifications for a class B digital device pursuant to Part 15 of the FCC rules and meets all requirements of the Canadian Interference Causing Equipment Standard ICES-003 for digital devices.

Waste Electrical and Electronic Directive

End-users may return the instruments to Marxperts GmbH for disposal without being charged for disposal.
This offer is valid only under the following conditions:

  • the unit has been sold to a company or institute within the EU
  • the unit is currently owned by a company or institute within the EU
  • the unit is complete and not contaminated

The instrument does not contain batteries. If not returned to the manufacturer, it is the owner’s responsibility to follow the local rules for disposing electronical equipment.

Function

The marquadb box is a microcontroller that counts signals (“A quad B”) from incremental encoders. Incremental encoders are linear or rotary electromechanical devices that have 2 output signals, A und B, which issue pulses when the device is moved. Incremental encoders report position increments nearly instantaneously, which allows them to monitor the movements of high speed mechanisms in near real-time. While either A and B signal would show the progress of a movement, the phase shift between A and B allows to determine the direction of movement. In the figure show above, signal B is leading A, so the direction of movement is negative.

The marquadb box counts pulses from up to 3 sources independently, but not simultaneously. The counting works in either direction. The instrument will report the direction of the movement and the time elapsed to count pulses from which the speed of the movement can be derived. However, the actual function of the mar quadb box is to trigger an action after reaching a given count of pulses . The box feeds a signal (TTL like) into one of the coaxial outputs. The level of the coaxial output is either HIGH or LOW and is as follows:

  • LOW if the box is not counting
  • HIGH if the box is counting
  • switch to LOW if the number of pulses has been counted
  • switch back to HIGH immediately or after a configurable delay
  • LOW if the box stops counting

By default, LOW means 0.0 Volt and HIGH means 3.3 Volt. It is possible to reverse the levels if desired. The marquadb box is not a real-time instrument. The time to switch between LOW and HIGH is in the order of magnitude of 5 microseconds but it is possible to increase the duration of the output signal.
A typical use of the instrument is to provide trigger signals to any sort of hardware as a motor coupled to an encoder is moving. Trigger signals will be created after counting a given number of pulses. The instrument does not need to know about physical properties of the motor. It just counts A and B pulses of the incremental encoder.

Example: a motor giving 1000 encoder pulses per mm of movement should trigger a camera that shoots a photo after every movement of 1 mm. This requires a camera capable of receiving TTL-type trigger signals.

Hardware components

The device ships with the following components:

Inputs

The marquadb box features a USB-B connector at the back side as well as a D-Sub9 connector. The box has to be connected to a PC using the USB cable.
The A, B and ground lines from up to 3 incremental encoders are fed into the controller via a 9-pin connector.
The pin assignments are shown in the table below.

Pin| Assignment|
---|---|---
1| Encoder 1: signal A|

2| Encoder 1: signal B
3| Encoder 1: GND
4| Encoder 2: signal A
5| Encoder 2: signal B
6| Encoder 2: GND
7| Encoder 3: signal A
8| Encoder 3: signal B
9| Encoder 3: GND

Outputs

The output signals are supplied to coaxial connectors that must connect the box (brass colored connector) with a target device, e.g. a camera. When the controller is idle, the output on the coaxial output is LOW (0.0 Volt). When the controller starts to count, the output signal is set HIGH (3.3 Volt). After reaching a given number of counts, the output signal drops to LOW. This signal can be used to trigger the read-out of a camera or some action in some other type of hardware. This operation will be repeated for a given number of times.

The duration of the signal switching HIGH-LOW-HIGH is approx. 5 microseconds. It is possible to invert the signals (HIGH=0 V, LOW=3.3 V).

When the controller is counting signals, LED1 will be lit. Otherwise, when the controller is idle, LED1 is off. LED2 will operate similarly but will turn on only if the output signal is HIGH and otherwise be turned off. Since the switching time between HIGH and LOW is very short, both LEDs will normally appear to look the same.

The settable delay time must be at least 100 milliseconds to see the difference.
The RESET button will reboot the controller which is an alternative to unplugging the USB cable. When booting up, LED1 flicker 5 times while LED2 is constantly lit. After the initialization sequence, both LED’s will be turned off.

Communication

The marquadb controller must be controlled from the data collection PC via a USB connection (USB-B to USB-A). The controller provides a conventional serial interface that understands plain ASCII commands and that sends output to the serial interface as plain text strings.
It is therefore possible to operate the box “manually” or via an API. You may use a variety of programs that use serial connections, e.g. PuTTY on Windows or minicom on Linux. Please use the following serial connection settings:

  • baudrate: 115200
  • parity: None
  • stopbits: 1
  • bytesize: 8 bits
  • flow-control: none

On Linux, you could thus a simple command like the following, making sure, that the device file has the proper permissions for the user to read from it and write to it:

  • minicom -D /dev/ttyACM0 -b 115200

On Linux OS, /dev/ttyACM0 would be a typical device name. On Windows, it would be rather COMn where n is a single digit.

Note: when implementing a communication API using the commands below, make sure to also read the text strings generated by the controller, even if you are not making use of them.

Commands

The controller understands the following commands (strings in brackets are optional.

  • counts N lines L channel C – enter counting mode for N counts with L encoder lines (pulses) each on channel C (default: N=0, L=1000, C=1)
  • N L [C] – as above but without keyword “counts” and “lines” and with the option to supply channel 1 to 3
  • init [T [L]] – initialize with T lines as tolerance and L lines to start (default: T=1, L=1000)
  • chan[nel] C – count signals from channel C (1 to 3, default: 3)
  • help – shows usage
  • set – shows current values of settable parameters
  • show – shows progress of ongoing counting including time elapsed
  • high – sets the default signal level to HIGH (3.3 V)
  • low – sets the default signal level to LOW (0 V)
  • led1|2 on|off – turn LED1|2 on or off
  • out1|2|3 on|off – turn OUT1|2|3 on (HIGH) or off (LOW)
  • tol[erance] T – tolerance for counted signals for reaching target (default: T=1)
  • usec U – time in microseconds to switch back the output level from LOW to HIGH after a count event (default: U = 0)
  • end | abort | stop – end ongoing counting before reaching target
  • verbose [false|true] – toggles verbosity. Use argument True of False

To start counting N events, it is sufficient to just enter N. After issuing the command, the counting starts and the output signal is set to HIGH (3.3 V). The parameter L is the number of lines (pulses) to count before generating a trigger signal on the corresponding output OUT1, OUT2 or OUT3. This process is repeated for N cycles.

The duration of the output signal, ie. the switch HIGH-LOW-HIGH, is governed by the CPU speed of the controller and is about 5 microseconds. The duration can be altered using command „usec U“ where U is the duration of the signal in microseconds and defaults to 0. If all N counts are completed, the output is set to LOW and the controller returns to the idle state.
While counting, LED1 and LED2 are turned on. If the counting mode is active, all further commands to count lines are ignored. It is not possible to count lines simultaneously on more than 1 channel.

Example:

To count 4 times 250 lines on channel 3, issue command „4 250 3“. You will get some feedback similar to:

As can be seen, the instrument returns the time elapsed and the total no. of counted lines. The total number of lines will be either positive or negative, indicating the direction of movement. The number of pulses to be counted, however, will always be given as positive number, regardless of the actual direction of movement.

Contact

Should you have questions concerning the system or its use, please contact us via phone or email.

marXperts GmbH

Copyright 2024 marXperts GmbH
All rights reserved.

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals