4017 diodes and pnp transistors

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Hi All,

I am working on a project which I can tell you about if you need me to... but my question is about a PNP transistor.

I am using a 4017 decade counter which counts up to 6 and then starts again. I am combining the outputs using diodes, if I then connect the base of a PNP transistor will it still work? or do the diodes effectively make the base open circuit rather than 0v?

I hope this makes sense and sorry if its a stupid question!

Cheers
Shaun
 

SgtWookie

Joined Jul 17, 2007
22,230
Can you post a schematic of what you're considering doing?

Keep in mind that the 4017 can't source or sink more than about 0.5mA. That's not much! If your Vdd is 5v, you'll need to use a 10k resistor to limit the base current to a safe level.
 

Audioguru

Joined Dec 20, 2007
11,248
The outputs of a CD4017 go high one-at-a-time. If you combine them with diodes then the output of the diodes will be low or high all the time.

The base of a PNP transistor needs a resistor to ground to turn on. The output high voltage from an output of a CD4017 can turn on an NPN transistor.
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Thanks AudioGuru and SgtWookie for your quick responses.

I will draw up a schematic and post it for you.

I'm glad you pointed out that the 4017 can sink/source 0.5mA as I thought it was 5mA! and yes my supply is 5v.

I am not combining all outputs together, but combining some of them together to produce 3 outputs. As you'll see from my schematic...

the aim is for a 3 phase inverter - I am using a 555 timer for the clock pulse to the 4017.

Cheers
Shaun
 

SgtWookie

Joined Jul 17, 2007
22,230
I think you'll find a 3-phase inverter a bit easier to construct by using one CMOS IC, along with a few resistors and capacitors.

Have a look at the attached.

The 4093 is preferred, as it has Schmitt inputs.

These two schematics are "in the ballpark" for a 400Hz 3-phase inverter. More "tweaking" would be required (with an estimated load) in order to come up with a really decent approximation.

More accurate timing would be achieved using a MCU (microcontroller) like a PIC with a crystal-controlled clock. This will be important if you are planning on using N and P channel MOSFETS for switching the power. You would not want to have both high and low side of an H-bridge on simultaneously, and it usually takes a different amount of time to turn a power MOSFET ON than it does to turn it OFF. Trying to achieve such timing using analog means is problematic, particularly when temperature changes come into play.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
The datasheets from Texas Instruments show the output current of Cmos gates and inverters.
With only 5V for the supply, the output current is typically 4mA directly into the base of a transistor or 3.5mA directly into an LED.
With a 10V supply the output current is typically 16mA directly into the base of a transistor or directly into an LED.
 

SgtWookie

Joined Jul 17, 2007
22,230
I'm currently looking at National Semiconductor's datasheet for CD4017BM/CD4017BC Decade Counter/Divider with 10 Decoded Outputs and CD4022BM/CD4017BC Divide-by-8 Counter/Divider with 8 Decoded Outputs, dated March 1988.
Link: http://www.national.com/ds/CD/CD4017BC.pdf#page=1

Page 2 of this document, for Vdd of 5V:
Iol @25°C is 0.51mA (min) 0.88mA (typ)
Ioh @25°C is -0.2mA (min) -0.36mA (typ)
It appears that even my initial assertion of 0.5mA source/sink was overly optimistic.
I can't explain the difference between what Audioguru is reading in TI's documents vs what I'm reading in National's datasheet for the exact type of IC you're looking at using - except perhaps that this isn't an ordinary gate or buffer; it's a counter made up of flip-flops.

A "rule of thumb" for current limiting resistors on digital CMOS outputs is 10k Ohms, which @ 5v limits the current to 0.5mA.

This is further reinforced by examining the ULN2x04 line of Darlingtons, designed to be driven by CMOS IC's, which have 10k Ohm current limiting resistors on inputs.
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Thanks for the schematics - I'll have a look at the 4093 and what you have said and see if I can understand it. I hope you don't mind me coming back to ask any questions if I have any (I most likely will!).

I can see the problem you mention about the switching time on the H bridge, I hadn't considered that at all.
Its handy to know that there are darlingtons specifically designed for outputs on CMOS IC's.

Seeing as this is changing all my ideas, its probably a good idea to explain what I'm hoping to power with it:

I am building a petrol-electric 7.25" gauge train, using a 3.5hp lawnmower engine and a 24V 100A alternator to power a 750W 24V DC motor. The problem I face is fitting an electric starter for the engine under the bonnet and when I saw the project on this website about using one alternator as a generator and another as a 3-phase motor I wanted to experiment with using my alternator as a starter motor... I have two 12v 12Ah batteries on board connected in series - hence why I am attempting to build a 3 phase inverter.

It has been a steep learning curve but very enjoyable. Just so that you know my background, I have a degree in computing, but I am relatively new to electronics.

I hope what I am planning is not impossible to achieve... but as far as I can see, in theory, it should work.

Cheers
Shaun
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
SgtWookie,

A quick question - when you say about using an MCU such as a PIC... presumably you mean instead of a 4093? and programming it to make its outputs high at the correct point... these outputs could then be amplified with appropriate transistors.

Am I correct?

Cheers
Shaun
 

SgtWookie

Joined Jul 17, 2007
22,230
Very interesting project! I would be delighted to see photos of your progress. :)

I suggest that you strongly consider using power MOSFETs rather than Darlingtons, as the former can have extremely low Rds(on) and remarkable power handling capabilities compared to more conventional transistors and Darlingtons, along with gate impedances that are practically immeasurable. You'll deliver more power to your motor while dissipating less energy in waste heat. Additionally, MOSFETs are a snap to parallel in comparison to transistors/Darlingtons - you just connect them up. Most semiconductor devices conduct more as the temperature goes up (negative temperature coefficient) leading to increased heating and "thermal runaway". MOSFETs are somewhat unique in that they have a positive temperature coefficient. If you parallel a few of them, and one starts getting hot, it'll increase in resistance, and current flow will be reduced.

Since you're a bit-twiddler ;) you'll find it quite easy to program a microcontroller to provide precise on and off times for your MOSFETS - and you won't need a fancy interface, either.

Phase A goes high @ 0 degrees, B high @ 120 degrees, C high @ 240 degrees.
They each go low 180 degrees after they went high.
You basically just need to figure out how many degrees in advance you need to turn off the high side before turning on the low side, and vice versa.
 

SgtWookie

Joined Jul 17, 2007
22,230
SgtWookie,

A quick question - when you say about using an MCU such as a PIC... presumably you mean instead of a 4093? and programming it to make its outputs high at the correct point... these outputs could then be amplified with appropriate transistors.
Yes, precisely - sorry, I didn't see this earlier.

Using a single microcontroller would eliminate a lot of fiddling, and would give you precise control over the timing of the waveforms.
 

Audioguru

Joined Dec 20, 2007
11,248
Hi SgtWookie,
The low current from a Cmos output with a 5V supply is when its output low voltage is only 0.4V so it can drive an old LS TTL gate. Its output high current with a voltage drop of only 0.4V is even lower.
But if you allow more voltage across its output transistor then its typical output current is 4mA into the base of a transistor or 3.5V into an LED.

Texas Instruments shows the current graph on their datasheets but all 4000 series produced my all manufacturers are the same.
 

Attachments

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Hi SgtWookie,

I have attached a photo of the engine as it is currently... I have a website for my project which I haven't updated since last summer! but will update at some point: http://manners.homelinux.com

In looking into PIC MCUs I have discovered I can use one for controlling the servos on the engine too... which is neat! I think I'll go the PIC controller route as that appeals to my bit twiddler side ;)

I'll have to calculate the on/off timing depending upon the switching time of the MOSFETS I guess... as for at how many degrees... I thought each phase was 60 degrees out?

Cheers
Shaun
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Great site, Shaun! :)
Yes, you might look at the PIC30 and PIC33 series of MCUs; some of them have up to eight PWM channels which will likely come in extremely handy for you. They're also 16 bit, so you have plenty of horsepower. The multiple built-in timers are nice as well.

In 3-phase AC power, each phase is 120° out of phase with the other two phases.

Phase A starts off at 0° going high. At 180° it goes low.
Phase B goes high at 120°; 180° later at 300° it goes low.
Phase C goes high at 240°; 180 degrees later at 60° (420°-360°) it goes low.

Your challenge is to ensure that no matter the frequency, there is enough time allowed to turn OFF the high/low side of the H bridge before the low/high side is turned ON.

For example, I'm looking at the dsPIC33FJXXXMCX06/X08/X10 Motor Control Family Data Sheet.
Link: http://ww1.microchip.com/downloads/en/DeviceDoc/70287A.pdf
It has multiple timers which can be set to trigger interrupts. If you used three of the timers (say, 2, 3, and 4) to control how long until the next event was to take place in it's corresponding phase (A, B, or C respectively - or however you choose to assign them) - the MCU would jump right into your code to take the next course of action (turn off a high/low bridge and reset the respective timer to off wait-time, or turn on either the high or low side and set the respective timer to on-time)

You may wish to use PWM in concert with timers to control not only the frequency, but the power expended.

If you swap the timing of any two of the phases, your motor will run in reverse.

This link takes you to Microchip's site for a list of PIC MCU's that are primarily oriented towards power conversion and motor control:
http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=8093&mid=14&lang=en&pageId=75
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Glad you like the site :)

Ok I was being a bit dim about the 60 degree thing.. 3 phases across 360 is 120... the only thing I still don't get is why it is 270 for the 3rd phase? shouldn't that be 240?

Thanks for your suggestions for the dsPIC30 series, that does look ideal... the problem is, I ordered a programmer before I read your post!.. perhaps I should have looked into it more deeply before ordering (I was looking at the PIC16F88)... the programmer I ordered was http://www.quasarelectronics.com/3149.htm ... it doesn't list these chips in its supported list... is it just the software that determines the compatibility though? as in, can I use this programmer with different software that supports the dsPIC? I have had a search round for a programmer that says it supports it, but cant see one... nothing seems to be that clear cut! :confused:

Cheers
Shaun
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
A quick update, I have found an online seminar on the microchip website which uses the PIC18F4431 for motor control... it would appear it has timers and pwm and ADC... it is also supported by the programmer I have ordered...

edit: it can be found here... http://techtrain.microchip.com/webseminars/ArchivedDetail.aspx?Active=42 it discusses the 3 phase bridge and how they switches cannot be on simultaneously... as you have mentioned :D

Cheers
Shaun
 

SgtWookie

Joined Jul 17, 2007
22,230
Ok I was being a bit dim about the 60 degree thing.. 3 phases across 360 is 120... the only thing I still don't get is why it is 270 for the 3rd phase? shouldn't that be 240?
I also had some dimness going on! :rolleyes: Yes, you are correct; it should be 0°, 120° and 240°. I got my phase C confused with points on the compass!

Thanks for your suggestions for the dsPIC30 series, that does look ideal... the problem is, I ordered a programmer before I read your post!.. perhaps I should have looked into it more deeply before ordering (I was looking at the PIC16F88)... the programmer I ordered was http://www.quasarelectronics.com/3149.htm ... it doesn't list these chips in its supported list... is it just the software that determines the compatibility though? as in, can I use this programmer with different software that supports the dsPIC? I have had a search round for a programmer that says it supports it, but cant see one... nothing seems to be that clear cut! :confused:
Hmm - that would take a bit of digging on the Microchip site. There are a lot of supporting documents for various families/groups of their MCUs.

Seems like many folks build their own programmers. I've previously stumbled across websites detailing uJDM and JDM2, amongst others. The 12F, 16F and 18F have been extremely attractive to hobbiests due to the low procurement cost, MCU features, and relative ease of programming.

It's at the point where building logic circuits out of more than a few discrete logic IC components is no longer cost effective.

I'll take a look at what it takes to program the 30F/33F families.
 

SgtWookie

Joined Jul 17, 2007
22,230
A quick update, I have found an online seminar on the microchip website which uses the PIC18F4431 for motor control... it would appear it has timers and pwm and ADC... it is also supported by the programmer I have ordered...

edit: it can be found here... http://techtrain.microchip.com/webseminars/ArchivedDetail.aspx?Active=42 it discusses the 3 phase bridge and how they switches cannot be on simultaneously... as you have mentioned :D
Ahh, that is good stuff ;) I think once you start bit-fiddling with those little MCU's you'll be hooked :D
 

Thread Starter

ShaunManners

Joined Feb 16, 2008
72
Hi SgtWookie,

Just to let you know that I have solved my problems with my MCUs... I'm now planning how to physically build the inverter!

Thanks for all your help.

Cheers
Shaun
 
Top