Maker Pro
Maker Pro

Determine switching frequency of photocoupler

J

John Popelish

Jan 1, 1970
0
Andrew said:
John, thanks for your quick reply!

I'm not sure how to quote your text so I'll just write what you wrote
and respond under it...



amplifiers, comparators and TTL logic chips."

I'm not sure exactly what you mean by this?

"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).
Also, do you suspect that current sensing in this fashion is the cause
of my ground noise problems?

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.
When I was using a small motor (I guess the noise wasn't enough to
reset the processor), I varied the current by varying the load, and the
current sensing seemed to work the way I thought. I will try some of
your suggestions to clean it up, but I only needed the current limit as
a very crude way to protect the motor from drawing too much current.

I thought that by removing the jumper from CURR_SENSE_1_A to
CURR_SENSE_1_B and from CURR_SENSE_2_A to CURR_SENSE_2_B I was
virtually eliminating this part of the circuit from causing any
problems. The only thing left after doing this was the 2milli-ohm
current sense resistor in series with the motor, which shouldn't have a
noticeable effect.

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.
Again, the problem is only when a motor is connected. With no motor,
everything *looks* ok. The "large" motor is about 316milli-ohms and
like 80mH. I'm not sure the specs of the smaller motor. In both cases
I suspect there is noise, but it only resets the processor with the
larger motor.

Unless you meant that my ground noise issues are likely caused by the
current sensing stuff (even with the jumpers removed), do you have any
further ideas on what the problem could be?

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.
 
A

Andrew

Jan 1, 1970
0
John, thanks for your help.

I used bypass caps on all my other designs, but I never quite knew what
they were or that they were so necessary, and that is half the reason I
left them out on this h bridge. Something that still trips me out
about them, is that capacitance in parallel adds, and the 5V supply has
a bunch of 0.1uF caps all over the place for other chips on the
processor board, and it also has some 10uF caps for some other chips.
Does adding another 0.1uF for a new chip really make that much
difference? It could be 0.1uF added to, say, 100uF or more in some
cases, much less than 1% added capacitance. I guess the logical answer
might be that it matters how close this bypass cap is to the new chip,
but I wouldn't have thought that the trace
resistance/capacitance/inductance/whichever it is that would effect
this would be enough to cause problems.

At any rate, hopefully this solves my ground noise issue!
 
J

John Popelish

Jan 1, 1970
0
Andrew said:
John, thanks for your help.

I used bypass caps on all my other designs, but I never quite knew what
they were or that they were so necessary, and that is half the reason I
left them out on this h bridge. Something that still trips me out
about them, is that capacitance in parallel adds, and the 5V supply has
a bunch of 0.1uF caps all over the place for other chips on the
processor board, and it also has some 10uF caps for some other chips.
Does adding another 0.1uF for a new chip really make that much
difference?

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 could be 0.1uF added to, say, 100uF or more in some
cases, much less than 1% added capacitance. I guess the logical answer
might be that it matters how close this bypass cap is to the new chip,
but I wouldn't have thought that the trace
resistance/capacitance/inductance/whichever it is that would effect
this would be enough to cause problems.

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.
At any rate, hopefully this solves my ground noise issue!

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.
 
J

John Woodgate

Jan 1, 1970
0
(in said:
Any thoughts on why I am receiving such terrible ground noise?
Everything looked like it would work so well on paper (and still does
haha)!

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.
 
A

Andrew

Jan 1, 1970
0
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.
 
R

Rich Grise

Jan 1, 1970
0
There really isn't a need to isolate them. I just liked the fact that
the optocoupler was a single IC chip as opposed to multiple
transistors.

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

Cheers!
Rich
 
J

John Popelish

Jan 1, 1970
0
John said:
You show Ground connected to Ground24 by JP1. Break that and connect
Ground directly to the battery.

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.
 
A

Andrew

Jan 1, 1970
0
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.
 
A

Andrew

Jan 1, 1970
0
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?
 
A

Andrew

Jan 1, 1970
0
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?
 
J

John Scheldroup

Jan 1, 1970
0
Andrew said:
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?

Possible ground signal noise interference at lower frequencies ?

http://tinyurl.com/a84z2

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
 
A

Andrew

Jan 1, 1970
0
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 <desired %> 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.
 
J

John Popelish

Jan 1, 1970
0
Andrew said:
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 <desired %> 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.
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.
 
A

Andrew

Jan 1, 1970
0
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.
 
J

John Popelish

Jan 1, 1970
0
Andrew said:
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.

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.
 
A

Andrew

Jan 1, 1970
0
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.
 
Top