Transistor output buffer for motor drive, fail! - Page 1
Forum section: electronics / projects

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 12:18:44 am
content: Hi!Being a newbe when it comes to electronics, but been programming for many years.I'm working on a motor controller from using a micro controller to use PWM and DDS to set the correct speed. The motor is an asynchronous 16V AC motor that is driven by 50 or 60Hz.Heres the problem. After reading a lot around the internet I designed a AVR micro controller that puts out a PWM signal into two opamp stages for filtering. Then that goes out to parallell connected transistors BC639 and BC640 to actually drive the motor.Here's the schematic, be prepared to be horrified!When hooking up my oscilloscope, I get a nice sine wave, both at the opamps and at the transistor output.But as soon as I try connecting the motor, or just hooking up a resistor, the output look like this, even at the second stage of the opamp! The first opamp happily presents a nice looking sine wave.I know I'm in way over my head on this one, so any pointers would be great.Just to make it complete, these are the things I tried.Hooking up the negative feedback to the transistor output. Same result.Adding a unity gain buffer between my last filter opamp and the transistor stage. No go. So I'm out of ideas. Obviously the negative part of the signal get into clipping, but I can't find where.

author: rs20
author_rank: Super Contributor
timestamp: November 02, 2015, 12:31:28 am
content: What "the second" stage? Please add names to the nodes in your circuit (like you already have with "NORMPHASE", and clearly state which plot corresponds to which node name using those clear, unambiguous names.Also, check your -15V rail. I suspect your -15V supply is collapsing.

author: moffy
author_rank: Super Contributor
timestamp: November 02, 2015, 12:32:46 am
content: It looks like you don't have a -15v supply for the BC640's or maybe one of the BE junctions for the BC640's is short circuit.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 12:40:40 am
content: I'm currently using a bench power supply during testing, but had the same problem with 7816 and 7916 regulators.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 12:42:16 am
content: Quote from: jackenhack on November 02, 2015, 12:40:40 amIf it was a short circuit, wouldn't it show up all the time?

author: moffy
author_rank: Super Contributor
timestamp: November 02, 2015, 12:46:01 am
content: Yeah, scrub the BE short circuit idea. It just looks like the BC640s are not connected, hence no current gain for the -ve half of the cycle.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 12:51:33 am
content: Quote from: moffy on November 02, 2015, 12:46:01 amThanks guys and girls for all the advice.I'm just curious why I get a nice sine wave when there is no load? Is it the opamp that drives and the transistors just kicks in under load? I'm going to check the f*cking Uni-T bench supply. Thankfully I'm getting a better one in a couple of weeks.

author: rs20
author_rank: Super Contributor
timestamp: November 02, 2015, 01:06:32 am
content: Quote from: jackenhack on November 02, 2015, 12:51:33 amWeird stuff happens when there's no load, current can leak through transistors in unusual ways. It's generally not productive to analyse why something works when you think it shouldn't; it gets you severely sidetracked.Quote from: jackenhack on November 02, 2015, 12:51:33 amYou don't need to go down the rabbit hole disconnecting and testing the power supply separately. Just connect the oscilloscope to the collectors of the PNP transistors (which, in your diagram, areshownas being connected to -15V), and check that there's a rock solid -15V there. If there's not, then there's your problem. If there is a solid -15V there, the base is at -15V, yet the emitter is clipped to 0V, then your transistors are broken/not PNPs/installed the wrong way around. If the base is not going below 0V, then your problem is further back.This should be a straightforward debugging job like that; follow the trouble around the board until you find the problem.

author: Ian.M
author_rank: Super Contributor
timestamp: November 02, 2015, 01:26:45 am
content: No load, all the transistors remain biassed off, and the OPAMP drives the output via R1 (1K).Under heavy load, you haven't allowed for the worst case minimum output current of the final OPAMP and the minimum HFE of the output transistors. To reach 500mA Ic per transistor, you may need as much as 20mA each, but the OPAMP may only be able to source/sink 10mA. Basically it needs more current gain between the OPAMP and the output transistors, and probably a base bias network to reduce the crossover distortion.You may also have another fault with the low side of the output stage. What's the resistance of the test load you have been using? Have you tried a larger resistor (e.g. 100R)?Edit: s/drain/gain/

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 02, 2015, 01:33:36 am
content: The fundamental design is flawed. A better way to do it is to just drive the output transistors with PWM and let the motor inductance do the filtering.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 01:35:16 am
content: Quote from: rs20 on November 02, 2015, 01:06:32 amIv'e checked the all the transistors and steady -15V on collectors, but the base gets the same signal with clipped bottom half of the sine wave, so I guess I have a problem earlier in the opamp/filter section. But if I remove the load (resistor to ground) from the output of the paralleled transistors, they get a nice sine wave again. Ugh!

author: rs20
author_rank: Super Contributor
timestamp: November 02, 2015, 02:48:32 am
content: Quote from: jackenhack on November 02, 2015, 01:35:16 amThat's not an "ugh" moment at all. Leave the load on there; and debug WHY the base is getting clipped. What is the value of the load resistor? Have you got the pinout of your PNP transistors correct? What is the Vbe breakdown voltage of your PNP transistors? Are they really BC640s? Do you have a transistor tester handy?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 02, 2015, 03:20:31 am
content: Hotlinks didn't work.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 09:38:54 am
content: Quote from: Ian.M on November 02, 2015, 01:26:45 amThanks for your help! I did remove one BC640 and one BC639 and now it can take a higher load (55 Ohm to ground) before going haywire. I'll continue my experiments tonight.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 09:43:33 am
content: Quote from: T3sl4co1l on November 02, 2015, 03:20:31 amThanks! Fixed.

author: Delta
author_rank: Super Contributor
timestamp: November 02, 2015, 10:11:07 am
content: I would say that your opamp can't sink enough current to drive those PNPs...Stick an emitter follower on there as a buffer...

author: fivefish
author_rank: Frequent Contributor
timestamp: November 02, 2015, 10:39:46 am
content: Add some driver transistors... in darlington configuration.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 11:19:37 am
content: I think you guys are on the right track. I'll do some current measurements tonight.Skickat från min iPhone med Tapatalk

author: Ian.M
author_rank: Super Contributor
timestamp: November 02, 2015, 12:53:14 pm
content: As has been mentioned earlier, driving motors with a linear amplifier is *STUPID* and wastes a lot of power. However if you must do it, lets do it right!Here's a possible design for a bipolar high current class B output stage.It uses a Darlington pair on the high side, a Sziklai pair on the low side, with a thermally coupled Vbe multiplier for bias. The output transistors can be just about any NPN high power transistors as long as they don't have internal bias resistors, and the sim uses 2N3055 because they are bad apart from their Ic rating! It should be quite happy driving a 10R load if adequately heatsinked output transistors rated at Ic>=2A are used. It needs about 3V headroom so you should be good for +/-12V output swing. The driver and bias transistors can be just about any jellybean >0.5W parts with Ic>=200mA.As shown it is driven by a x10 OPAMP stage, with the output stage in its feedback loop to further linearise it. The OPAMP is also chosen to be fairly generic, though a rail-to-rail one is preferred for more output swing. I certainly wouldn't use it for HiFi as it runs into nasty problems with the OPAMP slew rate limiting above about 1Khz. The output stage on its own is reasonably flat with little phase shift from DC to 20KhzStart with preset R3 set to zero and adjust for 10mA quiescent current with no input or load (9.4mV across the two output emitter resistors). Don't turn it up too far or you'll fry the output transistors. The bias transistors *MUST* be thermally coupled to the output transistor heatsink for stability - see note on schematic. If breadboarding it without a proper heatsink make sure Q6 is touching Q1's tab and Q5 is touching Q3's tab, and don't run it hard for very long! The bias bootstrap caps should be 25V rated electrolytics, top end +ve on the schematic.

author: Zero999
author_rank: Super Contributor
timestamp: November 02, 2015, 01:40:29 pm
content: I haven't seen the original circuit because I'm at work at the moment and the firewall blocks the pictures.Quote from: NiHaoMike on November 02, 2015, 01:33:36 amI agree. You need a class D output stage, rather than class B.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 04:51:18 pm
content: Well, as I said, I'm a newbie at electronics. I already have a motor controller for my vinyl record player. It broke down and I fixed it (burnt out diode). I started to experiment and realised that I could get much better precision and be able to adjust the speed using DDS. So I implemented it in software on a micro controller. Here's a picture of the motor controller I got the idea from. As you can see, it uses transistors as an output stage which I unskilfully copied. I just want to do the software and get my record player going at the correct speed, because this one is not adjustable.

author: Yansi
author_rank: Super Contributor
timestamp: November 02, 2015, 06:01:44 pm
content: Why on earth don't you drive the AC motor directly? All that filterpassing amplification powerstaging (without freewheeling diodes! fail right there!) seems quite unnecessary. Just put the PWM directly into it, the winding inductance will act as the current filter ("lowpass").Just measure the phase-to-phase inductance, calculate minimal/optimal working frequency and drive it with whatever waveform you can make with your MCU.Minimum suggested PWM frequency for (any) motor is like fmin= Us/ (4 * La* dI) where the Usis the supply voltage, Lais the load inductance and dI is the maximum permissible current ripple (peak-peak). dI should be less than 10% of nominal motor current, typically. (Note: The above mentioned formula is not so universal, but here it will get what you need.)If the motor is sinusoidal type, just generate the waveform based on the "DDS principle". A table of sine values and phase register pointing into the table. Each PWM period the phase register is incremented by a phase increment - proportional to the output frequency.With a single phase AC induction motor, it is easy. Just don't forget do lover the voltage proportionaly with the frequency. The magnetics will saturate otherwise.With three phase one, it is the same, only you find three values in the sine table based on the phase register. The other two phases are found by adding 120 an 240 degrees. To get a full voltage swing output betwenn phases, special modulation techniques have to be considered: Third harmonic injection (the easiest I think) or any other... The same rules for the voltage and frequency proportion.Yan

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 06:04:22 pm
content: Quote from: Yansi on November 02, 2015, 06:01:44 pmJust to make it clear, that's the image of a Pro-ject Motor Controller II. Not my design.

author: Ian.M
author_rank: Super Contributor
timestamp: November 02, 2015, 06:22:57 pm
content: Two good reasons *NOT* to use unfiltered PWM - old motors with suspect winding insulation, or mains voltage motors with an overwind for the deck's LT supply.Anything else gets a MOSFET H-bridge PWMed at >25KHz (to keep it out of the audio range)For this application, I'd probably start with a hobby RC BLDC controller that has open source firmware and hack on that till it does what I need.

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 06:34:47 pm
content: Quote from: Yansi on November 02, 2015, 06:01:44 pmI already have the PWM software using DDS up and running, with LCD screen and rotary encoder for adjusting speed and changing between 33 1/3 or 45RPMs. All I need is a smooth 16 volt sine wave to drive the motor for the lowest vibration. All vinyl record motor controllers for asynchronous AC motors builds up an analog sine wave signal. Makes me wonder if that's the right way to do it. Stuff like sending in unfiltered PWM and other solutions might be fine for a motor, but I don't want to burn or wear out my motor or get rumble when listening to music. That kinda goes against it's purpose.

author: Delta
author_rank: Super Contributor
timestamp: November 02, 2015, 06:43:22 pm
content: I think for a low-power application like this, there's nothing wrong with using a liner amp to drive an AC motor.Instead of your discrete output stage, why not just use a power opamp, like one of the many audio amp IC like the LM3886?

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 07:35:51 pm
content: Quote from: Delta on November 02, 2015, 06:43:22 pmThat's a rather interesting idea. Especially because I got a tube of those. The motor needs around 2 watts so it may be a bit overkill.

author: Delta
author_rank: Super Contributor
timestamp: November 02, 2015, 07:37:14 pm
content: Quote from: jackenhack on November 02, 2015, 07:35:51 pmOverkill schmoverkill!At least it won't even need a heatsink!

author: jackenhack
author_rank: Contributor
timestamp: November 02, 2015, 07:38:48 pm
content: And it will impress the girls! (in my dreams)

author: Delta
author_rank: Super Contributor
timestamp: November 02, 2015, 07:44:16 pm
content: One possible "gotcha" there - some of those ICsdo notlike being operated at unity gain, and the datasheet specs a minimum gain, so you may need to reduce the gain of your filtering stages or whack in an attenuator.

author: Yansi
author_rank: Super Contributor
timestamp: November 04, 2015, 02:01:53 am
content: The usual motor drives in these things are made by people who know near to nothing about PWM, switching and motor control. Hence the analog sinewave stuff. I think there is no real issue with powering the motor with PWM.If the PWM will be kept outside of audible range, I see no problems at all. If you are still afraid, then use LC lowpass filters directly on the controller board. Just like a small three-output class D amplifier. (Personaly, I'd recommend really using the LC filters on the controller board.)I cant get the note about crusty insulation of the winding. The PWM wont stress it much more than the analog AC. Only adds some insignificant current through the parasitic capacitances of the windings.You can drve the small motor with for example a teeny tiny261 from atmel. Costs close to nothing, has a 3ph. timer. Good enought for this application.Note: You absolutely cannot use BLDC motor controllers for AC induction motors.And it doesn't matter if they are opensource.

author: jackenhack
author_rank: Contributor
timestamp: November 04, 2015, 02:14:10 am
content: Quote from: Yansi on November 04, 2015, 02:01:53 amI've already put the PWM signal through a 3rd order Butterworth active filter (see schematic). I found the problem of the output buffer. Breadboarding the solution tomorrow for testing and I should be done. I'll post the final schematic just for posterity if everything works out. The motor is an asynchronous AC motor, so it needs -8.5 Vrms to +8.5Vrms sine wave so I might as well send it the nice filtered wave that I already have at those levels.Thanks for all the advice, I guess that the real learning starts when stuff doesn't work.

author: Yansi
author_rank: Super Contributor
timestamp: November 04, 2015, 02:38:27 am
content: The butty filter is unnecessary bunch of parts here, so is the output linear power stage. Too complicated for "nothing" and if still lacking antiparallel diodes to the output trannies, it is made wrong and can/will blow up. Especially with more inductive loads.Put the damn PWM into pair of fets, then a simple LC lowpass, done.

author: jackenhack
author_rank: Contributor
timestamp: November 04, 2015, 02:53:52 am
content: Quote from: Yansi on November 04, 2015, 02:38:27 amI got it working, except I learned about cross over distortion today, with output looking like this:So two diodes are part of the solution.I'll post pictures of the magic smoke when I'm done testing tomorrow.

author: Ian.M
author_rank: Super Contributor
timestamp: November 04, 2015, 03:09:44 am
content: The insulation issue for drect PWM drive is due to switching spikes. SeeWhen Should Inverter-Duty Motors Be Specified?A low voltage motor shouldn't have a problem with the waveforms, unless its near-dead anyway.

author: rs20
author_rank: Super Contributor
timestamp: November 04, 2015, 03:33:26 am
content: Quote from: jackenhack on November 04, 2015, 02:53:52 amTwo diodes ameliorate the issue somewhat; but the real problem is that the output stage is not part of any feedback loop, so the opamp can't compensate. If you connect the inverting input of IC1B to NORMMOTOR instead of NORMPHASE, you'll find that the crossover distortion disappears (or at least, it becomes a little glitch during zero crossing, rather than the entire top half of the waveform being shifted down).

author: jackenhack
author_rank: Contributor
timestamp: November 04, 2015, 08:35:12 am
content: Quote from: rs20 on November 04, 2015, 03:33:26 amJup! Already done that. Also need to remove DC after the filter before going into the transistors.