📜 ⬆️ ⬇️

Micro-UPS on ionistors

Good day to all respected community. I have the honor to offer habrovchana interested in electronics, some reasoning and a specific implementation of a backup power supply unit on ionistors (they are also supercapacitors with a double electric layer) designed to ensure the correct shutdown of the processor module on an ARM microcontroller operating under standard Linux Debian.

The challenge arose before your humble servant in the following guise: you need to correctly redeem Linux OS (spinning on the Embedded-solution) when external power is cut off. This power came from a standard USB 2.0 port to a previously made box-device via at least a standard USB-B connector. The inexperienced user of this device preferred to tritely pull out the USB cable, following the principle of "UnPlug-NoPlay-NoProblem". It is clear that the embedded-solution without hard drives and with virtual memory zeroed when configuring is resistant to such force majeure, but a couple of thousand user-hours of operating time showed that it does not always turn out “no problem”.

I had to wrinkle the brain and go into a creative trance. At the exit from the trance, the first possible way to solve the problem materialized - a psychological one that at first seemed the most attractive. The course of thinking was approximately as follows - why does an ordinary user with an unwavering hand pull a USB flash drive sticking out of the USB port? Probably, because neither he nor his closest acquaintances lost in this way a thesis, dissertation, or annual report. Why the same user did not pull the printer cable from a working printer at the time of it? Probably, because either he saw himself, or he heard from someone's mouth, how he had to buy a new MB or Centronics on ISA (PCI). I do not want (from the word at all) that my box was pulled out unceremoniously. What do you need to do for this? Correctly, to form the required user behavior.

I had to shake the skills of circuitry and tracing, and the next version of the box acquired an RGB-LED on the front panel and a button, as well as a piezo-signal with a nasty timbre inside. A simple program to determine whether the last shutdown was correctly passed. If the misconduct of the user was incorrect and was the first in her flash memory, then the control action followed: instead of the indicator that was pleasing the yellow and green colors, the box blinked with a cutting eye red and wickedly squealed for a couple of minutes before it calmed down and started to load. Relapse was punished with five minutes, even more disgusting heather and a string in the manual, which says that the box, blocked due to repeated incorrect shutdown, is removed from the guarantee, here.
')
You know, the way turned out to be surprisingly effective. But here Dear Customer put forward the wish that before disconnecting the box they would report to the server that they are leaving the stage for a while. Now I needed some kind of energy source. The brain from the next creative trance came back with the thought: the lithium-polymer battery is our everything! Common thinking added a bit of skepticism to this thought: somehow, I didn’t really want to charge the battery each time it turned on, because the number of charge-discharges is a consumable resource and the subject of cynical deception by battery manufacturers of innocent customers. Charge not every time you turn on, but as far as discharge? So it is necessary to make a fuss, calibrate the battery, measure the voltage on it with good accuracy. In general, this and that, and then came on the scene Samsung Galaxy with its incendiary batteries. Imagining a fire in the place where the box should have stood, had to voluntarily move the sword and stop the painful deliberation of the second idea.

Having gone into a trance for the third time, a creative genius brought to the light ionistors. And what, it seems not bad. The capacity is in farads, the number of charge-discharge cycles is unlimited, the volt is not enough - 2.7 maximum per cell, and they are not very easy to cascade. There was nothing to think about in the absence of options, and again I had to take on the circuitry for a couple of tracing.

Searches on the vast expanses of Ineta brought some catch, and, after a brief reflection, it was decided to stop at the chip company Linear LTC3110. Looking ahead, I will say that a couple more options have been tested, but not particularly well. If the reader is interested in the details of the choice - you are welcome in PM. Of the available options, the LTC3110 contains almost everything needed to build a backup power supply on ionistors:
- it has a buck-boost converter, which makes the designer not particularly limited in the choice of supply voltages;
- this converter uses inductance for energy storage, which significantly increases efficiency and makes it possible to load a pair of amperes into the load;
- it is possible to limit the current consumed when charging in the range of 125mA - 2A, which is especially important when powered from USB;
- there is a built-in scheme for individual balancing of the series-connected ionistors to increase the stored power and reliability;
- the microcircuit is equipped with conclusions indicating the charge degree of ionistors;
- and, for sweetness, there is an additional comparator, the response thresholds of which are specified by the user.

For details and examples of applications, I refer a curious Reader to the datasheet on a microchip, all-powerful Google with the “LTC3110 pdf” spell to help you.

In theory, to build a workable Micro-UPS to the LTC3110 itself, you need to add a circuit that powers the box in normal mode, if connected to a working USB. For this honorable role was selected IC ST1S10PHR, whose unpretentious temper and low price are known and tested for a long time. We also had to add a key, breaking the main consumers supply chain during the initial charging of ionistors. This key allows you to solve two problems: firstly, the initial charge time is reduced (since almost everything consumed from USB goes to ionistors), and secondly, it eliminates the unpleasant possibility of de-energizing with such an uncharged UPS so that the power supply is not enough shutdown. Moreover, the “high start” from fully charged ionistors allows the circuit to sometimes (but not very often) consume more current than the USB port can give - the deficit will be replenished from the ionistors. Such a situation may arise, for example, when recording a large block of information on a capacious USB flash drive that is powered together with a box.

I think that at this introductory part can be completed, and go to a specific working scheme.

image

It looks like a micro-UPS on ionistors.

Power comes from the USB 2.0 port (upper left corner of the circuit). On DA1, according to the recommended scheme, a down converter 5B -> 3.3V was assembled from the datasheet. Its only feature is an additional filter from high-frequency ringing on L2 and C7. If desired, these elements can be excluded. Resistors R3 ... R5 serve for emergency discharge of ionistors before transporting, for example, or before adjusting the entire board as a whole, otherwise the power supply remains on it, and it is powerful enough to burn something. Connect-disconnect discharge resistors jumper SA1. VT1, C16, R17 and R18 is the key for the power supply of the main consumers, it was already mentioned above and you will have to add a few words below. All the rest is standard datashit LTC3110 binding.

3V3SBY - on-duty power control circuit, in the box it is implemented on the Altera CPLD EPM240T100, but nothing prevents to execute it on a microcontroller or discrete logic. 3V3 - the main power supply box, backed up by UPS. Information about the status of the micro-UPS is displayed on PWRFAIL, BATFULL and BATLOW with self-explanatory names. PWRFAIL is activated when the power supply from USB is lost, BATFULL indicates that the charge of ionistors is 95% (5.2V), BATLOW shows a decrease in charge level up to 40% (2.1V). If desired, this level can be adjusted by selecting R6 and R7, based on datasheet. Unfortunately, such a focus does not pass with the BATFULL level - it is hammered with nails in the IC.

Two signals control the micro-UPS: PWRON and BATOFF. PWRON turns on the main power, BATOFF turns off the UPS as a whole.

The general logic of the micro-UPS is:

  1. in the initial state, C8 and C9 are completely discharged, jumper SA1 is in the left position, 5V USB power supply is not supplied;
  2. The device is included in the port USB-B 2.0;
  3. the converter on DA1 starts producing current to the 3V3SBY line, energizing the control circuit on the CPLD, which, in turn, opens the key VT1, removing the PWRON signal; in addition, the control circuit removes the BATOFF signal, including DA2;
  4. DA2 starts charging ionistors; as they are charged, the BATLOW signal is deactivated (at 2.1V), then BATFULL is activated (at 5.2V on the ionistors);
  5. the appearance of the signal BATFULL control circuit regards as the readiness of the micro-UPS for operation, and turns on the VT1, supplying power to the main circuit; At the same time, DA2 continues to monitor ionistors, and when the charge is reduced to less than 95%, it starts charging; connecting VT1 to the RSENS DA2 output ensures that such a current will be taken for recharging that does not exceed the USB limit taking into account that consumed by the main circuit; if the consumption of the main circuit exceeds this limit, the discharge of the ionistors will begin to compensate for the waste;
  6. when 5V USB is disconnected, the PWRFAIL line is activated, letting the control device know that the external source is missing; the control circuit generates a request to interrupt the ARM processor to run the script correctly shutdown; all this time, the food is provided by DA2;
  7. upon completion of the shutdown procedure, ARM signals that everything is ready for extinction, and the control circuit sets BATOFF, disabling DA2; in this state, the box is before the power supply to 5V USB (see item 1 with the exception of the residual charge on C8 and C9);
  8. if ARM hesitated a lot and failed to close everything up to the BATLOW signal, the circuit would have to be de-energized by force.

If desired, it is easy to organize any other micro-UPS control logic, for example, by increasing the BATLOW percent turn on level to 60% (picking up R6 and R7), using it as a signal to stop, forcibly disconnecting by full charge C8 and C9.

Finally, quickly go over the customizable parameters of the scheme. R1 and R2 determine the output voltage DA1, another voltage may require replacing C1, C2, C4-C6 and L1. Nominal C8 and C9 determines only the charging and discharging time of the UPS, personally tried from 4.7 to 100 Farad, theoretically there are no restrictions. R6 and R7 determine the activation level of BATLOW. From the ratio of R8 / R9 depends on the voltage of the maximum charge ionistors. R11 determines the current consumed from 5V USB, at the indicated resistance the circuit consumes 0.5A. The ratio of R12 / R14 sets this level to a drop of 5V USB, which will be determined as power loss (PWRFAIL). R15 / R16 determines the output voltage DA2 in the discharge mode.

The output signals of the LTC3110 are made according to the “open drain” scheme in order not to be tied to a specific supply voltage. In my circuit, pull-up resistors for them are involved in CPLD, not a problem to use them in any modern microcontroller. Well, if you decide to assemble a control circuit at K155, then you will have to work on resistors yourself.

A few words about the C16. Getting this knowledge took away the most time I spent on the UPS board. What is the problem? It is written in black in English in the datasheet that if you want the sum of the current consumed by the basic circuit and the ionistor charging current to be guaranteed not to exceed the limit set by R11, please feed the main circuit from the RSENS pin. OK, agreed. And then - more interesting. Since in your scheme there can be anything, up to KoZy (KZ, it is also a short circuit, it is short), says the datasheet, the LTC3110 is equipped with a special protection circuit. OK, very nice. And now the fun part. We read the datasheet further: and so that the protection scheme does not make a mistake, please, provide the total capacity in the supply line NOT MORE, Karl, 10 microFarads. Opanki ... For everything about everything, and do not deny yourself anything. And indeed, any load greater than 10uF when connected wedges ... Do not be deceived, infidel. I had to make a small delay in the key on VT1, which gives the C16. I understand that for some time VT1 will not be in the key mode, but between heaven and earth (in the sense, between VCC and GND), which is not healthy at all. But at least it works. Such is the "new hava". For adherents of purity of key modes, I will add that I tried to install not C16, but inductance 1.5 ÎĽH in series with VT1 - everything works fine.

Below I give an image of a printed circuit board with the described scheme, naturally, the numbering of the components differs from that indicated on the circuit diagram - it is through to the whole box.

image

If you have questions, you are welcome.

Source: https://habr.com/ru/post/402243/


All Articles