74HC14 / power-negotiation

Hardware, firmware, and symbology for negotiating 5-50V 0-40A DC power from source to load
The Unlicense
0 stars 0 forks source link

Power Negotiation

This is a repo describing an experimental protocol for negotiating 5-50V DC power demand between source and load, for systems in the 0-40A range. Lower voltages might be possible. Higher voltages and currents may be possible. Loads will be able to be placed in parallel, while sources will be able to be placed in series. Sources may be as simple as batteries or fixed supplies, or as complicated as variable power supplies that can set a voltage and/or current output.

Hardware

The key power connector of this protocol will be the DA7W2 D-sub connector, with male plugs on the load, and female sockets on the source, as to reduce short-circuit risk. The two large pins carry the power, while the 5 smaller pins carry the communication signals. Other connectors, such as the DB9W4 D-sub, might be an option for multi-rail supplies. All cables will have a single plug on one end, and a single socket on the other end, and have no electronics contained. There will also be splitter boxes, which are required to plug loads in parallel, and combiner boxes, which are required to plug sources in series. Each communication line in these boxes will be commoned together.

Inside the load and source will be load or source circuit board respectively, referred to as "key"s. These key boards have their own step-down converter that steps down the 5-50V power to 3.3V to power the microcontroller, it is this step-down converter that determines the minimum voltage of the protocol, choosing something lower than 3.3V or using sufficiently low dropout regulators would allow the protocol to operate at 3.3V power rails, but there is little purpose in doing this. The load key alone has the capability to shut off current via transistor, it is this 55-60V MOSFET that determines the maximum voltage of the protocol, requiring higher voltage transistors would increase the BOM cost significantly for higher-current loads, but it may be desirable to increase marginally to cover all "48V" battery chemistries, or even higher voltages still. The source key alone has the capability to measure current. Both keys have the capability to measure the voltage of the power rail. It Is likely that the keys will contain LEDs for diagnostics and status. The keys may be connected to external hardware, such as buttons, displays, sensors, and such, or they may communicate to another MCU board.

The communication lines consist of a +3.3V rail, a 0V rail, a "Source In, Load Out" or SILO pin, and a "Source Out, Load In" or SOLI pin, which carry asynchronous serial data. It might be possible to use the fifth unused pin for a clock line to make it synchronous, but for now this pin is left unused as not all microcontrollers can send synchronous serial. The source key's communication lines are optically isolated from its power rails, in order to allow series loads. The communication lines on all keys have series resistors followed by protection diodes, making them robust against being shorted to any other pin.

Firmware

The protocol itself is UART, because I2C is harder to put though protection and optical isolation circuits, and doesn't transmit as far. That said, low-speed multi-master I2C through dedicated I2C isolator ICs like the ISO1640 is worth considering due to I2C's natural ability to avoid collisions.

The load key, after powering on from the source, will initiate the communication, with its MOSFET turned off by default. The load will validate the presence of any source keys and other load keys, then request power at its desired voltage and current. The source key(s) will respond with what they can provide, and the load key will determine whether the resulting voltage and current are acceptable. If acceptable, the load key will tell the source key(s) to set their output as desired if required, before turning on its MOSFET. Each source key will then periodically inform the load key of its current consumption and output voltage, in response the load key will measure its own voltage, calculate if the voltage drop across the cable is acceptable, and determine if it is safe to continue operating. The load key may request that a source key changes its output throughout operation. There might also be information about noise levels and voltage ripple.

The keys will use pseudorandom delays to mitigate collisions during initial contact, if all communications get through without collision these pseudorandom numbers become each key's ID value for that session. Perfect mirroring of two loads or of two sources is not a solved problem, with 16 bits of randomness generated from the ADC it is hopefully not an issue.

Symbology

While no connection of sources and loads will cause damage under this protocol, not all sources and loads are compatible. An LED light load might require a constant current, while a source might only be able to provide a constant voltage, or a variable source can provide from 5 to 36V, but a battery wants to charge up to 48V, as examples. While the presence of diagnostic LEDs should indicate to the end user whether they can expect their system to be working (e.g. if their battery is charging), but language-agnostic symbols for establishing compatibility to the end user beforehand are a requirement.