Connect with us

LabView Alternative for an Automated System to Drive Steppers andTake Measurements of the DUT.

Discussion in 'Electronic Design' started by sms, Aug 10, 2013.

Scroll to continue with content
  1. sms

    sms Guest

    Here's what we want to do:
    1. Move a platform on an X-Y-Z motion, with three steppers, a specific

    2. Make some measurements (voltage, temperature, current) on the device
    under test and save those measurements and the position to a file.

    3. Go to 1.

    There's plenty of low cost CNC stepper boards and software to do the
    positioning, but the software doesn't really have an opportunity for
    feedback other than some limit switches.

    I've used an Arduino board to read in analog values but I need a way to
    combine driving the steppers and recording the measurements.

    I could do a LabView setup but by the time I buy the software, chassis,
    and stepper board it will be $10,000.

    Since the steppers need only DIR, STEP, and ENABLE, I suppose I could
    write an Arduino program that did everything. However the accuracy of
    the Arduino A/Ds leave something to be desired and I haven't found an
    Arduino Shield with better A/Ds.

    Is there any good alternative to LabView that doesn't cost as much?
  2. Joerg

    Joerg Guest

    Yes, there is:

    Comes with the Express version of this:

    DAQFactory Express is also free if you don't by a Labjack but it might
    be difficult to cobble together a driver for the Arduino. For the
    Labjack there already is one which saves a lot of work. There is also a
    forum on both sites in case you get hardcore stuck.
  3. Works great with Python, too. And linux!
  4. sms

    sms Guest

  5. sms

    sms Guest

    The Raspberry Pi (of which I have four) is not a particularly good
    platform for embedded control. Even with the Gert Board you only get 10
    bit A to D converters.

    The Arduino is better, and their are stepper routines for Arduino
    already available. But again, you're limited to 10 bit A to D converters.

    Now that someone pointed me toward Labjack, I find that there are
    several options for inexpensive DAQ boards with the precision I need (12
    bit A/D converters are fine).
  6. sms

    sms Guest

    The analog devices we are reading have 0-10VDC outputs, so I would
    prefer an A/D that can take up to a 10V input which the Labjack U3-HV
    and U6 can do. With the Arduino, I used a voltage divider to keep the
    level at 5V or less, but I would prefer not to have a voltage divider
    because of tolerance and accuracy issues. The RPi has no A/D so it means
    an expansion board. With the Gert board for the Raspberry Pi, which I
    have, you get only 10 bit A/D converters.

    I need 11-12 bit A/D accuracy, 10 bit isn't quite enough and greater
    than 12 bit will be meaningless.

    I did initially plan to use the Raspberry Pi for this project, but the
    more I dug into it it became clear that the amount of additional
    hardware necessary made it a poor choice. The GPIO pins are not 5V
    tolerant so that means level translators for all of the pins used as
    inputs. There is no A/D. The Gert board didn't solve everything because
    the A/D isn't good enough for this project. You can use an HDMI monitor
    and a USB keyboard and mouse with the RPi, but this is actually more
    cumbersome than using a cheap laptop (unless you use the Motorola
    Lapdock, which I have been doing).

    I can just get by with the Labjack U3-HV, if I leave the four steppers
    enabled all the time. I thought about just writing to one stepper at a
    time and using the enable pin for each so I could share the direction
    and step and even limit pins, but my experience is that when the motor
    is enabled there is some slight movement in the X-Y-Z table and it's
    better to leave them enabled all the time. I could use some extra logic
    to get around that issue to prevent the step pulses from reaching the
    motor except when that specific motor is enabled.


    All four stepper motors are always enabled. Direction, Step, and Limit
    signals are not multiplexed.

    OR U3-HV
    ------- -------- ------ ----
    Motor X Direction Output EIO0
    Motor X Step Output EIO1
    Motor X Limit Input FIO4

    Motor Y Direction Output EIO2
    Motor Y Step Output EIO3
    Motor Y Limit Input FIO5

    Motor Z Direction Output EIO4
    Motor Z Step Output EIO5
    Motor Z Limit Input FIO6

    Motor S Direction Output EIO6
    Motor S Step Output EIO7

    Analog 1 A/D Input FIO0
    Analog 2 A/D Input FIO1
    Analog 3 A/D Input FIO2
    Analog 4 A/D Input FIO3

    SPI Input Input CIO0
    SPI Output Output CIO1
    SPI CLK Output CIO2
    SPI CS Output CIO3

    Unused FIO7
  7. Well, that's your opinion, popular demand tells otherwise ;-)

    The arduino is great for small projects, for the less experienced user. Goes for as low as 15USD and you don't need external USB thingie to quantize analog signals, that comes free. It draws a lot less power and does not need a Flash card as the Pi does.


  8. sms

    sms Guest

    That's true. The big advantage of the Arduino is for projects where you
    need to control stuff and read in TTL level inputs and analog inputs.
    You don't need level converters. You don't need separate A/D converters.
    There are extensive libraries available for stuff like steppers and

    Now you can use a Raspberry Pi to control an Arduino. That's becoming
    popular. So you run Linux on the RPi and it talks to the Arduino.
  9. Another issue is the power consumption. The Pi takes up to 5W, the Arduino maximum 0.1W. A Pi is not suited for a battery operated application, the Arduino can be used for that.

    Running the controller 24/7, the Pi would cost 14USD in utility costs per year (Danish prices), the Arduino close to nothing. Heating reduction duringwinter period due to the dissipation has not been taken into account.


  10. sms

    sms Guest

    The Raspberry Pi also has power issues that can reduce some people to tears.

    At our Raspberry Pi Meet-Up, I'd say that around 50% of the problems
    that newbies have relate to power issues. I finally put up a simple web
    site to refer them to. <>
  11. Guest

    You could use LabView but it is not wise to close a loop around the PC which is a non-deterministic system. You would need a compact rio to be sure of exact timing.
  12. sms

    sms Guest

    Doesn't matter, the RPi has no A/D converters. I did use a voltage
    divider on the Arduino to get the voltage down to proper levels (the A/D
    has input levels of 0 to 5V).
    I think what "we guys" prefer is a solution that doesn't require a load
    of extra components that increase the cost and complexity beyond that of
    a proper solution. By the time you buy a Raspberry Pi, an A/D board,
    power supply, level translators, and put the whole thing together you've
    spent far more than buying something like a $120 U3-HV. There's no
    upside in cobbling together a sub-optimal solution when it costs more
    money and ends up being a kludge.
  13. Very good defence of your argument, somebody walked on water a couple of thousand years ago, who cares?
    Yes, but you don't get a no-nonsense development environment to get quickly started
    No, but does the Pi have analog input? No
    Does the Arduino have analog input? Yes
    Do we then need a shield? Yes, for both, but more for the Pi

    You have done some nice and somewhat impressing project, that you have presented here during the last couple of months. But, think about it, are you not deeper into the Pi than the regular person that you are trying to convince to use the Pi?

    I like the Pi, have used it only superficially I must say. But I also like the Arduino, the PSOC, the STM32, the.......

    From my point of view you need to select whatever gets you there with least effort and with good performance. Using a Pi to control a stepper is not my first choice for such an application.


  14. Nice turn at 55 seconds :)

    But yes, you need some mechanical damping (or SW ramp programmed to slow the steps)


  15. So you are using a servo, but with a gear added to that or with a gear thatis built-in?

    If its built-in (reads the position on the slow axis), you have little control of the way the servo reaches the position. If it reads the position directly on the motor, then you can add lead-in and lead-out slope reduction, so the ressonances does not get triggered so much.

    When you are tracking, you only need very slow movement, I guess?


  16. sms

    sms Guest

    On 8/12/2013 1:53 AM, Klaus Kragelund wrote:

    LOL, I am very much into the Pi. I presently have four of the Raspberry
    Pi boards going, and I am very active in the local RPi community. But
    that does not make the RPi the answer to every question!

    There's a good article at
    "For applications that interface to external sensors we recommend the
    Arduino and the BeagleBone." That's the bottom line. To use external
    sensors with the RPi requires a lot of additional components that are
    already included on the BeagleBone and Arduino.

    Actually the BeagleBone Black may be a good solution as well, as it has
    12 bit A/D converters, and would require only a voltage divider (maximum
    input voltage on the A/D converters is 1.8V) and level translators for
    the GPIO. It lacks some of the problems inherent with the Raspberry Pi,
    has internal Flash for the OS, and has a wider variety of add-on boards
    (which is somewhat surprising considering that it's newer). TI looked at
    the functionality that was missing from the RPi and put some of it on
    the BeagleBone boards. The BeagleBone Black is also much faster than the
    RPi or the Arduino.
  17. sms

    sms Guest

    That's the point. It was brought to the market as a tool for learning
    programming, not as a device to replace embedded processors in consumer
    or industrial equipment, for which it is still far too expensive, and
    for which it lacks the necessary functionality. The Arduino is also far
    too expensive to replace embedded processors, but it's purpose was to
    enable the user to learn how to control external devices.

    "The Arduinos <sic> strength is I/O control while the Raspberry Pi is
    more a processing device that has the GPIO pins for I/O."

    The upcoming Udoo board combines the processing power of the RPi and the
    I/O capabilities of the Arduino Due and has 12 bit A/D converters. Not
    yet available. They raised far more money in crowd funding than they had
    expected and are not taking any more orders until they can fulfill all
    the orders from backers (>3000 boards ordered).

  18. sms

    sms Guest

    There is a higher end Beagle Board capable of HD at 720p because it has
    a separate DSP.
  19. sms

    sms Guest

    Sadly, the world does not revolve around what you need. There are needs
    that go beyond your own.
  20. sms

    sms Guest

    And you would think wrong.

    First of all, there is no official Raspberry Pi power supply, so
    "counterfeit" is meaningless. Second, Probably 99.9% of power supplies
    with a Micro-USB connector come from China. Third, the problem with the
    Raspberry Pi power stems from a poorly written specification and bad
    suggestions as to what to use.

    The issue is that a Micro-USB was not designed to provide so much power.
    By the time you add some expansion boards, and power some USB devices,
    you can need several amps of current.

    The Raspberry Pi's power distribution is especially poorly designed.
    They improved it somewhat in removing polyfuses F1 & F2, though this
    really didn't fix much since F3 is still 1.1A. If they increased the
    value of F3 so the Raspberry Pi could power expansion boards, more power
    hungry USB devices, HDMI to VGA converters, etc., they'd need to change
    the power and ground planes.

    The Adafruit supply <> is one good
    solution since it puts out 5.25V at 1.1A. But you're probably better off
    with _one_ higher current supply that can also power a USB hub, an HDMI
    to VGA converter if necessary, by adding some extra cables and
    connectors to the power cord to split up the available power.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day