Calculate Volumetric Flow Through Orifice Flowmeter
double CalcFlowmeter(double CfA0, double dP, double density, double offset) {
return CfA0*sqrt(((dP-offset)*2)/density);
}
where:
CfAo is determined through flowmeter calibration
dP is the differential pressure across the flowmeter (from Press_Data[i]) in Pascals
density is the density of the gas (1.2 kg/m3 for air, estimated to be 0.95 for wood gas)
offset is the zero offset for the pressure sensor. The zero offset does fluctate with time, ideally the offset should be found before each run (no flow condition)
Manually Pulse Servo
Pending library support for servo control, you can manually control a Futaba servo:
void PulseServo(int servo_pin,double angle) {
// manually pulse servo - up to 2 ms delay will be be an issue w/ more then a few servos, may be ok w/ 3.
digitalWrite(servo_pin,HIGH);
delayMicroseconds(1000+angle*5.556);
digitalWrite(SERVO0,LOW);
}
PID Control Library
http://www.arduino.cc/playground/Code/PIDLibrary
Note that the library defaults to limiting inputs to 0-1024 (the 10-bit analog input native to arduino). These limits will need to be changed to handle values from pressure sensors etc. The library also defaults to a sample time of one second (compute() will not run,even if called more frequently), which is too slow in some cases (like mantaining reactor vacuum through ejector air input).
These methods are useful:
void SetSampleTime(int NewSampleTime)
void SetInputLimits(double INMin, double INMax)
void SetOutputLimits(double OUTMin, double OUTMax)
Comments (0)
You don't have permission to comment on this page.