Need help ?rapid on & Off state
Siri
Posts: 220
I am working on project using BS2SX OEM module - with a pressure sensor circuit and ADC convertor.
I am using the pressure out-put to trigger a solenoid on and off .The solenoid is suppose to be ·"on" when there in no pressure and on when there is pressure detected and "Off" when pressure increases.
The problem is when there is very "little" pressure the solenoid continuously goes on and off untill higher pressure is detected and then the solenoid stays off and then when the pressure drops at very low level the the solenoid continues on and off untill pressure drops further down.
Since there is not a big difference in the pressure I did take the ADC out-put and converted· into ratiometric pressure toinlde 3 decimal points(3.432 cm H20) and then multipled by 1000 to get large numeric but proprtional values.Still even if the triggering values like <35· (solenoid - "Off") and >125 (Solenoid· "On") the triggering is not stable when the pressure is very low.
Is there a hardware or code or both that can fix this "Flikering problem"
Thank you,
Siri
I am using the pressure out-put to trigger a solenoid on and off .The solenoid is suppose to be ·"on" when there in no pressure and on when there is pressure detected and "Off" when pressure increases.
The problem is when there is very "little" pressure the solenoid continuously goes on and off untill higher pressure is detected and then the solenoid stays off and then when the pressure drops at very low level the the solenoid continues on and off untill pressure drops further down.
Since there is not a big difference in the pressure I did take the ADC out-put and converted· into ratiometric pressure toinlde 3 decimal points(3.432 cm H20) and then multipled by 1000 to get large numeric but proprtional values.Still even if the triggering values like <35· (solenoid - "Off") and >125 (Solenoid· "On") the triggering is not stable when the pressure is very low.
Is there a hardware or code or both that can fix this "Flikering problem"
Thank you,
Siri
Comments
-Phil
Hysteresis as mentioned before is a good idea. You are probably experiencing some pneumatic "bounce". When you open a valve in a pressurized system, it will take a finite time to settle. You may need to delay a bit after the solenoid is open before you read the pressure and then delay and read it again. That way you can tell if it has settled.
·I am atttaching the circuit and the code I am using so you can make more suddestions to solve the problem.
Phil - I tried your sugesstion widening the threshold limits and it did slow it down but it still goes on and off at a slower rate when I widen any furtherit required more pressure to work and is not suitable for the project.
Lee - I will try your suggestion to increse the inbetween reding times.
Thanks once again for your help.
Siri
Siri
I already had programmed 30 milsec delay after readings· and I tried increasing and did not do any better.I am trying with pauses at different stages in the program just to see whether I can better the on & Off states.
Thanks for your help
Siri
··
Another thing you might try is lowpass filtering your readings using a running average, for example, like this:
NewReading is the value obtained from your sensor, and CurrentReading is the value you use in your program. (CurrentReading needs to be initialized at the beginning of your program by assigning it the sensor reading directly.)
Along with the hysteresis and delays, this will help to keep small changes from tripping the solenoid unnecessarily.
-Phil
Thanks again for helping out.
Siri