Slowing down a 0-10v output

Hi,

I am wanting to use a pressure meter which outputs a 0-10v value to regulate a valve. However, I want to be able to smooth the response of the flow meter so it doesn't fight the valve.

Imagine that water is being pumped through a pipe and I am wanting to maintain a constant velocity. If the velocity drops, I need to start to shut the valve to build up pressure. If the pressure increases i need to start to open the valve to stop it from pressurising to much. In real life, the pressure sensor is sensitive and as the pressure drops it tells the valve to open more which it does instantly. this creates a surge, which the sensor detects and reacts by closing the valve rapidly.

I am trying to get it to slow down and average out the response from the sensor somewhat so that it isn't such a knee jerk reaction.

I know from experience I could do this using the functionality of an inverter to take the 0-10v input and add in a X second delay on the 0-10v output however I don't have that sort of money to throw at this project and it seems a total overkill.

So... I was wondering, I could use a arduino to read the 0-10v (obviously stepped down) and then output a "delayed & averaged" PWM signal that could then be converted to a tidied up 0-10V signal for the valve.

However, doing a fair bit of googling, it would seem to me as though an RC filter arrangement would do this a far simpler way. My research has given me the following:

  1. Calculate the time constant: The time constant (τ) determines how quickly the signal will change. It is calculated as the product of the resistance (R) and the capacitance (C) in the circuit: τ = R * C.
  2. Choose resistor and capacitor values: Depending on your specific requirements, you can select values for R and C. A larger time constant (larger R or C) will result in a slower response.
  3. Connect the components: Connect the resistor and capacitor in series. Connect the input signal to the junction between the resistor and the capacitor. Connect the other end of the capacitor to the ground (0V) reference.
  4. Observe the output: The voltage across the capacitor will be the filtered output signal. It will change more slowly than the original input signal.

I want a 10 second delay so had come up with this:

τ = 100,000Ω * 0.0001F

Does anyone know if this is all that needs to be done? My oscilloscope is currently out of action and I would be very glad if anyone can give me a yay or nay.

You might take either a voltage divider or opto coupler to count the pulses per second provided by the flowmeter.

Try slowing down the output of the valve. Is this an on/off valve or adjustable flow? Look at a PID (Proportional Integral Derivative) type of control.

Do you want to "smooth" the signal or delay the signal, they are two different things

Ideally both, but most importantly delay

A low pass filter will certainly smooth and delay but any signal changes above the cutoff frequency will be lost

fc = 1/(2PiR*C) = 0.0159Hz

Hmm.. I think I understand about 10% of this.

How would I figure out if this will be an issue or not? I assume I need to know what the frequency is which I wont be able to measure without a scope? Or am I wrong

I'm not sure what you mean by this "fight the valve"

Sorry, this was because I said flow meter, when in actual fact it is measuring pressure, and i am calaculating flow from it.

Imagine that water is being pumped through a pipe and I am wanting to maintain a constant velocity. If the velocity drops, I need to start to shut the valve to build up pressure. If the pressure increases i need to start to open the valve to stop it from pressurising to much. In real life, the pressure sensor is sensitive and as the pressure drops it tells the valve to open more which it does instantly. this creates a surge, which the sensor detects and reacts by closing the valve rapidly.

I am trying to get it to slow down and average out the response from the sensor somewhat so that it isn't such a knee jerk reaction.

I will add all this into the original question as I think its key information that i left out.

What you need is a PID controller, which you can actually do with an Arduino.
You can certainly use a filter to smooth the response, but there will allways be a constant lag between the valve response and a pressure change. If the system works and does not become unstable with a 10 second delay then use it.

Thanks Jim, thats very helpful.

I will breadboard it and do some trial and most likely plenty of error.

One more thing: You will probably need an op amp buffer between the filter and the valve, otherwise the signal input to the valve may be severely attenuated.

A cheap LM358 non-inverting op-amp configuration will work if run from a 12V supply.
v

Thanks very much @jim-p i'll update you once I've cleared the decks and back onto this

Hi @jim-p I have been doing some trials and have the following circuit for creating a PWM signal which is supposed to convert to a 0-10V output!

AGOT1 and AGOT2 are "AnalogOut1 & 2" from the atmega 2560 connected to PWM pins.

For some reason, probably very obvious to you, when I run the example code in Arduino IDE for "Fade" as per the below, the voltage fluctuates very fast on the final output (AOT1), takes a while to get above 1V, gradually creeps up to 3.6V (at about 70-80% duty) and then as the "fade" gets to the highest value, jumps up to 10V.

I am monitoring it using two scope probes, one connected directly to the 2560 PWM pin to check the PWM duty, and the other to monitor the output voltage (in theory 0-10V). However, reading the voltage output is easier with a multimeter.

I am only using AGOT1 at the moment, AGOT2 is a spare.

Any ideas please?

Code I am using is as follows:

int OutputOne = 9;         // the PWM pin the LED is attached to
int brightness = 0;  // how bright the LED is
int fadeAmount = 5;  // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
  // declare pin 9 to be an output:
  pinMode(OutputOne, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // set the brightness of pin 9:
  analogWrite(OutputOne, brightness);

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 1000 milliseconds to see the dimming effect
  delay(1000);
}

Why are you using an I2C bus isolator?

In short, I found it on a schematic in the depths of google! Im still very much learning! Is that where the problems are coming in?

Is there a reason why you need the Mega2560 isolated from the 0-10V output?

Only that I thought that is how it would have to be to signal to an external valve. Again, something I had read but may not be correct. Why would isolating it be recomended?

If you are interfacing to the AC mains (120VAC, 240VAC) then for safety reasons you would want to isolate your low voltage electronics.

It may also be required in certain medical application again for safety reasons.

So are you trying to create a 0-10V signal using PWM?
If yes, what will the 0-10V signal connect to.

Yes okay that makes it understandable. The 0-10V will be controlling a valve which is mains connected so probably best if I keep the isolation circuit in there?

Valve actuator is here: https://www.controlstraders.com/assets/brochures/BEL-DAM-NM230ASR.pdf

Really do appreciate your help on this.