New project requiring closed loop pressure control

HI, I have a concept (R&D project) that i'm considering the use of the Arduino for and would appreciate some feedback on. I plan to build a machine to pressure test various vessels. During this test, i will need to capture data from to analog inputs. One is the pressure (this can be a conditioned 4-20 or 0-10 signal from a strain gauge) and the other is displacement from expansion (also can be 4-20 or 0-10). The pressure will also be the feedback device for the closed loop control circuit. The output for this CLC circuit is a proportional valve that requires +-10vdc. This will be a machine mounted control that will require inputs such as (pressure 1, timer 1, pressure 2, timer 2, pressure 3, timer 3, start, stop, and pause). I want to use a custom .NET application in a PC as the UI and the data logging which will require info from the controller like peak pressure, peak displacement, and up to 100 hz sampling from the pressure and displacement. Ideally, i would love for this information to transfer wireless through Bluetooth. Three other discrete inputs will be required and two other discrete outputs will be required. Questions: 1) Is the Arduino suited for this? If so, which would be the best (Mega, UNO, etc.) and why? If not, are there other recommendations? 2) If the Arduino is suitable, is there a scaling sketch available as the transducers will need to be calibrated. This seems simple enough, but as you know will require extensive work. I really don't want to spend many hours and dollars if someone else has experience why this would not work. Please ask away as i know there will be many questions. And thank you in advance for your help.

1) Yes every Arduino can do this. Start with an UNO. The only slightly-difficult part of this is boosting up the Arduino's 5V output to 10V. There are many modules available online to do this but it's considered to be an unusual thing to do. Scaling 4-20mA or 0-10V down to 5V will only take one or two resistors and is very easy.

2) Look in the reference for the map() function. This only works on integers so you may find you need a floating-point version. It's also only linear so you may need a more complex calibration curve for your sensors and outputs. Start simple and add the complex stuff later.

Awesome! Thanks for the quick response. One question though, if I add resistors to reduce the i/o voltage, will I sacrifice resolution? I will need an ultimate resolution of not less than 16 bit.

Georgia_Dan: Awesome! Thanks for the quick response. One question though, if I add resistors to reduce the i/o voltage, will I sacrifice resolution? I will need an ultimate resolution of not less than 16 bit.

yes, 4-20 converts to 1=5 or 80% of the 10 bit ADC of the arduino.

teensy has 16 bit ADC, not sure of the useable range.

Converting 4-20 without using instrument op-amp will only off 80% of the input range

The first question that needs asking is accuracy and resolution of the pressure signal ? If you need resolution greater than 1 in 1024, you will need to look at a different method.

Either an off board ADC or a different board altogether.

Most industrial applications like this would use 12 bit of resolution or greater, for example, 12 to 16 bits is common. The lowly Arduino has 10 bits.

The DUE can do 12 bits.

Next is the input stage of the ADC, if you are needing accuracy, you will also need a good input stage to the ADC from your pressure transmitter, whether 4-20mA or any of the standard voltages.

Next, what would your sampling rate be and need to filter out any noise while retaining the response you need.

Edit: I just see that you have a criteria of;

I will need an ultimate resolution of not less than 16 bit.

Well, forget the onboard ADC of the standard Aruino UNO, Mega etc. then.


Paul

Guys, thank you again for the great input. This is exactly why I can't go it alone. I had no idea the ADC in the Arduino was 10 bit. I had a look at the Teensy product that offers 16 bit. Can this be integrated with an Arduino product seamlessly? Paul, When you say that i'll need a good input stage from my transmitter, what exactly is meant by that? Will the ADC not accomplish that? Guess i'm a little confused. Further, I would like to receive samples by the PC up to a rate of 100 hz. if possible. As i'm very unfamiliar with the use of micro-controllers, won't I require ~65000 bits of some memory from each of these analog inputs? And if so, which memory is meant to handle this? Flash or SRAM? Or, am i completely thinking of memory in the wrong way. Thanks again guys.

When you say that i’ll need a good input stage from my transmitter, what exactly is meant by that? Will the ADC not accomplish that?

Depending on the analog source characteristics, you may need to better match the signal into the input of the ADC, possibly via a analog condition or isolator module.

I’m guessing your pressure transmitter will be powered from a 24Vdc supply ?
If the transmitter provides a 0 - 10 volt as I recall you mentioning, then simple resistor divider to bring down the 10 volt signal to 5 volts max should suffice. You still need to respect the input impedance of the ADC. This means selecting the appropriate resistor values to do the signal down scaling while still matching the ADC input impedance. At a guess, for 0 - 10 volts, the resistors might typically be in the order of 5kΩ each. Not too low that it loads down you voltage source of the sensor and not too hight that it is higher than the ADC input impedance.

For 4-20mA, again, a simple method is a resistor.
You select a resistor that will provide a 5 volt drop while the current loop of the transmitter is at 20mA.
Typically this is a 250Ω precision resistor, not a general resistor. They are specific to this purpose and have a high tolerance on accuracy and low temperature coefficient.

Use 4 - 20mA if your sensor is in a electrically noisy environment or the distance is greater than what should be use with a voltage line. Rough guide, a cable run less than 10 metres and in clean EMF environment or less than a few metres in a noisy environment.

A 4 - 20mA signal can be run over many metres, in fact hundreds of metres with the correct cable and conditions,and is mostly used in industrial sites.

Your sample rate to you PC is going to be limited by the communications link form Arduino to PC I suspect, but at a quick guess, if you are meaning you want to receive 100 sample per second on your PC, then that should be achievable quit easily.

Or, if you are referring that you would like you PC to be able to have sensor data that had a filter response such that you are getting sensor data up to 100Hz, then that is another box of dice. You need to know that each part of the sensor circuit does not dampen or filter below at least twice what you want, so, no filtering below 200Hz.
Will your sensor be capable of this sort of response is another question, as it might have mechanical or electronic filtering, intentional or unintentional.

From what I understand yo wish to do, I would look at a system that acquires sensor data and streams it out on a reliable communications channel.

Really, using an Arduino may be ok, but there are possibly better methods to achieve a better outcome for your project.

If you wish to play with Arduino, then certainly, a DUE or Teensy would be the first choice.
Other methods would be an off the shelf DAQ system, where you simply plug in the sensors in one side and the PC on the other and load up the propriety software.

Another method if you are serious and need good reliable sensor acquisition and control, is to look at a PLC system.

I want to use a custom .NET application in a PC

You ‘want’ or you ‘need’ ?


Paul

well, you have some research to do.

first question I would ask is the real process as you know pressure travels at the speed of sound. pressure in the vessel will be at equilibrium continuously.

your throttling valve will be glacial in comparison and unless you have something inside, the pressure will not fluctuate.

based on this, your process will be very quiet and not need a lot of filtering.

if your compressor is a piston you will get the pulses of each stroke as the valve opens.

typically we request the data sheet for the parts for review. not sure of the pressure range. why do you want such high accuracy and such high speed

I would offer that a very stark review of the actual needs be determined.quite ofer the goals in the board room do not meet the goals in the real world.

16 bits is a lot. Really a lot. That’s measuring pressure to millibars in a system with 65 bar pressure. Serious laboratory measurements need serious laboratory equipment. An Arduino (or Teensy) is not suitable for this.

I think it’s more likely that 10 bit is enough for what you want, given the other parameters of the system. 16 bits sounds better but really you will end up applying an average filter to that to stop it ‘jumping around so much’ that you will get less than 16 bits effective resolution. An Arduino can do this and maybe it can help you decide if you need to spend the big bucks on the lab equipment if you determine that you really do need that accuracy.

Wow! I never expected to get this amount of input in the forum. I'm so glad i posted this. Honestly, it's the first time i've ever posted on a forum. Thanks again for all the advice.

First, in response to dave-in-nj, this application will be dynamic whereas outside mechanical forces will be acting upon the vessel and therefore, effecting the internal pressure. The idea is to measure the pressure of water from 25psi to 500psi at different points. The resolution will need to be .03psi. I know, that sounds like a lot, but that is the requirement. I have not selected the transducer yet, but i can say that most high end published accuracies are in the neighborhood of +/-.03 to .05%. I do realize that my proposed resolution is smaller than the published accuracy of the sensor, but in my experience, the published accuracy is quite conservative.

Now, in response to rockwallaby, thank you for the very detailed information. This will and has been very helpful. While i'm not exactly sure what you mean by "you may need to better match the signal into the input of the ADC, possibly via a analog condition or isolator module.", I am planning to use a signal conditioner like the Honeywell DA-05 which, yes, will require the 24 volt input. The sensor will only be a few meters away and therefore, i think the voltage over the 4-20 should be okay. I'm quite inexperienced on the noisy environments and EMF. I tried to google it, but i'm not sure i know any better now. I will say that there will be computers and cell phones around as well as 3-5 hp electric motors. Outside of that, i don't for-see anything like X-ray machines, microwaves, etc. What should be considered? I'm having trouble distinguishing the difference between these two statements...

"Your sample rate to you PC is going to be limited by the communications link form Arduino to PC I suspect, but at a quick guess, if you are meaning you want to receive 100 sample per second on your PC, then that should be achievable quit easily.

Or, if you are referring that you would like you PC to be able to have sensor data that had a filter response such that you are getting sensor data up to 100Hz, then that is another box of dice."

Therefore, i'll explain a little further and hopefully you can help me understand? My thought was to have a sketch that would produce a rolling average of 10 samples for the PC to receive. I'm guessing this might be what you guys are referring to as "filtering" due to the electrical noise? The idea would be that once started, it would take 100ms for the first data point to be calculated and then, one would be calculated every 10ms. I hope that makes some sense. If i'm reading the amplifier spec correctly, the response is 2300 hz??? I love the suggestions for the other solutions. If this works out, i may need to produce 16 of these. Regarding the PLC solution, i've often heard that it would not handle the closed loop control very well. Perhaps, because they're not fast enough?? At least, that's what i've heard within the last three years or so. Further, i'm not quite sure how i can integrate the PLC to my custom application which i "want" to use .net because it's my understanding that it's much easier to pick up on?? I love the idea of the open source with the Arduino. I was always told that PLCs were good solutions for PID control of temperature and fluid volume, but not the best solution for high speed dynamic response applications. Lastly, will the off the shelf DAQ system allow me to scale my input with multiple points. I love the idea, but sometimes i feel stuck in a box with the off the shelf products and their proprietary software.

Finally, in response to MorganS, you are right, i'm asking for a lot. Quite honestly, after more calculations this afternoon, i've realized that i will really only need 14 bit, but that isn't the most common. Right? If the averaging scheme i detailed above still doesn't fit within the capability of the Aduino products, is there something else on the market that would be capable and provide me the freedom?

Thanks again guys!

Oh yeah, i gotta learn how to put that "Quote" thing in my post! Lol. I'll figure it out.

what kind of sensor are you considering. Is it a industrial sensor. The reason I ask is that industrial sensors sometimes have a 3rd option like hart protocol for communication.

I was thinking about a Honeywell or or an Omega product. I have never heard of heart protocol for communication. I'll look it up. Thanks for the tip.

Dan wrote:

I am planning to use a signal conditioner like the Honeywell DA-05 which, yes, will require the 24 volt input. The sensor will only be a few meters away and therefore, i think the voltage over the 4-20 should be okay. I'm quite inexperienced on the noisy environments and EMF. I tried to google it, but i'm not sure i know any better now. I will say that there will be computers and cell phones around as well as 3-5 hp electric motors. Outside of that, i don't for-see anything like X-ray machines, microwaves, etc. What should be considered?

Good, that signal conditioner and transmitter sound fine for what you need, I looked over the specs for the Honeywell DA-05, it would seem a good starting point.

Use the 4-20mA with appropriate instrumentation cable. The 4-20mA loop will not be a problem in noisy EMF environments. A voltage signal would be effected. EMF is from all those things you described, all producing different EMF spectrum's, but that can impact on sensitive measuring equipment.

Use quality cable, shielded, place any electronics in a metal enclosure and have that enclosure connected to a good Earth point.

Yes, most PLCs are slow, but this application I am sure has been done many time before using either high speed PLCs or off the shelf DAQ systems, (with their propriety software).

I think your idea of trying with Arduino is good, and your questions are directed in the right direction. I guess we just need to find if it is possible with some form of Arduino configuration.

gpop1:

3rd option like hart protocol for communication

This is true, though it means a lot more work for Dan, in terms of working with the Hart protocol, whereas he already has a transducer and transmitter that, I think be suitable. Remember, any communications from a smart transducer is probably not going to be super fast, whereas a simple analog signal is, or at least can be. Hart is great in an industrial environment and where you have many of these things going into a central control system. With Hart, you are locked into propriety systems again, which I think Dan is happy to avoid if he can.

Dan:

Quite honestly, after more calculations this afternoon, i've realized that i will really only need 14 bit, but that isn't the most common

No problem, just use 16 bits. As long as you equal or exceed the required resolution, you are fine.

Now, one thing I would look at is using a good quality external ADC. I don't have a suggestion, but find one that is a single or at most four channels, not 16 channels. You want something that isn't going multiplex across a bunch of inputs, if you only need one or at most two anaolg channels. Look for a ADC board that communicates using SPI. This can then be connected into the SPI of the Arduino and is fast, faster than I2C.

Ok I do of one suggestion, here is a nice little ADC board, it is I2C, but I would throw this into the consideration circle. It can do up to 860SPS but you need to check under what limitations. ADS1115 It is a not an expensive board, again, just a hobbyist board that might look to be closer to what you might need.

The reason I am suggesting an external ADC is for two reasons, one, the Arduino hasn't the resolution for your needs and two, the internal ADC of most Arduinos can be noisy, meaning, noise from the internals of the CPU can get onto the ADC signal and mess up what would otherwise be a clean signal. The ADC on most of these sort of micro-controllers is just there for convenience and they are not high precision or high performance at all.


Paul

Paul, Thanks again for the great advice. It appears the (TI) ADS1118 ADC has the SPI communication. Are there any off the shelf DAQ devices that offer open source programming? Lastly, if i'm successful with this, and need to build these units, is there any reason you'd not recommend the Arduino for the builds?