# Open Standards/Multipurpose AC-Battery/Electrical specification

This chapter describes the electrical requirements and definitions for a multipurpose AC-battery pack.

# Requirements:

The electrical design has to fulfill the following requirements:
- good compromise between small voltage jumps and high output voltage
- safe state in case of broken wires within 15µs possible
- direct charge from mains without transformer
- fast and fine control possible
- support for internal and external battery management
- support for different current classes
- Generating AC 1000Hz at 1000Vpeak possible

# Specification
## Systems overview

AC battery packs are controlled via a control unit, for example a micro controller. It gives commands, how many cells shall be switched on. The battery packs can be connected in series in order to gain output voltage or capacity. A kind of rolling mechanism will take care, that all battery packs are statistically used in the same way.
There are two kind of signals: such who go in every battery pack and such which loop through all battery packs.
The signals "Trigger" and "Command" are fed to all AC battery packs and control the ramp up and down of the desired output voltage. In fact, the output voltage is increased or decreased step by step with these commands. If the "Trigger" signal is missing, the battery cells are switched of to tristate, preventing any current to flow.
The signals "Marker" and "(Tx-)Data" loop through all AC battery blocks. The "Marker" signal is used to distinguish, which cell has to be switched on of off next time. The "Data" signal carries a serial protocol. With it, the control unit informs the battery packs about the actual mean current. Moreover, the control unit is informed about the state of all battery cells, which battery packs are used, their temperature, the maximum allowed current and so on.

## Output voltage

The output voltage shall be adjustable as fine as possible but able to be charged directly from mains. So, the switchable voltage step shall be fixed to 7V +/- 1V. The control unit has to deal with step voltages in the range of 6V...8V. An AC-battery shall be charged directly from a 120V mains. 5% voltage overshot has to be regarded, leading to a peak voltage of 178V. Thus, an AC-battery pack shall have a discharge voltage of minimum 178V. (Example: Battery pack with 6V discharged voltage needs 30 switching cells. With 7.2V nominal (2 lithium cells), the nominal battery tension is 216V maximum.)
The foreseen control speed is 1MHz (Trigger and Command signals), so that minimum 6V/us voltage slope can be archeived.

## Communication

Because of the floating levels the battery pack is workin on, the communication has to be galvanical insolated (min. 3000V). As an input, opto coupler can be foreseen. They have to work with:
- minimum voltage: 2,5V
- maximum voltage: 3,3V
- maximum current: 10mA
The GND_All is supplied by the control unit. The GND_Last is supplied by the control unit (for the first battery pack in a row) or the preceding battery pack. Every AC battery pack delivers its "Marker" and "Data out" signal with an appropriate "GND_Next". The delay between marker_in and marker_out must not exceed 100ns to control 1..10 AC battery packs in series with a speed of 1MHz.
With this signals, the control unit in the battery packs can switch battery cells on and off, react and report status. It is recommended that this control unit consists on a fast logic for control and short circuit detection, and a small micro for battery management and supervision.

### Control commands

The trigger and command signal lines are used to transfer five commands via two slope modulation:
- idle: No trigger signal received for more than 14us. This is either the start condition or used for fast switch-off to tristate. The control head shall put out a "marker" signal before the trigger starts again, all cells must not. So, the start point for switchin on cells is defined. The switching cells are set to tristate. (The parasitic diode is still present.)
- positive up: Comeing from tristate or all-off, an additional cell is switched on with every "positive up" signal. The polarity switch (or full bridge) is set to positive polarity.
- negative up: Comeing from tristate or all-off, an additional cell is switched on with every "negative up" signal. The polarity switch (or full bridge) is set to negative polarity.
- idle: nothing changes. This is used to keep the set voltage and trigger the timeout mechanism.
- down: Comeing from tristate, all the not yet switched cells are set to bypass (off). Otherwise, one cell is switched to bypass (off).

### Control Statemachine

In idle state, all switches of all battery packs are tristate and thus safe. For starting operation, the control head shall put out a "marker" signal and 100ms an "idle" signal to wake up the battery pack. The switching cell next to the control head will store this "marker" information.
We assume power charge on-the-fly, means that we synchronize immediately to the mains voltage.
A "positive up" signal is sent, and internally in the first AC battery pack the first cell is switched on. The "marker" signal to the next switching cell is set high for preparing the next cell to be switched on.
Again a "positive up" signal is sent, and internally in the first AC battery pack the second cell is switched on. The "marker" signal is set high for the third switching cell. With a third "positive up" signal, the third cell is switched on.
If the output voltage has its desired level, we send a "down" signal. Now all cells which are still in tristate, are switched to "active off" and current can begin to flow. The first cell is switched off, according to the command. The "last off" marker remains in the first cell.
Now we can "play":
A "positive up" signal will increase the output voltage by one step, the most right "marker" signal will be forwarded.
A "down" signal will decrease the output voltage by one step. The second cell gets the new "last off marker", the first "marker" signal will be cleared. Condition: Marker was set and second "down" command came. A "negative up" signal will also decrease the output voltage as long as not all (visible) cells are switched off. So it is avoided that via simple error a positive voltage can be negated. (jump protection)
Another "positive up" signal switches on the next unused cell. The "I'm on"-marker from this last cell is fed through the control unit to the first switch cell.
Another "down" signal switches off the third cell (condition: marker-in off AND cell was on). Stepping up and down will rotate the used cells in a "caterpillar style", so that statistically all cells see the same load. Several "down" commands will succesively switch all the cells.
But care has to be taken not to give too much "down" commands. In that case, the "last off" marker is lost and the next "up" command will be ignored. If this happens, the control unit must set its marker to re-start the chain.
As long as the marker is still there, the "caterpillar" of switched-on cells starts at the position with the marker.
If the end of the chain is reached, the "switched on" marker is fed through the control unit to the first cell, which is switched on next.

### Example for logic implementation

see chapter: Open_Standards/Multipurpose_AC-Battery/Logic_implementation_examples
A simulink demo (120V sin wave generator) is available on request: Please mailto: acbattery200@gmail.com