SimonRafferty / Webasto-Heater---Replacement-Controller

An Arduino M0 based controller for Webasto C/E Diesel Water Heaters
GNU General Public License v3.0
40 stars 11 forks source link

flame control #5

Open softwarecrash opened 1 year ago

softwarecrash commented 1 year ago

hey, interessting project, but one question, why you not use the glow plug as flame control like the orginal?

SimonRafferty commented 1 year ago

Originally, because measuring the difference between 0.3 & 0.6 Ohm is relatively hard to do simply.

I tried just using a shunt resistor & measuring the voltage across the shunt with an ADC - but the signal is right down in the noise, even with an Op-Amp & it was unreliable.

I have a version in the works which uses a hall effect current sensor, then pulses the power to the Glow plug for 10mS to measure the current flow, before it has a chance to heat up too much.
I think the OE board uses a current mirror to measure in the temperature in the same way.

This has stalled at the moment because of the apparent chip shortage. When I came to make the board - they were not available until next year. I could re-design the board to take a sensor that is available - but I wasn't in a hurry so figured I'd wait.

Watch this space - as they say!

softwarecrash commented 1 year ago

s-l1600 i hope you can get the glow plug up to work as termistor, so a new pcb design that can swapped with the oem board without extra sensors sound good. so in pcb and hardware design i cant help, but when you have done that i will look that i can help you with the code. you use a esp32? so i i can try to make a webinetrface and mqtt connection (have heard from camper vans that have running a smarthome system onboard) so the heater let it integrate. im self have the heater as staionary garden house heating solution, but actual the pump get stuck when it was could.

i dont know much from the hardware sensoring, but the webasto software will fire up the heater first, then shut off the glow plug and use it as termistor, glow heating and measure is not on the same time by oem firmware. so i n oticed that the glow plug not will be firered by fulll power, there uses a pwm and ramp ho heat up and after firestart phase the ramp goes slow down.

an aftermarket pcb exsist from norx.hu i have atached, some chance to look where the guys solve the measuring?

SimonRafferty commented 1 year ago

I would guess, looking at the photo, they are using the 1R0 resistor (Left middle) as a shunt in series with the glow plug & measuring the voltage across it, through an Op-Amp. Their design is a lot more 'polished' than mine - so maybe they have a lower noise floor & can measure the signal reliably.

I was using an ESP32 but changed to an M0 because a feature of the ESP is the WiFi interferes with the ADC readings (one of the two ADC converters mainly). I did build a reasonable Android App to control it.

I used the M0 because it was what I had laying around and it plugs into the same socket as the ESP - so I could make it work without changing the PCB. I should really go back to the ESP & use the other ADC channel - then re-establish the App & a web interface. A job for another day though!

Thanks for the offer - I imagine you could make a way better job of a web interface than me! My app looked rather 'Agricultural' ;-).

softwarecrash commented 1 year ago

a little thing i have noticed in your fan.ino in the comments your write the fan runs at 10V i think thats not so correct, the fan was powered by a high frequenzy pwm, and runn at heater full load at 80-93% deepend on the co2 calibration, by hex80 calibration the fan will run at 83% so that is like 10V so when the heater goes to cooldown and blow out the flame the fan goes to 100% duty cycle so the fan speed corespondign with the pump frequency, and co2 calibration

SimonRafferty commented 1 year ago

You're right! On the original processor, the analogWrite was 10 bit - so the comment '// Assuming a 13V Input, 769 gives 10V' was about right. On the current version, it's 8 bit so the mapping: "mapf(fan_speed, 0, 100, 0, 239)" actually gives about 12V rather than 10V.

It was clearly an error. Then I calibrated the fuel & fan based on the error - so the fueling is about right.

When I have time, I'll go through the code & re-calibrate the fan. I think the highest voltage tha fan will see is about 10.8V - but it really ought to be 10V.

Thanks for pointing out the error!

softwarecrash commented 1 year ago

fu*** cold outside, i have quick check it, in the working phase the fan will run around 10V, but in the blowout phase it will get fullspeed at 12V. its simply a (brushed?) dc motor, i think it cant damage at 12V. so when you have a cooldown/blowout phase implemented you can run the fan at full power for faster cooldown or blof off the flame.

i look at the moment for a second heater (maybe damaged) for testing, so when i get one i can try to make a map that was listen the pump frequenzys coresponding to the fan frequenzy. so we can make a ramp mapping like oem but with wider operating range. as example from the oem is pump - fan 50% - 60% 100% - 83% 115% - 100% so its easy to implement a co2 correction, not realy needet but it can be used to optimize the burning prozess

SimonRafferty commented 1 year ago

It is just a DC PM Motor. Running at higher voltages for short durations is not a problem.

softwarecrash commented 1 year ago

jep, the fan motor will permanently run at 11-14volts without any damage.

so the idea will not go out of my head to watch the flame like the oem, so sorry im not a electrical pro, so i think with a cricuit like this (https://www.electronics-lab.com/project/arduino-based-milliohm-meter-lcd-display/) that will switch on measuring when the glow plug switched off is a base? or a simple way a lm317 to get variable voltage from a resistor for measuring with ADC

mlynekg commented 1 year ago

Hello Congratulations on a great idea. Wouldn't it be possible to add support via a web browser to the project like Ray Jones did http://www.mrjones.id.au/afterburner/

Regards

SimonRafferty commented 1 year ago

@mlynekg - The afterburner is really neat!

The first version of this had a web based control interface. I'd originally used an ESP32 - which made it fairly easy to implement. Unfortunately, I had to move to an M0 for other reasons & it has no WiFi or Bluetooth.

It's still on my ToDo list - but there are more important things to address first.

I currently use an eWeLink, 4 relay board https://www.ebay.co.uk/itm/354419373377 to control mine. One relay for heater on/off, one for the underfloor heating pump & one for the convection blower. It works pretty well.

I would, one day, like to make another version with a web app to control it, along with diagnostics & over the air updates. Watch this space - as they say!

P.S. I've just found this: https://www.adafruit.com/product/2598 Which is pin-compatible with the M0 I've used. I'll order one & have a play!

softwarecrash commented 1 year ago

when exsist a hardware basic with adc to and current sensors to controll glow plug/fan stuck ans some else, i will help make a web interface and other bindings

SimonRafferty commented 1 year ago

I've just ordered one of the Adafruit M0 WiFi boards - a little bit expensive at the moment, but that will probably change.

I'll test the existing code on one and write a basic web interface. If @softwarecrash could make a nice UI for it - that would be amazing!

Another option might be to use something like Blynk. Just expose data and some hooks for controlling it + relays. It has the advantage of a hosted server, such that it can be controlled via the web.

I already use Blynk for monitoring a load of stuff in my RV - but don't use it for control. image

SimonRafferty commented 1 year ago

The ACS711 Current sensors turned up, so I built up a board. This is the results from the first test run. It switches on the glow plug for 10s then starts measuring: Batt V=12.65| Glow A=20.34| Glow R=0.62| Glow T=112.44 Batt V=12.87| Glow A=21.22| Glow R=0.61| Glow T=104.79 Batt V=12.87| Glow A=20.92| Glow R=0.61| Glow T=108.90 Batt V=12.88| Glow A=21.70| Glow R=0.59| Glow T=98.06 Batt V=12.89| Glow A=22.56| Glow R=0.57| Glow T=86.93 Batt V=12.90| Glow A=21.36| Glow R=0.60| Glow T=103.34 Batt V=12.89| Glow A=22.71| Glow R=0.57| Glow T=85.06 Batt V=12.91| Glow A=23.73| Glow R=0.54| Glow T=72.88 Batt V=12.91| Glow A=23.54| Glow R=0.55| Glow T=75.17 Batt V=12.90| Glow A=23.14| Glow R=0.56| Glow T=79.77 Batt V=12.91| Glow A=23.05| Glow R=0.56| Glow T=81.06 Batt V=12.91| Glow A=25.22| Glow R=0.51| Glow T=56.61 Batt V=12.92| Glow A=25.81| Glow R=0.50| Glow T=50.95 Batt V=12.91| Glow A=22.71| Glow R=0.57| Glow T=85.51 Batt V=12.92| Glow A=26.10| Glow R=0.49| Glow T=48.11 Batt V=12.91| Glow A=25.73| Glow R=0.50| Glow T=51.60 Batt V=12.92| Glow A=24.32| Glow R=0.53| Glow T=66.49 Batt V=12.92| Glow A=23.90| Glow R=0.54| Glow T=71.16 Batt V=12.93| Glow A=26.27| Glow R=0.49| Glow T=46.78 Batt V=12.96| Glow A=23.85| Glow R=0.54| Glow T=72.65 Batt V=12.91| Glow A=26.71| Glow R=0.48| Glow T=42.30 Batt V=12.94| Glow A=25.27| Glow R=0.51| Glow T=56.82 Batt V=12.93| Glow A=26.15| Glow R=0.49| Glow T=47.87 Batt V=12.93| Glow A=26.22| Glow R=0.49| Glow T=47.17 Batt V=12.92| Glow A=25.73| Glow R=0.50| Glow T=51.83 Batt V=12.94| Glow A=24.10| Glow R=0.54| Glow T=69.36 Batt V=12.92| Glow A=27.15| Glow R=0.48| Glow T=38.56 Batt V=12.94| Glow A=28.03| Glow R=0.46| Glow T=31.21

The absolute (calculated) temperature probably isn't accurate - but it was interesting to try. At 20C, the glow plug measured 0.45 Ohms (on a multimeter) so the readings are not far off.

Hopefully this week, I'll be able to test it with the heater running properly. The above was a 'dry' test with only the glow plug connected. Looks promising though!

softwarecrash commented 1 year ago

The ACS711 Current sensors turned up, so I built up a board. This is the results from the first test run. It switches on the glow plug for 10s then starts measuring: Batt V=12.65| Glow A=20.34| Glow R=0.62| Glow T=112.44 Batt V=12.87| Glow A=21.22| Glow R=0.61| Glow T=104.79 Batt V=12.87| Glow A=20.92| Glow R=0.61| Glow T=108.90 Batt V=12.88| Glow A=21.70| Glow R=0.59| Glow T=98.06 Batt V=12.89| Glow A=22.56| Glow R=0.57| Glow T=86.93 Batt V=12.90| Glow A=21.36| Glow R=0.60| Glow T=103.34 Batt V=12.89| Glow A=22.71| Glow R=0.57| Glow T=85.06 Batt V=12.91| Glow A=23.73| Glow R=0.54| Glow T=72.88 Batt V=12.91| Glow A=23.54| Glow R=0.55| Glow T=75.17 Batt V=12.90| Glow A=23.14| Glow R=0.56| Glow T=79.77 Batt V=12.91| Glow A=23.05| Glow R=0.56| Glow T=81.06 Batt V=12.91| Glow A=25.22| Glow R=0.51| Glow T=56.61 Batt V=12.92| Glow A=25.81| Glow R=0.50| Glow T=50.95 Batt V=12.91| Glow A=22.71| Glow R=0.57| Glow T=85.51 Batt V=12.92| Glow A=26.10| Glow R=0.49| Glow T=48.11 Batt V=12.91| Glow A=25.73| Glow R=0.50| Glow T=51.60 Batt V=12.92| Glow A=24.32| Glow R=0.53| Glow T=66.49 Batt V=12.92| Glow A=23.90| Glow R=0.54| Glow T=71.16 Batt V=12.93| Glow A=26.27| Glow R=0.49| Glow T=46.78 Batt V=12.96| Glow A=23.85| Glow R=0.54| Glow T=72.65 Batt V=12.91| Glow A=26.71| Glow R=0.48| Glow T=42.30 Batt V=12.94| Glow A=25.27| Glow R=0.51| Glow T=56.82 Batt V=12.93| Glow A=26.15| Glow R=0.49| Glow T=47.87 Batt V=12.93| Glow A=26.22| Glow R=0.49| Glow T=47.17 Batt V=12.92| Glow A=25.73| Glow R=0.50| Glow T=51.83 Batt V=12.94| Glow A=24.10| Glow R=0.54| Glow T=69.36 Batt V=12.92| Glow A=27.15| Glow R=0.48| Glow T=38.56 Batt V=12.94| Glow A=28.03| Glow R=0.46| Glow T=31.21

The absolute (calculated) temperature probably isn't accurate - but it was interesting to try. At 20C, the glow plug measured 0.45 Ohms (on a multimeter) so the readings are not far off.

Hopefully this week, I'll be able to test it with the heater running properly. The above was a 'dry' test with only the glow plug connected. Looks promising though!

looks great, that a big step to build a open replacement

SimonRafferty commented 1 year ago

It's ALIVE! After a bit of tweaking, the Flame Sensor / Exhaust temperature works well. I discovered the Current sensor needed a bit of thermal compensation. It's well within it's operating temperature range - but the read current reduces with temperature - enough to cause spurious readings.

I built a simple web server delivering the data to a page. Unfortunately, I found it too slow. When a client connects & requests a page, it takes a second or two - enough to miss several pulses of fuel. In the short term, I've implemented Blynk which only takes 100mS or so & doesn't cause a problem. I'm going to try making the fuel delivery controlled by an Interrupt Timer to see if that helps.

I've added a branch for the code.

SimonRafferty commented 1 year ago

I've added a new version here https://github.com/SimonRafferty/Webasto-Heater---Replacement-Controller/tree/Webastardo-V3

Which includes compile time options for different versions of the PCB & whether you want to use WiFi / Blynk

With this version, you can swap your existing Feather M0 for a WiFi version - then use Blynk or a WiFi interface, even on a V1 or V2 PCB.

softwarecrash commented 1 year ago

It's ALIVE! After a bit of tweaking, the Flame Sensor / Exhaust temperature works well. I discovered the Current sensor needed a bit of thermal compensation. It's well within it's operating temperature range - but the read current reduces with temperature - enough to cause spurious readings.

I built a simple web server delivering the data to a page. Unfortunately, I found it too slow. When a client connects & requests a page, it takes a second or two - enough to miss several pulses of fuel. In the short term, I've implemented Blynk which only takes 100mS or so & doesn't cause a problem. I'm going to try making the fuel delivery controlled by an Interrupt Timer to see if that helps.

I've added a branch for the code.

The web Server blocking the working system of Pump etc? That realy Bad. Let me Check later, so i must build a Code Version that i can Test without Hardware.

SimonRafferty commented 1 year ago

If you want to give it a go with test hardware, ping me an email & I'll post you a V3.0 PCB?

softwarecrash commented 1 year ago

sadly i cant build actual a hardware test setup, i must order some pices for a second heater, and electronic components. my mail is softwarecrash )ath( hotmail dot com btw.. dit you know that the oem board checking the compustion fan for blocking or wire break? its simple power up the fan, cut off the power and measure the voltage generated by the motor, and power on again, is this easily to realize with a voltage divider?

let me check start next year that i can work on it without hardware first. a short look at your wifi section, you use a verry basic wifi webserver routine with delay and awaiting answer and end, thats blocking all. so i hope i can put in the incredible fast asyncwebserver librays wich brings a wifi manager and other nice things like websocket.

so i prefer to use a esp82xx board for use, or better get the big brother esp32? later usable for bluetooth (never used but sound funny). short read about power of both, yep i think the esp32 is the right choice, i have a bucnh of wemos d1 style esp32 laying around, but the wroom variant does the same, only different pinout/header.

yust another idea, use two brains, one like a pro micro ore something hat only job is to control the heater, and on top a esp for communication, so when the esp crash or hang the heater will work. i think thats easy to realize, we only need a common communication between the two for getting data and set configuration. so for people they dont need wifi or something they can setup the heater with a uart cable and serial. the communciation can secure by a simple crc. i think that is the high class version, i can make a code for the esp that work alone and only need the data from the heater brain. nice extra is that the wemos d1 mini have the same footprint for esp82xx and esp32, so with one pinout on the board we can make a choice what to use.

communication example: esp: Q01 (crc) //Q for querry data, 01 for wich dataset heater: 13 100 0 12 10 (crc) //answer like 13grad water temp, 100 percent load, 0 errors, 12 minutes runtime, 10 whatever

SimonRafferty commented 1 year ago

I actually started the project using an ESP32 but had too many problems with the ADC conversion being interfered with by WiFi - even when the WiFi was not active or enabled! The M0, even with WiFi, on the other hand just works!

Using something like a ProMicro with an ESP32 as a co-processor isn't a bad idea though. I'll have a think on that option & see if I feel inspired to have a go!

softwarecrash commented 1 year ago

I actually started the project using an ESP32 but had too many problems with the ADC conversion being interfered with by WiFi - even when the WiFi was not active or enabled! The M0, even with WiFi, on the other hand just works!

Using something like a ProMicro with an ESP32 as a co-processor isn't a bad idea though. I'll have a think on that option & see if I feel inspired to have a go!

yes, i think its the securest way, so have often struggeling with the esp wifi and timing sensitive or dangerus devices. so when the esp goes wild, it dint burn the house :) so with a proMicro ore whatever you have a 5V base. only a levelshifter is needed by the esp

prensel commented 1 year ago

I'm following this because I have built the hardware but lacking the exhaust temp sensor. Considering a current sensor has come to mind but then I have to change my present setup. Was rather looking into using the already present water temp sensor as indication for flame control. I assume (havent measured) the water temp would soon drop when there is no flame and the pump is running. So say at a deltaT of 5 degr I would stop pumping fuel and restart the unit.

SimonRafferty commented 1 year ago

@prensel It would, depending on how you're using the heater. In my case, I'm heating a volume of water which is continually circulated - so if the flame extinguishes, the water temperature sensor only cools at the rate the larger volume of water cools - which takes hours. If you were using it to heat water on demand, continually feeding in cold water - then it could work.

Jonburford1 commented 1 year ago

Morning Simon. Really excited to hear about your developments, have you made the v3 board available yet? Wouldn’t mind getting going on one. Cheers!

SimonRafferty commented 1 year ago

https://oshwlab.com/simonrafferty/webastardo-3-0

I've published this - and it works OK. I am thinking about revising the whole board design though. I designed the board based on the parts I had laying around, rather than ones which you can buy from JCLPCB as a made up board (which most people seem to want).

image This is a trace of the temperature read through the glow plug. The 'tepmerature' shown isn't accurate - but does show enough swing between flame & no flame to be useful / reliable.

I've been running this as a heater for my office (connected to a domestic radiator) for a couple of weeks and it's been pretty good!

Jonburford1 commented 1 year ago

Thanks Simon, Good progress, I’ll hold fire for now then and see what happens. Let me know if there’s any testing you’d like me to help with. Cheers.

Ramdough commented 1 year ago

Simon,Do you think we could get a simple altimeter added on the next revision?   The circuit would be simple.   Next time you turn a board, I would be interested in pitching in on a few.   ThanksDOn Dec 31, 2022, at 5:55 AM, Simon Rafferty @.***> wrote: https://oshwlab.com/simonrafferty/webastardo-3-0 I've published this - and it works OK. I am thinking about revising the whole board design though. I designed the board based on the parts I had laying around, rather than ones which you can buy from JCLPCB as a made up board (which most people seem to want).

This is a trace of the temperature read through the glow plug. The 'tepmerature' shown isn't accurate - but does show enough swing between flame & no flame to be useful / reliable. I've been running this as a heater for my office (connected to a domestic radiator) for a couple of weeks and it's been pretty good!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

softwarecrash commented 1 year ago

Simon,Do you think we could get a simple altimeter added on the next revision?   The circuit would be simple.   Next time you turn a board, I would be interested in pitching in on a few.   ThanksDOn Dec 31, 2022, at 5:55 AM, Simon Rafferty @.> wrote: https://oshwlab.com/simonrafferty/webastardo-3-0 I've published this - and it works OK. I am thinking about revising the whole board design though. I designed the board based on the parts I had laying around, rather than ones which you can buy from JCLPCB as a made up board (which most people seem to want). This is a trace of the temperature read through the glow plug. The 'tepmerature' shown isn't accurate - but does show enough swing between flame & no flame to be useful / reliable. I've been running this as a heater for my office (connected to a domestic radiator) for a couple of weeks and it's been pretty good! —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

simon and me have a idea, so simon will think about it to split the prozessors, in this case i think its a better way to ad some altimeter and other things to the co prozessor with wifi that communicate with the main cpu

SimonRafferty commented 1 year ago

I was actually thinking about the barometer. Most barometer modules can measure temperature too. I wonder if there's a module with sufficient pressure & temperature range to use if for both altitude and measuring the temperature of the body of the heater? All those I've looked at so far top-out at 85C. I would rather the measurement range extend at least to 100C. Any ideas?

SimonRafferty commented 1 year ago

I've uploaded a couple of small fixes to the version with the flame sensor - just in case you're thinking "#@:&% thing doesn't work!" ;-)

It was causing unreliable starts at some ambent temperatures. However, that asside, this version seems to work pretty well.

zorrobyte commented 11 months ago

@SimonRafferty Do you have details on how you implemented the ACS712 into your PCB design? I can't find the SMD on the board anywhere. Are you using a breakout ACS712 board? I just mistakenly ordered 15 v2.1 boards not noticing the v3.0

Cheers

SimonRafferty commented 11 months ago

It's implemented on the V3.0 Board. That's the only difference between 2.1 & 3.

However, you could easily implement it off the main board by interrupting the power feed to the glow plug & putting the ACS712 in series with the glow plug. There are plenty of easy modules on eBay that will be easier to solder than an SMD device.

SimonRafferty commented 10 months ago

V3.0 has been running nicely, heating my workshop, for almost a year now. I've recently introduced a version controlled by Home Assistant https://github.com/SimonRafferty/Webasto-Heater---Replacement-Controller/tree/Webastardo-V3-WiFi-Home-Assistant

There have been a lot of requests for different features here, by email, Facebook etc. I decided to design a 'universal' version which is built on a rectangular board (so it has to be in a separate box), using XT30 & XT60 connectors for power and screw terminals for everything else. The board is mostly SMD, so you can get JCLPCB to assemble the majority of it.

It has 6 MOSFET outputs, all with the same current rating, so any can be used for the glow plug. They all have current measurement capability - which can be used for fault detection as well as measuring the flame sensor. I've also moved away from Thermistors and changed to K-Type Thermocouples which are accurate from -100 to +1000C and thus can be used for water / air / exhaust temperature.

To accomodate all the other requests, such as displays, LoRa remote control, Altimeters, GPIO etc, I've broken out one SPI Port and I2C so you can easily add peripherals. It also uses an ESP32 and runs a web-server for control. At the moment, the web server allows all the settings (fuel mixture for example) to be adjusted live, which will make tuning much easier.

The boards have not arrived yet - but once they have and I've tested them properly, I'll start a new branch. This will get a significant re-write of the code. Hopefully this will make it easier to understand!

softwarecrash commented 10 months ago

V3.0 has been running nicely, heating my workshop, for almost a year now. I've recently introduced a version controlled by Home Assistant https://github.com/SimonRafferty/Webasto-Heater---Replacement-Controller/tree/Webastardo-V3-WiFi-Home-Assistant

There have been a lot of requests for different features here, by email, Facebook etc. I decided to design a 'universal' version which is built on a rectangular board (so it has to be in a separate box), using XT30 & XT60 connectors for power and screw terminals for everything else. The board is mostly SMD, so you can get JCLPCB to assemble the majority of it.

It has 6 MOSFET outputs, all with the same current rating, so any can be used for the glow plug. They all have current measurement capability - which can be used for fault detection as well as measuring the flame sensor. I've also moved away from Thermistors and changed to K-Type Thermocouples which are accurate from -100 to +1000C and thus can be used for water / air / exhaust temperature.

To accomodate all the other requests, such as displays, LoRa remote control, Altimeters, GPIO etc, I've broken out one SPI Port and I2C so you can easily add peripherals. It also uses an ESP32 and runs a web-server for control. At the moment, the web server allows all the settings (fuel mixture for example) to be adjusted live, which will make tuning much easier.

The boards have not arrived yet - but once they have and I've tested them properly, I'll start a new branch. This will get a significant re-write of the code. Hopefully this will make it easier to understand!

wow... i dont have time to do some thing , so other projects needs my time, but what you make sounds verry good, looking forward to order a pcb to test it :) thank your for your great work