I have moved a little futher forward - I now have a first pass
regulated -48V Vbat rail working!
Here is how I did it:
+ using the atmega163
+ DC-DC converter circuit: http://www.rowetel.com/images/psu.png
+ this program: http://www.rowetel.com/downloads/vbat.c
A resistive voltage divider between 5V and Vbat is connected to the
163's A/D Converter (ADC). I uses a 10k and 330k resistor such that
the negative Vbat translates into a positive voltage that the ADC can
sense, V. Note that as Vbat gets more negative, V decreases. It's
hooked up like this:
Vbat 330k V 10k 5V
So with Vbat=-48 and V=5 we have 53V across the divider, this gives
V=3.44V (referenced to ground 0V), or a "setpoint" ADC code of
256*(3.44/5) = 176.
V connects to the PA0 pin on the '163, I also have some LEDs connected
to PB0 and PB1 to demonstrate if I am above or below the desired
setpoint. They both light when closed loop regulation is achieved.
The control algorithm is very coarse:
+ If V < the setpoint, Vbat must be too high and the PWM is shut down.
+ If V > setpoint, Vbat must be too low and the PWM is switched on, to
a fairly low duty cycle pulse for now (I didnt want to blow anything
up). A a side effect this reduces the drive capability (increases the
output impedance) of Vbat, not normally a good thing but OK for now.
The setpoint is the ADC code that when mapped through the voltage
divider translates to Vbat = -48V.
Anyway it works! With any Vunreg of > 6V I get a relatively constant
Vbat=-48V, so it is demonstrating regulation of the output voltage as
the Vunreg input changes. The load for these tests was 10k. An on
hook phone is actually much higher than this (M-ohms), but when
ringing the impedance of the ringer is about 3k @ 50Hz I think.
So I am pretty happy with this result. Some next steps (help
welcome):
+ maybe try to modulate the setpoint to produce an AC ringing voltage.
+ sense off hook, when this happens DC loop current (e.g. 20mA) needs
to flow, and we need to switch from "constant voltage" regulation to
"constant current". Off hook phones only need about 6V to work, 48V
would blow them up.
+ consider a finer control loop, although to be honest good regulation
when on hook is not essential. It's more important in the "off hook"
state - coarse PWM jumps might cause analog noise.
+ Now that I have ADC and PWM code, try passing audio from the ADC to
PWM and see if it sounds OK.
BTW if anyone wants to build one of the DC-DC converters I have lots
of parts, I can post them to you.
Cheers,
David
Hello David,
Can you suggest me a biography (links ans specially a Book) about
DC-DC convertors, especially the type that you builded? I have found
some information on the web, but not enough to understand the circuit.
> So I am pretty happy with this result. Some next steps (help
> welcome):
>
> + maybe try to modulate the setpoint to produce an AC ringing voltage.
>
> + sense off hook, when this happens DC loop current (e.g. 20mA) needs
> to flow, and we need to switch from "constant voltage" regulation to
> "constant current". Off hook phones only need about 6V to work, 48V
> would blow them up.
>
> + consider a finer control loop, although to be honest good regulation
> when on hook is not essential. It's more important in the "off hook"
> state - coarse PWM jumps might cause analog noise.
>
> + Now that I have ADC and PWM code, try passing audio from the ADC to
> PWM and see if it sounds OK.
>
> BTW if anyone wants to build one of the DC-DC converters I have lots
> of parts, I can post them to you.
I have bought an atmega32 chip, and will try to build a simple
developmente board to use then. I am also studying a bit of it's
architecture, and looking for development tools. I would like to build
the DC-DC circuit if possible, please tell me how we can set that up.
>
> Cheers,
>
> David
>
See ya,
Felipe.
> Can you suggest me a biography (links ans specially a Book) about
> DC-DC convertors, especially the type that you builded? I have found
> some information on the web, but not enough to understand the circuit.
Well I used the circuit from the Silicon Labs Si3210 data sheet, there
is some explanation there. I am sorry I don't have any books to
recommend. The heart of the circuit is Q7, L1, D1, C9. You should find
similar circuits in and DC-DC switch mode tutorial. Its a negative
voltage step up configuration.
When PWM goes H, Q8 switches on, which switches on Q7. This causes the
inductor to start "charging". When PWM switches off L1 attempts to keep
the current flowing and it's energy is dumped into C9. That's about the
limits of my understanding :-)
nPWM is the inverted version of PWM, via C10 it quickly drives the base
of Q7 low on the rising edge of PWM. This accelerates the switch-on
time of Q7, making the circuit more efficient.
R18 is there to measure current in the original Si labs circuit, two 1
ohms resistors as I couldn't easily source 0.5 Ohm resistors :-)
> I have bought an atmega32 chip, and will try to build a simple
> developmente board to use then. I am also studying a bit of it's
> architecture, and looking for development tools.
Cool, I use the Linux avr toolchain, I will post some examples and
Makefiles. I use avrdude to program. As a first step maybe just try
and get a simple LED blinking program downloaded, that's what I did.
> I would like to build
> the DC-DC circuit if possible, please tell me how we can set that up.
The easiest way is probably if I send you the parts, and you solder
something up. I have a bunch of dead FXS modules:
http://www.rowetel.com/images/ip04/proto_fxs.jpg
That have all the parts on them that you need (and more). I can post
you one of these and you can pull the parts off that you need. They are
dead for reasons not related to DC-DC converter parts, like
manufacturing faults.
Alternatively you can buy the parts from Digikey for a few $. The only
critical parts are Q7, L1, D1, and watch the voltage ratings on C10, C9,
C11.
Cheers,
David
--
Free Telephony Project
open embedded IP-PBX hardware and software
http://www.rowetel.com/ucasterisk
Cool!
This circuit seems to be some type of charge pump? I'm afraid I'm a
little fuzzy about this side of electronics.
<snip>
> V connects to the PA0 pin on the '163, I also have some LEDs connected
> to PB0 and PB1 to demonstrate if I am above or below the desired
> setpoint. They both light when closed loop regulation is achieved.
Visual feedback is always good for debugging. The person who invented
LEDs has my eternal gratitude.
> The control algorithm is very coarse:
>
> + If V < the setpoint, Vbat must be too high and the PWM is shut down.
>
> + If V > setpoint, Vbat must be too low and the PWM is switched on, to
> a fairly low duty cycle pulse for now (I didnt want to blow anything
> up). A a side effect this reduces the drive capability (increases the
> output impedance) of Vbat, not normally a good thing but OK for now.
I haven't actually looked at your code yet :P
If I am understanding correctly, changing the PWM frequency should
change the speed at which the voltage is ramped up.
This means the greater the difference between the set-point and the V,
the faster the PWM should be output, right?
Faster PWM also means we can use smaller components - which means a
cheaper design.
I know that dedicated charge pump chips you find from people like Maxim
and National use a frequency of around 100k. The PIC chip will happily
output PWM signals of around 600k!
> The setpoint is the ADC code that when mapped through the voltage
> divider translates to Vbat = -48V.
>
> Anyway it works! With any Vunreg of > 6V I get a relatively constant
> Vbat=-48V, so it is demonstrating regulation of the output voltage as
> the Vunreg input changes. The load for these tests was 10k. An on
> hook phone is actually much higher than this (M-ohms), but when
> ringing the impedance of the ringer is about 3k @ 50Hz I think.
Have you tried putting in other Vunreg voltages? Or does it need to be
around 6V to work with the chip? I seem to remember we where aiming for
a 12V input?
The specs for a phone can be downloaded from the web easy enough. I
believe they use to cost money but they are free now.
> So I am pretty happy with this result. Some next steps (help
> welcome):
>
> + maybe try to modulate the setpoint to produce an AC ringing voltage.
How are you going with this? It shouldn't be to hard to do this.
> + sense off hook, when this happens DC loop current (e.g. 20mA) needs
> to flow, and we need to switch from "constant voltage" regulation to
> "constant current". Off hook phones only need about 6V to work, 48V
> would blow them up.
How do you do "constant current" regulation?
Measuring the voltage over a small 2-5 Ohm resister in series?
> + consider a finer control loop, although to be honest good regulation
> when on hook is not essential. It's more important in the "off hook"
> state - coarse PWM jumps might cause analog noise.
See above :P
> + Now that I have ADC and PWM code, try passing audio from the ADC to
> PWM and see if it sounds OK.
That would be cool.
> BTW if anyone wants to build one of the DC-DC converters I have lots
> of parts, I can post them to you.
The circuit looks pretty simple - maybe we should build this in
veroboard with through-hole components? That would allow a lot more
people to quickly give it a shot. Size is not really an issue at the
moment.
> Cheers,
>
> David
Tim Ansell