Author Topic: Temperature Compensated PWM DumpLoad Controller  (Read 11620 times)

0 Members and 2 Guests are viewing this topic.

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Temperature Compensated PWM DumpLoad Controller
« on: December 13, 2010, 12:57:05 PM »
I'm hoping to get my 7' windmill up soon, so i've made a PicAxe 08M based dumpload controller in anticipation. ;D

It started out rather simple; just an 08M that monitors the voltage, and turn on and off some Fet's at a set voltage.

It evolved with a Dallas DS18B20 Digital Temp sensor and some code to compensate for temperature, and then i wanted to play with PWM regulation on the output.

All this is well; i managed to get it to work with only 4 bytes of memory left in the Picaxe - But it's not suitable for dumping power from a windmill anymore, since the code now uses pwm to reduce power to the dumpload to regulate float charge...  ::)

Fun though; excellent for solar where one wish to use excess power to heat water or a room.
Going up one step on the Picaxe; one with 2 pwm out and a bit more memory, it would be no problem to make one for windgen where one dumpload regulates charging voltage, and another uses up excess power. More pins, and Amps, rpm. etc could also be added...

Here's the Picaxe code:
Start:
SYMBOL Volt = w0
SYMBOL Mode = b10
Symbol Temp = w1
Symbol TempLow = b11
Symbol TempComp = b12
Symbol CompTempBoost = w2
Symbol CompTempMaint = w3
Symbol Duty = w4
Duty = 120   'Set initial Maintenance duty cycle to 18%
Mode = 0   'Set initial Mode to off/Battery Ok

'pin1 = Volt
'pin2 = Output (MosFet)
'pin3 = Manual on/off (if within dumpload voltages)
'pin4 = Temp

Main:
ReadTemp12 4,Temp
ReadTemp 4, TempLow
GoSub SetTempComp
CompTempBoost = 605 + TempComp
CompTempMaint = 554 + TempComp
If Volt >= CompTempBoost AND Mode = 0 Then Boostdump
If Pin3 = 1 AND Mode = 0 Then BoostDump
Pause 500   'Must Pause here between Pin3-On and Pin3-Off check (to avoid 'doubleclick'.)
ReadADC10 1,Volt
'SerTXD("V:", #volt, "M", #Mode, "T", #Temp) ', "D", #duty)
SerTXD("V:", #volt, "T", #Temp) ', "M", #Mode)
If Volt <= CompTempMaint AND Mode = 1 then MaintDump
If Pin3 = 1 AND Mode >= 1 Then DumpOff
If Volt > CompTempMaint AND Mode = 2 Then
   Gosub PwmUp
EndIf
If Volt < CompTempMaint AND Mode = 2 Then
   GoSub PwmDown
EndIf   
If Volt <= 533 AND Mode = 1 OR Volt <= 533 AND Mode = 2 Then DumpOff
Goto main

SetTempComp:   'Find TempComp Voltage
If TempLow >= 25 And TempLow <= 29 Then   '0,0V comp @ 25-29c
   TempComp = 0   '14,4V, 13,2V
EndIf
If TempLow >= 20 And TempLow <= 24 Then   '0,15V comp @ 19-24c
   TempComp = 6   '14,55V, 13,35V
EndIf
If TempLow >= 15 And TempLow <= 19 Then   '0,30V comp @ 15-19c
   TempComp = 12   '14,7V, 13,5V
EndIf
If TempLow >= 10 And TempLow <= 14 Then   '0,45V comp @ 10-14c
   TempComp = 19   '14,85V, 13,65V
EndIf
If TempLow >= 5 And TempLow <= 9 Then   '0,60V comp @ 5-9c
   TempComp = 25   '15,0V, 13,8V
EndIf
If TempLow >= 0 And TempLow <= 4 Then   '0,75V comp @ 0-4c
   TempComp = 31   '15,15V, 13,95V   
EndIf
If TempLow >= 129 And TempLow <= 134 Then   '0,90V comp @ -5--1c
   TempComp = 38   '15,3V, 14,1V   
EndIf
'If TempLow >= 135 And TempLow <= 140 Then   '1,05V comp @ -10--5c
'   TempComp = 44   '15,45V, 14,25V   
'EndIf
Return

PwmUp:
Duty = Duty + 10 Max 667
Pwmout 2, 166, duty
Return

PwmDown:
Duty = Duty - 10 Min 10
Pwmout 2, 166, duty
Return

BoostDump:
pwmout 2, 166, 667
Mode=1
Goto Main

MaintDump:
pwmout 2, 166, 120
Mode=2
Pause 500
Goto Main

DumpOff:
pwmout 2, Off
Mode=0
Duty = 120
Pause 500
Goto Main


Anyone got suggestions for optimization of the code? Feel free to suggest. ;)
There are some points i wish to do better, but memory limits are reached. :( (In the 08M chip, that is... ;D )

1642-0
« Last Edit: December 13, 2010, 01:00:06 PM by Simen »
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #1 on: December 14, 2010, 06:11:01 AM »
To describe the workings of the controller:

For each second (approx), it reads temperature and volts, and then adjust on and maintenance voltages for the dumpload according to temperature. If on voltage are reached, it turns on the dumpload at full load; then it switches on pwm when maintenance voltage are reached, and cycles the pwm up/down to maintain that voltage. (More/less load.) If charging amps are less than min. pwm load and the battery reaches 12.7V, the dumpload are turned completely off.

I've choosen 14.4V to turn on the load, and 13,2V as maintenance voltage @ 80F as baselines for my flooded lead acid.

I've only tested the controller on a fully charged 67Ah start-battery with a 3A charger and a 200W ceramic heater (for cars) as a dumpload. The room i tested in held around 50F (10C), and the temperature compensation worked. ;) Currently, it's 17F (-7C) outside where my main 530Ah bank resides, and i hate freezing. ;D
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #2 on: August 08, 2011, 03:48:14 AM »
For those who's interested... ;D

With the introduction of the new PicAxe 08M2, i've revisited my small dumpload controller. :)
The 08M2 chip have now 2048 bytes of memory and max 32MHz among other new things. :) (The old 08M had 256 bytes of memory, and max 8MHz) Also, it can run up to 4 parallel tasks, where the old one was single task...

With the freedom of more memory and new functions, i've rewritten the code a bit; making it a bit more efficient, and since the weather are nice and warm, i've had the opportunity to test the controller better on my 530Ah battery bank connected to 200+W of PV panels. It's a bit slow on adjusting the pwm duty according to input power, but i've only run the picaxe at 4MHz so far; clocking it up to 32MHz should speed things up. ;) Also, putting some of the code in parallel tasks should smooth things out...

Now, here's the present code (using 390 bytes):
Code: [Select]
Start:
SYMBOL Volt = w0
SYMBOL Mode = b10
Symbol Temp = w1
Symbol TempLow = b11
Symbol TempComp = b12
Symbol PrevTemp = b13
Symbol CompTempBoost = w2
Symbol CompTempMaint = w3
Symbol Duty = w4
Duty = 67 'Set initial Maintenance duty cycle to 10%.
Mode = 0 'Set initial Mode to off/Battery Ok.
setint %00001000,%00001000 'Arm interrupt for pin3.

'pin1 = Volt
'pin2 = Output (MosFet)
'pin3 = Manual Boost on/Dumpload off (if within dumpload voltages)
'pin4 = Temperature

Main:
ReadTemp12 4,Temp
ReadTemp 4, TempLow
If TempLow <> PrevTemp Then
GoSub SetTempComp
EndIf
CompTempBoost = 605 + TempComp
CompTempMaint = 554 + TempComp
If Volt >= CompTempBoost AND Mode = 0 Then
GoSub Boostdump
EndIf
ReadADC10 1,Volt
SerTXD("V:", #volt, " D:", #duty, " M:", #Mode, " T:", #Temp, " TL:", #TempLow, 13, 10)
If Volt <= CompTempMaint AND Mode = 1 then MaintDump
If Volt > CompTempMaint AND Mode = 2 AND Duty < 667 Then
Gosub PwmUp
EndIf
If Volt < CompTempMaint AND Mode = 2 AND Duty > 67 Then
GoSub PwmDown
EndIf
If Volt <= 539 AND Mode > 0 Then
GoSub DumpOff
EndIf
Goto main

SetTempComp: 'Find TempComp Voltage
If TempLow >= 25 And TempLow <= 29 Then '0,0V comp @ 25-29c
TempComp = 0 '14,4V, 13,2V
EndIf
If TempLow >= 20 And TempLow <= 24 Then '0,15V comp @ 19-24c
TempComp = 6 '14,55V, 13,35V
EndIf
If TempLow >= 15 And TempLow <= 19 Then '0,30V comp @ 15-19c
TempComp = 12 '14,7V, 13,5V
EndIf
If TempLow >= 10 And TempLow <= 14 Then '0,45V comp @ 10-14c
TempComp = 19 '14,85V, 13,65V
EndIf
If TempLow >= 5 And TempLow <= 9 Then '0,60V comp @ 5-9c
TempComp = 25 '15,0V, 13,8V
EndIf
If TempLow >= 0 And TempLow <= 4 Then '0,75V comp @ 0-4c
TempComp = 31 '15,15V, 13,95V
EndIf
If TempLow >= 129 And TempLow <= 134 Then '0,90V comp @ -5--1c
TempComp = 38 '15,3V, 14,1V
EndIf
If TempLow >= 135 And TempLow <= 140 Then '1,05V comp @ -10--5c
TempComp = 44 '15,45V, 14,25V
EndIf
PrevTemp = TempLow
Return

Interrupt:
If Mode = 0 Then
Gosub BoostDump
EndIf
If Mode = 2 Then
Gosub DumpOff
EndIf
setint %00001000,%00001000
Return

PwmUp:
Duty = Duty + 5 Max 667
PwmDuty 2, duty
Return

PwmDown:
Duty = Duty - 5 Min 67
PwmDuty 2, duty
Return

BoostDump:
pwmout 2, 166, 667
Mode=1
Pause 1000
Return

MaintDump:
pwmout 2, 166, 67
Mode=2
Goto Main

DumpOff:
pwmout 2, Off
Mode=0
Duty = 67
Pause 1000
Return

Another new feature of the 08M2 are a builtin timer which i can use for periodic equalizing, and better control of bulk and maintenance charge... :)
« Last Edit: August 08, 2011, 03:57:32 AM by Simen »
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

oztules

  • Hero Member
  • *****
  • Posts: 1477
  • Country: aq
  • Village idiot
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #3 on: August 08, 2011, 05:54:35 AM »
Thanks for the share Simen.

I'm always interested when people actually do something. (even if I do prefer analogue).



................oztules
Flinders Island Australia

SparWeb

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 5452
  • Country: ca
    • Wind Turbine Project Field Notes
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #4 on: September 01, 2011, 02:28:46 PM »
No idea why this didn't attact attention when you first posted it last year (I don't remember seeing it either) but you sure have my attention now!

How fast is its response time?  Looks like you keep it hooked up to the computer to keep a datalog too.

4 tasks in parallel?  That's really got my attention!
I gotta go look up the new spec sheet.

I've had a PIC 08 datalogger going for years now, and it sure bugs me how it only reads RPM a full second AFTER the current and then wind speed ANOTHER second after that again.  The time spacing between readings makes the data go bad on stormy days. 
No one believes the theory except the one who developed it. Everyone believes the experiment except the one who ran it.
System spec: 135w BP multicrystalline panels, Xantrex C40, DIY 10ft (3m) diameter wind turbine, Tri-Star TS60, 800AH x 24V AGM Battery, Xantrex SW4024
www.sparweb.ca

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #5 on: September 02, 2011, 03:44:51 AM »
Remember, it does timeslicing, not true parallel tasking. :) Default speed are still 4MHz, but if you run 2 tasks, it defaults to 8MHz, so each task get 4MHz, etc...

Nevertheless, you should manage to speed up the code with it. Like i do; i let the code sense voltage and adjust the pwm duty in one task, and reads the temp (which takes 750mS) each 10 sec. and output log data each 5 sec. in another task.
Except the readtemp command, the pauses in the second task does not affect the first, so the pwmduty adjusting response are pretty fast; maybe 500mS from 10% to 100% duty. (I've never timed it...)

In your case, both rpm and wind speed uses count, and count have to count for a certain time to get a count... :D But i think you could put them in separate parallel tasks and that way, speed things up. Maybe also clock the 08M2 up to 32MHz too?

And yes, i wrote a simple logging program in Clarion (?!); here's a snapshot of the graph output for one day:


(For some reason, the numbers for the y-axis does not display for Duty, but it's scaled 0%-100%)
This is from a sunny day with only occasional clouds, which are reflected in the dips in the duty cycle. The voltage are a bit variable, because i have 25A of solar in, and only 22A worth of dumpload right now... ;)

Right now, I'm struggling a bit with a Mosfet driver which won't behave... :) the picaxe struggles to drive the irfz48 fets directly, so they get very hot with these loads, due to insufficient gate voltage.

Edit:
A new 'current' code; with multitasking... ;)
Code: [Select]
Start0:
'setfreq m16
SYMBOL Volt = w0
SYMBOL Mode = b10
Symbol Temp = w1
Symbol TempLow = b11
Symbol TempComp = b12
Symbol PrevTemp = b13
Symbol Counter = b14
Symbol CompTempBoost = w2
Symbol CompTempMaint = w3
Symbol Duty = w4
Duty = 0 'Set initial Maintenance duty cycle to 10%.
Mode = 0 'Set initial Mode to off/Battery Ok.
setint %00001000,%00001000 'Arm interrupt for pin3.
ReadTemp 4, TempLow
PrevTemp = 120 'Set PrevTemp to very high to force a tempcomp

'pin1 = Volt
'pin2 = Output (MosFet)
'pin3 = Manual Boost on/Dumpload off (if within dumpload voltages)
'pin4 = Temperature

Main:
ReadADC10 1,Volt
If TempLow <> PrevTemp Then 'A weakness here; if Templow are 0C at startup,
GoSub SetTempComp 'variables will not be set...
EndIf
If Volt > CompTempBoost AND Mode = 0 Then
GoSub MaintDump
EndIf
If Volt <= CompTempMaint AND Mode = 1 Then
GoSub MaintDump
EndIf
If Volt <= 546 AND Mode > 0 Then ' 12,80V
GoSub DumpOff
EndIf
If Volt > CompTempMaint AND Mode = 2 AND Duty < 1015 Then
Gosub PwmUp
EndIf
If Volt < CompTempMaint AND Mode = 2 AND Duty > 105 Then
GoSub PwmDown
EndIf

Goto main

SetTempComp: 'Find TempComp Voltage
'SerTxd("Setting Temperature Compensation voltage.")
If TempLow >= 25 And TempLow <= 29 Then '0,0V comp @ 25-29c
TempComp = 0 '14,4V, 13,2V
EndIf
If TempLow >= 20 And TempLow <= 24 Then '0,15V comp @ 19-24c
TempComp = 6 '14,55V, 13,35V
EndIf
If TempLow >= 15 And TempLow <= 19 Then '0,30V comp @ 15-19c
TempComp = 12 '14,7V, 13,5V
EndIf
If TempLow >= 10 And TempLow <= 14 Then '0,45V comp @ 10-14c
TempComp = 19 '14,85V, 13,65V
EndIf
If TempLow >= 5 And TempLow <= 9 Then '0,60V comp @ 5-9c
TempComp = 25 '15,0V, 13,8V
EndIf
If TempLow >= 0 And TempLow <= 4 Then '0,75V comp @ 0-4c
TempComp = 31 '15,15V, 13,95V
EndIf
If TempLow >= 129 And TempLow <= 134 Then '0,90V comp @ -5--1c
TempComp = 38 '15,3V, 14,1V
EndIf
If TempLow >= 135 And TempLow <= 140 Then '1,05V comp @ -10--5c
TempComp = 44 '15,45V, 14,25V
EndIf
PrevTemp = TempLow
CompTempBoost = 615 + TempComp '14,4V baseline.
CompTempMaint = 562 + TempComp '13,2V baseline.
Return

Interrupt:
If Pin3 = 1 then
Goto Interrupt
EndIf
If Mode <= 1 Then
pwmout 2, 255, 1015
Mode=1
' SerTxd("Boosting ")
Pause 1000
EndIf
If Mode = 2 Then
pwmout 2, Off
Mode=0
Duty = 0
' SerTxd("Off ")
Pause 1000
EndIf
'SerTxd(#Mode)
setint %00001000,%00001000 'Arm interrupt for pin3.
Return

PwmUp:
Duty = Duty + 1 Max 1015
PwmDuty 2, duty
'SerTxd("Up! ")
'Pause 20
Return

PwmDown:
Duty = Duty - 1 Min 101
PwmDuty 2, duty
'SerTxd("Down! ")
'Pause 20
Return

BoostDump:
pwmout 2, 255, 1015
Mode=1
'Pause 1000
Return

MaintDump:
pwmout 2, 255, 101
Mode=2
Return
'Goto Main

DumpOff:
pwmout 2, Off
Mode=0
Duty = 0
'Pause 1000
Return

Start1:
For Counter = 0 to 10
If Counter = 5 OR Counter = 10 Then
SerTXD("V:", #volt, " D:", #duty, " M:", #Mode, " TL:", #TempLow, 13, 10)
EndIf
If Counter = 10 Then
'ReadTemp12 4,Temp
ReadTemp 4, TempLow
let Counter = 0
EndIf
Pause 1000
Next

The code needs a bit cleaning up, but it works ok as is... ;)
« Last Edit: September 02, 2011, 03:51:02 AM by Simen »
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

SparWeb

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 5452
  • Country: ca
    • Wind Turbine Project Field Notes
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #6 on: September 02, 2011, 01:21:18 PM »
...and if you put a clock on board you could have it equalize every couple of weeks...

Who cares about clean code when you're having so much fun ?

Thanks again for posting all of this.  As usual something fun and intresting that I want to try, just when life is so busy I have no free time!   :(
No one believes the theory except the one who developed it. Everyone believes the experiment except the one who ran it.
System spec: 135w BP multicrystalline panels, Xantrex C40, DIY 10ft (3m) diameter wind turbine, Tri-Star TS60, 800AH x 24V AGM Battery, Xantrex SW4024
www.sparweb.ca

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #7 on: September 02, 2011, 02:28:57 PM »
Quote
Who cares about clean code when you're having so much fun ?

Exactly... ;D

Fun and fun...
I've just burned my way through 4 mosfet drivers before i got the fifth to work correctly, and what happens when i finally connect the controller to my battery and dumpload?!
The Source leg on one of the mosfets breaks of and short something; probably against Drain, and blow the output on the driver... :(

That was the last driver i had, so now i've just rewritten the code to eliminate the pwm part, and connected the mosfet back directly to the picaxe, and let the mosfet turn on and of an relay instead.
(On at 14.4V, off at 12.8V; then on at 13.6V and off at 12.8V as long as the battery hasn't been under 12.6V; if so, it charges up to 14.4V etc... Baseline voltages, ofcourse; temp compensation adjust the voltages... But i ramble... ;D )

I'll re-engage the pwm part as soon as i get my hands on some proper Mosfet drivers again. :)
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

ruddycrazy

  • Hero Member
  • *****
  • Posts: 529
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #8 on: September 02, 2011, 07:20:34 PM »
Hi Simen,
             Although that irfz48 is logic level fet @ 4.5 volts it will only do about 10 amps max as shown on the data sheet. It may pay to redesign the circuit and run the fets off the battery input rail. Ditch the fet drivers and just use some transistors say BC337's and put a 10V zener on the rail for the gate voltage. When switching fets on a high duty cycle if you don't switch them hard off every time they will overheat and let the magic smoke out.

Cheers Bryan

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #9 on: September 03, 2011, 02:01:15 AM »
Yes, i know the gate has to be driven with a firm hand. 8)

I took some pictures of the scope mesuring over Source-Drain when driven by the picaxe alone, and with a proper driver. They're almost school examples. ;)

Here's the one when driven by the picaxe; 2 irfz48 in parallel, 22A load:


And here, with a driver between the picaxe and the mosfets:


(Sorry about the blurry scope; it's old and tired... ;) )
One can feel the struggle inside the mosfets when not driven properly - in the form of heat... ;D

I had no experience with mosfet drivers until now, and now i know they have to be fully wired up, with proper ground return path on the outputs etc. I tested the first 3 drivers on a breadboard with only power connected, and they didn't like that; suddenly they started to use over 500mA with nothing connected etc... :(

Oh well...
As long as the electrons flow; one learns... ;D
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

joestue

  • Hero Member
  • *****
  • Posts: 1791
  • Country: 00
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #10 on: September 03, 2011, 05:43:37 AM »
Two reasons the mosfets are heating up.

1) Your supply is not tight enough. Put a few more thousand uF on the supply rails, make sure its a low inductance layout.
The overshoot you see at turn off should be a decaying sine wave, at most a few volts above the rail, not clipped at what appears to be three times your supply voltage.
In the second photo the mosfets appear to be in avalanche for what looks like 1/20th of the off time?
If it really is 1/20th of the time, this is where about 90% of the heat you're feeling is coming from.

2) Turn on is taking entirely too long. A complementary emitter follower made from any two descent npn and pnp transistors capable of dumping 500ma will fix that. Cut the gate resistor down to say, 4.7 ohms.
My wife says I'm not just a different colored rubik's cube, i am a rubik's knot in a cage.

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #11 on: September 03, 2011, 06:27:38 AM »
Fyi:
In the first picture, the mosfets was driven directly from the picaxe, which has way too low voltage to turn them on properly.
In the second picture, the driver was in place, and the mosfets barely got lukewarm @22A.

My supply are a 12V, 1060Ah battery bank.
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #12 on: September 03, 2011, 07:27:57 AM »
I'm going through the same pain with a PWM dump load!!

Mk1 blew up the driver (not enough decoupling on the driver supply)
Mk2 also blew up the driver (series regulator for the driver dissipating too much power when switching at 120Hz, it put 28v onto a 20v component)
Mk3 was a total redesign with a fast recovery diode across the slightly inductive dump  load but the gate resistors also needed ferrite beads to stop the parasitic oscillations due to drain gate capacitance - smoking FETs
Mk4 was perfect except I trialed it without a heatsink, thermal runaway caused the whole thing to catch fire!!
Mk5 will have a heat sink and the PWN rate will be reduced to 7.5Hz from 120Hz

Incomplete details of the whole controller at http://gilks.ath.cx/~g8ecj/New_Turbine/new_controller.html

Enjoy...
Robin Down Under (Or Are You Up Over)

ruddycrazy

  • Hero Member
  • *****
  • Posts: 529
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #13 on: September 03, 2011, 07:36:50 AM »
Well guys I have been running my Ross Shunt controller now for about 4 years or more on my shed array. In summer I was smoking fets due to the power I was dissipating so I went and bought some 169 amp fets and put them in parallel and ever since they are dumping load upto or over 30 amps and with no heatsinks. To say I'm happy with Ross's circuit is an understatement but it isn't honestly shown on this forum...

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #14 on: September 03, 2011, 08:44:13 AM »
Frackers;
Why are you switching at so low frequencies?
I've settled at 3.9kHz (like in the first scope pic.), the second scope pic i switched at 10kHz as a test...
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #15 on: September 03, 2011, 03:54:29 PM »
Frackers;
Why are you switching at so low frequencies?
I've settled at 3.9kHz (like in the first scope pic.), the second scope pic i switched at 10kHz as a test...
The more often the FETs are switched, the more time they spend in the linear region and end up dissipating power. My system is using a 50amp dump load but I'm designing the controller for double that. I may have made a bad choice of FET judging by the instability problems I'm having, but since I have a couple of tubes of them I'm avoiding going out and buying any different ones!
Robin Down Under (Or Are You Up Over)

joestue

  • Hero Member
  • *****
  • Posts: 1791
  • Country: 00
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #16 on: September 04, 2011, 01:49:57 AM »
looks like i meant to refer to the first photo, but the details here change a few things..

http://gilks.ath.cx/~g8ecj/New_Turbine/MOS_Driver_pcb.png
That electrolytic cap on that^ board can't support the 3 amps of current that driver needs to turn on, you will need to put a 10uf ceramic or tantalum cap right next to it.
Honestly, i'm surprised you haven't blown up that 7812. At turn off any energy stored in your supply side inductance is dumped into that 4 uf capacitor. Its voltage could very easily exceed the ~40-50 volts needed to blow the linear regulator.
My wife says I'm not just a different colored rubik's cube, i am a rubik's knot in a cage.

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #17 on: September 04, 2011, 04:45:23 AM »
But how would equipment connected to your bank react to such a low switching as 7.5Hz? Each time it switches the load on, it sucks 50A out of the bank, and there will be a voltage drop; could that be a problem? Also, at 120Hz, you could get a hum on more sensitive equipment?

I do know both the need and the feeling for using what one have laying around... ;) That's why i initially wanted to drive my fets directly from the picaxe, but i do see the need for drivers... :(

Your fets have a rather large input Capacitance; typical 7000pF according to spec. The driver you're using might struggle with that. :) It's my understanding that input cap. are what decides how hard it is to drive the fets.
My irfz48 have a input cap of typical 1970pF, and the drivers i used (and burned) says 1000pF are good; 2000pF and it starts to struggle a bit, and i have 2 fets in parallel, which = 3970pF...
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #18 on: September 04, 2011, 04:57:10 AM »
Joestue;
Don't mix my project with Frackers... ;)

Frackers doesn't states his system voltage, but i'm guessing 24V since he uses 7812 regulators several places and one 7815 regulator for the mosfet driver; in his case, he should ensure enough current capacity locally to get proper switching...

Edit:
I'm starting to get out on thin ice, because i've just starting to get a hold on the edges of Mosfet switching theory here... ;D
« Last Edit: September 04, 2011, 05:28:17 AM by Simen »
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #19 on: September 04, 2011, 07:51:07 AM »
looks like i meant to refer to the first photo, but the details here change a few things..

http://gilks.ath.cx/~g8ecj/New_Turbine/MOS_Driver_pcb.png
That electrolytic cap on that^ board can't support the 3 amps of current that driver needs to turn on, you will need to put a 10uf ceramic or tantalum cap right next to it.
Honestly, i'm surprised you haven't blown up that 7812. At turn off any energy stored in your supply side inductance is dumped into that 4 uf capacitor. Its voltage could very easily exceed the ~40-50 volts needed to blow the linear regulator.

As Simen says, mixing my system details with his is confusing!! Still, I think we're both happy to learn what we can from both projects so I'll see if I can answer some of your comments and hopefully the answers will show me I'm on the right road !

The 470uF electrolytic is just to remove other supply spikes - the real driver chip decoupling is a 2.2uF ceramic surface mount directly under the driver chip. Maybe a bit low in value but I've actually increased the series gate resistors to 15 ohms as well as putting a ferrite bead on them which should reduce the peak driver current demand.

The 4uF cap is a PET (Polyethylene-terephthalate)  low K capacitor rated at 2.5V/uS continuous - again perhaps close to the theoretical requirement but I was following the rule of thumb words from a guy at work who designs our switch mode power supplies ;)

I have a bag of IRF540N FETs that I may use on the next PCB I etch (TO220 rather than MAX247 package so needs a minor change) which are pretty much the same current capability but a third of the gate capacitance - they may be more tolerant of parallel operation. Since I'll be relaying to give room for a heatsink anyway, do you (Joestue) have any suggestions on what other improvements I can make? bearing in mind the limited component availability here locally in NZ.

Cheers all - very useful thread (for me!!).

Robin Down Under (Or Are You Up Over)

joestue

  • Hero Member
  • *****
  • Posts: 1791
  • Country: 00
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #20 on: September 05, 2011, 12:20:15 AM »
Apologies for mixing the two up.  :-[

My advice for both of you is buffer the battery with capacitors sufficient to handle the rms current (half of the dump load current), then switch the fet as fast as you need to to cut the current ripple seen by the battery to reasonable levels, IF that matters to you.
If you do not have sufficient capacitors on hand to do this then cut the frequency down to where the capacitors do not get warm. But you still need them, with out them something else gets warm

@Frackers, the 2.5v/us doesn't matter if its voltage exceeds 50 volts and fries the 7812. if you've got 10uH supply side inductance, every time the fet turns off, @22amps, 2.4mJ has to go somewhere. 2.4mJ into 4 uF makes 34 volts. assuming its already at 26 volts then that puts it up to 42 volts. However, the parasitic inductance of your system could just as easily be 10 times that value, which explains why it works for some and not others.
My wife says I'm not just a different colored rubik's cube, i am a rubik's knot in a cage.

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #21 on: September 05, 2011, 05:51:46 AM »
I have at last seen the error of my ways - the application of a bit of Ohms law works wonders...

Looking at just the static ON resistance of my chosen FETs and the power disipated as a result thereof is as follows:
RDS = 0.14ohm; 4 in parallel; P = I2. R
P = 50 * 50 * 0.14/4 = 87.5watts

By switching to the IRF540N devices I have kicking about as well, they have an RDS of 0.044ohms
P = 50 * 50 * 0.044/4 = 27.5watts

In either case I was foolish to even test without a heatsink.

I've etched another board that has room for the heatsink as well as the connectors and we'll see how it goes (near time for bed now!!) I'll report back (with amended photos on my controller article on my website) when its done :)

Cheers all


Robin Down Under (Or Are You Up Over)

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #22 on: September 09, 2011, 08:47:55 PM »

I've etched another board that has room for the heatsink as well as the connectors and we'll see how it goes (near time for bed now!!) I'll report back (with amended photos on my controller article on my website) when its done :)


The updated FET board is now up and running - its only had a few hours of operation but its all looking SO much better than was. The details and pictures can be found as before at http://gilks.ath.cx/~g8ecj/New_Turbine/new_controller.html

Cheers
Robin Down Under (Or Are You Up Over)

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #23 on: September 10, 2011, 01:23:45 AM »
Nice work! :)

I like the layout of the extra copper on the board. ;)
I'm waiting for some new drivers i've ordered. In the meantime i'm using an irf840 to just turn a relay on/off. It works ok, but it's not as tight as the pwm control.

In my temporary rewire, i discovered i still used 0.5 meter of 1.5mm2 cable supplying the mosfets with the power. They show signs of having been very hot! ;D After swapping those out with some 6mm2, the amp-meter connected between the fets and the dumpload suddenly showed a draw of 28A instead of 22A. ;D
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

Simen

  • Sr. Member
  • ****
  • Posts: 479
  • Country: no
  • Grimstad, Norway
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #24 on: September 16, 2011, 06:13:42 AM »
Frackers;
Did you burn up drivers before you added those schottky diodes at the driver output?
I will accept the rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do. - (R. A. Heinlein)

frackers

  • Sr. Member
  • ****
  • Posts: 435
  • Country: nz
  • Picard spits "Hello"
Re: Temperature Compensated PWM DumpLoad Controller
« Reply #25 on: September 16, 2011, 09:04:38 PM »
Did you burn up drivers before you added those schottky diodes at the driver output?

I certainly did - the FETs were getting into parasitic oscillation due to the very high gate/drain capacitance of the ones I used originally (since changed) and that was feeding back to the driver chip and taking that out as well. Not shown on the circuit but the gate resistors have a ferrite bead as well as the schottky diodes to clamp the driver output to prevent it going -ve.

My dump load is also inductive hence the big fast diode across the load for turn-off protection and the high current cap that can supply some of the initial inrush turn-on current.

It all runs cold now (apart fro the dump load itself!!)

Cheers
Robin Down Under (Or Are You Up Over)