Hi.
In my new project I need to drive a proportional valve 24VDC with a pressure transducer feedback regulated by a PID algorithm.
The pressure must be maintened at a specific value (set point) given by user in a range between 0bar and 12bar. I think to use a proportional valve to drive the pressure and a pressure transducer to read pressure value. I think to use a Proportional-Integrative-Derivative (PID) algorithm.
I need to drive proportional valve via PWM with a range of frequencies between 600 and 900 Hz, how I can achieve it with Arduino Mega 2560?
I need to write a PID routine with a set point and a value to drive the PID routine...
Could someone help me to implement a PWM interrupt driven pin and a PID algorithm to drive it? I need to give a Set Point value to the PID routine and with a pressure transducer value drive accordingly the output pin to move the proportional valve to reach the set point pressure.
This kind of question generally gets a 'do it yourself' response, but I would ask -
Is using a separate valve and sensor possible for your application?
The valve has quite a slow response time, around 25ms, depending on your time constant you could vastly overshoot the target pressure before it reacts.
What happens if the valve stays fully open, will damage occur? This could happen by accident during development of the system.
CommonRodent:
Is using a separate valve and sensor possible for your application?
Yes, it is possible. My links are only for demonstration purpose. I am searching for cheap proportional valve....
CommonRodent:
The valve has quite a slow response time, around 25ms, depending on your time constant you could vastly overshoot the target pressure before it reacts.
What happens if the valve stays fully open, will damage occur? This could happen by accident during development of the system.
If Reaction time is 25ms, it is really good for my project.
If the valve stays fully open there is no problem and will not damage anything.
depends on the medium. air will increase in volume as the square of the increase in pressure.
a change in pressure will cause an increase in flow if there is no control action.
if you have a hard time getting a stable pid loop, try a simple fuzzy control.
I used 3 ranges in a project.
if the reading was more than 50% away from the set point, move fast
if it was between 50 and 20% move slow
if it was withing 20% move very slow.
(Though as dave-in-nj said it might be more than you need if it's just a case of approaching the target pressure without overshooting).
Your control loop will be roughly:
read pressure sensor
myPID.Compute();
update pwm setting
But you might need to change the PWM frequency. I don't have your board but this might have it http://forum.arduino.cc/index.php?topic=72092.0
(One of the pins might be configured to 980Hz as a default, but that's slightly outside your range)