delboy711 / BST900-ESP32

ESP32 firmware to control BST900 Boost Converters remotely
GNU General Public License v3.0
3 stars 0 forks source link

BST 900 original firmware i d like to contribute. #1

Open ouinouin opened 1 year ago

ouinouin commented 1 year ago

Hi, sorry to bother you on here this project, i m actually just starting to use your "original" BST 900 firmware in a solar powered environment. unfortunately there is no "issue" button on the original BST 900 firmware

i prefered the BST900 firmware since it looks easy to manipulate everything i need with the serial port (i can connect an esp32 through the serial port directly and dont need hardware change. ( a great thing would be to be able to get some tasmota interaction on ESP32 :-) .

for now i m noticing while playing with the voltage that the protocol.md might be wrong :

Voltage Set

    Send: "VOLTAGE XXXXX"
    Receive: "VOLTAGE - OK" or "OK"

Set the maximum voltage level in mV.
Use the "CONFIG" command to confirm.

I think the voltage is directly in volts.

tell me if you re motivated to open the "issue" tab on the bst 900 if i can give feedback (on docs most likely, i m not really a coder).

PS : my project is to connect the input of BST 900 on the 48V DC of my solar powered system, and to dump the extra load in one resistance of my water heater, with a retroaction loop : trying to adapt the dump load dynamically based consumption information received from the solar panel production system, letting some predefined amount flowing in the battery for example, and adapting to the power curve of the sun during the day (i did the same in AC with thyristors, but its highly power inefficient, and i like the idea of doing DC only. with some other solar enthusiasts, we have plenty of other projects that could take benefit of your great efforts.

delboy711 commented 1 year ago

Hi Thanks for taking an interest in my project. I have taken a look at the github settings, but because the original BST900 STM8 based project is a fork of another project github does not permit the 'Issues' Tab to be enabled. Feel free to highlight any issues relating to it here.

Now as for the documentation for setting the voltage I have taken a look through the code and it looks to me as if voltage is declared in milliVolts on the serial interface but internally it is converted to centiVolts (because BST900 can have output voltages exceeding 65535mV which would overflow a 16 bit integer)

However it is a long time since I have worked on this code, and I no longer use this version myself so I could be wrong.

Have you got the code working yet? The biggest difficulty with this project is the fact that once you overwrite the stock firmware on the top board there is no way to go back to stock firmware again.

Now regarding your application be aware that a Boost converter like BST900 can raise the output voltage above the input voltage, and can control the current while doing so, but it cannot prevent the input voltage appearing on the output terminals even when disabled. If you look at the basic circuit diagram of a boost converter you will see the input connects directly to the coil, through a diode to the output terminals. So if you have 48V going in, then the output will always be at least 48V and current can only be controlled when the output is higher than 48V.

I do actually have another project to do a similar function to your application which I use to dump excess solar power into a storage heater. It uses an esp8266 to switch a Triac on for complete AC cycles. It is more efficient than a Thyristor, and does not produce any emi noise. I have not uploaded this project to Github but if you are interested I could do so.

regards Derek

ouinouin commented 1 year ago

@delboy711 thanks for your constructive answer, well noted for the issue propagation mode of github. as you said, i could not turn on or off the output of the supply as expected since there is always at least the input voltage on the output. the code works, i could in a test regulate voltage and current, this rocks. just the buttons seems not working but i dont know if its because i once misconnected the board upside down or because of some code (and i dont need the buttons indeed).

as a note for people interrested in doing the modding, I had to unsolder the 20 pins microcontroller on the board and put a real STM8 from a dev board inplace by unsoldering with hot air becuase i couldnt flash in situ then I soldered back on the eval board the chinese component, and i still couldnt flash it : meaning, they dont ship this kind of supplies anymore with stm8. but this might be one pin compatible, so frankensteinisation si still doable.

for info , with this boost the goal can also be to supply some loads wich have 110/220AC adapters but in fact have a rectifier (like laptop supplies, led supplies etc etc. i did some interresting tests, some old dell laptop supplies are working directly with the 120V DC ,some led bulbs also works. this could make a lot of sense for a whole DC house transition.

another info : at 52V (which is the average voltage of my dc circuit , I can get a maximum of 300W of power @120V DC output. I d like to trace the full curve of this unit since they state 15 ampx max and 120V max but there is nowhere a real set of curves of the unit and his efficiency (while doing my next session around this unit in 4 5 weeks, i ll try to caracterize this.

I dlike to have a DC boost unit capable of going from 50V zone to 220 V DC around 1KW ... to be able to try a maximum of devices and make a list of thigs that coud transition direct from ac to DC. IF you know some macgic chinese stuff able to do this.

for your triac project, yes id be interrested in seing what you did with a triac, to sse how you could manage to not have the full power during one period.

I have another project in parallel to regulate a dump load with an autotransformer that I would drive with a stepper motor. (nothing ne under the sun , already some projects are there n the internet, just the purpose to regulate and do a dump load is a bit new.)

delboy711 commented 1 year ago

Sorry. It seems I have accidentally deleted the files for the hardware design of my Triac solar load dumper. The basic principle was to have a triac triggered by an opto triac which is itself driven by a microcontroller. The microcontroller monitors the AC waveform from its own power supply (a transformer feeding a bridge rectifier) and looks for the zero crossing point and gives a pulse 15ms wide at the zero crossing point so the triac triggers at 0V and will remain on for the current half cycle and the next half cycle and turns off at the following zero crossing point. By choosing which cycles to switch the power can be modulated. This technique works well with domestic electricity meters. This article https://learn.openenergymonitor.org/pv-diversion/mk2/intro describes a product that works using the same technique.