LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Analogue output professional single board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/analogue-output-professional-single-board-computer-4175611038/)

Boniato 08-01-2017 06:49 AM

Analogue output professional single board computer
 
Dear all,

In my work I need to set up a system that reads from a USB device and sends the data as a voltage to another device.
For this purpose I have created some Python code that can read from the USB device and convert the digital input into an analogue voltage in a Raspberry Pi running Linux.

The set up works properly but I need a professional and more stable version of it. I'm considering two potential options:

1) To buy a professional grade single board computer. I'm not an expert, so perhaps someone can recommend a Raspberry equivalent board that runs Linux, has a port for SATA or SSD, has analogue voltage output and USB input and is very stable.

2) To use a desktop computer with a suitable analogue card. That would be a Linux server with a Linux compatible card, that can produce voltage output such as in the Raspberry Pi and interacts with Python through some library. Does anyone know of such a card?

I'm not sure which option is the best, or which is the best hardware for each option. Any help will be kindly appreciated!

Thanks a lot for reading!
Boniato

business_kid 08-01-2017 08:36 AM

What you need is a digital to analogue converter. You need to Specify your requirements for the voltage(voltage & current values), the degree of control, etc. For example, 8 bit D/As are cheap; but they only have 255 steps, so a 0-5V output has step sizes around 20mV. 64 bit D/As are %@£&! expensive, if available at all. Match your python to your d/a.

Then source the parts matching your spec.If this isn't straightforward, use someone local with a knowledge of electronics. Little things mean a lot, especially with analogue stuff, which is different, more fragile and fussy than digital.

Boniato 08-01-2017 09:10 AM

Thank you Business Kid.
Price is not so much a concern so the more voltage resolution the better. But if someone can advice about a digital to analogue converter that is Linux compatible and easy to control from Python it would be great!

michaelk 08-01-2017 10:38 AM

National Instruments or Measurement Computing Corporation would be my choices for I/O stuff. Measurement Computing has some information on there website about building acquisition equipment using the Pi.

You didn't post your configuration or why your system is unstable but there could be many reasons whether it is related to the operating system, hardware etc.

business_kid 08-01-2017 10:47 AM

Look for industrial I/O cards.

Shadow_7 08-01-2017 11:37 AM

What exactly is unstable about the RPi? There are addon things hardware wise which reduce the load / work that needs to be done on the pi. There are industrial cards too, which mostly extend the operation temperature range. The freescale i.MX6 boards have had SATA for a while now. Lots of options depending on what you need. Some of the cubie boards have had SATA too.

cubieboard.org
(doesn't seem to be online for me atm)

The compu-lab utilite had the i.MX6 setup with dual video out and dual gigabit ethernet ports. And an SSD. Not so sure about the GPIO option(s) since it was more of an early fanless desktop type thing. Lots of options like minnowboard and others. So many boards these days.

http://linuxgizmos.com/

Some of which have laptops based on them now. pi-top, pinebook, ...

https://pi-top.com/

https://www.pine64.org/?product=pinebook

And probably others.

Boniato 08-01-2017 05:41 PM

Thank you all for your answers.

By unstable mostly I mean the fact that the operating system is installed in a SD card (although there are other alternatives). I think the raspberry pi is unstable but this setup is to build a server work as a part of a driving simulator and must be very realible.

I will analyze the options you have given me!

coltree 08-01-2017 08:35 PM

If you're doing D/A you probably want real time.
PCs are total crap at real time !
Are you using the raspberry pi for other functions, or just a single D/A ?
Do you need Linux ?
Can you run your main application on your Linux PC or raspberry Pi, USB to an Arduino, which can handle the D/A in real time ?
Having a little dedicated board for D/A might make timing easier.
All this stuff will also hook up to your Raspberry Pi by the I2C bus.

Here's a quick look at python on an Arduino
http://www.toptechboy.com/using-pyth...duino-lessons/

depending on D/A resolution
dirt cheap, simple pwm
https://provideyourown.com/2011/anal...wm-to-voltage/
8 bit via I2C bus
http://tronixstuff.com/2013/06/17/tu...91-adc-dac-ic/
12 bit via I2C bus
https://cdn-learn.adafruit.com/downl...c-tutorial.pdf
quad 16 bit via I2C bus
https://stackoverflow.com/questions/...ar-using-a-spi

github has a library for ArduinoISP and Analog Devices DACs
https://github.com/frejanordsiek/arduino_library_AD56X4

Analog Devices have historically made really good gear.

Boniato 08-02-2017 06:37 AM

Hi Coltree. It has to run in real time.

But I have coded some python code that sorts that issue. It is simple as I don't need a very high time resolution (1/100 of a second is fine).

I have checked the national instruments I/O cards. I was thinking maybe this one could do the trick:

The problem may be how to control the output of this card from Python.

michaelk 08-02-2017 07:29 AM

A CompactRIO card requires a compatible controller/chassis which goes way beyond your needs. I was thinking more of a PCI I/O card. The controller does use a linux RTOS but not sure about Python.

As you posted 1/100 does not really need real time so near or low latency is probably good enough.

My Pi seem to be stable and I have not experienced any but SD corruption does seem to be a problem.

The ODROID is another popular SBC
http://www.hardkernel.com/main/main.php

Boniato 08-02-2017 07:53 AM

Hi michaelbk.

Thanks. Probably a PCI is the way to go. But how does one communicate with such a card using python?

michaelk 08-02-2017 08:34 AM

Never had the opportunity to see how well it works.

https://pypi.python.org/pypi/PyDAQmx

business_kid 08-02-2017 09:43 AM

As a general rule, when approaching industrial jobs, you're better using appropriate languages. There's a whole lot of industrial stuff out there, nearly blow up proof and cheap enough (e.g. plcs) which do your processing and i/o. If doing any amount of this, look into them. Industrial PC cards are messy to work with IME.

coltree 08-02-2017 07:51 PM

Quote:

Originally Posted by Boniato (Post 5743129)
Hi Coltree. It has to run in real time.

But I have coded some python code that sorts that issue. It is simple as I don't need a very high time resolution (1/100 of a second is fine).

I have checked the national instruments I/O cards. I was thinking maybe this one could do the trick:

The problem may be how to control the output of this card from Python.


Do you realise that is a $700 industrial rack system A/D,D/A module ? then a controller $2300 -> $13k
You started by talking about python, raspberry pi, then USB, and an SBC, then PC with analogue card.

If I may be so bold as to suggest a raspberry pi for a quick, cheap start,
doing analogue through a pwm output just to try out your python code.
When you're happy you can fiddle the voltages to what you want, as viewed with a thoroughly cheap oscilloscope http://www.bitscope.com.au/product/BS05/
(which is another device which can do all you want and more)
then lash out on thousands of dollars worth of industrial grade kit (has C/C++ libraries).

My CRO works off a laptop and is the only way to run up all sorts of DIY stuff.
When it doesn't work as expected, you need eyes to see what is happening.
It's the easiest way to adjust your software for required output.

Boniato 08-03-2017 08:52 AM

All right!!!

Thank you all.
After reading all your suggestions I think it is best to consider sticking to the Raspberry Pi (and see if I can substitute the SD card by and SSD drive somehow) or to get one Odroid.


All times are GMT -5. The time now is 08:14 AM.