PWM driver

I want to create a constant current load using a MCP1406 mosfet driver which is working all good but like better resolution than 8 bit's so I can choose finer adjustments on the current draw , I only need 260-1000Hz frequency. I did try the 12bit dac breakout board but driving the mosfet in linear mode gets the mosfets quite hot where as the way I'm doing it at the moment they run quite cool as the 4 90W power resistors take the current, The working voltage is 6-12V and current upto 25amps.

I've seen that PCA9685 gives 12bit PWM which is for a servo controller.Not sure if I could use something like this to control the mosfet driver rather than servo's, Just wanted to get your inputs before I brought one and find that it will not do as I thought ?

Any recommendations to increase the PWM step's would be good

Thanks
Steve

Use timer 1.

How could I sue timer 1 ? any examples how to say set it 260hz ?
I've seen the secrets of Arduino PWM cheats but bit confusing.
I will also do a search and read up on it and see if I can better understanding of it, Had a quick look I can see I can adjust the frequency but I would like more steps than 255.

The datasheet is a great place to start. The 16-bit Timer/Counter1 with PWM section is 27 pages but more than half of the space is consumed by pictures and tables. I suspect it can be read from start to finish in about 30 minutes.

Mode 14 is probably the one you want.

Don't constant current loads usually use the MOSFET in the linear region, not PWM?

Steveiboy:
How could I sue timer 1 ?

Talk to your lawyer :slight_smile:

...R

Robin2:
Talk to your lawyer :slight_smile:

...R

My fingers can't type faster than my brain wants them to :slight_smile:

The reason I used PWM is they seem to run a lot cooler, The PWM frequency and circuit was used in a commercial product and I just took the idea from that. Plus a company we used who designed a similar product based on the same idea kept blowing the mosfets at 12V 30amps and they where running them in linear mode. Even though they had massive heatsink with fans blowing through them, When I carried out some testing on it the heatsink where only getting to 42-50 Degrees but the mosfets where reaching at least 150-170 degrees measured with a thermal temp sensor gun. There was 4 or 6 mosfets per battery. It must have been something wrong with there design as the idea got binned because they kept blowing the mosfets and power resistors.
I've only been playing around with PWM to learn and see which method works best. Been looking into PID routines to maintain the constant current as well.

Steveiboy:
The reason I used PWM is they seem to run a lot cooler,

In this case I know slightly more about lawyers than Mosfets. And I know very little about the law.

...R

The reason I used PWM is they seem to run a lot cooler,

Then you might not be doing things right.

When you’re drawing power from something, that power has to be dissipated somewhere. 30A @ 12V is going to be dumping 360W into something, the only question is what. If your MOSFETs are running cooler and nothing else is getting hotter, it means your circuit’s not working the way you intend it to.

A load is not the same as a regulator, because a load has to actually absorb the power and not just convert it as it’s passing through. You can’t make a 360W load without something needing chunky heatsinks and fans.

Maybe a brain-fade or a bright idea.
So you have four equal value 90watt load resistors.
Why don't you switch three of them, and (8-bit) PWM or regulate the fourth one.
Leo..

Never mind, I see you've got resistors to absorb the power. I missed those on the first read through.

I don't see mention of inductors, which is what you need to smooth the switching MOSFETs into a relatively smooth current flow. I would try to create a high power buck-boost regulator and use a control algorithm (like PID) to adjust the output voltage to the resistors to maintain the set input current.

It seems to be working ok as it is st the moment, I have heatsink with a fan, the 90w power resistors are free standing and have a fan blowing across them. I don't think it's quite running correct yet as I can here the fet's ringing(like high pitch noise). I did a 4 hour soak test at 25amps and it went ok.
I never thought about adding inductors to it to help smoth out the current will look into that.
I just wanted to get a better resolution on setting the current draw, at the moment I use a multi turn pot and can set the Pwm in 1 steps upto to 255, the idea later is to set the current draw in software and the software adjusts the Pwm to maintain the constant current when the voltage falls. This is in the early stages of design and testing at the moment.

Steveiboy:
It seems to be working ok as it is st the moment, I have heatsink with a fan, the 90w power resistors are free standing and have a fan blowing across them. I don't think it's quite running correct yet as I can here the fet's ringing(like high pitch noise). I did a 4 hour soak test at 25amps and it went ok.
I never thought about adding inductors to it to help smoth out the current will look into that.
I just wanted to get a better resolution on setting the current draw, at the moment I use a multi turn pot and can set the Pwm in 1 steps upto to 255, the idea later is to set the current draw in software and the software adjusts the Pwm to maintain the constant current when the voltage falls. This is in the early stages of design and testing at the moment.

If you don't have inductance in the circuit, it's not a constant current load. The current draw will match the PWM waveform, and be a square wave. This will make a difference when discharging your batteries.

Thanks for the information, I will get some big inductors ordered. Is the a formaula to work out the size of inductor I know it got to be rated for the highest current

Steve

Depends on your load resistance, PWM frequency, and the amount of ripply you want.

And inductor and resistor in series form a first order low pass filter. Instead of using a capacitor to smooth out voltage fluctuations, an inductor smooths out current fluctuations. The formula for the cutoff frequency is:

f = R/(2πL)

Roughly speaking, in a first order filter like this the magnitude of a frequency down by 10 for every 10x it is higher than the cutoff frequency. Suppose you want to reduce the ripple to about 1% (100x less). You need to choose a critical frequency about 100 times lower than the PWM frequency. Crank the PWM speed up to the maximum 15.6 kHz you can use if you put Timer1 into 10-bit mode, and you would need to make the filter have a critical frequency of 156 Hz. If you want less ripple, divide the critical frequency down further (use a larger value inductor).

You can parallel up inductors to increase the total amount of current you can run through them, just remember that series and parallel inductance combines like resistance. Paralleling 2 or more inductances reduces the total inductance.

Thanks for a very much for a detailed information, I'll certainly look into that and see about reading up on timer 1 for 10bits or 16bits Pwm.

Once again thank for your input
Steve

A 25-30Amp inductor might be hard to get.
Bit silly to PWM four resistive loads, while you can switch 0, 1, 2, or 3 loads on/off and PWM the fourth one.
Discharging a battery does not require load regulation to be super fast. Relays could work.
Leo..

Steveiboy:
Thanks for a very much for a detailed information, I'll certainly look into that and see about reading up on timer 1 for 10bits or 16bits Pwm.

Once again thank for your input
Steve

Increasing the resolution also increases the period. 16 bits of resolution means the fasting frequency is only 244 Hz for a 16 MHz chip. I wouldn't go any higher than 10 bits.

Wawa:
A 25-30Amp inductor might be hard to get.
Bit silly to PWM four resistive loads, while you can switch 0, 1, 2, or 3 loads on/off and PWM the fourth one.
Discharging a battery does not require load regulation to be super fast. Relays could work.
Leo..

That is why I brought up series/parallel combinations, though your idea has great merit.