Pages: [1]   Go Down
Author Topic: Digital or Analog inputs for DAQ ?  (Read 434 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
     I'm a final year engineering student and I'm trying to get a basic DAQ set up on my project rig, A water level & temperature control system.

The system consists of a Siemens PLC (S7-300), HMI, and a number of valves & sensors.

My plan is to use an Arduino UNO and the Adafruit Data logging Shield. Students can then use the SD card in a laptop, and import the data into excel for analysis.

I need to record liquid level, temperature, valve position, heater status, level setpoint and temperature setpoint, and of course a time-stamp for each, so 6 inputs and a time stamp.
The system reacts slowly, so a sample rate of 1/s is what I have in mind, I don't want to sample faster than I need to because it's just wasting memory!

My question is regarding the choice of inputs. The rig has analog sensors, a DAC, a PLC, and an ADC, so I have a choice of whether I want to use digital or analog inputs. The PLC takes the digital values from the ADC and scales them to corresponding tank level percentage and temperature in degrees. The level is measure with an absolute pressure sensor, which requires daily calibration, so I'd like to get the DAQ to record the (scaled & Calibrated) digital values the PLC uses rather than taking data straight from the sensors.
I have absolutely no experience of Arduinos or Datalogging, and my coding skills are next to none (I'm in the mech stream) but I'm eager to learn about it. Is there any other reasons why I should choose analog over digital or vice versa?
If anyone could point me in the direction of any useful reading information/tutorials/etc it would be much appreciated.

The Bottom Line: Is there any reasons to chose digital or analog inputs to log? Does the arduino "prefer" one type over another, or are there any problems i'll tend to encounter with one over the other?
Logged

Lacey, Washington, USA
Offline Offline
Edison Member
*
Karma: 154
Posts: 2231
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, if the PLC already has an ADC, why convert it back to analog? If you do that, you lose four times. The first ADC, then scaling, then DAC, then the Arduino's ADC, then scaling again.

Let the DAQ do the ADC and scaling, then send the corrected digital data to the Arduino for logging. The great thing about digital is that, barring catastrophe, a 1 is a 1, a 0 is a 0.
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, if the PLC already has an ADC, why convert it back to analog? If you do that, you lose four times. The first ADC, then scaling, then DAC, then the Arduino's ADC, then scaling again.

Let the DAQ do the ADC and scaling, then send the corrected digital data to the Arduino for logging. The great thing about digital is that, barring catastrophe, a 1 is a 1, a 0 is a 0.

Im confuzzled  smiley-red 
You're saying use the already scaled digital values and send those to the arduino, So it'd look like this?

Sensor -> ADC -> PLC (scaled here) -> PLC Digital Output ->*Tee-off this line to the arduino* -> DAC -> Analog Signal -> Valve input

On a side note, The HMI communicates with the PLC via profibus, so I'd like to have a button on the HMI to start the logging, I'm presuming I could easily grab another output off the PLC to the Arduino that triggers the Ardiuno to start logging when that input is live? 
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12520
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To be able to answer your question really needs an understanding of your overall system. Do you have / can you create a block diagram identifying the main components, the connections between them, and the nature of the signals on those connections? If, for example, you already have an async serial data stream carrying the data you want to log then two wires to an Ardulog would be all you need. In reality I doubt you will get that lucky, but knowing what data is available and what form it is available in has to be your starting point.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Lacey, Washington, USA
Offline Offline
Edison Member
*
Karma: 154
Posts: 2231
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with what PeterH said. I thought the Arduino was only logging the data, and you were asking how to send it to the Arduino.
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Haven't done a block diagram before so here's my first attempt at it...any tips let me know!
Drawing this has shown me I really need to brush up on the communication going on in the jig...I'm the 5th student to work on this jig, and the previous documentation isn't good, I can't find a block diagram in the previous reports, I'll head into the lab tomorrow and spend a few hours making sure this is all right and I'll try do up a proper diagram, but off the top of my head this is what I'm working with

Logged

Lacey, Washington, USA
Offline Offline
Edison Member
*
Karma: 154
Posts: 2231
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So... where is the Arduino in this? What is the purpose of the Arduino?
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with what PeterH said. I thought the Arduino was only logging the data, and you were asking how to send it to the Arduino.

I do just want the Arduino to log data, the PLC and HMI have full control over the system as it stands, I just want to steal some of their values and log them without having any input into the system...the Arduino should be fly-on-the-wall as it were.

Because the system needs daily calibration, this involves switching to manual mode and filling the tank, recording the pressure, emptying the tank, recording the empty pressure, and then the CPU scales the values between 0-100%. I don't want any of this to be logged by the Arduino, so I'd like to have the logging switched. Ideally, I'd like to have a switch on the HMI rather than an external physical switch, just to keep the jig as user friendly as possible and avoid extra wires and switches wherever possible.

Having seen some of the stuff students do in labs, I think it's necessary to have huge ignorant prompts on the HMI at almost every step of the process reminding the operator to start logging and finish logging after every time they change a setpoint / gain / control algorithm etc, accompanied by a big fat button under the warning to actually switch the logging on/off. The only communication the HMI has with the rest of the jig is the Profibus cable so that'll have to be worked through that.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So... where is the Arduino in this? What is the purpose of the Arduino?

That's my question...I don't know the most practical place to put the Arduino because I've no experience of what tends to work better/worse with them in practice or which communication types would end up giving rise to more problems.

I'm not looking for an answer handed on a plate though, I'd like to just be steered in the right direction of thinking by someone who has a bit of experience with these...I'm studying Computer Aided Engineering & Design, which is in the Mechanical stream, so the only exposure I have to electronics/programming is some basic Electronic Engineering in 1st year (Mostly Filters & Basic Circuits) and a Matlab module in first year (Which I was rubbish at smiley-red )

EDIT: The purpose of the arduino is just to log the temperature value & setpoint, as well as the level value & setpoint, and the position of the Valve with the 0-10V input signal. It doesn't have any control over the system, I just want to be able to plot the process variables rather than taking photos of the HMI screen with a phone, I need reasonably accurate plots to be able to expect students to use the data to derive transfer functions for the process from plots
« Last Edit: November 02, 2013, 01:41:32 pm by Kealan » Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12520
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a good starting point but it's lacking a lot of detail.

Quote
I need to record liquid level, temperature, valve position, heater status, level setpoint and temperature setpoint, and of course a time-stamp for each, so 6 inputs and a time stamp.

Where abouts are these data present in your system, and in what format? (I assume that some of these data will be present in multiple places in different formats.)
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a good starting point but it's lacking a lot of detail.

What else should I be putting in there? Is there a standard format for these?


Where abouts are these data present in your system, and in what format? (I assume that some of these data will be present in multiple places in different formats.)


Well there's the analog values at the sensors themselves
Unicode digital ones from the adc output to the PLC input
The PLC itself has them stored in its internal data blocks as Unicode
The PLC has them as INT values between 0-100% and 0-100 degrees
The HMI reads those data block INT values and displays graphs so it has a live feed of them but it doesn't have them stored afaik
I'll go through it all this evening / tomorrow and try to compile a table of all the relevant I/O's and their respective formats
Logged

Pages: [1]   Go Up
Jump to: