Forums

Small transformers and LTSpice simulation

Started by Grant April 22, 2011
On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant
<omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>:

>Actually I modeled the output latch to be like the comparator reset latch >that some of the power PIC chips have, with external level shifting to 10V >gate drive. Not used a current transformer for feedback yet, haven't looked >to see how big the signal is. I remember when you put that circuit up many >months ago. I recall rightly the PIC comparator reference can be varied >so the switching basically is happening in hardware, supervised by the >software. A timer setting the latch and output, the comparator terminating >power cycle?
There is a hardware feature in the PIC that you can enable that resets the PWM output\ as soon as a comparator level is exceeded.
>What happens if your feedback coil wired backwards?
Well, the limiter wont work then :-) Just scope it while increasing PWM angle, if its goes negatove reverse wires.
>One reason I modeled the power circuit was to make sure it settled safe if >the controller stalled, that meant AC coupled gate drive so that open loop >step would not cause over-current.
Not sure I understand that part. >Very nice to simulate that little bit,
>the rest of the circuit left to real world design, I wouldn't try to do the >lot in a sim. So now I have a failsafe hardware driver waiting for my to >catch up with PIC chip and an input sensor opamp.
>>Then you can control the current reference so you get cycle by cycle voltage control, >>something I need to add to this one day (it is now hysteretic), > >Possibly we agree on this :) >> >>I do a simple HV stabiliser here with a PIC too, up to about 1300 V software controlled: >>That one has no current trip, runs of a wallwart. >> >>Here is an other stabilised (500 V IIRC) PIC PWM supply, >>in this and the first one the PIC does the LCD drive, calculations and communication too. >> http://panteltje.com/panteltje/pic/gm_pic/ > >I've yet to do PIC serial comms, bought some serial to USB bridge modules to >try for that. Keep getting distracted with other stuff though. No programming >PICs for months now.
I just got a bunch of 18F14K22 PICs, 64MHz, nice. Now I need to fix my programmer, some pin is broken of in an IC socket...
>Grant.
On Sat, 23 Apr 2011 12:51:09 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:

>On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant ><omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>: > >>Actually I modeled the output latch to be like the comparator reset latch >>that some of the power PIC chips have, with external level shifting to 10V >>gate drive. Not used a current transformer for feedback yet, haven't looked >>to see how big the signal is. I remember when you put that circuit up many >>months ago. I recall rightly the PIC comparator reference can be varied >>so the switching basically is happening in hardware, supervised by the >>software. A timer setting the latch and output, the comparator terminating >>power cycle? > >There is a hardware feature in the PIC that you can enable that resets the PWM output\ >as soon as a comparator level is exceeded.
Yes, that's for the power supply driver type, one I'll be using soon
> > >>What happens if your feedback coil wired backwards? > >Well, the limiter wont work then :-)
Bang! ??
>Just scope it while increasing PWM angle, if its goes negatove reverse wires.
Nervously watching a 30A converter from 100AH batteries?? Nope! Too nervous ;)
> > >>One reason I modeled the power circuit was to make sure it settled safe if >>the controller stalled, that meant AC coupled gate drive so that open loop >>step would not cause over-current. > >Not sure I understand that part.
For when the PIC is dead, waiting for watchdog reset -- when 'stuff happens'.
> > > >Very nice to simulate that little bit, >>the rest of the circuit left to real world design, I wouldn't try to do the >>lot in a sim. So now I have a failsafe hardware driver waiting for my to >>catch up with PIC chip and an input sensor opamp. > > > >>>Then you can control the current reference so you get cycle by cycle voltage control, >>>something I need to add to this one day (it is now hysteretic), >> >>Possibly we agree on this :) >>> >>>I do a simple HV stabiliser here with a PIC too, up to about 1300 V software controlled: >>>That one has no current trip, runs of a wallwart. >>> >>>Here is an other stabilised (500 V IIRC) PIC PWM supply, >>>in this and the first one the PIC does the LCD drive, calculations and communication too. >>> http://panteltje.com/panteltje/pic/gm_pic/ >> >>I've yet to do PIC serial comms, bought some serial to USB bridge modules to >>try for that. Keep getting distracted with other stuff though. No programming >>PICs for months now. > >I just got a bunch of 18F14K22 PICs, 64MHz, nice. >Now I need to fix my programmer, some pin is broken of in an IC socket...
Someone commented recently about not using PIC below 16bit 24F* series, I'm thinking about it, but I bought a lot of 16F and some 12F baby stuff to play with, none of the in-betweeners like the high performance PICs you're using. Yet... Got some of the cheap TI 430 series intro kits too, not powered one up yet, kit comes with a little USB interface, loads of software for download -- but they're not getting a mention from anyone here? 'Cos they bad or just new?
> >>Grant.
On Sun, 24 Apr 2011 00:53:30 +1000, Grant <omg@grrr.id.au> wrote:


>Got some of the cheap TI 430 series intro kits too, not powered one up yet, >kit comes with a little USB interface, loads of software for download -- but >they're not getting a mention from anyone here? 'Cos they bad or just new?
The 16-bit MSP430s are squeezed from the bottom by 8-bit AVRs and from the top by the multitude of 32-bit ARM7TDMI and Cortex M3 chips. There's still a niche for the MSP430 series but it's getting narrower every day. -- Rich Webb Norfolk, VA
Grant wrote:
> I have a design that could use three or four winding toroid transformer. > > In the LTSpice notes they suggest keeping the transformer coupling at > 1.0 or -1.0 otherwise there's lots of high frequency noise generated, > I'm not sure if that's real world, or the simulation going silly? > > What I'm wondering is just how much coupling should I expect to see in > a real world transformer of around five to ten turns on a half or > three-quarter inch diameter toroid? Like the ones you see on PC mother- > boards. Or the larger mag-amp ones from PC power supplies that come > with two or three windings. >
Usually I get 0.96 to 0.98.
> I have lots of toroids recovered from power supplies, no idea of what > inductance they have until I power up some circuit and try to match > LTSpice inductance with observed waveforms ;) I'm guessing 33uH at > the moment for 40 or 50kHz operation. >
Pretty easy to measure: Short a secondary and read the inductance again. It isn't terribly accurate for a multi-winding transformer but give you a ballpark number.
> I do notice that over-voltages start at close to ideal coupling, for > example 0.97 can give a nasty over-voltage spike on the leading edge > in LTSpice. I don't know how much of that to expect in a real circuit, > any guidance here? >
0.97 is quite realistic although I had 0.995 recently, with an EI-core no less. You've got to deal with those spikes, they will happen in the real world. There will also be ringout. I always try to tackle this without snubbers because those kill efficiency. Better to dump that energy back into a rail and get the covered Energy Star sticker :-)
> What I plan to do is drive a transformer with a current limited latch > circuit, +ve edge turns on a 'hc74 flip flop, current sense through an > npn will pull 'hc74 reset line down. Should be safe enough to watch > the waveforms. > > Frequency of interest is 20 to 100kHz, current up to 2A through N-chan > MOSFET driving the transformer, small snubber on primary as suggested > by LTSpice, secondaries are standard flyback, pair of schottky diodes > and caps. > > I might even use a 555, as it has a -ve reset line? :) Save me building > a separate oscillator, add the voltage cutoff and it's done, cheap'n'nasty. > > Can one make a 50KHz oscillator from half an 'HC74? and an R + RC? Is there > a odd numbered ring of inverters hiding in there? >
Why not use a real PWM chip for starters? You can always back down from there to reduce cost once everything runs to your satisfaction. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
Grant wrote:
> On Sat, 23 Apr 2011 12:51:09 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote: > >> On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant >> <omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>: >> >>> Actually I modeled the output latch to be like the comparator reset latch >>> that some of the power PIC chips have, with external level shifting to 10V >>> gate drive. Not used a current transformer for feedback yet, haven't looked >>> to see how big the signal is. I remember when you put that circuit up many >>> months ago. I recall rightly the PIC comparator reference can be varied >>> so the switching basically is happening in hardware, supervised by the >>> software. A timer setting the latch and output, the comparator terminating >>> power cycle? >> There is a hardware feature in the PIC that you can enable that resets the PWM output\ >> as soon as a comparator level is exceeded. > > Yes, that's for the power supply driver type, one I'll be using soon >> >>> What happens if your feedback coil wired backwards? >> Well, the limiter wont work then :-) > > Bang! ??
Phssss ... tck ... bzzzt ... *KABLAM* :-)
>> Just scope it while increasing PWM angle, if its goes negatove reverse wires. > > Nervously watching a 30A converter from 100AH batteries?? Nope! Too nervous ;) >> >>> One reason I modeled the power circuit was to make sure it settled safe if >>> the controller stalled, that meant AC coupled gate drive so that open loop >>> step would not cause over-current. >> Not sure I understand that part. > > For when the PIC is dead, waiting for watchdog reset -- when 'stuff happens'.
Seriously, I'd try this with a real PWM chip first. 30A is nothing to sneeze at, if something goes wrong you could have molten solder splattering about. Then once it works you can always migrate to a uC or discrete solution. Real PWM chips have some nice feature in there, such as leading edge blanking for the current sense. A uC (normally) can't do that because the granularity for such features is finer than their clock allows. Although you could probably do it with a Cypress PSoC. The other issue with uC is that they don't have enough gusto to drive a FET, so no real financial incentive is left there.
>> >>> Very nice to simulate that little bit, >>> the rest of the circuit left to real world design, I wouldn't try to do the >>> lot in a sim. So now I have a failsafe hardware driver waiting for my to >>> catch up with PIC chip and an input sensor opamp. >> >> >>>> Then you can control the current reference so you get cycle by cycle voltage control, >>>> something I need to add to this one day (it is now hysteretic), >>> Possibly we agree on this :) >>>> I do a simple HV stabiliser here with a PIC too, up to about 1300 V software controlled: >>>> That one has no current trip, runs of a wallwart. >>>> >>>> Here is an other stabilised (500 V IIRC) PIC PWM supply, >>>> in this and the first one the PIC does the LCD drive, calculations and communication too. >>>> http://panteltje.com/panteltje/pic/gm_pic/ >>> I've yet to do PIC serial comms, bought some serial to USB bridge modules to >>> try for that. Keep getting distracted with other stuff though. No programming >>> PICs for months now. >> I just got a bunch of 18F14K22 PICs, 64MHz, nice. >> Now I need to fix my programmer, some pin is broken of in an IC socket... > > Someone commented recently about not using PIC below 16bit 24F* series, I'm > thinking about it, but I bought a lot of 16F and some 12F baby stuff to play > with, none of the in-betweeners like the high performance PICs you're using. > > Yet... > > Got some of the cheap TI 430 series intro kits too, not powered one up yet, > kit comes with a little USB interface, loads of software for download -- but > they're not getting a mention from anyone here? 'Cos they bad or just new?
Well, they run on 3.3V and the ports are kinda wimpy for driving a big FET. Also not much direct HW-interaction with the timers is possible and that can make a switcher risky. One little hang-up in the code ... *POOF* -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
On a sunny day (Sun, 24 Apr 2011 00:53:30 +1000) it happened Grant
<omg@grrr.id.au> wrote in <5ip5r65onrsh1h5o86k9tmsef4n0gsc1qn@4ax.com>:

>On Sat, 23 Apr 2011 12:51:09 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote: > >>On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant >><omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>: >> >>>Actually I modeled the output latch to be like the comparator reset latch >>>that some of the power PIC chips have, with external level shifting to 10V >>>gate drive. Not used a current transformer for feedback yet, haven't looked >>>to see how big the signal is. I remember when you put that circuit up many >>>months ago. I recall rightly the PIC comparator reference can be varied >>>so the switching basically is happening in hardware, supervised by the >>>software. A timer setting the latch and output, the comparator terminating >>>power cycle? >> >>There is a hardware feature in the PIC that you can enable that resets the PWM output\ >>as soon as a comparator level is exceeded. > >Yes, that's for the power supply driver type, one I'll be using soon >> >> >>>What happens if your feedback coil wired backwards? >> >>Well, the limiter wont work then :-) > >Bang! ?? >>Just scope it while increasing PWM angle, if its goes negatove reverse wires. > >Nervously watching a 30A converter from 100AH batteries?? Nope! Too nervous ;)
Nobody is stopping you from starting it with a car headlight or some other load in series. That is usually what I do, some bulb, it will light up if things go wrong. Remember cold resistance of those bulbs is 1/10 of warm. There are many other ways too, fuses one should sue :-)
>>>One reason I modeled the power circuit was to make sure it settled safe if >>>the controller stalled, that meant AC coupled gate drive so that open loop >>>step would not cause over-current. >> >>Not sure I understand that part. > >For when the PIC is dead, waiting for watchdog reset -- when 'stuff happens'.
The PIC will never be 'dead' with the PWM output active due to a program lockup, the PWM is completely hardware, Use a small resistor to ground from the PWM drive output to make sure no voltage to your switches while the PIC is in power up reset, as then those outputs are tri-state (MOSFET input could float).
>>I just got a bunch of 18F14K22 PICs, 64MHz, nice. >>Now I need to fix my programmer, some pin is broken of in an IC socket... > >Someone commented recently about not using PIC below 16bit 24F* series, I'm >thinking about it, but I bought a lot of 16F and some 12F baby stuff to play >with, none of the in-betweeners like the high performance PICs you're using. > >Yet... > >Got some of the cheap TI 430 series intro kits too, not powered one up yet, >kit comes with a little USB interface, loads of software for download -- but >they're not getting a mention from anyone here? 'Cos they bad or just new?
I dunno, my philosophy is: Be good at the ones you have, I cannot possibly try every new thing that comes on the market.. The 18F14K22 is not perfect (hardware SPI is broken), but at least it can do most of the things I can think of. I fixed my programmer, still have to test it though.
On Sat, 23 Apr 2011 12:41:17 -0400, Rich Webb <bbew.ar@mapson.nozirev.ten> wrote:

>On Sun, 24 Apr 2011 00:53:30 +1000, Grant <omg@grrr.id.au> wrote: > > >>Got some of the cheap TI 430 series intro kits too, not powered one up yet, >>kit comes with a little USB interface, loads of software for download -- but >>they're not getting a mention from anyone here? 'Cos they bad or just new? > >The 16-bit MSP430s are squeezed from the bottom by 8-bit AVRs and from >the top by the multitude of 32-bit ARM7TDMI and Cortex M3 chips. There's >still a niche for the MSP430 series but it's getting narrower every day.
Thanks for that, I don't know the AVR, I'm not particularly impressed with the PIC from a programming PoV, in that stuff I found easy to do a couple decades ago with 68HC05 family is near impossible (plus I'm terribly rusty). For example, a simple LCD module display cache, only rewrite letters that changed after a page update (in multi-tasking situation where 'app' writes to virtual screen in memory, cannot directly access hardware to the display as the hardware data bus is a shared resource). Only had the PIC debugging support to go by, but I couldn't spot the issue, gave up for a while. Well, the break is now ten months, embarrassing. I got distracted by too many other things, this prototype been waiting for software that long :/ Photo here: http://grrr.id.au/image/adc-card.jpg PIC (40 pin) to run high resolution ADC (15bit) front end plus LCD module, room on the foreground board for CPU with serial link. Later. Other board will become a controller for a measurement project I been working on for years So it seemed I try to do too much with the PIC on the human interface side. It's probably just right for power supply stuff I work with. Got the needed latch onboard and so on. Didn't want to go to ARM for my higher level stuff, seems too much? Maybe it's not. But what of the entrance fee? Depends on support tools, PIC wins there because entrance fee was like $50 for a PICkit II, plus the 28pin + 44pin cards have CPU with onboard debug (limited ICE) support that makes it easy to view memory after a breakpoint. Grant.
On Sat, 23 Apr 2011 10:58:30 -0700, Joerg <invalid@invalid.invalid> wrote:

>Grant wrote: >> On Sat, 23 Apr 2011 12:51:09 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote: >> >>> On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant >>> <omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>: >>> >>>> Actually I modeled the output latch to be like the comparator reset latch >>>> that some of the power PIC chips have, with external level shifting to 10V >>>> gate drive. Not used a current transformer for feedback yet, haven't looked >>>> to see how big the signal is. I remember when you put that circuit up many >>>> months ago. I recall rightly the PIC comparator reference can be varied >>>> so the switching basically is happening in hardware, supervised by the >>>> software. A timer setting the latch and output, the comparator terminating >>>> power cycle? >>> There is a hardware feature in the PIC that you can enable that resets the PWM output\ >>> as soon as a comparator level is exceeded. >> >> Yes, that's for the power supply driver type, one I'll be using soon >>> >>>> What happens if your feedback coil wired backwards? >>> Well, the limiter wont work then :-) >> >> Bang! ?? > > >Phssss ... tck ... bzzzt ... *KABLAM* :-) > > >>> Just scope it while increasing PWM angle, if its goes negatove reverse wires. >> >> Nervously watching a 30A converter from 100AH batteries?? Nope! Too nervous ;) >>> >>>> One reason I modeled the power circuit was to make sure it settled safe if >>>> the controller stalled, that meant AC coupled gate drive so that open loop >>>> step would not cause over-current. >>> Not sure I understand that part. >> >> For when the PIC is dead, waiting for watchdog reset -- when 'stuff happens'. > > >Seriously, I'd try this with a real PWM chip first. 30A is nothing to >sneeze at, if something goes wrong you could have molten solder >splattering about.
Nah, each 12V battery has it's own 35A fuse to guard against the most stupid things -- like what I did last week, shorting out the 24V -- because I present the protected batteries as two by 12V, then a connector puts them in series or parallel, well I assumed the two centre contacts would be the natural centre tap for series batteries. Only as I plugged the old series whatsit into a new thingy I'd just made, heard and watched that overloaded DC hiss welding, did I realise the old whatsit joined the outer contacts to put the batteries in series. Oops! Blew each battery's 35A fuse and weld up the mating Anderson connectors where the arc happened. I'm so glad I decided on a 'proper' last resort safeguard. Replaced pair of fuses, and that pair of welded Anderson connectors :) I don't like the idea of burning dancing wiring inside where I live! Not flying molten solder... And the smell!
> >Then once it works you can always migrate to a uC or discrete solution. >Real PWM chips have some nice feature in there, such as leading edge >blanking for the current sense. A uC (normally) can't do that because >the granularity for such features is finer than their clock allows.
Ah, but some PIC chips have that latch in hardware, so the software is setting the parameters, but not directly involved in the switch off decision that is handed off to an onboard comparator and latch. So it should be safe. Though one needs external RC to stop that leading edge pulse. I modeled that part of the power circuit as a 'HC74 latch with standard MOSFET source current resistor feeding an npn, collector pulls 'HC74 reset low to finish the output pulse on max current. So the design aspect of interest for the simulation was the 5V to 12V gate drive level shift with AC coupling, since the power circuit is half bridge, active low pulse for the P-channel, active high pulse for the N-channel. For that aspect, the simulation was useful, informing start capacitor and resistor values around the level shift transistor vs output inductance.
>Although you could probably do it with a Cypress PSoC. The other issue >with uC is that they don't have enough gusto to drive a FET, so no real >financial incentive is left there.
You could be right there, in that I have to add the usual two transistor plus diode level shifting drive. But then I'm not doing a commercial high quantity design. So I'm not terribly fussed by extra components at this stage :) It is interesting to consider commercial design reality at times. Hell, if I come up with a design where we had volumes to contract out the assembly and so on, there'd be time to save every little bit. I work in a niche area where if I did solve a common problem, the solution would be copied in a flash -- but only if the commercial volume was there. It isn't. Not in .au anyway. Not much of an industry left here, just after-market add-ons to make stuff a bit better suit intended use.
> >>> >>>> Very nice to simulate that little bit, >>>> the rest of the circuit left to real world design, I wouldn't try to do the >>>> lot in a sim. So now I have a failsafe hardware driver waiting for my to >>>> catch up with PIC chip and an input sensor opamp. >>> >>> >>>>> Then you can control the current reference so you get cycle by cycle voltage control, >>>>> something I need to add to this one day (it is now hysteretic), >>>> Possibly we agree on this :) >>>>> I do a simple HV stabiliser here with a PIC too, up to about 1300 V software controlled: >>>>> That one has no current trip, runs of a wallwart. >>>>> >>>>> Here is an other stabilised (500 V IIRC) PIC PWM supply, >>>>> in this and the first one the PIC does the LCD drive, calculations and communication too. >>>>> http://panteltje.com/panteltje/pic/gm_pic/ >>>> I've yet to do PIC serial comms, bought some serial to USB bridge modules to >>>> try for that. Keep getting distracted with other stuff though. No programming >>>> PICs for months now. >>> I just got a bunch of 18F14K22 PICs, 64MHz, nice. >>> Now I need to fix my programmer, some pin is broken of in an IC socket... >> >> Someone commented recently about not using PIC below 16bit 24F* series, I'm >> thinking about it, but I bought a lot of 16F and some 12F baby stuff to play >> with, none of the in-betweeners like the high performance PICs you're using. >> >> Yet... >> >> Got some of the cheap TI 430 series intro kits too, not powered one up yet, >> kit comes with a little USB interface, loads of software for download -- but >> they're not getting a mention from anyone here? 'Cos they bad or just new? > > >Well, they run on 3.3V and the ports are kinda wimpy for driving a big >FET. Also not much direct HW-interaction with the timers is possible and >that can make a switcher risky. One little hang-up in the code ... *POOF*
Okay, the intro kit cost $4.30 includes a short USB cable almost worth it ;) They sending them out for free too, 'limited time only'... For months now. But product design shouldn't go *POOF* if the CPU hangs, that's why there's watchdogs and stuff -- perhaps I show my age here. Or that's why stuff still has builtin fuses -- in the software doesn't lockup something might fail anyway? Safe uC design? I used to make stuff that had to work 24/7. That meant watchdogs and undervoltage reset -- though the last only accepted by the boss only after field failures were solved by the extra part cost. Grrr! Grant.
On Sat, 23 Apr 2011 18:12:47 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:

>On a sunny day (Sun, 24 Apr 2011 00:53:30 +1000) it happened Grant ><omg@grrr.id.au> wrote in <5ip5r65onrsh1h5o86k9tmsef4n0gsc1qn@4ax.com>: > >>On Sat, 23 Apr 2011 12:51:09 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote: >> >>>On a sunny day (Sat, 23 Apr 2011 20:52:19 +1000) it happened Grant >>><omg@grrr.id.au> wrote in <oqa5r6tf0fhfbugsct5i9bk5tlq2amqvjt@4ax.com>: >>> >>>>Actually I modeled the output latch to be like the comparator reset latch >>>>that some of the power PIC chips have, with external level shifting to 10V >>>>gate drive. Not used a current transformer for feedback yet, haven't looked >>>>to see how big the signal is. I remember when you put that circuit up many >>>>months ago. I recall rightly the PIC comparator reference can be varied >>>>so the switching basically is happening in hardware, supervised by the >>>>software. A timer setting the latch and output, the comparator terminating >>>>power cycle? >>> >>>There is a hardware feature in the PIC that you can enable that resets the PWM output\ >>>as soon as a comparator level is exceeded. >> >>Yes, that's for the power supply driver type, one I'll be using soon >>> >>> >>>>What happens if your feedback coil wired backwards? >>> >>>Well, the limiter wont work then :-) >> >>Bang! ?? >>>Just scope it while increasing PWM angle, if its goes negatove reverse wires. >> >>Nervously watching a 30A converter from 100AH batteries?? Nope! Too nervous ;) > > >Nobody is stopping you from starting it with a car headlight or some other load in series. >That is usually what I do, some bulb, it will light up if things go wrong. >Remember cold resistance of those bulbs is 1/10 of warm. >There are many other ways too, fuses one should sue :-)
Almost a car headlight, I have a heap of cheap 12V 50W halogen globes for dummy load, as well as some big resistors, 5R 280W and some 10R 72W. But my accidents here with 24V are usually bits of loose wire in the wrong place ;)
> >>>>One reason I modeled the power circuit was to make sure it settled safe if >>>>the controller stalled, that meant AC coupled gate drive so that open loop >>>>step would not cause over-current. >>> >>>Not sure I understand that part. >> >>For when the PIC is dead, waiting for watchdog reset -- when 'stuff happens'. > >The PIC will never be 'dead' with the PWM output active due to a program lockup, >the PWM is completely hardware, >Use a small resistor to ground from the PWM drive output >to make sure no voltage to your switches while the PIC is in power up reset, >as then those outputs are tri-state (MOSFET input could float).
Sure, that's what I meant by AC coupled drive, not fussed by the start state of the port pins, or care if they're stuck hi or low when I stop the CPU to examine memory content, which I'm used to doing and allowing for in hardware plus software design. Old habits?
> > >>>I just got a bunch of 18F14K22 PICs, 64MHz, nice. >>>Now I need to fix my programmer, some pin is broken of in an IC socket... >> >>Someone commented recently about not using PIC below 16bit 24F* series, I'm >>thinking about it, but I bought a lot of 16F and some 12F baby stuff to play >>with, none of the in-betweeners like the high performance PICs you're using. >> >>Yet... >> >>Got some of the cheap TI 430 series intro kits too, not powered one up yet, >>kit comes with a little USB interface, loads of software for download -- but >>they're not getting a mention from anyone here? 'Cos they bad or just new? > >I dunno, my philosophy is: Be good at the ones you have, >I cannot possibly try every new thing that comes on the market.. >The 18F14K22 is not perfect (hardware SPI is broken), but at least it can >do most of the things I can think of. >I fixed my programmer, still have to test it though.
I agree with you, except I'm not good with any PICs yet, not done enough with them, apart from select a few, buy a few and buy the cheap entrance fee of tools (PICkit II plus the demo boards with debug support CPUs) to play with. I have my own style of multi-tasking OS mostly written, it's just a timebase framework and interrupt round robin call list cooperative type, no magic, no context save & restore 'cos there's no support for that. Sort of stuff I did couple decades ago on 'HC05 CPUs. Bent and fitted into PIC reality. Grant.
On Sat, 23 Apr 2011 10:18:57 -0700, Joerg <invalid@invalid.invalid> wrote:

>Grant wrote: >> I have a design that could use three or four winding toroid transformer. >> >> In the LTSpice notes they suggest keeping the transformer coupling at >> 1.0 or -1.0 otherwise there's lots of high frequency noise generated, >> I'm not sure if that's real world, or the simulation going silly? >> >> What I'm wondering is just how much coupling should I expect to see in >> a real world transformer of around five to ten turns on a half or >> three-quarter inch diameter toroid? Like the ones you see on PC mother- >> boards. Or the larger mag-amp ones from PC power supplies that come >> with two or three windings. >> > >Usually I get 0.96 to 0.98.
Thanks.
> > >> I have lots of toroids recovered from power supplies, no idea of what >> inductance they have until I power up some circuit and try to match >> LTSpice inductance with observed waveforms ;) I'm guessing 33uH at >> the moment for 40 or 50kHz operation. >> > >Pretty easy to measure: Short a secondary and read the inductance again. >It isn't terribly accurate for a multi-winding transformer but give you >a ballpark number.
I don't have an inductance meter, seems it's time to make or buy one since I want to play with inductors and transformers? Another PIC project -- I think Jan worked on one? I already bought some 1% polystyrene reference capacitors to make one. Yet another distraction.
> > >> I do notice that over-voltages start at close to ideal coupling, for >> example 0.97 can give a nasty over-voltage spike on the leading edge >> in LTSpice. I don't know how much of that to expect in a real circuit, >> any guidance here? >> > >0.97 is quite realistic although I had 0.995 recently, with an EI-core >no less. You've got to deal with those spikes, they will happen in the >real world. There will also be ringout. I always try to tackle this >without snubbers because those kill efficiency. Better to dump that >energy back into a rail and get the covered Energy Star sticker :-)
Right. What about the fuzz LTSpice adds to the primary waveform? It doesn't look real to me? I certainly believe the spikes, I've seen that on hardware, but aggressively dumping it back to the rail killed power transfer to the secondaries in my simulation. But that's where I need to play with hardware as well, to see what's real and imagined :) Balance how much energy to capture on the primary side, without snuffing the life out of the system.
> > >> What I plan to do is drive a transformer with a current limited latch >> circuit, +ve edge turns on a 'hc74 flip flop, current sense through an >> npn will pull 'hc74 reset line down. Should be safe enough to watch >> the waveforms. >> >> Frequency of interest is 20 to 100kHz, current up to 2A through N-chan >> MOSFET driving the transformer, small snubber on primary as suggested >> by LTSpice, secondaries are standard flyback, pair of schottky diodes >> and caps. >> >> I might even use a 555, as it has a -ve reset line? :) Save me building >> a separate oscillator, add the voltage cutoff and it's done, cheap'n'nasty. >> >> Can one make a 50KHz oscillator from half an 'HC74? and an R + RC? Is there >> a odd numbered ring of inverters hiding in there? >> > >Why not use a real PWM chip for starters? You can always back down from >there to reduce cost once everything runs to your satisfaction.
Because my favourite chip at the moment (NCP3063) is not a proper PWM, it can be talked into PWM by injecting current onto the timing cap node, but I didn't have much success with that yet in hardware*, and cannot find a model for simulating it, to help me get into the ballpark. * Drawback is one has to add a reference to complete external control loop, so there's little incentive to go that way, too many components. Got some of the common 2843 (?) series chips, could try them. Otherwise I'm open to suggestions! Grant.