# My first PWM



## dougingraham (Jul 26, 2011)

Jamie EV said:


> I haven't tried the oscilloscope on it yet but it's doing everything that he said it would. Anyone know how to keep the mosfet cooler? Is there a reason it's so damned hot? (it's almost as hot as a rotating armature or something....  )


Remove the 470uf cap. That is heating the FET when it turns on. Increase the frequency to 14khz or higher to get rid of the whine. A 555 doesnt have enough drive to turn the FET on and off so the FET is spending a lot of time as a resistor. Use a FET driver. Once you do all of that you will find that the diode across the motor terminals is getting hot. If you dont have the diode across the motor you are lucky you haven't blown up the FET. Without the diode you are probably exceeding the Vds rating of the device. Replace the diode with a FET and do synchronous rectification. TO-220 packages can handle about 5 watts into free air. You will need to heat sink it if you are dissipating more than that. You can also parallel devices such that the heat dissipated is shared across multiple devices and avoid the heat sink.


----------



## alvin (Jul 26, 2008)

That circuit does not look right. Pin 3 should be the output to the mosfet.
Pin 7 should be the discharge path from the cap.


----------



## PStechPaul (May 1, 2012)

alvin said:


> That circuit does not look right. Pin 3 should be the output to the mosfet.
> Pin 7 should be the discharge path from the cap.


You should drive the MOSFET from pin 3 and just leave pin 7 disconnected. The bypass capacitor on pin 5 is normally larger, about 10-100 nF. And, as mentioned above, the 470 uF capacitor causes additional heating because it is discharged through the MOSFET on each ON cycle. It would be good to put it across the 12V supply, close to the motor and the MOSFET source, and add a 100 nF or so capacitor in parallel.

Your PWM frequency is about 1 kHz. You should try using about 10-20 kHz to reduce audible noise. So use a 5k or 10k pot or use 1 nF for the capacitor.


----------



## Siwastaja (Aug 1, 2012)

Make sure you have the push-pull version of 555. It probably isn't. I can't remember the part number for that...

If it isn't the push pull version, lower the pull-up resistor (1k from pin 7 to +12V) considerably. For example, to 220 ohm or even smaller. The circuit works by switching the MOSFET ON via that resistor, and it is VERY slow through 1 kOhm. Switching OFF happens by 555 shorting the output pin to ground. 555 has a surprisingly strong driver, so it is possible that this is quick enough, at least with small MOSFET as yours here, but this won't help with the turn-on time which has no driver at all - only the pull-up resistor.

By using a smaller resistor, you make the pull-up stronger, but will be wasting some energy in the resistor when the 555 is pulling it down (the current flows all the time through the resistor). Go too low, and 555 is not strong enough to pull the pin down with that resistor anymore. 220 ohm with 12V is 50 mA which will be no problem to 555. You can try even lower.

But in the end, you will need a proper MOSFET driver. You can then use the 555 to drive that driver. Again, I recommend ACNW3130.

LOWER, do not increase the switching frequency. Your switching losses go down linearly. With no switching, you are in conduction and will have zero switching losses even with weakest mosfet drivers out there and even with your 1K pull-up "driver". If you switch at 100-200 Hz, you will probably be fine. Switch at 10 kHz, and you will _really_ need a strong driver. Of course higher frequency means less noise and smoother drive, but increase the frequency after you have verified you have good rise and fall times.

Get an oscilloscope somewhere; you will see what I mean by probing the FET Gate and changing the pull-up resistor and switching frequency.


----------



## Jamie EV (Oct 3, 2012)

Wow you guys are smart. My brain hurts from reading all this. I will try each suggestion one at a time and report my findings. I am humbled in your presence. 

I think my capacitors and resistor values might be off from the schematic....I sort of scrounged in my drawer. The circuit is rather forgiving.but...I will take your advice.


----------



## Siwastaja (Aug 1, 2012)

And don't forget to place a good, large electrolytic capacitor (for example, 1000 µF) AND a smaller plastic/ceramic capacitor (for example, 1 µF) between GND and +12 V near the motor; this is, between the Source pin of the FET and, the motor lead connected to +12V. These supply the current quickly to the motor so that the voltage in the rest of the circuit doesn't need to drop. And maybe more importantly, they absorb the voltage spikes. Overrate the voltage rating of these capacitors... For example, 35V electrolytic and 100V plastic/ceramic.

Ah, and I forgot to mention, some more details for you to digest . Slow gate drive is not necessarily only a bad thing! While it increases switching losses, it also considerably reduces the voltage spikes that can kill the FET. So it basically does quite the same as some snubbers, but more easily. Strong driver switches the load off very quickly, causing the inductive load (motor coils) to generate a large voltage spike. But with your 555, you more likely have too slow than too quick switching so this is not your problem (yet!).


----------



## Jamie EV (Oct 3, 2012)

I ACTUALLY do HAVE AN oscilloscope and will put the probes on the motor to see what comes out. It's an ancient beast with vacuum tubes but it SHOULD do the trick. I am trying to dust off my high school electronics for this so bear with any difficulty understanding your points. My goal is to try to make a rock solid PWM....THEN feed the output of that into a bank of fets or what-have-you.

can I take the output of that fet and feed that directly into the array? Or is that an extraordinarily bad idea? I seem to recall that this was done by one of the electrical engineers at GM after he left (he did this to a CRX)


----------



## Jamie EV (Oct 3, 2012)

I'll try both the diode across the motor terminal and also reducing the 1k ohm resistor...see what happens.


----------



## subcooledheatpump (Mar 5, 2012)

You can also use this circuit with an IGBT if you add a gate driver and an isolated power supply, which you should be using for a FET anyway. HCPL-3120 will also work as a gate driver for a MOSFET or IGBT. 

As stated above;

Add parallel capacitance with your load to reduce voltage spikes

Yes a slow switching time makes everything hot but it reduces voltage spikes during turn off (DI/DT).

A high switching frequency increases voltage spikes and switching losses, but it reduces current spikes and noise. You can have either a high frequency and voltage spikes (DI/DT) or low frequency and current spikes (DV/DT) Take your pick

So just keep experimenting and wear your safety goggles. Your scope will be very useful for seeing the stuff we're all talking about.


----------



## Siwastaja (Aug 1, 2012)

OLD analog oscilloscope IS just FINE for a DC controller. 

It is easy to get "solid" PWM directly from 555, but once you connect more and more FETs (or a bigger FET) to it, it starts to round off because these FETs have capacitance on their gates.

If you use one FET to build a driver to drive the gates of the actual FETs, you just get quick switch-off time (the FET quickly shorts to the ground when enabled), but are still limited to a slow, resistive pull-up to do the switch-on. Proper FET drivers have half-bridge (= push-pull) configuration of two semiconductors, the lower one does strong pulldown, the upper one does strong pullup (instead of a weak resistor).

When you crank up voltage and current, these things become more important. Then, optoisolation starts to matter, too. But there are optoisolated drivers available. They have optocoupler, some filtering _and_ the strong push-pull type two-transistor drive you can directly connect (with a small gate resistor) to a FET gate.


----------



## PStechPaul (May 1, 2012)

Actually the 555 output has a quite respectable 100 nS rise/fall time which is the same as the ACNW3130. However the Avago part has a higher drive current rating of 2.5 amps and has an integrated optoisolator, which is not needed for a low-side driver.

The IRF520 is only an 8A device with 0.3 ohms RdsOn, so if the motor draws 3 amps the power will be 2.7 watts while conducting. The switching losses will be approximately 0.5*12*3*(tr+tf)*Fpwm, so at 1 kHz it will be 0.36W and 3.6W at 10 kHz. The discharge of the 470 uF capacitor will involve a peak current as high as 12/0.3 = 40 amps or 480W for a time constant of 141 uSec. So at 1 kHz this may add as much as 0.5 * 480 * 141 / 1000 = 34 watts. Obviously this is a maximum value, assuming worst case conditions, but it's a very real problem.

These are the sort of calculations that need to be done when designing even a simple PWM circuit. A more accurate way to determine the actual operation of the circuit is to use a simulator such as LTSpice, which is available FREE at www.linear.com.


----------



## Jamie EV (Oct 3, 2012)

cool info...so ok...I changed out the resister on pin 7 to a 3.3 k ohm resistor.....I know you said lower...but that was not working. Now the unit runs cooler....I removed the capacitor from pin 2 and 3 of the Fet since it seemed to be making it hot (you were right about it doing that BTW)

Then I put a diode between pin 2 of the the fet and positive 12 v. THis has made the unit even cooler....and I think quieter...not sure why. I'm just glad it passes the initial...will it burn up test....so far it looks good...

I can't have it burn up since I only have the one fET LOL! Don't fry little guy! 

I will check out the scope soon.


----------



## Jamie EV (Oct 3, 2012)

bear in mind I'm not using the 520 fet. I'm using the 540.


----------



## Jamie EV (Oct 3, 2012)

Ok so it looks like what he's doing is creating a dynamic control loop between the output of pin 3, and the threshold of pin 2 and the trigger of pin 6. 

He's using the trimmer pot to vary the resistance between trigger and threshold or something....that guy is perhaps not using it the way you would have but he's smart....and instead of using 3 to drive the MOSFET, he's using the discharge of 7.

So does that mean he's only using the "pull"? (am I getting this correctly?)


I'm swimming in deep water and my water wings are leaking.

BTW is that nF = microfarads? Isn't that supposed to be uF?


----------



## Jamie EV (Oct 3, 2012)

oh never mind. I looked it up. You mean 1 billionth....my bad. I think I have a .1 uF on the 2 pin. will that do?


----------



## Jamie EV (Oct 3, 2012)

My ancient oscilloscope may have bitten the dust. Remember it's old...I lost the trace (could be on overheated tube) 

Before the scope died on me, I could distinctly see the "on" cycle changing width but I'm not sure if it's right yet. I'll have to see if I can get that puppy running again to take a better picture of the waveform.

I have noticed that when the motor is turning slowly...(narrow pulse width) the fet heats up. When the throttle is wide open....cool as a cucumber. Maybe this is normal? Is that just an issue of heat sinking and I'll have to live with it? 

I'm not sure what the discharge resistor should be. I have tried 300 ohm, 1 meg ohm, 3.3k ohm...1 k ohm I thiunk 3.3k works best so far. 

As for capacitors, I guess the electrolytic across the power supply going to the motor is a lot like a snubber....and it does alter the noise....but it makes the FET extremely hot....so I dropped that. I do have a diode across the negative and positive and that has kept it from overheating a bit ( is that because it prevents back flow from inductance load? What if I had it in series instead of parallel?) 

I have a whole lot of really thin aluminum strapping I'd like to make a "sail" out of and bolt to the FET. Would that minimize the risk of failure? Whould a well designed circujit need that?

I would really like to make it tough and reliable so that I could make a board with it....that way I could have a reliable "driver" for a bank of Mosfets when I am ready to acquire them . Who knows....maybe I CAN make a 500 amp controller from scratch....would save a fortune in conversion costs.


----------



## Jamie EV (Oct 3, 2012)

Gonna try this one instead.


----------



## alvin (Jul 26, 2008)

That looks better. You can get rid of D2. R1 should be a potentiometer so you can adjust the speed.
Edit: P1 should be R2 from pin 7 to pin 6. D2 should parallel R2. In the same direction as your diagram. 
The diode allows for less than 50% duty.
Alvin


----------



## Jamie EV (Oct 3, 2012)

alvin said:


> That looks better. You can get rid of D2. R1 should be a potentiometer so you can adjust the speed.
> Edit: P1 should be R2 from pin 7 to pin 6. D2 should parallel R2. In the same direction as your diagram.
> The diode allows for less than 50% duty.
> Alvin


Actually, I tried the circuit. Failed miserably. Did not work at all. Either my components not matching to the specs or I did something wrong. 

I decided to go back to the initial design from PCBheaven.com and returned the components as near to spec as I could....


my capacitor values are a littel wonky and my 1 k ohm is back between pin 7 and gnd. I put a 25 volt 2200uF capacitor across the motor terminals...NOT the power supply....and instantly it went totally silent. No noise at all when low speed. I also have a diode parallel to the 2200uF cap and it's not heating up at all....mayb ethe tinyest bit warm but well within tolerance at low speed.


I only have one question. Now the motor will turn slow but not stop completely. (maybe that's why I'm not hearing the sound. Since the addition of the capacitor (snubber?) across the motor, the lowest setting is slow...but not a complete stop. Must be causing a capacitance bridge effect....when the PWM is very narrow, the capacitor is filling in the valleys? 


How do I stop that? Smaller capacitor?


----------



## Siwastaja (Aug 1, 2012)

Jamie EV said:


> I only have one question. Now the motor will turn slow but not stop completely. (maybe that's why I'm not hearing the sound. Since the addition of the capacitor (snubber?) across the motor, the lowest setting is slow...but not a complete stop. Must be causing a capacitance bridge effect....when the PWM is very narrow, the capacitor is filling in the valleys?
> 
> 
> How do I stop that? Smaller capacitor?


You stop it by setting the pulse width to 0% - i.e., ground all the time. Unfortunately, that 555 schematic does not support that. It doesn't go fully on, either.

You could add a traditional switch to do full stop; or get a better PWM generator than 555 .


----------



## dougingraham (Jul 26, 2011)

Jamie EV said:


> I have noticed that when the motor is turning slowly...(narrow pulse width) the fet heats up. When the throttle is wide open....cool as a cucumber. Maybe this is normal? Is that just an issue of heat sinking and I'll have to live with it?


This is probably because the rise/fall time on the gate of the FET is too slow. You need a FET driver chip which has been mentioned before in this thread. FET's have a linear range where they are resistors and if you don't have adequate drive then the FET spends a lot of its time as a resistor instead of as a a switch. There are other possibilities but this is the most likely. A 555 chip doesnt have the capability to drive several amps into the gate to cause it to switch quickly. The reason it runs cool at full power is because the FET is on all the time and isn't spending any of its time as a resistor.

You can remove the gate resistor and see what happens. It will probably improve it quite a lot.

I suggest you wear safety glasses when experimenting with power electronics. I have been hit by pieces of flying FET several times over the years. I remember once I had been running a little bldc at 20krpm unloaded. It had been running a couple of minutes and I just happened to glance at the FET's and saw one of them crack and emit light and then the rest of them followed. Bits of FET all over the workshop. I tracked the cause down to unglued windings in the motor that rubbed together causing a short inside the motor. I was running 12v and it was pulling about 5 amps and I had a 30 amp fuse in the circuit which didn't blow. I was glad I was wearing glasses that day.


----------



## Jamie EV (Oct 3, 2012)

Siwastaja said:


> You stop it by setting the pulse width to 0% - i.e., ground all the time. Unfortunately, that 555 schematic does not support that. It doesn't go fully on, either.
> 
> You could add a traditional switch to do full stop; or get a better PWM generator than 555 .


Yeah yeah, I get it...I just happened to have a 555 so that's what I built....I suppose that I should use a dedicated PWM driver...

But it has to be cheap....reliable and strong....so that I can attach it to 1000 amps worth of Mosfets!

(or at least 500 amps)



Hey I had a thought....could I make the Mosfet bank modular? Like start with 500 amps worth, then build another bank and plug them together after the fact?


That way, I can decide to improve capacity later on for a later motor, different pack, etc.


----------



## alvin (Jul 26, 2008)

On your last diagram you posted remove the gate resistor,get rid of D1 and D2. Get a 10k potentiometer one lead from pin 8 one lead from pin 1 the center lead to pin 7. Put a 20k resistor from pin 7 to pin 6. Pin 3 is the output to the mosfet gate.

Power up turn the potentiometer and away you go.


----------



## Jamie EV (Oct 3, 2012)

Well I would Alvin, but the general consensus on here is not to use a 555 timer. Anyone know where I can get a cheap Fet driver? What was the preferred model # again?


----------



## alvin (Jul 26, 2008)

A 555 is not for making a controller for an EV. It is just to get your feet wet. First you must get that little motor coming on when you want it to and turn off when you want it to.

There is more to the real thing than just PWM. There must be safety issues taken into account for you and others.

The parts for the power section of the controller are expensive and must be protected.

I thought you just wanted to experiment with that motor and chip.

Alvin


----------



## Jamie EV (Oct 3, 2012)

alvin said:


> A 555 is not for making a controller for an EV. It is just to get your feet wet. First you must get that little motor coming on when you want it to and turn off when you want it to.
> 
> There is more to the real thing than just PWM. There must be safety issues taken into account for you and others.
> 
> ...


I appreciate the help from all you electronics veterans. The limits of the 555 are painfully obvious but I learned a lot about what the Mosfet needs. I still have much to learn to make a good PWM mind you. 


Alvin, I'm aware of there being safety issues. Thanks for the concern. As for the 555 timer, I know that it's not ideal because it's not purpose built for pwm. 

I'm not a total idiot. I know FETs can blow up. so can snubber capacitors too...rather violently, I might add.

I will be sure to put a lot of safety features on the Mosfet bank to try and prevent explosions...and also will over-build it so that it's able to handle whatever I throw at it.

I experimented with it. I learned the basics of a FET driver. I succeeded in making the motor turn on and off and vary it's speed. It was only a car window crank motor but it was about an amp or so. 

I know for a fact that the factory devices also whine at low speed and start-up and that they do pretty much the same thing as my little version...just in larger scale.

So thanks for the info. I'm looking to build a real PWM for larger MOSFETS or IGBTs....thanks for the memories. 


I have seen the OpenRevolt system. I think it sells for like 600 bucks. I may go that route but before I get to that point, I want to see how economically viable it is for me to simply build one. If it ends up being close to the cost of the Open Revolt....forget it. What's the real point. Learning is what I'm doing now. 

I don't have a motor nor do I have contactor, Batt pack, spline adapter, cables, pot box, etc etc etc....so basically, this is still highly theoretical.

So was the atom bomb when Oppenhemier worked on it though.... muhahaha!


----------



## Jamie EV (Oct 3, 2012)

http://www.ebay.ca/itm/Power-MOSFET...ltDomain_0&hash=item2a18a88b7f#ht_2371wt_1165

If I were to build a bank of 20 of these, I could switch 700 amps and a theoretical 600V. 

What kind of gate driver could be equal to that task?


----------



## alvin (Jul 26, 2008)

I have been using the Open Revolt controller for a little over 3 years. It has been in two different vehicles. I like it.

On the mosfets and diodes I think most people derate them by about one third. It takes a diode of a least equal value for each mosfet.

A couple of MIC4451YN drivers might work on 20 of those mosfets.

The control section has to be isolated from the power section. You won't be able to use the same power for the motor like in your small motor controller.

Good luck. I made my first contoller before the Open Revolt. It did not have high pedal lockout or overamp protection. Or over temp protection or low voltage shutdown. Or.... well you know what I mean. It worked though.

You can do it too.

Alvin


----------



## Jamie EV (Oct 3, 2012)

alvin said:


> I have been using the Open Revolt controller for a little over 3 years. It has been in two different vehicles. I like it.
> 
> On the mosfets and diodes I think most people derate them by about one third. It takes a diode of a least equal value for each mosfet.
> 
> ...


Do you mean that I should use two gate drivers? How would I syncronize them?


----------



## alvin (Jul 26, 2008)

Send the PWM signal to both.


Here is a link to an inexpensive controller chip. It is for different type motors. It will do series dc just use one (1) of the bottom drive outputs.

Link

Alvin


----------



## Jamie EV (Oct 3, 2012)

alvin said:


> Send the PWM signal to both.
> 
> 
> Here is a link to an inexpensive controller chip. It is for different type motors. It will do series dc just use one (1) of the bottom drive outputs.
> ...


That chip looks expensive. Just one of those will run 20 mosfets? (actually, I just ordered 16 of them) I was thinking more along the lines of an opto-isolated gate driver. 

http://www.ebay.ca/itm/FAN3122-9A-H...ultDomain_0&hash=item2a23f00b6c#ht_2246wt_907


----------



## PStechPaul (May 1, 2012)

See datasheet: http://www.fairchildsemi.com/ds/FC/FCA35N60.pdf

Remember that the FCA35N60 has a typical RdsOn of 0.079 ohms which will drop 2.8 volts at 35 amps. That's about 100 watts. The thermal resistance is 0.4 C/W junction to case and 0.25 C/W case to heat sink. So if you can find a heatsink with 0.35 C/W you will have a 100C teperature rise above ambient, and maximum junction temperature is 100C, at which the maximum current is 22 amps. At 100C, the RdsOn is almost doubled, so figure on 0.15 ohms. At 22 amps, that is 3.3 volts drop and 73 watts. So with 20 of these devices you might just barely get 440 amps continuous. 

If you look at the safe operating area, at 100V the DC limit is only 3 amps, and even for 10 mSec pulses it is only 15 amps, and 22A for 1 mSec. You should always use a working voltage no more than about 1/2 the absolute maximum rating (600V), so you should have a battery bank of no more than 300V. At that voltage the SOA is further reduced to 10A at 1 mSec (1 kHz). So the maximum power you will be able to control will be 100V at 440A or 44 kW, with resistive losses of about 1400 watts, for an efficiency of 97%. But you will need to add switching losses as well, and I would expect no better than 90-93%. 

There is also the issue of synchronizing 20 parallel MOSFETs and designing the PCB or wired connections so that the current is shared equally. Fortunately MOSFETs are not subject to current hogging as exhibited by IGBTs. But as you can see these MOSFETs drop as much as 3 volts or more, which may be more than large IGBTs. Much depends on the specific voltages and currents involved, but large single IGBTs are easier to wire and replace if necessary, and may be more cost effective, especially if you can find used/surplus units on eBay. 

For instance:
http://www.ebay.com/itm/PRX-IGBT-CM...220?pt=LH_DefaultDomain_0&hash=item2ebbacc74c
This is a dual 300A 1200V module which can be used as the commutating diode across the motor, and is only about $50, which is about what you would pay for the 20 MOSFETs.


----------



## Jamie EV (Oct 3, 2012)

Well, those tolerances and efficiencies look good to me. I'm going for it. Mosfets are pretty tried and true apparently. If it's not enough, I'll build a bigger bank.


----------



## Jamie EV (Oct 3, 2012)

I was thinking of using a long copper pipe as heat sink and common mounting point for all of them and then link to a heavy gauge wire by resistor for the other contact and then use equal lengths of heavy wire for the third pin....all driven by a purpose build gate driver. 

Yes I know there will be heat losses but the thing is it's my first controller, I'm not looking for a road rocket and the motor I have in mind won't go beyond 96 volts...IF THAT.

Current will be the limiting factor in the car's speed for sure. On the bright side, If I create a switching "module" and it's not enough, I'm tempted to build an identical copy of the first one and double the amps...or at least increase them. 

I was thinking of housing it in a large vented PVC pipe with twin cpu case fans on either side. I've seen a few home made jobs with a large common heat sink and I reckon I could do that. I'm really quite stoked. 

I still need a good circuit for a gate driver now. Anyone know where to steal, er I mean obtain such a thing?


----------



## PStechPaul (May 1, 2012)

The MOSFET driver I recommend is:
http://www.ebay.com/itm/UCC27321-Fast-Gate-Driver-for-IGBT-MOSFET-9A-Invert-/170632933298

You might be able to get a free sample from TI:
http://www.ti.com/product/ucc27321

For a PWM controller a good device (also maybe free sample) is:
http://www.ti.com/product/uc3524

Another popular device often found in switching supplies is:
http://www.ti.com/product/TL494

But I would suggest using a microcontroller such as:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012134

You can download an application note that describes a low cost brushed motor control, including scheatics and source code. The PIC16F684 is only about $1.00 and has four PWM outputs, ADCs, comparator, and other useful peripherals. You can get a PICkit3 for about $30 which will program it and also do in-circuit debugging. If you are serious about making your own controller, you will need to consider how to sense throttle position as well as battery voltage and current and the motor current. You will need a current sensor and a fast overcurrent shutdown in case of short circuit or locked rotor condition.

I think it's great that you are willing to put the effort into making prototypes and learning by experience, but try to make use of the many good tutorials and video presentations on motors and control theory and real-life demonstrations. As you go up in power you will need to be more careful. There are videos on youtube showing what can happen when motors are purposely overloaded. So, safety first, and expect to blow up a few components before you have success. The more time you spend ahead of time to understand the principles, the fewer fireworks you will have. I still make mistakes, too. Here is one:


----------



## Siwastaja (Aug 1, 2012)

A cheap source for rather high-voltage MOSFETs are PC power supplies; that is, if you can find a disposal site / etc. where you can get them for free.

They are similar to what you linked. OTOH, desoldering them can be PITA, and it is possible that some are broken. Mostly, however, these FETs are alright.

Of course, when paralleling MOSFETs, it would be nice to have them identical.

Then, we have the bottom-drive only vs. using a half bridge vs. using a full (H) bridge.

To be fair, I have to say that I have not experimented with high-power bottom drive only DC drives, so I can't really speak of experience here. I have gone up to a few hundred watts with this kind of 555 --- no special gate driver --- bottom side only FET controller. And I have used low PWM frequencies to reduce switching losses.

In an AC drive (this is what I'm currently doing), there is a push-pull stage for every phase anyway, and every leg is connected firmly to either ground or V+ all the time, unlike in the simplest "bottom drive only" you are now experimenting where you let the motor "loose" when you drive the FET off.

555 in your schematic should not be considered a "FET driver" per se, a "PWM generator" or "PWM synthesizer" would be a better description. A "driver" is just a powerful amplifier, and often optoisolated, which really helps reducing possibly destructive voltage spikes, _even_ if you had a common ground point. So, in theory, you could use a 555 to synthesize the PWM even for a megawatt train .

Of course it has been pointed out that a "duty cycle" control as a "gas pedal" is not as good as a real torque control. However, I think it is _usable_, at least for a poor man's kamikaze controller. I think the real challenge is avoiding voltage spikes. An oscilloscope and careful ramping up current and voltage while monitoring the voltages is great here, as you can experiment with snubbers, protection, gate drive etc. _before_ breaking things.

Did you already include gate clamping? This is simply two fast (preferably schottky) diodes from gate to Vcc and Ground, so that if in any point of time Gate gets higher in voltage than Vcc, the excess flows there, or if it gets more negative than Ground, the excess flows there.


----------



## Jamie EV (Oct 3, 2012)

I have no idea what you mean by bottom drive only. 

Yes my oscilloscop would come in handy for sure...I was having trouble getting a cl;ear reading from it. It might be toast.


----------



## Jamie EV (Oct 3, 2012)

I was just at the "makers fAIR" and someone was demonstrating an arduino. This seems like an ideal control circuit for an ev controller. It has a built in PWM as well as a number of other inputs and outputs. You could conceivably program high pedal lock-out, over-current shutdown and all sorts of other features....cruise control anyone? 

If only I was good at programming...


----------



## PStechPaul (May 1, 2012)

The Arduino is very popular among hobbyists for robotics and various projects. I started using Microchip PICs about ten years ago when the Arduino was not yet available. So I have a bias toward Microchip products. The concepts for both are the same, but assembly code and peripherals differ. I'd be able to help if you used a PIC, but for the Arduino, not so much. 

It is pretty much necessary to get some experience with micros if you are serious about making a practical and full featured motor control for an EV. And once you start getting used to them, they are rather fun!


----------



## Jamie EV (Oct 3, 2012)

Well I can think of lots of tasks for the Arduino...EV and otherwise.


----------



## Jamie EV (Oct 3, 2012)

In the interests of doing a good job on the PWM, I looked for a driver on eBay:


http://www.ebay.ca/itm/DRV590-1-2A-...ultDomain_0&hash=item2a241364b5#ht_2964wt_810


Is this a good fit regarding driving my mosfets? (do I still need a gate between it and them?) Again, sorry if my questions are dumb.


----------



## Jamie EV (Oct 3, 2012)

Here's an interesting basic electronics lesson for those like me who needed to get down to basics.

http://www.robotroom.com/PWM.html


----------



## Jamie EV (Oct 3, 2012)

Ok so based on what I've learned so far, I can generate pwm pretty easily based on certain chip architecture but essentially it's the same thing. potentiometer with opposing diodes at the extreme ends and a capacitor on the main pin discharging and or charging the gate input/schmidt trigger input....this created a series of charge/discharge cycles the pulse width of the on position is controlled by the position of the pot.....then the output of the gate is used to drive a transistorized switch (WITH OPTO-ISOLATION) to control much large current....it then is protected by snubbers, flywheel diodes etc etc to prevent inductive load from rebounding upon the MOsfet switch causing it to pop like a pan of Jiffy Pop popcorn....

Am I basically correct so far? 

So my question is, why don't I create a basic PWM with any old gate, clean the signal up with an inverter (on the same chip like in the example?) and then opto-isolate it, send it to a small (pre-amp) transistor that then drives the Mosfets which need the little transistor's ability to give current to all of the 20 some beasts I have purchased?

Is this plan flawed? I'm sure you'll tell me  

BTW, I appreciate the hand holding.


----------



## PStechPaul (May 1, 2012)

Jamie EV said:


> In the interests of doing a good job on the PWM, I looked for a driver on eBay:
> 
> 
> http://www.ebay.ca/itm/DRV590-1-2A-...ultDomain_0&hash=item2a241364b5#ht_2964wt_810
> ...


No, that is a specialized PWM driver for TEC modules. See data sheet:
http://www.ti.com/lit/ds/symlink/drv590.pdf

If you want to use the Arduino, get the "motor shield" (about $25) to learn some of the basics:
http://www.arduino.cc/en/Main/ArduinoMotorShieldR3

I would suggest one of the Microchip motor control development kits:
http://www.mouser.com/ProductDetail/Microchip-Technology/TDGL007/?qs=sGAEpiMZZMtVFuKNr6IGvh0cBif%252b4%2fLn

http://ww1.microchip.com/downloads/en/DeviceDoc/70594C.pdf

http://www.futureelectronics.com/en.../8-bit-eval-board/Pages/5541453-DM163029.aspx

You will need to invest in a few more tools, and the kits are about $120.

Here is another development tool from ST micro for about $90 that might be good:
http://www.mouser.com/ds/1/389/CD00292276-32292.pdf

There used to be some much less expensive motor control development kits, but they seem to be no longer available. However, it's fairly easy to build a simple PWM control.

You might also get one of the cheap DC PWM controls now available on eBay: http://www.ebay.com/itm/12V-48V-30A...476?pt=LH_DefaultDomain_0&hash=item3ccb13d59c Not bad for $20 including shipping.

Or you could find a junk treadmill which may have a 2-3 HP DC motor and controller. Many on eBay and Craigslist.


----------



## Jamie EV (Oct 3, 2012)

http://www.ebay.com/itm/12V-48V-30A...476?pt=LH_DefaultDomain_0&hash=item3ccb13d59c

Wouldn't the one above be overkill? Would I need to do anything to it's output so that it didn't cook my mosFet inputs?

I agree 20 bucks is a decent price. I guess you'd have to look at it's waveform through the pot range to know if it was doing a good job, eh?


----------



## PStechPaul (May 1, 2012)

That's actually a complete motor control, and not a MOSFET or IGBT driver. Its output should drive high power modules, but that's not what it's designed for. It jus seems like a good start so you can see how it is built and use it for small motors. 

If you are serious about building a vehicular motor control I suggest getting started with microcontrollers. Here is a good assortment of kits, including a PWM motor control and various Arduino projects:
http://www.jameco.com/webapp/wcs/st...tegoryName=Education & Hobby Kits&category=70

A good series wound small motor to experiment with ($8) is:
http://www.herbach.com/Merchant2/me...AR&Product_Code=TM01MTR4476&Category_Code=MTR

You can get an oscilloscope for under $100:
http://www.ebay.com/itm/PC-USB-Digi...51405?pt=BI_Oscilloscopes&hash=item20cba39f0d
http://www.ebay.com/itm/ARM-DSO201-...53534?pt=BI_Oscilloscopes&hash=item1e72dc371e


----------



## Vehikelfranz (Feb 13, 2012)

I had built a quite powerful controller based on a Atmega 88
and a 1200V 420A IGBT these days and it works really fine.
You can watch it in my blog 
(in german language, as i am from there, but don't hesitate to 
"talk" english with me ;-) )

http://vehikelfranz.blogspot.com/

You will find the complete Program there.
(not the final version,i am still working on it)

If You are a real beginner in programming,
I recommend programming it in BASCOM,
that's easier for beginners although arduino is 
also quite easy and rather similar to C.
Arduino boards can also be programmed with BASCOM

As driver i used a TC4451 
(have also a look on TC 4452 and TC4431 / TC4432 too)

The 4451 is strong enough for big IGBTs

If You want to use "analog" PWM, i recommend using a TL494
There are a lot of examples for using the TL494 out there 
in the WWW

go on and have fun!
Franz


----------



## Jamie EV (Oct 3, 2012)

Vehikelfranz said:


> I had built a quite powerful controller based on a Atmega 88
> and a 1200V 420A IGBT these days and it works really fine.
> You can watch it in my blog
> (in german language, as i am from there, but don't hesitate to
> ...


I will try 

Here's a schematic of a tl494 circuit for this... 
http://www.electronica.mk/all_artic...Control/60A Motor Speed Control Schematic.png


----------



## Jamie EV (Oct 3, 2012)

TL494I seems to have a broader temperature tolerance (I'm in Canada).-40-85C


----------



## PStechPaul (May 1, 2012)

I'm not too sure about that schematic. The feedback pin 3 is left open and the PWM seems to be controlled with the deadband pin 4. I found another circuit that may be better:

http://www.eleccircuit.com/pwm-control-speed-motor-12v-by-tl494/

and the following has some information about the TL494 as well as details of modified sine wave and true sine wave inverters, as an interesting project which includes parts list and PCB layout:

http://www.wpi.edu/Pubs/E-project/A...-190851/unrestricted/PWM_Techniques_final.pdf


----------



## Vehikelfranz (Feb 13, 2012)

Wow! The second document is a giant one!
almost all You should know about this theme........

But, if you will have only a little bit of experience in
programming some day, You surely will love some Atmaga / ATtiny
much more for this purpose


----------



## alwina (Oct 22, 2012)

Hi There, 
I just got my Adruino Board and started to play a little with it. I have some java skills whereas i never got in touch with C!

So now i started my first "project": 
I just want to fade an LED using PWM. I know that Port 9-11 can be used for that by taking the analogWrite() Methode, but i want to fade slower. With only 254 steps, slow fading looks quite jerky. So i built an PWM program which works finde, but the problem is to merge into a Fade.

I was wondering how to use "time" instead of mere operations and i remembered that there is a "millis" variable that might be useful..
So this is the code; which compiles but works without any visible result.
Code:

// LED Fade realized with PWM
#define LED 9
int STEPS = 1000;
int time = 10; //ms
void setup(){
pinMode(LED, OUTPUT);
}

void loop(){
for (int j = 0;j<=STEPS;j++){
long millis_read = (long)millis;
while ((long)millis-millis_read < time){
for (int i=0;i<=STEPS;i++){
if (i<j){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
} 
}
} 
}


----------



## Vehikelfranz (Feb 13, 2012)

@ Alwina:
Sorry, i dont have enough experience to help You with arduino.
but, do you really work with the hardware-PWM ?
Dont generate PWM by switching a pin on an off but by giving a number
( 0 - 255 ) to the hardware PWM. Maybe there is also a
9bit or even 10bit PWM available, this depends on the 
chip You have.

@ Jamie EV : 
one part i forgot to mention is the 6N137 optocoupler.
it has a ttl-output, so there is no need for any resistor or so
at the output and You can drive a TC4451 or similar without
any additional hardware. then You can drive even big IGBT
with the TC4451 with only a ca. 10R resitor in series
between TC 44XX and the IGBT. (ok, there should also be a
resistor parallel to the input of the IGBT and a suppressor-diode
for some safety) For supplying the TC4451 and driving the IGBT,You 
dont need a lot of power, but it must be very stable against 
those little peaks when switching the IGBT. Add a few GOOD
plastic-capacitors to the output of the DC-DC-Converter that
drives the IGBT (or the Mosfet power-stage)


----------

