Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-Spunding #186

Open
wants to merge 327 commits into
base: testdrive
Choose a base branch
from
Open

Auto-Spunding #186

wants to merge 327 commits into from

Conversation

MrDAnger82
Copy link

Hello.
Assembled the BPL and assembled an automatic tongue for pressure control. I use WemosMini and in order not to burn A0 between the pressure sensor I put a 4.7k resistor and calibrated at 4.4psi. When calibrating the sensor, the parameter "b" varies 137-155 for me, and the parameter "a" 0.32 ..- 0.48 ...
Pressure control works, but the readings are very "floating", for example, then 17psi, then 25psi, then 46psi. If the control is set to 30psi, the machine relieves the pressure and in the end I get about 15-18psi. Checked when supplying gas from a cylinder.
Maybe it makes sense to add pressure logging and its graph to the screen?
Then it will be possible to deduce approximately how much pressure should be indicated above in the control to obtain the desired carbonation of beer.
The sensor is at 500psi, just like what you have in the picture, only bought to China on Aliexpress.

@vitotai
Copy link
Owner

vitotai commented Aug 18, 2019

First of all, I am glad that it works. I haven't finished hardware upgrade to my fermenting controller.

You might have a pressure transducer with TOO high maximum PSI and hence error. The specification of mine is 100psi max, and I got around 3psi variation, which is exact 3% error specified. If you have the same one as mine, and I bet you do, maximum 15psi error seems reasonable.

You must have as small as possible "pin hole" for pressure release. It is very important, although I guess you should have already done a good job. Given no interrupt is available, pulling is the only way I can think of. ( I've thought of using another controller dedicated for pressure control, which complicated things a little bit.) To avoid exhausting the processor, the pressure is checked every second. That means the valve will be open for at least one second before the controller has a chance to check the pressure reading.

Some kind of filter is necessary. Maybe a simple low pass filter might do. Or, 5 successive reads from A0, and average the middle 3 readings. What is your opinion?

Adding pressure readings to chart is in the schedule, after I finish my setup for better verifying.

Specifying carbonation level is a good idea. However, I have to study/survey the formula first. A chart is the only way I know.

@MrDAnger82
Copy link
Author

Today, the tongue apparatus has been slightly modified: I removed the resistor altogether. Because the maximum pressure is unlikely to exceed 44psi, so I doubt that a large voltage will come to the input of the processor.
Everything is working.
The power supply apparently also has a range of parameters. I had a Chinese 5v 1A unit, replaced it with the original Samsung 5v 2A power supply, the readings began to jump less.
I also replaced the wire from the sensor with a shielded one (USB-wire), and applied grounding to the braid.
Again, the readings are more stable. But the problem remains ...
I have a sensor from 0psi to 500psi, during calibration I apply pressure no more than 44psi.

@MrDAnger82
Copy link
Author

I am very confused by the jumps of indicators, and they can be negative (-15psi) and sharply positive (112-162psi).
positives rarely occur, but they show a significant effect on the retention of pressure in the system.
After the sensor, I put a needle valve in front of the relief valve, which allows you to adjust the pressure relief rate.
I think that a filter is needed from sharply incorrect results, since there can be no negative pressure, and there can also be no jumps from 30-40 psi to 112-160 psi during fermentation.
Maybe it’s worth checking the pressure 1-2 times per second, taking 2 close results and evaluating them — is it necessary to open the valve?

@MrDAnger82
Copy link
Author

MrDAnger82 commented Aug 18, 2019

Yes, and I did not warn, I am from Russia, so my English = English from Google translator ... sorry ...

By the way, we mainly use different units of pressure measurement, for home brewers, usually everything is measured in bar ...
Therefore, I would like to have a choice of pressure indication units ...
But I almost adapted to psi ...

@vitotai
Copy link
Owner

vitotai commented Aug 19, 2019

I added the filter in a new testing branch. You can try it.
https://github.com/vitotai/BrewPiLess/tree/PressureMonitor

However, I don't think it would work well with variation like that.

@MrDAnger82
Copy link
Author

Maybe this resource can be useful for creating and editing an automatic carbonization module?
http://www.lowoxygenbrewing.com/brewing-methods/spunding-automation-and-logic/

@MrDAnger82
Copy link
Author

I added the filter in a new testing branch. You can try it.
https://github.com/vitotai/BrewPiLess/tree/PressureMonitor

However, I don't think it would work well with variation like that.

Thanks you. I'll try, according to the results, I will write to you.

@MrDAnger82
Copy link
Author

Vito, the processor creates a BPL network, I try to connect, it says that the connection fails. Authentication to the BPL network does not pass from a phone or tablet.
I double-checked this firmware on several processors, old versions of the firmware on the same processors easily raise the network and everything works. This firmware does not raise. We recompiled the firmware several times, changed the processors, and everything that can be erased from them ... Does not help.

@MrDAnger82
Copy link
Author

Vito, do not consider it arrogance, but you can’t compile me a bin file? In order to avoid my mistakes?

@vitotai
Copy link
Owner

vitotai commented Aug 26, 2019

Get the binary with 3.6p.

@vitotai
Copy link
Owner

vitotai commented Aug 27, 2019

螢幕快照 2019-08-27 下午3 15 41

FYI,
I don't get stable readings from my sensor, either. The correct reading should be steady 0. The 1.8 peak value at 16:30 is already filtered. It's 5psi raw.

@MrDAnger82
Copy link
Author

Vito, flashed your firmware to several controllers. I can not connect to the brewpiless network. It seems that the controller does not turn on the network ...
Old firmware-without a problem create a network ...
Is there a problem with this new belief: "ESP8266 won't start after selecting WiFi network. The web server used is ESPAsyncWebServer which uses ESPAsyncTCP. I found that if ESP8266 ever enters SoftAP mode before connecting to the network, the Web server will fail on tcp_bind () and the web service will be unavailable. Not tracing the source code of the LWIP, I just worked around by reseting the system. However, ESP8266 sometimes doesn't reset. "

@vitotai
Copy link
Owner

vitotai commented Aug 27, 2019

Well. I've changed the design. Now, there is no WiFiManager.
I guess it might have something to do with settings.
Try flashing via USB. If it still doesn't work. Try turning serial debug, ie. development build, and check the serial logs.

@MrDAnger82
Copy link
Author

Vito, I'm just a doctor ... :(
I can not do that... :(
I'm flashing through a USB program
ESP8266FlasherX64.

@MrDAnger82
Copy link
Author

And you can’t stick a filter in the old firmware?

@MrDAnger82
Copy link
Author

Vito, I managed to start, first I flashed version 3.5.4, then tied it to my home network, and then updated it to version 3.6.4.
Indications are quite stable, they do not jump much.
But I don’t see the pressure graph, as you mentioned above by type ...
And how do you know exactly which version of the firmware is installed? otherwise only v3.6 is written ...
Thank you so much for the device!

@MrDAnger82
Copy link
Author

Maybe it makes sense to do a trickier sensor calibration? Not by two points, but more? By type, how fast is the iSpindel calibration?

@vitotai
Copy link
Owner

vitotai commented Aug 29, 2019

The graph is currently under development.
The calibration processes of iSpindel and pressure transducer are different.
The real formula of iSpindel is an arctangent formula, if we can find one. Linear regression is used to get a proximal formula.
The formula of the transducer is simply a linear equation. It's easy to get the coefficients by two points, or readings.
The problem is not the formula, but the READINGs that the transducer gives are not stable. The program does a very easy job by translate the VOLTAGE reading from A0, the analog input PIN, and convert it to pressure based on the linear formula.
Take mime for example, the reading drifts from 130 to 230 at no pressure, or 0 PSI. It's not possible to get a formula that f(130)=F(155)=f(230)=0. (Except that the formula always return 0 whatever input is.)

@MrDAnger82
Copy link
Author

It is a pity that the pressure schedule is not available ... I wanted to brew beer at the beginning of September and check its operation ...
I realized that iSpindel has a different dependence ... But its readings also "float" from gas bubbles and waves?
Can measure, say, 5-10 times, just take the arithmetic average? Suddenly it will work?
I also think that we should try to replace the BPL power from a switching power supply with a stabilized transformer. I did not install a Chinese power supply, but the original high-quality from a Samsung tablet, the readings were more stable.
Thank you for your help!

@MrDAnger82
Copy link
Author

So our problem is the sensor and the analog-to-digital converter of the processor ...
How can I stabilize the data from the sensor yet? Maybe a different connection scheme? With a resistor or capacitor?
Why here:

http://www.lowoxygenbrewing.com/brewing-methods/spunding-automation-and-logic/

Does a person on a similar sensor have no such problems?

@vitotai
Copy link
Owner

vitotai commented Aug 29, 2019

First of all, you don't know how good it really works.
(well, I think I found some information about his setup. you can check the picture in this thread: https://www.homebrewtalk.com/forum/threads/my-mostly-automated-brucontrol-setup.646559/page-5#post-8389647
The pressure is neither stable.)

Second, I don't see the specification of the sensor. It might be a maximum 35psi one, which would have lower error rate, like 1 or 2 psi.

Third, I got this idea from here:
https://aussiehomebrewer.com/threads/spunding-valve.90341/

He seems to use a 36psi transducer and Arduino. Maybe ADC of ESP8266 might have something to do? I will test it with an Arduino later.

BTW, I found the formula to convert carbonation level into pressure. However, it might not work as expected because It takes some time to reach equilibrium. When crashing the beer, temperature should drop faster than pressure. If the setting pressure is derived from carbonation level, we will lose some co2 before it reach equilibrium.
I like the idea, though. A simple calculator to help deciding pressure will be added.

@vitotai
Copy link
Owner

vitotai commented Aug 30, 2019

A little googling led me to this issue:
esp8266/Arduino#2070

I will try me best, but we might not be able to get stable readings unless turning off WiFi, which is non sense to me.

External ADC is an option, like:
https://www.adafruit.com/product/1085
(It is very cheap on eBay.)

@MrDAnger82
Copy link
Author

MrDAnger82 commented Aug 30, 2019

Vito, then I'm right in something ...
As I understand it, you need to add a separate voltage stabilizer or stabilized power source for the sensor, the processor ground and the sensor are common.
I will try to do so.
Vito, for the experiment I would like to have a pressure graph, at least inaccurate, but there will be something to show you.
Thank!

@MrDAnger82
Copy link
Author

Of course, you should not turn off WiFi, without it there is little sense ...
If it turns out to be bad, can it make sense to make an additional processor (Wemos mini, for example) to work only with the remote sensor, and will it transmit data to the "main" processor?

@vitotai
Copy link
Owner

vitotai commented Aug 30, 2019

Just push the updated code with graph.
https://github.com/vitotai/BrewPiLess/tree/v37alpha

The tricks mentioned in the issue above are used, and it seems to work fine for me. I got around 0.5 psi maximum drift in 4 hours, which is acceptable.

@MrDAnger82
Copy link
Author

Updated by OTA ... again I can not connect to the BPL ...
Like before...

@MrDAnger82
Copy link
Author

The LED constantly blinks.

@vitotai
Copy link
Owner

vitotai commented Aug 30, 2019

oops. My bad.
Please try again with the *pre2.bin

@MrDAnger82
Copy link
Author

Hooray! Everything is working! I'm chasing now. Tomorrow I will try to throw off the screenshots.
Thanks you!

@MrDAnger82
Copy link
Author

Yes, it got better, but all the same, in an hour it loses pressure to the minimum due to false positives.
It is necessary to try to put a voltage regulator on the sensor power supply or a separate power supply to the common ground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants