Home‎ > ‎Technical Articles‎ > ‎

MAIO Enables PWM, QEI, AI and DI/O on Neousys Nuvo-2500

posted Oct 18, 2015, 7:47 PM by Raymond Hsu   [ updated Oct 25, 2015, 6:45 PM ]
Neousys Technology releases a new option, titled as MAIO, of its Bay Trail fanless industrial computer Nuvo-2500. MAIO stands for Multi-function Automation Input and Output. Designed by Neousys for industrial applications, Nuvo-2500 with MAIO provides not only isolated digital inputs and isolated digital outputs but also other I/O interface commonly used. Enabling MAIO option of Nuvo-2500 resembles to installing a multi-function card insides without consuming the expansion slot. Here are the I/O interfaces covered by the MAIO option:
  • DI: 4 channels of isolated digital inputs
  • DO: 8 channels of isolated digital outputs
  • PWM: 6 channel of pulse-width modulation outputs
  • QEI: 1 set of quadrature encoder input with phase A, B and index signal
  • AI: 2 channels of uncalibrated voltage inputs

  • DI/O, isolatated digital inputs and outputs

    The term DI/O usually refers to discrete inputs and outputs with galvanic isolation, and is much more suitable for applications out of laboratories. In order to interfacing with external devices, i.e. sensors, relays and actuators, DI/O provides wider input voltage range and output driving capacity than GPIO which is usually TTL compatible. Unlike some traditional design with worse performance sensing the turning off action, the DIs of MAIO uses high speed photo-coupler with new technology. Therefore both turning on and off can be sensed by the MCU 10 times faster.

    Each DI of MAIO has an internal resistor, and 5~24VDC can be applied directly between the input pins and the common ground pin, DI_GND, as a logic “1”, while 0~1.5VDC as a logic “0”. The following figure shows the wiring digram of DIs.
    Figure 1: Wiring of DI of MAIO
    Figure 1: Wiring of DI of MAIO

    DIs usually work with dry contact switches and sensors with digital outputs. Dry contact switch comes in various forms, such as buttons, rocker switches, tactile switches, limit switches and so on. When a dry contact switch is used as the external devices, connect on pin of the switch to DI pin and the other pin to the positive voltage. When a sensor with PNP output is used, connect the output pin of the sensor to DI pin and the power pins, perhaps named Vcc and GND, to the PSU, power supply unit for the external devices. Sensors with NPN output is not compatible with DIs of MAIO. DOs is interfaced with open drain MOSFET, capable of 200mA sinking driving current each channel. With open drain design, loadings are connected between positive voltage of PSU and DO pins, and ground of PSU is connected to DO_GNDs.
    Wiring of DO of MAIO
    Figure 2: Wiring of DO of MAIO

    With open drain design, a wide range of driving voltage from 5VDC to 30VDC is acceptable. The rated driving voltage is 24VDC, while 30VDC is the peak voltage. Please note that when the DOs activate, as open-drain design, the DOs is almost short to DO_GND. It’s users’ obligation to calculate the driving current and connect resistors to limit the current if necessary.

    PWM, pulse-width modulation output

    PWM is a special form of digital outputs. It uses the percentage of “on-time” of a series of pulses to deliver information more than “0” and “1”, what a digital output does. PWM stands for pulse-width modulation. Wikipedia has deep explanation on this topic, and we don’t emphasize on the principle. Although it’s not exactly correct, thinking it as a special analog output might help you to understand. The following figure shows wave forms of different on time. Imagine that each “ON” turns on the lamp and the frequency is high enough. The larger portion of on-time is, the brighter you feel the lamp is.
    PWM wave forms and energy
    Figure 3: PWM wave forms and energy 

    PWM is widely used in applications. Many drivers and amplifiers accept PWM signals to adjust the their outputs. For example, the LED driver HLG-120H-C500B, from Meanwell, accepts PWM control signal for dimming purpose. The driving output current up to 500mA is provided by the LED driver, and the PWM signal only controls the percentage of output current. By the way, the PWM of MAIO is a 5V voltage output, but this LED driver accept a 10V-PWM signal. A simple Darlington IC can help to convert the voltage if necessary. Another example is the DC motor driver. PWM signal controls the rotational speed of the DC motor via the DC motor driver. The following picture shows a BLDC motor with a integrated driver. This BLDC uses 24V power source, and the yellow line is 5V PWM input for adjusting the rotational speed.
    PWM BLDC motor with an integrated driver
    Figure 4: A PWM controllable BLDC motor with a integrated driver

    Another application is to control RC servos. RC servo uses the pulse width of on time as a positioning command. A live demo of Neousys Nuvo-2500 with PWM of MAIO to control a tiny 6-axis articulated robot arm actuated by RC servos has been built for Computex 2015.
    Figure 5: Live demo of PWM controlling RC servo robot arm

    However, depending on the controlled devices, different PWM frequency might be required. The RC Servo usually requires 20ms period, i.e. 50Hz, and the mentioned LED driver HLG-120H-C500B accepts from 100Hz to 3KHz. PWM of MAIO provides programmable PWM frequency from 20Hz to 500KHz. The high frequency PWM is basically a series of pulses. This also make it possible to control the speed of stepping motors via the driver which is commanded by high speed pulse chain.
    PWM of MAIO controls speed of a stepping motor
    Figure 6: PWM of MAIO controls speed of a stepping motor

    QEI, Quadrature Encoder Input / Incremental Encoder Input

    Quadrature encoders are widely used in automation industrial applications. A quadrature encoder translates offset and speed into special pulse waves, and needs a QEI, quadrature encoder input, to translates it back to offset and speed. QEI is also known as incremental encoder input, and has three phases of inputs, denoted as Phase A, Phase B and Phase Z. Phase Z is sometimes named Index.

    QEI of MAIO supports two modes of counting. One is the quadrature encoder mode, and the other is event counter mode. If only number of event is counted instead of the quadrature encoder signal, it’s possible to configure QEI of MAIO to event counter mode. In this mode, QEI behaves like an event counter, counting the number of inputs occur at Phase A. Phase B is defined as direction, which decides to increase or decrease the counter while inputs are find at Phase A. When working with quadrature encoders, QEI of MAIO has to be configured to quadrature encoder mode. The pins of different phases are internally pulled high to 5V, is designed for open-collect output encoders, such as E6J-CWZ1C from Omron.

    Some industrial rotary switches and joysticks has quadrature encoder outputs, also named as quadrature 2-bit code. A Grayhill’s Joystick 60A loaned from QuadRep Electronics [Taiwan] Ltd. has been tested and is totally compatible with QEI of MAIO. Besied of encoder output, this 60A joystick has 2-bit output codes of X and Y status. That is, 0V for “Low” position, 5V for “High” position and 2.5V for neutral position. The AI of MAIO, introduced in the following paragram, is suitable for the 2-bit output. The following figure shows the wiring between Nuvo-2500 MAIO and Grayhill 60A.

    Wiring example of Grayhill 60A and Nuvo-2500 MAIO
    Figure 7: Wiring example of Grayhill 60A and Nuvo-2500 MAIO

    AI, Analog Input / Voltage Input

    There are also two AI channels of MAIO. The AIs accepts voltages signal up to 33VDC. Not designed for precise measurement usages, the AIs don’t have any calibration circuit. The input interface is a simple voltage divider. The AIs are suitable for human interface devices, such as hall sensor joysticks and analog joysticks. Grayhill 60A is an example mentioned in the previous paragram. In addition, APEM produces many industrial joysticks which should be compatible with AI of MAIO, but haven’t been really tested. Connecting to sensors, such as ambient light sensor TEMT6000, is also suitable. In short, the reading values of AIs are relatively correct although they are not calibrated.

    At last, but not least, like some multi-function I/O cards in the market, PWM, QEI and AI are interfaces which are not isolated. It means these interfaces share the same digital ground with Nuvo-2500. Among all interfaces of MAIO, only DI/O are, by design, isolated.

    Regarding to software and development of user applications, C APIs for developing applications under Windows XP, Windows 7 and Windows 8 are available from Neousys, and Linux is not support at this moment. The programming flow is nothing more than initialization, configuration and access. Sample codes for each functionality has been ready for reference. MAIO equips Nuvo-2500 with various interface, sush as DI/O, PWM, QEI and AI at the same time with one single option, and it’s not necessary to install extra 2 or 3 add-on cards and use only a little part of them. It’s really a cost saving option for your application. Please contact with Neousys if you need more information.