Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Voltage Regulator #939

Open
1 task
setsunafseiei opened this issue Jun 10, 2019 · 4 comments
Open
1 task

[Feature Request] Voltage Regulator #939

setsunafseiei opened this issue Jun 10, 2019 · 4 comments

Comments

@setsunafseiei
Copy link

  • Feature request

Issue description

I would like to request a module named LM7805 or voltage regulator especially to export voltage as consistent rate while input voltage is not consistent.

Datasheet

https://www.sparkfun.com/datasheets/Components/LM7805.pdf

Electrical Age version

Future Versions

@jrddunbr
Copy link
Contributor

jrddunbr commented Jun 10, 2019

Heh, seems fun enough. Worth noting that the 78xx and 79xx series of voltage regulators are generally LDO Linear regulators, which behave very similarly to a large rheostats and voltage probe on the output side. It's literally a resistor controlled feedback loop IRL.

LDO Linear regulators require 1.5 to 2 volts more than their typical output voltage (otherwise the output voltage sags), and any voltage drop it creates multiplied by the current through the device immediately becomes heat!

They are typically rated for 1.5A on the TO-220 form factor, but in my experience they tend to melt at that sort of current. There are also smaller versions that are rated for 150mA.

Just to get an idea for the naming convention:

LM7805: 5v regulator
LM7812: 12v regulator
LM7905: -5v regulator
LM7912: -12v regulator

LM317: Variable positive output voltage LDO Regulator
LM337: Variable negative output voltage LDO Regulator

@AMIDIBOSS
Copy link
Contributor

We are currently working on voltage regulators. 😄

@semplar2007
Copy link

semplar2007 commented Jul 10, 2020

That would be very good to have a voltage regulator as a single block.
Meanwhile, you can create your own linear voltage regulator with use of CPU and rheostat.

 Vcc ---p-L-p-R-p-P----- Rload --- GND
        |   | | | |
        ----c-C-+--
              | |
              ---

GND - Ground
Rload - well, your network of machinery that draws current, or battery charge source;
P - electrical probe set to measure current, min=0 max=1000;
p - electrical probe set to measure voltage, min=0 max=1000;
L - an inductor, set it to 100 Henry (19 wires), it's for making current rise slowly;
R - a rheostat, set to 2200 Ohm (64 coal dust), it's for dropping of excess voltage to make current match limits;
'+' - a hub with its default cross setting;
c - helper CPU with formula: B*0.8+C*0.2, B input (the green one) is the one between Vcc and L;
C - controller CPU with formula:
if(A*1000<0.05,1.0,1.01*(max(B,C)*1000/CURRENT-min(B,C)/(A+pow(max(0,derivate(A))*2,2)))/2200-0.01)
Replace CURRENT with 5 if you want to have 5 Amps max.

Explanations on formula (to whoever want to go into technical details).

  • A (red input) is from current probe P, B (green input) is from voltage probe, C (blue input) is from helper CPU.
  • Or you may drop helper CPU and use C (blue input) directly from voltage probe to the left of rheostat.
    Basically, what it does, it sets resistance of rheostat based on following rules:
  • if current < 50mA, set resistance to max; "the cutoff state": if battery is unused, setting resistance to max for when sudden jump in current will not be able to quickly rush in and momentarily increase current.
  • if current > 5A, it will set voltage by formula: Rrheostat = Vin / Iwanted - Vout / Imeasured.
  • output value of resistance: Vout = 1.01*(Rrheostat)/2200-0.01, this converts resistance value to signal rheostat wants to have R_rheostat resistance.

Current limits you want to have:

Based on cable type (I_cable_max below):

  • 20A for low 50V green cable;
  • 10A for 200V blue cable;
  • 6.25A for 800V yellow cable;
  • 4.69A for 3200V red cable;

Based on batteries (I_battery_max below, but watch out cable limits!):

  • 5A for cost oriented battery;
  • 10A for capacity oriented battery;
  • 1.25A for voltage oriented battery;
  • 20A for current oriented battery.
  • 5A for life oriented battery;
  • 10A for single use battery;

So final formula for max amperage is:
I_max = min(I_battery_max * N_parallel_batteries, I_cable_max)
Better to set it to 90% or 80% limit just to make system surely explosion-proof, because even on allowed currents close to limit, cables still greatly heat up.

Tested myself with 800V batteries. There is little overshoot, but it works fine, both for charging and discharging.
Beware of using small passive cooling rheostat, it may explode if overheated. Better use large rheostat.
Another way is to use PID controller, but I had hard time to configure it so it works for all currents and all voltages.

Examples of setups:

  • 16 life oriented batteries in series, generating ~800V: current limit is 5A because of batteries.
  • 4 voltage oriented batteries in series, generating ~800V: current limit 1.25A because of batteries.
  • 16 current oriented batteries in series, generating ~800V: current limit is 6.25A because of yellow 800V cable, though batteries could handle 20A. This may seem like a waste of battery capacity to deliver power, but this greatly increases battery life; battery life decrease is based on how much you draw current from battery: if you draw half of designed current limit, it will make battery live 4x longer. Alternatively, to utilize full battery current capacity, you can use DC-to-DC converter and convert to very high voltage (red cable), which will add up some current (so and power) capacity, but I have not tested that yet, so be careful.

@jrddunbr
Copy link
Contributor

The development here has halted and been put into new efforts on eln2 which we hope to have completed within two years and will be a complete overhaul with tons of new mechanics and stuff. We're not updating this older version any more because it's too difficult to set up the development environment and you can't use modern versions of Kotlin with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants