Determine switching frequency of photocoupler

Excellent. A thousand words saved.

Understood.

The big problem with your current sense design is that you have not taken the ground path resistance and inductance into account so your sense amplifiers are amplifying that path voltage drop (in response to the large and fast currents through the bridges). First, you can greatly reduce the high frequency content of the current in these paths by giving it an alternate, low inductance path. This involves connecting a low internal series resistance and inductance capacitor directly between, for instance, the drains of Q1 and 2 and the bottom of R13, to act as a local power supply. You can enhance the effect of this capacitor (keep more of the high frequency current in this local loop) by adding some intentional impedance in the +24 volt line. A small inductance, for instance. You should also return the high current lines back to the 24 volt supply, and not pass these currents through any lines that include the signal path.

You also need to bypass the 5 volt supply right across the sense amplifiers, comparators and TTL logic chips.

But there will always be some instantaneous difference between different parts of the ground system. So you can make your sense amplifiers more noise immune by configuring them as subtracters and subtract the voltage at one end of the sense resistor from the voltage at the other end. Your sense amplifiers are programmed for a gain of

250. Add a similar pair of resistors to the non inverting inputs, with the 1k resistor going to the top end of the sense resistor and the 249k connected from the non inverting input to the local signal ground used by the comparators (which I see are referenced to ground at the moment, indicating a current trip of zero). then reconnect the 1k that is shown grounded to the grounded end of the sense resistor.

This implies that there are two connections to each end of these resistors. One that carrys the current and one that connects to the sense amplifier but does not carry current. If you are working with a plug board, I suggest you solder an extra lead onto each end of the sense resistors, so you can use separate sockets for the current carrying path and the signal path, so the contact resistance of the socket is not included in the sensing operation.

Once you get the ground noise problems under control, you will be in a much better position to deal with comparing various ways to drive the bridge mosfets.

It is very helpful.

Reply to
John Popelish
Loading thread data ...

"Bypass" means connect a small bypass capacitor between the chip's supply and ground pins, so that the pulses of current they consume do not have to zip all the way back to the supply. I recommend either X7R type ceramic or stacked film types for low internal resistance.

0.1 uF should be plenty for low power stuff. The H bridges need lots more. Something like one or two 1uf stacked film (like the Panasonic V-series) and at least 470 uf low series impedance electrolytic (I like the Panasonic FM series).

Your method includes the ground noise. The subtracter separates the current signal from the ground noise. The processor reset is the ground noise causing mischief through another path.

The H bridge ground current is still causing voltage drops on its way back to the 24 volt supply. If those drops get into the logic, it will cause trouble.

I am sure that, without correct bypassing, your H bridge will cause any number of ground noise problems. I was just trying to help you correct the current sense problem since it involves a change to the schematic I could see. Correct bypassing will help all of them.

Reply to
John Popelish

If the chip uses current in sharp pulses, it does. The trace length over to another not so nearby capacitor will act as an inductor that will resonate with the capacitor, causing the supply line to have a sinusoidal ring superimposed on the supply voltage, each time a pulse is used. Getting used to thinking of copper traces as low value resistors and inductors is part of judging where and how much bypass is needed. But testing examples with a scope is also important.

It all depends on the rate of change of the current. This relates to the wavelength of the current wave in the trace. Big capacitors also tend to have a lot of internal inductance that separates all that capacitance form the board at high frequencies.

I hope so. Then we can get back to your very serious gate drive issues, which have not yet been solved. I look forward to commenting on a new schematic that has dealt with the bypass and ground noise issues.

Reply to
John Popelish

Thanks for the suggestion. I was playing around this afternoon with it and could not get the problem solved. I added 0.1uF X7R caps across the power and ground pins of every chip, this did not seem to effect the ground noise.

Measuring the ground noise was running me in circles and I kept scratching my head. I would ground the probe at the ground input (the wire) on the h bridge, then probe to a via which is the same node, still ground, and I would see the spike. I even put the ground of the probe at one of of the wire (where it connects to the battery) and probed the other end, and saw noise!! It is pretty out of control. I put a cap across the wire, and this removed the noise on that piece, but of course, other sections were still noisy. I don't know if I'm doing this all wrong and losing my mind or what. I did remove the GND to GND24 JP1 jumper to test for a minute. This seemed to reduce the noise somewhat, but there was still plenty of noise evident. I also tried running a wire directly from the connection at the battery where the h bridge is getting ground, to the processor board where the 5V and

12V ground is coming in. Even though this creates a ground loop since there is a ground connection from the power board to the h bridge anyway. Placing this wire did nothing. I was able to measure noise across this wire also! The noise is ~5V to ~-5V sometimes more sometimes less.

I think I had already tried your suggestion with all the stuff I was doing this afternoon, but I'll double check tomorrow as I think I was getting somewhere today.

Reply to
Andrew

ULN2803. 8 Darlington transistors in one DIP, including reverse diodes.

Cheers! Rich

Reply to
Rich Grise

That method will keep the motor current noise out of the logic, but will make it harder to interface the current sense amp between power and logic sections. I would run the power line from source to the two current sense resistors and then extend it to the other circuits that need ground. This will bounce everything with the same ground drop so that all circuits agree on what ground voltage is.

Reply to
John Popelish

I read in sci.electronics.design that Andrew wrote (in ) about 'Determine switching frequency of photocoupler', on Tue, 23 Aug 2005:

Motor current and ground lead inductance. Run separate ground leads from the battery, one to the motor ONLY, and one to the electronics. Not guaranteed, but if it works, it's simple.

--
Regards, John Woodgate, OOO - Own Opinions Only.
If everything has been designed, a god designed evolution by natural selection.
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
Reply to
John Woodgate

I read in sci.electronics.design that Andrew wrote (in ) about 'Determine switching frequency of photocoupler', on Tue, 23 Aug 2005:

You show Ground connected to Ground24 by JP1. Break that and connect Ground directly to the battery.

--
Regards, John Woodgate, OOO - Own Opinions Only.
If everything has been designed, a god designed evolution by natural selection.
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
Reply to
John Woodgate

After testing it for a while today, I have finally began to make a conclusion, but I am not sure if it is even totally conceivable.

When I measure with the scope from the sources of the bottom transistor (above the .002 ohm current sense resistor) and at JP2 or JP3 (depending on which motor output I am using), I get a signal that starts at 0 when I am not trying to drive a motor to, when I hit "go" to start the pwm signal (which is just a 5V signal at this point, it is not osciallating), and goes to about 300mV before reset is tripped. This takes about 500uS before it trips. The JP2 and JP3 connections SHOULD be the same as GND24/GND, etc, it is only a piece of wire connecting them, but then again, this should be the same as the sources of the bottom transistors, because it is only a wire here also.

If I measure with the scope from the same sources of the bottom transistors to ground on the power board, I get the EXACT signal, except that the voltage is not 300mV, it is more like 1V. Since this is the ground on the power board, the reason the processor resets, is that the power monitor reset chip will generate a reset when the 5V supply gets too low. As this signal rises to 1V, the potential that should be at 5V is actually heading to 5V minus the signal value (at

1V, it is about 4V potential, which causes the reset chip to generate a reset signal).

I tried replacing the current sense resistor with just a piece of wire, this did not solve anything.

This all happens with the "large" motor. With the small motor, this reading stays at zero (as it should). The large motor, I know, has a very large start up current of approximately 75A per the data sheet.

I am estimating that what is happening, is that the large startup current of the "large" motor is making the resistance of the wire generate a voltage large enough to create enough voltage drop on the 5V supply (and 12V and 24V supplies, but they do not effect the processor) to generate a reset condition.

Is it conceivable that a large startup current from a motor like this can cause a voltage drop in the wire that is enough to see results like this? How can I get correct it? I have commercial H bridges that work fine with this motor?

My first thought was to put a capacitor across the sources of the bottom transistors, to the JP2/JP3 GND24, GND net. I thought this might slow the voltage drop long enough that the intial startup current would pass by and I would be ok. This was not the case with either the

0.47uF, or 47uF electrolytic caps that I tried. The signal still looked the same.

Another thought I had, but did not try, was to add some inductance in this same place. I thought that this could slow that intial startup current enough to work, but I haven't tried this because I didn't know what effects this would have on the motor later down the road, with a PWM signal or whatever. The inductance of the motor is only 80mH as it is.

Does my conclusion make much sense? The high startup current causing too much voltage drop? Are there any other possibilities.

BTW, I tried the suggested ground wiring scheme, all the grounds are tied at one place. The 5V ground to the 12V ground to the 24V ground, and one wire headed to the h bridge. There isn't any way to minimize these connections more than I have.

Reply to
Andrew

I connected the motor power to the same 12V supply instead of to the

24V battery.

When I hit "go" I notice the current limit on the supply blinks. This blinks whether it is set at the max (6A) or less. If I set it low enough (half or less of max), it will still blink on, but the processor will not reset, which is a set forward. If it is set above half, it will reset.

I can only think that this confirms that the startup current is causing problems.

Any thoughts?

Reply to
Andrew

I connected the motor power to the same 12V supply instead of to the

24V battery.

When I hit "go" I notice the current limit on the supply blinks. This blinks whether it is set at the max (6A) or less. If I set it low enough (half or less of max), it will still blink on, but the processor will not reset, which is a set forward. If it is set above half, it will reset.

I can only think that this confirms that the startup current is causing problems.

Any thoughts?

Reply to
Andrew

Possible ground signal noise interference at lower frequencies ?

formatting link

This type of amplifier may have may have low-frequency power supply rejection, but negative supply rejection is limited at higher frequencies.

Since the amplifiers gain is what causes the output to be restored, the negative supply rejection approaches zero for signals above the closed-loop bandwidth.

The result: high-speed, high-level circuits can interact with the low-level circuits through the common impedance of the negative supply line.

Decoupling often is the recommended solution, but there are many wrong and some better ways. A decoupling capacitor near the power supply maybe seaparated from the op amp by many centimeters of wire, which looks like a high-Q inductor. Place the decoupling capacitor near the op amp may still not solve the problem since, for decoupling, the other end of the capacitor must be connected to that mystical somewhere called "ground."

John

Reply to
John Scheldroup

It's official. I am almost 100% confident that the resistance in the wires/traces between the grounds creates enough voltage drop during "large" motor startup condition to cause the 5V supply to fall off to nearly 4V and reset the processor. I calculated the resistance in my test setup to be roughly 41milli-ohms. With startup current from the motor being in the range of 25A+, this causes up to and more than a 1V drop.

A possible fix that I am looking into is ramping the PWM signal from 0% to in software. This was absolutely planned for the future but I didn't realize that the startup current of this particular motor would cause such an issue in my early testing phase.

In order to achieve this fix I will need to properly drive the MOSFET gates. To do this, I am thinking about just switching to some MOSFET gate drivers. I have seen at least one model that is plenty fast enough to switch at 10kHz (Rise and fall times of roughly 30-50nS).

Hopefully I have correctly analyzed the problem and the solution will remedy this portion of my h bridge trouble.

Please let me know your thoughts.

Reply to
Andrew

John, that would work, but this H bridge is part of a larger design that is running off of a set of batteries. It isn't practical for this application to use more than one set of batteries, and other components already in the design prevent isolation between the various voltage levels, 5V, 12V, and 24V.

Ideally, though, I would have isolated it completely and avoided this problem altogether.

Reply to
Andrew

My thought is that now that you know about this voltage drop problem, why don't you reconnect your supplies so that it doesn't occur? The only reason I could guess is that the motor and 5 volt supply come from the same source, so must share the motor return current path. If they come from different sources, you could just connect their commons together at the bottom of the H bridge current sense resistors, and completely separate the return voltage drop from the 5 volt supply.

Reply to
John Popelish

Are you saying that all supply voltages are regulated down from a single 24 volt battery? If so, all this requires is that the 5 and 12 volt regulator have their ground reference pins tied to the bottom of your current sense resistors.

Reply to
John Popelish

They are actually 5 and 12 volt dc to dc converters. The power requirements of them are too large for a simple regulator. There are many commercial DC components being used off of these supplies. All the grounds for all devices are linked together with the 5, 12, and 24V grounds. This makes a single ground for all power supplies and devices.

Reply to
Andrew

John Popelish,

I have redesigned the circuit to use L6384 High-voltage half bridge drivers to drive the MOSFETs. At roughly 30-70nS rise/fall times, they are more than fast enough to switch at frequencies much greater than the 10kHz signal I am trying.

With this new setup, I am hoping to use software to create a ramp in the PWM signal from 0% to 1% to 2% etc up to the desired PWM duty cycle. If this is done at a slow enough rate (such that the high time does not allow a current spike from the startup current of the motor), I should minimize the large rise in the ground (dip in the 5/12/24 supply). There will, however, still be a dip in these supplies, but the dip should not equal more than 6A * the 41milli-ohm, or roughly

0.25V. This voltage drop should be within an acceptable range, as the motor(s) should never be drawing more than 6A, and will be limited to prevent this.

I am confident that this solution will work, however, this still leaves my current monitoring/limiting circuitry. I reread your post concerning this and I noticed that you thought the comparators are referenced to ground (creating zero current trip), but if you look again, they are actually referenced to 5V. It is a little tight there and easy to misread. This being the case, and with the 10uF X7R capacitors I have added from CURR_SENSE_1_B to ground and from CURR_SENSE_2_B to ground, I think that the voltage outputs of the amplifiers (COMPIN1 and COMPIN2) will directly represent the current flow through R13 and R14 current sense resistors. As the current increases, the amplified voltage drop will reach 5V (well, 5V - the voltage drop in the wire, based on current) at a rate that is determined by R15/R17. When this amplified voltage drop reaches 5V, it will compare to the 5V, and trip the COMPOUT1/COMPOUT2 value low, such that the 74ls157 multiplexers will drive the MOSFET driver inputs with ground instead, effectively turning off the motor, which reduces the current through R13/R14 current sense resistor, which lowers the amplified voltage into the comparator and sets the comparator outputs COMPOUT1 and COMPOUT2 back to 5V. This cycle will repeat rapidly (I have not determined how rapidly) which should halt a motor at current level determined directly by R16/R18 until a command to stop the motor is sent.

Sorry that this is so wordy, hopefully it makes sense.

Also, would you mind pointing out any drawbacks of this method, and why it is might not be the best way to accomplish current limiting? Also, if you might further explain the "subtractor" method (if it is still a valid way of achieving the same thing), I would appreciate it!

Thanks, Andrew

Reply to
Andrew

If the bypass capacitors across the H bridge average the pulse current over more than 1 PWM cycle, the above description may be valid. If not, you have to take the inductive as well as resistive drop of the ground path into account.

I see that you follow a gain stage that has a gain of 250 times the voltage drop across the 2 milliohm resistor with a comparator that has its reference set to 5 volts.

The gain causes the opamp output voltage to reach 5 volts (if it were capable of doing so) when the 2 milliohm resistor current reaches 10 amperes.

2 big problems. The comparator inputs do not work with inputs more positive than 3.5 volts and any ground path voltage drop between the bottom of each current sense resistor and the 1k input resistor on the amplifiers gets amplified along with the current sense resistor drop.

Those capacitors in parallel with a 2 milliohm resistor will do very little. And the amplifiers still have the ground path drop errors I mentioned above. For such high currents amd low voltages, you have to quit thinking of ground as a voltage. It is a path with resistance and inductance.

The speed of the process is determined by the total propagation delay around the whole loop from driver, to amplifier, comparator and back to driver. This will vary with different parts and is probably way too fast to be efficient at full limit current. I think you need logic that has two current thresholds. A higher one that trips the motor voltage off, and a lower one that turns it back on. Then the motor inductance determines the frequency. You also have to make sure your driver, when switched off by overcurent keeps the motor current coasting through the sense resistor. Your present schematic has no provision for that.

The subtractor is certainly still valid. It is a means of amplifying a resistor voltage drop without assuming that one end of the resistor is at a perfect zero volts. The resistor drop is amplified by a specified gain, and the result is referenced to an arbitrary zero referencethat may be different than the bottom of the resistors. (And this will certainly be the case with the ground noise you are dealing with. If you cannot parse my earlier description, I will go over it again. It just adds another 2 resistors to the + input that match the pair on the

- input. This keeps the ground noise (difference between ground voltage at the sense resistors compared to ground voltage at the sense amplifier) from being added to the current sense voltage.

Reply to
jpopelish

I'm not sure if my bypass capacitors do this. Is this comment specifically related to current limiting?

It sounds like I need to look into the subtractor setup more.

The comparator setup does appear to work, althought inefficiently, and certainly not the best way to do it, I have been able to "limit" the current to the motor with this setup. The limit does not have to be accurate at all. +/- roughly 20% would be acceptable. The system is not meant to run at limit for a lengthy amount of time, the limit is simply to prevent the motor from having the power to move anything outside of it's torque/continous current range.

I'll look into the subtractor idea and probably have a couple more questions about it.

Thanks again.

Reply to
Andrew

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.