Ah yes, what to program in...
At the moment, I split it. My development laptop runs Python, and interfaces to an Arduino via serial. So right now it just read the DS temp sensors, and sends them off to the serial port.
The nebulous thoughts I have on this is that I implement an AT command set on the Arduino so it can do the detailed control, while the Python side does the fancy display.
I started using Python to get access to the OpenCV library. I have a module about 80% complete which uses a webcam to look at a hydrometer and then report the ABV at a far greater accuracy than any temp based sensor can provide. This means I can plop a Raspi with a touch screen in there for not tooo much $$$ cause I think my still deserves it rather than an LCD display (no offense meant) however I have a bunch of old laptops that would be more than happy to do the job gladly for free.
This allows me to split the transport truck of code needed because the pickup truck Arduino can't do it all, I'm starting to think an ESP32 might be better as the embedded processor. I did ask for one for Xmas.
The logic works regardless of who is going to process it.
I do have to dump all the pressure compensation and tables to do this in the Arduino, since all I need it to do is read the DS18 array, run three steppers, (cooling, fores/heads/hearts/tails separation,hearts portioning), and few irq lines for a drop sensor and flow sensor,
The AT commands I think I need to implement right now are:
ATLn n=0,1 starts stops sending log data.
ATRn n= 0,1 stops/starts total reflux
Gives 3 responses, OK, +++ATR1 when stepper movement finished, +++AZEO when temp stable.
ATOn n = drops per second output, adjust reflux cooling to provide n output.
Gives OK.
ATMn=[+,-,""]ssss, moves Stepper n ssss steps +/- or to position ssss where ssss/2048 = 360 degrees.
Gives OK, then +++ATMn1 when movement complete.
ATBn=ssss , sets backlash for stepper n to ssss steps.
ATPnn Purge column move reflux control to purge position, then wait till high column temp changes by nn DS18 units, then move reflux back to obtain total reflux by ATR1 command.
Gives OK, then +++ ATP0 when reflux at purge position, +++ATP1 when desired delta t has occurred, then +++ATR1 when reflux achieved, then +++AZEO when column temp has stabilized.
ATVnnnn Start counting how many drops have been output, when at nnnn execute ATR1 command.
While I don't have the bits yet,
ATWn 0,1 open solenoid for cooling water.
ATHn n = 0 power off boiler heater, n+ PWM value for element control.
I'm getting the stink eye from the Mrs, I have three batches ready now that need to be run before Xmas, and I need a really good day to code all that to the Arduino,
I attached the template image for the OpenCV parrot, and the log file from a run in the summer.
Enjoy!
Algorithms column temperature stabilization. run graphs.png (68.02 kB. 350x189 - viewed 934 times.)edit no log file >6.5 mb pic instead
Algorithms column temperature stabilization. run graphs.png (68.02 kB. 350x189 - viewed 934 times.)