maximising the output from solar panels - maybe OT!

stocky

Senior Member
Still working on a 08M based idea for the time

simulated code working for shunt type regulator with temp compensation in 93 bytes :)

now to try and breadboard it and see what happens.....
 

ciseco

Senior Member
> I've got some cheapish MPPT chargers from this guy in france, might be
> worth a look if only for interest
>
>
> www.tunecharger.com <http://www.tunecharger.com/>
>
>
> I've been trying to weedle out of him how to up size it and he wont
> play ball :) but I know I'm on the right track, his uses a PIC,
> there's no reason you couldn't replicate with a PICAXE, all diagrams
> are available, I'm using an earlier version than is now on his site,
> but the principal is identical he's just tidied it up and used SMT
> stuff.
________
Mercedes Simplex
 
Last edited:

stocky

Senior Member
ok - code V1 - DONT LAUGH TOO MUCH! :)

Code:
;Pin assignments
;P0    =    Charge Indicator LED
;P1    =    Battery sense input
;P2    =    LVD MOSFET drive
;P3    =    unused
;P4    =    Shunt MOSFET drive


symbol VOLTS        =    b1
symbol TEMP            =    w6
symbol CHARGE_TARGET     =     b3
symbol TEMP_COMP        =    b4
symbol MARK            =    b5
symbol SPACE        =    b6
symbol SLA_TARGET        =    123        'equates to approx 14.0v - adjust as necessary
symbol TEMP_ZERO        =    25        'equates to approx 25 deg C - ad just as necessary
symbol LOW_BATT        =    97
symbol OK_BATT        =    103
    

'-----------------------------------------------------------
'Startup routine
'-----------------------------------------------------------
STARTUP:
     for b0 = 1 to 5                'Flash LED
         high 0                '
         pause 200                '
         low 0                    '
         pause 200                '
     next                        '
     readadc 1, VOLTS                'Read current battery voltage
     if VOLTS > OK_BATT then gosub LVC    'If battery voltage is above 11.5 then CONNECT load
     gosub CHK_TEMP
     
'-----------------------------------------------------------
' Main program
'----------------------------------------------------------- 
MAIN:
    for b0 = 1 to 100
        readadc 1,VOLTS                        'Read battery voltage
        if VOLTS < LOW_BATT then gosub LVD            'if battery voltage is below 11.0 then DISCONNECT load
        if VOLTS > OK_BATT then gosub LVC            'if battery voltage is above 11.5 then CONNECT load
        if VOLTS > CHARGE_TARGET then gosub SHUNT        'if battery voltage is above CHARGE_TARGET then SHUNT
        if VOLTS < CHARGE_TARGET then gosub CHG_LED_OFF 'if battery volatge is BELOW CHARGE_TARGET then turn CHARGED LED off
    next
    gosub chk_temp
    
    goto main
    
'-----------------------------------------------------------
'Check current temperature
'-----------------------------------------------------------
CHK_TEMP:
'    readtemp12 2,TEMP                    'REMOVED PENDING AVAILABILITY OF 14m CHIP
'    TEMP = TEMP*5
'    TEMP = TEMP/10
'    debug
    TEMP = 25
    TEMP_COMP = TEMP - TEMP_ZERO            'deduct 38 from TEMP ADC reading (38 = 25 deg C)
    CHARGE_TARGET = SLA_TARGET - TEMP_COMP    'Modify charge target value with temp compensation value
    return    
    
    
'------------------------------------------------------------
'SHUNT Routine
'------------------------------------------------------------
SHUNT:
    MARK = VOLTS - CHARGE_TARGET        'calculate M/S values
    MARK = MARK * 25 MAX 100            ' 
    SPACE = 100-MARK
        High 2                    'Turn on shunt MOSFET
        pause MARK                    'pause MARK time
        Low 2                        'Turn off shunt MOSFET
        pause SPACE                    'pause SPACE time
    return                    'return to main loop
    end
    
'------------------------------------------------------------
'Charge LED
'------------------------------------------------------------
CHG_LED_OFF:            
'    Low 0                        'Turn CHARGED LED off
    return                    'return to main loop

'------------------------------------------------------------
'Low Voltage Disconnect
'------------------------------------------------------------
LVD:                            
    Low 4                        'Turn off LVD MOSFET
    return                    'return to main loop
    end

'------------------------------------------------------------
'Low Voltage Connect
'------------------------------------------------------------
LVC:                            
    High 4                    'Turn on LVD MOSFET
    return                    'return to main loop
    end
Fine tuning to come when I get some 14M's

Once I have the 14M's I'll have I/O to burn - now to resist adding "bling" :)

FYI - with a input current of 2Amps @ 24vdc the shunt MOSFET doesnt rise above ambient - sweet - no heatsink needed!
 
Last edited:

moxhamj

New Member
Looking good. Pls post a schematic when it is working. BTW did you get that picaxe library working in Eagle?
 

stocky

Senior Member
Yes thanks Doc! Cheers!

Schematic as it will be with 14M:-



that needs a bit of tweaking yet too but the basics are there - note the code pinouts are for an 08M NOT the 14M - code will need adjusting!
 
Last edited:

stocky

Senior Member
LOL - yes well spotted!
Still getting the hang of Eagle and prob it the rotate function without noticing!

DrA suggested a few more features which I am working on at the moment - to function a bit more like a UC battery charger chip - two stage/level float charge

EDIT:- Schematic has been updated :)
 
Last edited:

stocky

Senior Member
and with a small hardware change we have a PWM linear reg instead of a PWM shunt type....
THIS IS UNTESTED and i haven't done any code yet but cant see any reason why it cant be made to work:)



:)
 

Dippy

Moderator
I think it's time for you to start bread-boarding Stocky.

I don't know what currents you expect but I can't see that working very efficiently if you want to do fast pwm.

- Assuming you want fast PWM, you have far too much gate up/down resistance for fast efficient MOSFET switching (we've been here before so sorry).
- Your PICAXE may be blasted with high-frequency harmonics. Do not be under the impression that a linear voltage reg + caps will stop HFs getting through. This will obviously get worse as you improve switching efficiency/speed. In your circuit it may be OK because of slow MOSFET switching where power will be lost in the MOSFET.
- Your ADC input will not be smooth either.

Or, if you are just doing slow on/off then it may be fine, so don't let me upset you.

There may be many other issues a lot of which depends on Solar panel size and expected power throughput.
I assume it is a baby panel? My design is for a (up to) 100w panel so if my suggestions are OTT then please don't worry. Mine is chuntering away as we speak.

If you start moving into fast switching then your circuit will have to get more sophisticated. Either that or it means that my circuit has got 20 components too many :)

So, dig out your breadboard and your 'scope, do some development and then post your circuit. I'm sure you'll get there.
 

stocky

Senior Member
Cheers dippy - no offence taken mate - was to stimulate further converstation mainly and to put other ideas "out there".

The SHUNT version is already on the breadboard and working nicely - albeit with an 08M with no temp compensation - the code is there waiting for my 14M's to arrive :) Its neat to see the PWM ratios constantly varying with PV illumination levels to keep the output voltage stable :)

Already started on some code to have 2 levels of float voltage like the UC charger chip as I have 100-odd bytes of space left :)

Panel size is MAX 30w - more commonly 10W or maybe 20W in my application

The LINEAR switched version is *JUST* a brain storm and is not tested and has no code yet - and there is work to do to improve the cct thats for sure!
I will build one just to try it out... but later :)

Switching speed will be SLOW - i guess ANY M/S ratio counts as PWM but not in the sense of the PWMOUT command i guess.....

Cheers

Stocky
 

moxhamj

New Member
Re switching speed is slow - I doubt a battery would care whether it is 1hz or 1khz. What will change are the volts - do you sample while in the middle of a fast pwm (average constant current), in a slow 'mark', or in a slow 'space'? I'm not sure I have the answer, but in one design I built it charged for 50 secs, then rested for 10 secs then measured the volts. But that wasted some potential charging time. The UC3906 senses while charging but I think it knows the charging current so it can compensate. And if you say "I'll measure the volts at a fixed charge current of 500mA" and it happens to be a dull day and the solar current never gets to 500mA, how do you ever measure the volts correctly? So you kind of get forced to measure the volts at zero charge current (and then how long is long enough to rest for before measuring?) , or you need a formula that relates volts, a random current and the charge state.

Some more questions I'm not sure about:
* If you drive pwm charge 1khz at a known battery voltage and known pulse width but an unknown solar voltage, can you work out the charge current? (I think no)

* If you drive a pwm charge 1khz known battery volts, known pulse width and known solar voltage, can you work out the charge current (I think yes, but am not sure of the maths)

* Is it better to run the electronics off the solar panel rather than the battery? (I keep changing my mind about this, currently I prefer running it off the solar panel (ie circuit is dead at night) as it saves 3mA discharge current overnight).

* Is it necessary to have a current sense resistor? (a battery will always read a higher voltage if it is being charged with a higher current, so how do you know when it is charged if you don't know the charge current)

* Is it better to switch off charge to a battery by disconnecting the solar panel (high side mosfet) or by shunting the solar panel (mosfet shorts solar panel with a big resistor)? (I used to go for disconnecting, but more recently I've gone for shunting as the extra heat helps drive moisture away from the electronics/board/box).

* Is it possible to detect the "real" charge of a battery expressed as a percentage? (I initially thought no which is why detecting the volts while charging was an inexact measure, but more recently I read that if a lead acid battery has settled for 8 hours then the volts will reflect the charge)

So regarding the latter, given that all solar systems will be off anyway at night, and given that will usually be 6-8 hours (unless one lives near the poles), and given a picaxe doesn't need to be running at night, that suggests a circuit where the picaxe is powered by the solar panel (ie before the reverse diode) and the first thing that happens when it comes on in the morning is it measures the battery volts (after first checking its own 5V - grr, yet another ADC input. 14M heading to 20M). It can then calculate the % full. If the picaxe knows the amp hours of the battery and it can measure the current, and it knows the percentage efficiency of the battery, it can deliver a certain number of amp hours to the battery to make it 100% without measuring the volts at all during charge. Or maybe measure them just to detect gross overcharge as a backup measure. This might lead to a slightly different design as it would have just one mosfet which would be on for some of the morning and then maybe switch off or switch to a balanced pwm where the solar charge just matched the load current.

Too many musings. And this is heading to an 18X with an LCD!

Just regarding the Eagle schematic, there are some unconnected components - led 2, D3 and D4 on post #49 but they are connected on post #46. Grab a little junction circle from the left side of the screen second to bottom symbol, left column. This can be a trap in Eagle - sometimes components don't connect up. If you get to making a board, when you grab each component to put it on the board, just ensure each component has all its stringy wires connected.
 
Last edited:

Dippy

Moderator
A lot to think about Drac. Looking at a few of them..

If you use fast PWM and self-adjust the duty to maintain a constant voltage you will see the duty go very low as the charge current reduced AND as it approched your threshold Voltage. A "poor-man's" current sensor. (Your charge voltage threshold being the maximum charge voltage). If the panel supply droops the duty cycle goes up. So your code can watch this and switch into trickle mode.
However this would require a slight re-design of your circuit which I won't bore you with and assumes a good battery with known spec.
Calculating current from PWM duty figure? Well, I'll leave that to the student.

If you use this method then your solar power (if available) will intrinsically balance your load requirements if within the panel's capacity/output.

I've powered my PIC circuit from Panel AND Battery. When it senses a low panel it does a Sleep-readADC loop to save battery power, not difficult.
I needed to do this as I measure both charge and load currents, which is not easy when using PWM power conversion.
I've found that it has become quite complex and I have several charging schemes based on the various parameters and some parts of code have to run quick and others need delays and hysteresis.

But I have managed to avoid nesting IFs 14 deep :)

Can you work out the charge current? Yes, but you have to measure the load current too. Obviously.
In mine I also calculate an approx figure of Ah from the panel.

Anyway, I'll stop drivvelling now as I'm looking at a pulse profile method to check battery quality. It nearly works, but if it doesn't I'll keep quiet about it and pretend I never said it.
 

stocky

Senior Member
Just regarding the Eagle schematic, there are some unconnected components - led 2, D3 and D4 on post #49 but they are connected on post #46. Grab a little junction circle from the left side of the screen second to bottom symbol, left column. This can be a trap in Eagle - sometimes components don't connect up. If you get to making a board, when you grab each component to put it on the board, just ensure each component has all its stringy wires connected.
annoying how it does that - sometimes it drops the "junction" by itself other times it doesnt! Will fix :)
 

Dippy

Moderator
You ought to get a proper CAD :)

I used to go out with a lady Reporter. She took down everything I said.
 

Dave E

Senior Member
I have a related (maybe) question or actually several and it sounds like you folks know what you are talking about. I have a 80W panel charging a couple of small SLA batteries. I am using a circuit similar to what stocky shows above except I am not using PWM (yet). I am using PWM and an RC circuit to generate an analog voltage to vary the current to the batteries to maintain a charge voltage. My question is why can I not get a full on state from the mosfet (IRLZ34N)? I have the output from the panel connected to the mosfet and the source is connected directly to the batteries. If I apply 5 volts to the gate I barely get any current flow. The only way I get a good current flow is to use the panel output through a 10K resistor to the gate. Of course solar panels are current sources so as the mosfet starts conducting, Vds decreases. I'm thinking that the reason that a 5 volt signal does not work is because the source voltage is somewhere above 13 volts (battery voltage) so therefore the 5 V signal is actually less than the source voltage. Or am I trying to use a mosfet in an application that they are not intended for? I know mosfets are designed for switching and not modulation like bipolars but I thought it should work and it does do a very good job of holding the constant voltage to a couple of hundredths of a volt.
I hope someone can shed some light on this. Don't hesitate to say so if I am way of base here. The only way to learn is to ask questions about things that we don't understand.

Dave
 

inglewoodpete

Senior Member
Borrowing one of Dippy's crystal balls for a moment, it sounds like you are trying to use the MOSFET in the wrong way. For an N-channel MOSFET to conduct, the gate must be more positive than the source.

Can you post a sketch (or a photo of a sketch on paper) of your current circuit?
 

stocky

Senior Member
Try a P channel MOSFET instead of an N Channel assuming your looking at the Linear version of my cct

pete beat me too it LOL
 

Dippy

Moderator
1. Do as Pete says.
2. Do as Stocky says.

3. Do NOT use variable analogue to drive a MOSFET for this type of app. Whilst my crystal ball is working at a duty cycle of only 10% I find it difficult to envisage exactly what you are on about. And it sounds like you have got you MOSFET theory wrong.

4. PLease, when asking asking questions it is really hard to read a big long paragraph like that. Split it up into descriptive sections.

5. Remember, you can see what you are looking at - we can't.

6. Read up on MOSFETs.

7. Post your schematic. A nice clear one.

8. Over the last three weeks there have been prolonged discussions on driving MOSFETs - I suggest you search and have a bit of a read. It may (hopefully) save repeating what has already been said very recently.

And finally, you said:-
"I have a 80W panel charging a couple of small SLA batteries.."
- does this mean you are doing 24V? (2 x 12V SLA in series?)
- or 2 x 6V in series?
- or 2 x 12V in parallel?
- or alternating the charge between 2 isolated batteries?
- or what?
 

moxhamj

New Member
Dippy "Whilst my crystal ball is working at a duty cycle of only 10%..."

Could I ask what brand of xtal ball you use, and is it picaxe powered? Does 10% mean you have flashes of insight 10% of the time as in a slow, pulse-width modulated crystal ball, or is it kind of rather fuzzy all the time? I am in the market for crystal balls at the moment, particularly with patients who answer the question "So what's wrong?" with "You're the doctor, you tell me!"

Further to my ponderings on solar cells (and I have 6 solar systems round my place at the moment all using slightly different algorithms and my water supply depends on them), the solar charger does not know what the weather is going to be, so I would think it is better to grab all the energy now rather than risk some cloud coming in half an hour. That leads to a design that calculates the battery % capacity at the beginning of the day, (say, 83%), and then just charges like crazy with whatever the cells can give till the battery is charged. That leads to a very simple design - just a relay (latching if the relay current is significant). Or a low side 5V drive mosfet driven straight off a picaxe and the mosfet is either on or off, no fancy pwm.

The curves vary also depending on charging or discharging and the rate of discharge:

http://www.arttec.net/Solar_Mower/4_Electrical/Battery Charging.pdf

When the battery is charged, maybe clever things can be done with balancing the load. But the bigger the load, the more chance of a week of cloudy days flattening the batteries, so the load ends up a very small percentage of the battery capacity. Eg 5mA load coupled with 7AH batteries and 10W panel.

So balancing may not be worth it.

So the circuit could end up quite simple. Measure the volts in the morning, calculate the % full, charge to either 100% or till the battery goes overvoltage (?14.5V). Then stop charging till tomorrow morning.

If the battery goes overvoltage consistently long before the circuit thinks it should be 100%, that indicates the battery might be failing.

This circuit measures the battery volts and the current into the battery. It does need the Amp Hour capacity of the battery programmed into the picaxe.

Could fit in an 08M if it only measures one voltage and only turns on one thing.

I'm wondering if there is a catch somewhere with this circuit?
 
Last edited:

moxhamj

New Member
Stocky, just to let you know the coding on my router boards is almost there. Just to recap, these are boards with 4 RS232 connections on each board plus a radio transceiver. The code almost fills an 18X and it may be relevant for this solar discussion as well.

The "instruction set" for each board reduces down to very simple commands:
1) Node x requests node y turns on a relay (one of 4)
2) Node x tells node y its relay status.
3) Node x requests an analog value from node y (one of 8 analog inputs)
4) Node x tells node y its analog value.
5) A PC requests a dump of the last packet to go through.
6) Program node x to tell node y an analog value went > or < a value (contained in the packet)
7) Node x to node y to turn relay 1 on if analog value changed.


Any packet not for that node number is forwarded on.

The PC can inject a packet into the network via any node.

Some scenarios:

A light sensor goes under or over a certain value, and generates a message to turn a light on via another node in the network.

A display box (with LCD) sends requests to a tank node for a water level and the level is sent back and displayed.

A portable battery powered node with some switches can be used to turn sprinklers on and off.

A pump controller node can turn a pump on when a tank level falls below a certain level.

A PC can control as much or as little of this as required. The system could default to turning on and off pumps, but when the PC is on it sends regular override signals to take over the control.

Tank levels can be displayed on an LCD (or bargraph or even an analog voltmeter) and/or on a PC.


Nodes can be mains or solar powered. Mains ones communicate with standard RS232. Solar ones via radio.

The physical layout of the nodes is unimportant. Nodes can even receive messages via multiple paths. The abstract concept is that what lives in the network are data packets. Each data packet has a unique 16bit header and bounces around the network till all nodes have seen it.

The system also can be made more reliable by adding extra nodes. For instance, two nodes could control a pump. Each has a relay, and the relays could be wired in series (ie both have to be on) for the pump to run, or parallel (either has to be on, but if one node goes down the other keeps the system running).

The PC can check the status of nodes to see if they are alive by requesting a (dummy) dump of the analog values.

Each node has a display (this code is too complex to debug without a display!). An 18X does the hard work and an 08 resets the 18X if it happens to get stuck on a serin.

So far I have all the code working except instruction #6 and #7(and I think they will be easy). The PC interface is in VB.Net.

So... long way to the original topic, this system could be used for solar charging. If a node can measure volts and amps on a battery, and turn a few relays on or off, (as it can) the algorithms can exist somewhere else, eg in a PC, and can evolve over time. Periodically, the PC could request a complete discharge of the battery to 11V and plot the discharge curve. The PC could request a periodic overcharge (wet cells need these to stir up the electrolyte). Or the PC could just control standard charge algorithms. If the node hasn't had a data packet for a while, (eg the PC crashed), it could just default to constant voltage charge.

This system could end up having quite a few uses. The only catch, and it is a big one (for robotics etc) is that with the criteria of ensuring no data clashes and a quiet radio network, the system can only handle a data packet every few minutes maximum. So it is great for measuring a stock trough, but not so good for controlling a robot leg!

I'll post once it is all working!
 

stocky

Senior Member
well - i have progressed to looking at alternative ways to gain my "missing" i/o pin.....have spent this evening getting no where fast trying to follow a tutorial on programming PIC's! :-(

I have a Microchip PICkit1 pack and I cant even work out how to flash a LED - thats sad! :-(
 

eclectic

Moderator
well - i have progressed to looking at alternative ways to gain my "missing" i/o pin.....have spent this evening getting no where fast trying to follow a tutorial on programming PIC's! :-(

I have a Microchip PICkit1 pack and I cant even work out how to flash a LED - thats sad! :-(
Or, a splendid recommendation of how good the
Picaxe system is.
 

stocky

Senior Member
yes that too!

Now if I could only get my "missing" i/o back on my 08M i'd be happy instead!

unless technical tells me the 14M is about to be released as an SMD version I'll have to keep being sad :-(
 

stocky

Senior Member
WOOT WOOT WOOT!!!

:):)

:D:D

u made my day!

I looked the other day and couldn't see it!

EDIT:- Thats because its NOT listed on the PICAXE site! Mental note => Check Tech-Supplies next time!
 
Last edited:

Dave E

Senior Member
Thanks for the input Pete, Stocky and Dippy. Looking at the other posts and the ideas you gave, it does look like I need a p-channel or not use a mosfet at all. I guess a BJT would be the best way to go with a modulating circuit.
My panel is charging 3-7Ah (20 hour rate) in parallel at 12 volts. I have lots of circuits running in my office, I had to get rid of all the wall warts.

I wanted to use a modulating circuit because it is easier to measure the current with a steady flow. Since the output of the panel can supply more current than the manufacturer recommends for the batteries, I use current measurement to determine if I need to reduce it or not. Its just I noticed on cloudy days, when the mosfet should have been hard on, it wasn't.

Thanks again for the help,

Dave
 

Dippy

Moderator
Well, that's up to you Dave. Whichever is easiest for you and most suitable for the job. My only advice: "Don't Penny-pinch" on the components.

I'm using P-Chan MOSFETs and get a power conversion efficiency of >90% at 6 Amps and >92% at 4 amps. Should be good for 10 to 12 Amps max. but not yet tested. It always looks odd when you have more current coming out than went in... but it's a good sign.

The software is just about finished. Just the 3Ts (tarting, tidying and testing) to do.

I might try BJTs as well, but I have enough on my plate right now :(
 

stocky6409

Senior Member
This project has been revilatised due to the manufacturer of the commercial unit (STECA) we where using having released a new model in an EVEN BIGGER case - so now it doesnt fit and there is no room left to do anything apart from get this design off the schematic!

I have it working quite nicely and within 0.5mA self consumption of the "commercial" version we are looking to replace - so i'm pretty happy.

I'm just trying to smooth out our ADC readings and have looked at these methods:
http://www.picaxeforum.co.uk/showthread.php?t=14109&highlight=readadc10

Problem is on my 14M is that i have but a few bytes of space left and NO variables.

What I am wondering is has anyone got a brilliant idea for making use of the remaining "bits" of an existing variable? I have 1 bit of b0 used as a status bit for the "boost" function of the regulator but I am in need of another variable for setting up an averaging loop. Can i use a mask to mask off the MSB and then use bit7 for the status bit and have a var that i can use up to 127 using the remaining bits??


Cheers

Tim
 
Last edited:

Dippy

Moderator
Can't you smooth it with a filtering method?
Doubly-handy if you have switcher noise kicking around.
 

hippy

Ex-Staff (retired)
Problem is on my 14M is that i have but a few bytes of space left and NO variables.
It is possible to use 'spare bits' in variables for storage but it may also add a lot code in masking bits when those variables and bits are used. You could find yourself between a rock and a hard place. It is possible you could store data in SFR (RAM) and use Peek and Poke to move data in and out as needed. There may also be scope to optimise the code to save some program memory or variables.

Is it possible to use a 20X2 with legs 8 to 13 bent upwards so it fits into the 14M socket ? It may be worth redesigning for use with a 20X2.
 

stocky6409

Senior Member
By removing some gosubs and packing more into the main loop I made a few more bytes available.

Code:
readadc10 VBATT,VOLT_CHK
VOLTS = VOLTS + VOLT_CHK
readadc10 VBATT,VOLT_CHK
VOLTS = VOLTS + VOLT_CHK
readadc10 VBATT, VOLTCHK
VOLTS = VOLTS + VOLT_CHK /4
Not elegant but without a spare var for a loop it will do! :)

Would rather not go to a 20x2 if i can help it - the 14m does what i need - might investigate whether the 20x2 could bring anything useful to the party tho......


Stocky
 

stocky6409

Senior Member
I have noticed my ADC reading steps being uneven -as the voltage decreases slowly over a few minutes:

483
482
478
477
476
472

instead of

483
482
481
480
479
478
etc

Sometimes it drops by 1 other times by up to 5 even though the voltage is very smooth and only dropping slowly?

Where the big jumps are there is no movement in the value for a while then takes a big jump - the voltage is still dropping its just like the ADC value gets "stuck" and doesn't want to change.

Stocky
 

stocky6409

Senior Member
Can't you smooth it with a filtering method?
Doubly-handy if you have switcher noise kicking around.
No switcher noise - just a solar panel charging and before the "slow PWM" shunt kicks in
Just seem to get "flicker" of the ADC value

483
482
483
484
483

etc
 

stocky6409

Senior Member
Would this be related to the use of DEBUG?
I have tried to use the "upgraded" DL circuit but didnt have a BAT85 so just used a normal schottky.

Or may it be related to the use of too high a values for the voltage divider network feeding the ADC input?
I may be trying to be too miserly with "self consumption" figures for the final cct.....

Stocky
 
Last edited:

Dippy

Moderator
You're worried about 2 in 480 for a PIC ADC?
Half a percent? You should be proud.

In addition to a slightly wobbley V+ supply PIC/PICAXE decoupling can affect ADC.
The 'smoothness' and noise-free-ness of the PICAXE supply is crucial.
Good regulation and good decoupling is very important.

And a little RC on the I/P can help too. Saves code. Costs 10p.
Very important to remove noise from signal and power inputs.

Obv. multi smoothing will improve things, but unless you have glitches then your numbers look good.
 

stocky6409

Senior Member
Once i tidy up the comments a bit and finalise the code/values i'll post it.
Here is a feature summary of the regulator:-

- "slow" PWM shunt regulation (13.8v)
- Automatic "boost" mode (14.4v)
- Temperature compensation
- Low voltage load disconnect/reconnect
- battery voltage and load disconnect status via dual colour LED
- <5mA self consumption

Memory used 244 of 256 bytes in a 14M
 

Dippy

Moderator
Haha :) ... but beware of going over that thin dividing line between 'prefectionist' and 'expecting too much'.

Your circuit, layout,components, values all play a part - as does the quality of the ADC itself. For that bit (pun intended) you have to wrestle with the PIC data sheet specs.
 
Top