DeeEmm / DIY-Flow-Bench

Volumetric flow bench based on ESP32 and MAF sensor.
GNU General Public License v3.0
27 stars 8 forks source link

MAF Transfer function for Slot style MAF sensors #136

Closed DeeEmm closed 1 year ago

DeeEmm commented 1 year ago

Discussed in https://github.com/DeeEmm/DIY-Flow-Bench/discussions/135

Originally posted by **DeeEmm** March 30, 2023 I've put together a quick Excel sheet to translate flow values between different pipe diameters. This allow you to use a slot / cartridge style MAF sensor in a different diameter pipe. The function is based on volumetric flow velocity formula ``` v = Q / (π · (ø / 2)²) ``` Where ``` Q = Volume flow rate v = Flow velocity A = Cross-sectional area r = Radius ø = Diameter ``` The formula specifically relates to volumetric flow but should also work for mass flow as the ratiometric relationship between flow and area is the same for both. Essentially it works as follows. First we convert the flow value to a velocity using the area of the pipe ``` velocity = original_flow_value / original_area ``` or... ``` velocity = original_flow_value / (3.145*(original_diameter / 2)^2) ``` Then we convert this back into a flow value again using the new area ``` new_flow = velocity * new_area ``` or... ``` new_flow = velocity * 3.145*(new_diameter /2)^2 ``` Essentially this is just scaling the flow value by the change in pipe area. The formula is included in the attached Excel sheet. Just paste your MAF flow values in the first column, put in the pipe diameters and drag the formulas down in the second and third columns to suit. [Flow Transfer Function.xlsx](https://github.com/DeeEmm/DIY-Flow-Bench/files/11110385/Flow.Transfer.Function.xlsx)

.

Add transfer function into code to allow end user to configure pipe diameter that they are using.

This requires that original MAF diameter is included within the MAFData file.

User can enter pipe diameter within configuration settings (this will default to original diamter for fixed diamters)

Flow data can then be transposed as part of the MAFData lookup function...

Data-lookup > Data-transpose > Transposed-Flow-Value

DeeEmm commented 1 year ago

Function added in build 23040302 (Commit https://github.com/DeeEmm/DIY-Flow-Bench/commit/7a2b8deaacc0ce50266aa295c98dd9f75399a60c).

The MAF data files now contain the MAF housing diameter that the flow data relates to. This is generally the OEM housing size but may be other non-standard diameters for custom MAF definitions.

Then on the configuration page in the WebUI there is a MAF Diameter setting. This is the size of the installed housing.

Screenshot 2023-04-04 at 11 54 16 am

The code then scales the flow value based on the difference in housing area using these two values

OEM housing area : Installed housing area

This will work for both larger and smaller than original MAF housings

If either value is set to zero or the two values are the same the calculation is not performed and the original MAF flow data is used. This means that the scaling is only applied if the original diameter is listed in the MAF Data file and a positive non-standard diameter is entered into the GUI.

Ultimately all new MAF Data files should include the housing diameter that the MAF data was recorded with.