MOSFET chopper controlled by 8051

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
After searching every shop in the market...I found only one shop with two pieces of IR2121 left...:D I was very lucky to say the least...anyways...I'm pretty happy that I have one...but I have to say...these driver ICs are certainly expensive.(it costs Rs. 165, which is about 3$):( I'll have my circuit ready within a day...will let you know whether it works or not. :D
BTW...I found that only low side drivers cost more than high and low side drivers. Why is it so? Shouldn't only low side drivers be less complicated?
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
I will need to use analog sensors later in this circuit...so I will have to shift to other micro-controllers eventually.:D If I use an ATmega16, can I use the high and low side driver IR2111? If not, could you suggest any other micro-controller that would make things easier for me?
 

JohnInTX

Joined Jun 26, 2012
4,787
$3 is what IR says 1000/pc. pricing should be..

The IRS44273 is a cheaper device which might work. It lacks some features that may or may not be necessary in your application.

Since you've spent your money, get the circuit working and the 8051 code running for one channel. Once you do that, you'll have a known-working testbed to try other parts.

Going to ATmega or any other uC will present the same issues that you have with the 8051 since the voltages are the same. Both of these MOSFET drivers should work but you'll need to read the datasheets then try them to be sure.

Sounds like you are on the right track, though!
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
I have made a new schematic based on IR2121. I have a few questions regarding this:
1. Will this circuit work at all?:rolleyes:
2. If yes, then what should be the values of capacitance Ce, resistance Rs and the resistance between output of driver and gate? Please don't tell me the exact values. Instead, please teach me how to calculate these values(provided I would understand :D).
3. I don't want to use the current sensing feature of this driver since this would reduce efficiency and the voltage applied across my motor as my MOSFET is not a hex-sense MOSFET. So if I short pins 5 and 6, wouldn't it turn off this feature?(I'm saying this because the voltage applied across pins CS and Vs should then become zero and should never cross the threshold value. Am i correct?)
Please help me with this.
EDIT: I'm sorry...it was rather careless of me...only pins 8 and 5 are connected by a capacitor(pin6 and pin7 are not attached to that wire)
 

Attachments

Last edited:

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
BTW...I have also noticed that if I connect an 8051 directly to a mosfet gate(with source and micro-controller sharing same ground), the output pin connected with the gate gets damaged(doesn't follow the programming and stays high always). Why does this happen? Or is it something else that is messing with my micro-controller?
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
Refer to the IR2121 Datasheet and AN-1014 (links above).

Vcc is the 12V motor voltage, not the logic level voltage. It probably should be called something else but that's why we get paid the big bucks... The IR2121 has internal level shifting to allow logic levels regardless of Vcc.

You've mixed some application circuits on your sketch. For the 2121, you don't need the 6ohm R and the 1M R would be optional.

The 2121 provides cycle by cycle current limiting (by shutting down the gate drive) set by Rcs. When the current is high enough to generate 230mV (typical) at pin 6, the shutdown circuit is activated and 100uA current is switched on to charge Ce. When the voltage on Ce reaches 1.8V (typ) the gate drive is shut down. The value of Ce determines the delay to avoid nuisance tripping. The ERR pin 3 has other functions that are described in the app note.

If you don't need current limiting, you should be able to connect pin 6 CS to ground so that it never trips. If you decide to add it, you'll have to select Rcs and Ce to fit your current limit and timing needs. OTOH if you don't require current limiting at all, consider the IRS44273 noted in a previous post. Simpler and cheaper if you can get it.

The two 10uF caps are somewhat redundant since pins 1 and 8 are connected internally but I'd probably leave both. I would also consider adding a 1uF tantalum and .1uf ceramic to each pin for better decoupling.

Circuit layout will be important. Section 4 of AN1014 has some tips and suggests looking at Design Tip 97-3.

Pay attention to your power distribution. Everything associated with the MOSFET/motor drive should have its own power AND ground that is separate from the 8051 power/ground. The two grounds should connect at a single point as close to the DC source as possible. Use heavy decoupling there. The key thought is that you don't want your 8051 to share the noisy power lines supplying the motor.

The attached sketch is where I would start. Hook it up and use a jumper wire to connect the input to ground (motor off) and +5V (motor should run). Debug that and then connect to the 8051.

Have fun!
 

Attachments

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
The DC supply I'm using is a 11.1 V Lipo battery. The actual volatge of the battery(when its fully charged) is about 11.4 V. Since this is a little less than 12 V, would it pose a problem?
Could you explain how the micro-controller circuit experiences interference because of sharing the same ground? Only the grounds are connected, so why would any current flow from the motor/driver circuit to MCU circuit? :confused:
And how should I decouple the two circuits? By adding capacitors? How should I add them? If I connect capacitors between the ground of MCU circuit and the motor/driver circuit, wouldn't the two grounds get disconnected?:confused::confused:
P.S.: This forum really needs a SUPER-thanks button...:D
 
Last edited:

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
BTW...I looked up the datasheet for IR44273...If this is available in the market...I'm going to use it...because four IR2121 s will make my circuit pretty costly. Later, if I use hexsense MOSFETs, I would use IR2121.
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
Its working great!!! :D:D:D:D
The 8051 has been programmed to slowly increase the pin voltage from 0 to Vcc when pin1 and pin2 is high and low respectively and reverse when pin1 is low and pin2 is high.
I have only one final question...I've noticed that after 8051 output and consequently gate voltage reduces to zero, a very soft noise can be heard from the motor(even though its not spinning anymore). What is causing this noise?
 

JohnInTX

Joined Jun 26, 2012
4,787
The DC supply I'm using is a 11.1 V Lipo battery. The actual volatge of the battery(when its fully charged) is about 11.4 V. Since this is a little less than 12 V, would it pose a problem?
I don't think so.

Could you explain how the micro-controller circuit experiences interference because of sharing the same ground? Only the grounds are connected, so why would any current flow from the motor/driver circuit to MCU circuit? :confused:
And how should I decouple the two circuits? By adding capacitors? How should I add them? If I connect capacitors between the ground of MCU circuit and the motor/driver circuit, wouldn't the two grounds get disconnected?
The grounds may only be connected at DC what about the high frequency switching currents? Don't forget that your 5V power eventually comes from the same battery as the motor.
Microchip's AN-797 and the Analog Interface Guide cover some of your questions. The AIG is concerned with separating digital and analog signals for data acquisition, the basics are the same. See the section on 'Mixed Signal Layout'. When reading the document, call the 8051 the 'analog' (noise-sensitive) circuit and the motor/driver the 'digital' (noisy) circuit.

AN-797 should answer your decoupling questions as well.

I have only one final question...I've noticed that after 8051 output and consequently gate voltage reduces to zero, a very soft noise can be heard from the motor(even though its not spinning anymore). What is causing this noise?
It sounds like you have reduced the duty cycle to a small enough value to stop the motor but its still pulsing the motor. Change the firmware to completely stop the PWM output when the duty cycle drops below what it takes to run the motor. Saves power too.
 
Last edited:

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
actually i was wrong...the motor is rotating at the lowest voltage...so slowly...that it seems stationary. and your right about the voltage not being completely zero. it actually reads 0.10 V. i will change the program to cut it off earlier then.
but regarding my other question about the interference...the MCU is being supplied by a different source(four AA batteries that add upto 6 V)...would there still be any interference?
 

JohnInTX

Joined Jun 26, 2012
4,787
the MCU is being supplied by a different source(four AA batteries that add upto 6 V)...would there still be any interference?
If you read through the previous links you'll understand that yes, there is lots of room for interference. But if you indeed have 2 different battery sources (12V and 5-6V) do it like this:
Wire each like they are completely separate i.e. the MOSFET and driver from its source with good decoupling, heavy wiring, short runs back to the battery etc. The goals are don't drop voltage at high currents due to long/small wires, provide decoupling at the MOSFET driver as covered here and the references and keep the current carrying wires physically separated from the 8051 stuff. If you can, lightly twist the power wires together.

Wire the 8051 with similar goals: good decoupling close to the package, adequate wire size etc.

Now, you need 2 connections between the two sections. First the common ground - needed because the logic input of the MOSFET driver has to be referenced to the 8051 ground. This should be a good sized wire connected between the two (-) battery terminals. If you sketch it out and trace the current, you should find NO common ground current on shared conductors between the two sections. For example, if you connected the 8051 ground to the GND on the MOSFET driver, the 8051 ground current would share all of the noise/transients generated by the motor as its current returned to ground. By connecting at one, heavily decoupled point at the power sources common ground, the 8051 does not have to experience the joy of high power/high frequency spikes on its ground. It will thank you for that.

The only other connection is the 8051 PWM output to the logic input of the MOSFET driver. With the proper grounding discussed, this should turn out to be a nice, quiet line. Note, however, that now you DO have a complete circuit between the two devices. If you didn't have separate grounds, nice and quiet, this circuit would share in the noise - not what you want in a PWM..

Sometimes, even with good power / layouts, noise can be a problem. In these cases opto-coupling the logic input will isolate the noise. In extreme cases, fully isolated logic AND power supplies ($$$) is required. You shouldn't have to go that far if you get the wiring right.

Onward!
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
wow...i think its only possible to learn these things by implementing a circuit like this...rather than just going through books...
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
I have another question...Since, as you have stated earlier, that a mosfet is voltage controlled device, its gate-source current should be zero. I have tried measuring the gate source current drawn by the MOSFET. The meter shows zero. But then, why does IR2121 have a 2A output? Does that mean it is used for MOSFETs with higher ratings? Also, can i use one IR2121 to drive four IRFZ44s simultaneously?
To me, the functioning of IR2121 looks quite similar to a DC motor driver IC L293D. Can L293D be used to drive this MOSFET?
The circuit is working on a perfboard. The MCU also seems to be working well.
 

JohnInTX

Joined Jun 26, 2012
4,787
I have another question...Since, as you have stated earlier, that a mosfet is voltage controlled device, its gate-source current should be zero. I have tried measuring the gate source current drawn by the MOSFET. The meter shows zero. But then, why does IR2121 have a 2A output? Does that mean it is used for MOSFETs with higher ratings?
Yes and no. Its true that the MOSFET has no gate current when in a stable condition but the gate - channel looks like a capacitor that you charge and discharge to Vgs ON/OFF to switch the MOSFET on and off. Changing the voltage level on the gate 'capacitor' requires that electrons move (current) so when changing Vgs, some current has to flow to charge/discharge this capacitor. How much current you need depends on how fast you want the change to happen.

With power MOSFETs you want them either off or on with low Rds to keep the power dissipation low. That implies fast switching between off and fully on. Slow switching yields high currents across a high Rds and high power dissipation - maybe enough to fry the MOSFET. So.. the key to switching the MOSFET is a gate drive circuit that not only swings voltage fast but has enough current to charge/discharge the gate capacitance fast as well. That's why evan a modest MOSFET driver switches very fast and has a large current capacity - to minimize charge/discharge time of that gate capacitance.

Also, can i use one IR2121 to drive four IRFZ44s simultaneously?
I wouldn't. 1)you would lose the current limit function (since its designed to measure current in one circuit) and 2)it would increase your switching time by a factor of 4. Could you live with that? Only some number crunching and tests would tell. Plus you would lose individual control of the motors.

To me, the functioning of IR2121 looks quite similar to a DC motor driver IC L293D. Can L293D be used to drive this MOSFET?
Not really. Its switching time is about 10x longer than the IR2121. Its meant for direct driving DC motors.

Sounds like you are making progress!
 

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
Yup...somehow i had the feeling that L293 doesnt have what it takes...however i'm using one IR2121 just for testing...i will eventually use a single IR2121 for every motor...
 

JohnInTX

Joined Jun 26, 2012
4,787
Yup...somehow i had the feeling that L293 doesnt have what it takes...however i'm using one IR2121 just for testing...i will eventually use a single IR2121 for every motor...
If I might insert some advice here: A good way to approach a project like this, especially if it means a lot of new things (MOSFET drivers, PWM firmware etc) is to get the prototype up first, using the simplest approach possible, without worrying about potential alternative approaches e.g. If you get one driver working, do the firmware and make sure it works OK. Then do the other stuff, power supply, user interface etc. Try to do as much a possible with one driver. As you tweak and modify it, you don't have to tweak all 4.

If you think that you may want to try other driver configurations, try when you have the basic 1 channel done. You'll have known working firmware and hardware to compare performance to. If you decide you don't need current limiting, you might go to that cheaper IRxxxx we found in earlier posts or try from another manufacturer.

Once you have one channel fully under control, make the other 3 channels and go from there. If you have problems, at least you'll know that everything else is working (because you've tested it).

When you have the working prototype, you can go back and examine where it might be improved (drivers, better user interface etc.) Whatever you decide to do, you'll always have a working system to go back to as a base.

Sounds like you are doing great!

PS. Semester starts tomorrow.. putting new strings on the Strat tonight!
 
Last edited:

Thread Starter

Anirban Raha

Joined Dec 4, 2013
70
yeah...its working for a single motor...i have tried it on a perf board too...everything seems to be working well...i'm going wireless...so i hav also bought a RF module...but i'm going to use it later...for now i want to try out allfour motors together...if i succeed...i will try out the final thing...controlling four motors seperately...using four microcontrollers(i cant think of any other way because a single MCU cant control two motors at the same time because of my programming). What are your thoughts on this? and also, i have decided that i would use the 12V Lipo battery to power everything...would that be a wise decision from interference point of view? obviously i would need to use resistors to drop the voltage across the microcontroller...but wouldnt that be lossy?
P.S. nothing feels better than sliding your fingers on the new strings of a strat!!!
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
Rich (BB code):
P.S. nothing feels better than sliding your fingers on the new strings of a strat!!!
Well.. almost nothing :)

(i cant think of any other way because a single MCU cant control two motors at the same time because of my programming).
Depending on the code and the chip performance and the frequency / resolution of the PWMs required, you might be able to generate 4 PWMs with one chip.
 
Top