Recently I had chance to look inside vintage power supply of my friend. It has got settable voltage and current limit so it's just typical, quite old workbench power supply (I don't dare to call it "laboratory")
After opening housing I've seen one-sided PCB with all components neatly described. The owner of the power supply told me that "current limitation doesn't work below 5V" and I was curious why it was so and if we could do anything with it. I could find damaged component quickly (there is not too much parts inside) but I started drawing circuit diagram to have clear overview.
As you can see this couldn't be simpler. According to circuit diagram current limitation should work just normal - when voltage across shunt resistor rises to around 0.7V, the transistor starts to conduct and pulls base of BC337 to lower voltage so it closes BC337 and in consequence closes 2N3055 to. This should be independent of voltage set-point.
I figured out that BC337 was damaged and replaced it with the new one. (OK, actually there were two transistors in Darlington-like configuration and I just omitted one). Power supply worked almost perfect, the only one problem was that current limitation (it worked below 5V to) smallest possible current limit setting was 1.4A when I expected it to be around 0.7V/1.5Ohm=0.46A. I just assumed that this two parallel power resistors which form shunt resistance (two white resistors below) are really 3 Ohms each like on the visible description on PCB. It turned out that they are 1Ohm each what gives 0.5Ohm and explains that current limitation can't be set to smaller value than around 0.7/0.5Ohm so around 1.4A. Never trust such a descriptions, measure it first!
By the way, here are some hints if you would like to build this power supply.
1. LM741 is not rail-to rail operational amplifier and this causes that the lowest possible to set voltage is around 5V, possible workaround would be to change operational amplifier to the one which can pull its output almost to the negative supply rail like LM321 for instance.
2. Current limit like on the circuit works actually from zero to around half of the potentiometer position, if you turn the knob further there will be no result. To eliminate that dead movement of potentiometer you could put another 470R in series with current pot, on top of it
3. By placing larger values of shunt resistor you get possibility to set lower current limit, I would prefer to put around 5.6Ohm as a shunt so I could set around 125mA as a lowest possible current limit.
Thursday, November 28, 2013
Thursday, August 22, 2013
Sachs Pentasport gearhub with two cables - fixing blocked extreme gears
If your Sachs Pentasport blocks extreme gears (you can switch only between 2 to 4, gear 1 and 5 can't be chosen because you are afraid of braking the lever) then:
1. Make sure that you've disassembled, cleaned with white spirit, lubricated and assembled gear correctly.
2. Make sure that you are adjusting the lever correctly (starting from gear 4 which means all cables are in their "longest" position and than adjusting length).
3. Check if you've placed sun gear correctly, in my case it was the root of all evil. Befor mounting a wheel to bicycle it seemed to work but after riding for a while gearhub resisted against switching gears 1 and 5, I didn't want to break plastic lever so I've started to investigae what might be the reason. Sun gear can be easily flipped (two side are different but it seems to make no difference but it does make a huge difference).
The part 25a on this drawing is the mentioned gear which can cause problems if flipped.
1. Make sure that you've disassembled, cleaned with white spirit, lubricated and assembled gear correctly.
2. Make sure that you are adjusting the lever correctly (starting from gear 4 which means all cables are in their "longest" position and than adjusting length).
3. Check if you've placed sun gear correctly, in my case it was the root of all evil. Befor mounting a wheel to bicycle it seemed to work but after riding for a while gearhub resisted against switching gears 1 and 5, I didn't want to break plastic lever so I've started to investigae what might be the reason. Sun gear can be easily flipped (two side are different but it seems to make no difference but it does make a huge difference).
The part 25a on this drawing is the mentioned gear which can cause problems if flipped.
Tuesday, July 30, 2013
How to succesfully replace Opel/Vauxhall factory radio or why your new radio can't pick up much
Opel/Vauxhall calls its factory radios CDxx where xx is a number, in my case it's Opel CD30, originally produced by blaupunkt. CD30 does not play MP3s so I decided to fit new radio - Blaupunkt Melbourne 120. I removed factory fitted CD30, mounted plastic shelf to fit regular ISO sized radio and tried to connect ISO connectors, unfortunately it is impossible because CD30 radio has got it's own standard - to have it done neat and nice I bought adapter for this and used to connect speakers and power supply.
CD30 has got FAKRA connector for antena so I have bought FAKRA to ISO adapter and was naive enough to believe that it is everything what I need.
Radio played mp3 but it picked up only two stations on FM band. After short research I found out information that CD30 radio provides DC component to its antenna connector and this DC component is used to supply antenna preamplifier which is located on the roof right under mentioned antenna. FM preamplifier has to be used because there is not that efficient antenna (it is quite short) and quite long coaxial cable which introduces loses. My brand new fancy Blaupunkt Melbourne 120 is not able to provide DC component so I had to exchange regular FAKRA to ISO antenna adapter to adapter with a circuit similar to this(it is circuit diagram from http://www.electroschematics.com/488/fm-antenna-amplifier/):
CD30 has got FAKRA connector for antena so I have bought FAKRA to ISO adapter and was naive enough to believe that it is everything what I need.
Radio played mp3 but it picked up only two stations on FM band. After short research I found out information that CD30 radio provides DC component to its antenna connector and this DC component is used to supply antenna preamplifier which is located on the roof right under mentioned antenna. FM preamplifier has to be used because there is not that efficient antenna (it is quite short) and quite long coaxial cable which introduces loses. My brand new fancy Blaupunkt Melbourne 120 is not able to provide DC component so I had to exchange regular FAKRA to ISO antenna adapter to adapter with a circuit similar to this(it is circuit diagram from http://www.electroschematics.com/488/fm-antenna-amplifier/):
Sunday, June 9, 2013
MPPT solar panel controller
PIC16F1782 has got built in almost all components needed to build a switching regulator. I've already tested a possibility of building step down regulator utilizing a microcontroller with "advanced analog peripherals". This time I would like to build a true maximum power point tracking converter for a solar panel.
My monocrystalline test solar panel is rated with:
Peak Power (Pm) 10W
Open Circuit Voltage (Voc) 21.67V
Short Circuit Current (Isc) 0.61A
Maximum Power Voltage (Vmp) 17.49V
Maximum Power Current (Imp) 0.57A
Maximum power voltage is lower than voltage needed to charge a 12V lead battery so I need a step-down converter:
I found it difficult to arrange which pins should be connected to which signals. There are some alternatives on which pins periferals are connected and it is rather difficult to notice the best arrangement looking only at schematic. It is much easier to notice every possibilities and clashes on a spreadshit like this:
| pin | 1st | 2nd | ||||||||
| RA0 | 2 | AN0 | CxIN0- | COMP_I | ||||||
| RA1 | 3 | AN1 | CxIN1- | OPA1OUT | PV_I_SHUNT | |||||
| RA2 | 4 | AN2 | CxIN0+ | COMP_I | ||||||
| RA3 | 5 | AN3 | C1IN+ | PV_I_FBK | ||||||
| RA4 | 6 | C1OUT | OPA1IN+ | PV_I_SHUNT | ||||||
| RA5 | 7 | AN4 | C2OUT | OPA1IN- | PV_I_SHUNT | |||||
| RA6 | 10 | C2OUT | COMP_I | |||||||
| RA7 | 9 | PSMCxCLK | ||||||||
| RB0 | 21 | AN12 | C2IN1+ | PSMCxIN | CCP1(2) | STOP_SWITCHING | ||||
| RB1 | 22 | AN10 | CxIN3- | OPA2OUT | COMP_V | |||||
| RB2 | 23 | AN8 | OPA2IN- | PV_U_FBK | ||||||
| RB3 | 24 | AN9 | CxIN2- | OPA2IN+ | CCP2(2) | OUT_V_FBK | ||||
| RB4 | 25 | AN11 | C3IN+ | COMP_V | ||||||
| RB5 | 26 | AN13 | C3OUT | COMP_V | ||||||
| RB6 | 27 | TX(2) | ICSPCLK | PROG | TX | |||||
| RB7 | 28 | RX(2) | ICSPDAT | PROG | RX | |||||
| RC0 | 11 | PSMC1A | ||||||||
| RC1 | 12 | PSMC1B | CCP2(1) | PV_I_SET_PWM | ||||||
| RC2 | 13 | PSMC1C | CCP1(1) | PV_V_SET_PWM | ||||||
| RC3 | 14 | PSMC1D | ||||||||
| RC4 | 15 | PSMC1E | LED2 | |||||||
| RC5 | 16 | PSMC1F | LED1 | |||||||
| RC6 | 17 | PSMC2A | TX(1) | DRIVE_HS | ||||||
| RC7 | 18 | PSMC2B | RX(1) | DRIVE_LS | ||||||
| RE3 | 1 | PROG | ||||||||
| VDD | 20 | |||||||||
| VSS | 8 | |||||||||
| VSS | 19 |
Thursday, May 30, 2013
Blaupunkt Melbourne 120 vs voltage dip during engine start
I replaced factory-mounted car radio
with new fancy Blaupunkt (mostly because of possibility to playback
mp3). The radio works fine but I noticed that every time I start-up
the engine the radio switches off because of supply voltage dip
(engine starter drains lots of current). I try to do ecodriving which
includes switching engine off when I expect that I will wait for
possibility do drive further more than 1 minute and in such cases
radio boots up like another 50...60 seconds of my valuable time.
What's funny - there were no such problem with factory-mounted CD30.
I took Melbourne 120 from my, connected
to regulated power supply and measured that the Blaupunkt product
goes off when voltage falls below 9 Volt. On this picture it still works but it was enough to go 100mV lower to cause reset.
I didn't find anything trustful about
car battery voltage during engine start up so I did real-life
measurements with my 1.2 liter Opel Corsa. This is battery voltage
measured during starting engine. You can notice that voltage falls to
about 7 Volts, after around 100ms voltage reaches 9 Volts and than
goes rather up.
Avoiding this voltage dip would keep the radio alive during engine start. I came up with such an circuit idea:
There are two ways the radio can be supplied: from the car battery through D1 or from the buffering capacitor C1 through D3. D1 and D3 works so the Blaupunkt will be supplied from the voltage which is momentary higher. During almost all time Melbourne will be supplied through D1 from car battery. C1 will be charged thrugh D2 to voltage which is almost equal to car battery. During engine starting battery voltage will fall down but thanks do D2 C1 will not be discharged. When car battery voltage is lower than C1 + 1.4 Volt the radio will be supplied from C1. Of course it will take a moment to discharge C1 but this is only matter of 100ms for battery voltage to go above 9 Volt again.
Now, let's calculate C1 value to find out if it such solution is possible. From definition of capacitance:
C=Q/U
Definition of current is:
I=Q/t
which can be transformed to
Q=tI
lets put Q intu definition of capacitance and we get:
C=tI/U
Where:
C is capacitance
t is discharge time
U is voltage drop across capacitor.
Let's calculate what voltage drop do we accept: before engine startup voltage across battery is around 12.4 Volt, on C1 voltage will be 0.7 Volt lower due to D2 so 11.7V. To keep Melbourne alive voltage across C1 must be higher than 9 Volt + 0.7 Volt so C1 voltage at the end of discharge is 9.7 Volt. 11.7 - 9.7 Volt = 2V.
Time read from oscillogram above is around 100ms, after 100ms voltage on car battery will raise and will be high enough to supply the radio. Let's assume that during this time the radio will be consuming 2 Amper.
C=0.1[s] 2[A] / 2[V] = 0.1[F]
So we are looking at 0.1 Farad capacitor with voltage rating of minimum 16 Volt. Conventional electrolytic capacitor would be huge so I looked for so called ultracaps aka goldcaps.
After short searching I decided to choose Su'scon 5.5F 2.5V. I had to use 6 capacitors in series to achieve voltage rating of 15V which is barely enough to install it in a car. I choose capacitors which have values 50 times bigger that my calculations say, it is not because I distrust my calculations - the only one and simple reason is that this capacitors were cheap. You may be tempted to choose 5V ultracapacitors but be aware - usually they are designed to backup RTC and some memory and they have high ESR value (what basically means that they can't provide too much current).
Plug and play - My circuit is equipped with male and female ISO connector so it can be simply connected between the radio and original cable harness.
Here is my prototype ready to go:
It works!
I connected it and surprisingly inrush current didn't blow a fuse. I didn't even bother to look at fuse and see what its rating, I just assumed that there has to be some fuse on radio supply line (and another in the Balupunkt itself). SO far I had no time to make exact measurements and test what does voltage look like but one is for sure - it works, I can start up the engine and Melbourne 120 works without any interruption.
One more thing has to be measured - leakage current. I tired to test it with my desktop power supply but with no success. To do such a measurement you need really stable voltage, in case of 5F each millivolt of voltage change causes flow of couple of hundreds of uA needed to charge or discharge the capacitor (depending on direction of this voltage change)
Tuesday, November 13, 2012
PIC16F1503 based MPPT controller for photovoltanic system
Once I found a really simple MPPT
circuit on Chris' website: http://www.freewebs.com/acselectronics/buildppt.html I decided to
build something inspired by his work. I always wanted to build a
switching regulator based on a general purpose simple (and cheap!)
microcontroller instead of specialized switching controller. I choose
PIC16F1503 because it has got build in two comparators, PWM (maybe
not very sophisticated but fully functional) and CWG - new peripheral
from Microchip which can be used to generate dead-band time between
two outputs.
My first goal was to build something as
“prove of concept” so it is not a real MPPT controller because it
doesn't measure a PV cell current, but it adjusts load of the PV cell
to make sure it works with given output voltage. Here is circuit
diagram:
It's actually simple step-down
converter with P-channel MOSFET (I decided to use P-channel because
it allows use of common ground to measure input and output voltage).
Load of this circuit will be a lead-acid battery so I added D3 to
make sure that circuit will not discharge battery. D3 introduces lose
of efficiency so right now I'm thinking about other fancy circuit
which will do that better (with lower voltage loss across itself).
Here is an idea how microcontroller is configured to control switching regulator with its peripherals:
This is straight-forward implementation
of switching regulator but implemented in a microcontroller, after
initialization of FVR (Fixed Voltage Reference), PWM, comparator and
CWG (complementary waveform generator) it works and software can do
something else. And it will do: I plan to implement perturb and
observe algorithm to search for maximum power condition of PV cell. I
plan to introduce some changes to Circuit: I have to add PV cell
current measurement. I also have to add another PWM with RC filter as
a source of voltage of comparator. PIC16F1503 allows me to use a DAC
output as a input signal for comparator but DAC is 5-bit only, it is
to small resolution for effective MPPT tracking.
Another improvement will be second
MOSFET instead of D4 to increase efficiency. Due to a simplicity of
MOSFET driver circuit off-time is longer than I want so I will search
for some improvement, maybe totem-pole circuit?
Here is a waveform on pin 6 of
microcontroller (channel 2) and gate of MOSFET (channel 1), it is clearly visible
that there is much to improve, especially switch-off time.
Here is picture of a circuit itself
during early tests:
It's built on one-side substrate to
minimize costs, why should I order PCB in a fab if I know that
circuit will anyway need changes?
Here is PCB design, as usually I have
to show off how nice PCBs I draw. I used SMD components wherever it
was convenient. I even managed to design whole PCB on one layer
without a single wire-bridge.
I will update this post or I will write
the new one when I will build next version of this circuit with
mentioned improvements.
The software "as it is"
#include <pic.h>
__CONFIG(FOSC_INTOSC & WDTE_OFF & PWRTE_ON & MCLRE_ON & CP_OFF);
void main(void)
{
OSCCONbits.IRCF=13; //4MHz
ANSELA &= ~(1<<2);
TRISA &= ~(1<<2); //konfigurj LEDa
PORTA &= ~(1<<2); //zgas LEDa
PWM1CON=0;
PR2=9; //40 us
PWM1DCH=7;
PWM1DCL=1<<7;
TMR2IF=0;
T2CONbits.T2CKPS=1; //prescaler /4
T2CONbits.TMR2ON=1;
PWM1CONbits.PWM1OE=1;
PWM1CONbits.PWM1EN=1;
TRISC &= ~(1<<5);
FVRCONbits.CDAFVR=1; //4.096V
FVRCONbits.FVREN=1; //enable
ANSELA |= (1<<7); //comparator
TRISC |= (1<<3);
CM1CON1bits.C1PCH=2; //positive input to FVR (1.024V)
CM1CON1bits.C1NCH=3; //ngative input to C2IN3-
CM1CON0bits.C1ON=1; //on
TRISC &= ~(1<<4); //konfiguruj wyjscie do sterowania mosfetem
PORTC &= ~(1<<4);
CWG1CON0bits.G1EN=1; //wlacz
CWG1CON0bits.G1OEB=1; //w?acz wyjscie
CWG1CON0bits.G1POLB=1; //inwersja na wyjsciu
CWG1CON1bits.G1ASDLB=2; //zero w auto shot down
CWG1CON1bits.G1IS=2; //na wejsciu jest PWM
CWG1CON2bits.G1ARSEN=1; //auto restart enabled
CWG1CON2bits.G1ASDSC1=1; // comparator 1
while(1)
{
if(CMOUTbits.MC1OUT)
PORTA |= (1<<2); //wlacz leda
else
PORTA &= ~(1<<2); //zgas LEDa
}
}
Subscribe to:
Posts (Atom)














