Maker Pro
Maker Pro

Help interfacing Current Transformers to ADC

J

John Perry

Have a look at abse. I found out how to get a pdf from Eagle :)

John Perry
 
J

Jim Thompson

Have a look at abse. I found out how to get a pdf from Eagle :)

John Perry

Either your posting client or the way you created the PDF is
non-standard.

Your PDF came up as "application/pdf"

Standard PDF's show as "application/octet-stream"

...Jim Thompson
 
D

DJ Delorie

Jim Thompson said:
Standard PDF's show as "application/octet-stream"

"application/octet-stream" is a catch-all for "I don't know what this
is", and is generated by the web server, not the file itself.

PDFs *should* be application/pdf so that you can have your browser
open up the right kind of viewer.

Most web servers look at the filename suffix (.pdf) or the magic
numbers in the file to automatically determine the type of the file;
it has nothing to do with how the file is itself created (other than
to create a pdf vs some other type of file).
 
J

Jim Thompson

"application/octet-stream" is a catch-all for "I don't know what this
is", and is generated by the web server, not the file itself.

PDFs *should* be application/pdf so that you can have your browser
open up the right kind of viewer.

Most web servers look at the filename suffix (.pdf) or the magic
numbers in the file to automatically determine the type of the file;
it has nothing to do with how the file is itself created (other than
to create a pdf vs some other type of file).

Maybe it's a quirk of Agent and Acrobat combined.

John's PDF would only open if I added application/pdf as a file type
to Agent.

I did a trial post of a PDF made by Acrobat v7. It shows (and opens)
as application/octet-stream in Agent.

...Jim Thompson
 
D

DJ Delorie

Jim Thompson said:
I did a trial post of a PDF made by Acrobat v7. It shows (and opens)
as application/octet-stream in Agent.

Hmmm... when a file is attached to a mail or posting, the user agent
doing the posting needs to do the same checks a web server would do -
look at the suffix and/or magic numbers and determine a file type.
Any time you end up with application/octet-stream, it means whoever is
doing these checks doesn't know anything about the file in question,
which almost always means it's "wrong" if you intend for people to be
able to click on the file and have it automatically come up in the
right viewer.

Since application/octet-stream is the "I don't know" catch-all, if you
tell your reader/browser to use acroread to read such files, I could
post a chunk of pseudorandom numbers (which *should* be
application/octet-stream, since that's all it is - a stream of
octets), and you would try to view it in acroread. That would be bad.

So it sounds like your Agent is misconfigured; it should post PDFs as
application/pdf and it should never try to automatically view files of
type application/octet-stream. Otherwise, next time someone with a
naive Agent tries to post a spreadsheet, you're going to have an
unhappy acroread on your hands.
 
J

Jim Thompson

Hmmm... when a file is attached to a mail or posting, the user agent
doing the posting needs to do the same checks a web server would do -
look at the suffix and/or magic numbers and determine a file type.
Any time you end up with application/octet-stream, it means whoever is
doing these checks doesn't know anything about the file in question,
which almost always means it's "wrong" if you intend for people to be
able to click on the file and have it automatically come up in the
right viewer.

Since application/octet-stream is the "I don't know" catch-all, if you
tell your reader/browser to use acroread to read such files, I could
post a chunk of pseudorandom numbers (which *should* be
application/octet-stream, since that's all it is - a stream of
octets), and you would try to view it in acroread. That would be bad.

So it sounds like your Agent is misconfigured; it should post PDFs as
application/pdf and it should never try to automatically view files of
type application/octet-stream. Otherwise, next time someone with a
naive Agent tries to post a spreadsheet, you're going to have an
unhappy acroread on your hands.

You're right... makes no sense. I'm going to delete "octet-stream"
and see what happens.

...Jim Thompson
 
J

Jim Thompson

You're right... makes no sense. I'm going to delete "octet-stream"
and see what happens.

...Jim Thompson

Deleted. Still tried to open as "application/octet-stream".

Deleted the post. Re-posted, now works as "application/pdf".

Somehow "application/octet-stream" got tagged as PDF.

I suspect it happened when I tried to install Acrobat v7 and still
keep Acrobat v4. Had so many quirks I had to move Acrobat v4 to
another machine.

There are times when I could "go postal" at Adobe headquarters ;-)

...Jim Thompson
 
J

John Perry

Jim said:

....Was that a simulation of my circuit? Thanks, if I'm understanding it
correctly. Apparently I should have kept your big (100uf?) capacitor.

I guess you found a model for the AD8551? Looks like it really did go
rail-to-rail. If I'm completely off the wall, please be kind :).

I wish the bastards at hp would get my replacement hard drive to me so I
can run my own simulations and such. They've been jerking me around now
for over a month. I would've bought a drive, only they keep giving me a
sure shipping date. I'd rather hear a truthful "we can't yet" than a
"september 15th" lie. I really like my hp printers, and thought I was
in good shape with this damn Pavilion laptop.

jp
 
J

Jim Thompson

...Was that a simulation of my circuit? Thanks, if I'm understanding it
correctly. Apparently I should have kept your big (100uf?) capacitor.

I guess you found a model for the AD8551? Looks like it really did go
rail-to-rail. If I'm completely off the wall, please be kind :).

I wish the bastards at hp would get my replacement hard drive to me so I
can run my own simulations and such. They've been jerking me around now
for over a month. I would've bought a drive, only they keep giving me a
sure shipping date. I'd rather hear a truthful "we can't yet" than a
"september 15th" lie. I really like my hp printers, and thought I was
in good shape with this damn Pavilion laptop.

jp

I bought an hp computer ONCE. Never again. Printers and scanners
ONLY.

...Jim Thompson
 
M

Michael A. Terrell

Jim said:
I bought an hp computer ONCE. Never again. Printers and scanners
ONLY.


I had to laugh when Carly bought Compaq. One brand that I won't buy,
bought out by the other brand I won't buy.


--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
 
B

beananimal

I suspect it happened when I tried to install Acrobat v7 and still
keep Acrobat v4. Had so many quirks I had to move Acrobat v4 to
another machine.

There are times when I could "go postal" at Adobe headquarters ;-)

...Jim Thompson


Long story short, I own an IT consulting company... Adobe long ago
sold out to the bloated software gods. The package is pure garbage,
conflicts with a large portion of popular software (including MS Office
2003 and XPSP1 and SP2). The software is burdened with numereous bugs,
memory leaks and inconsistant behaviors. Adobe is more worried about
branding and co-branding than they are about turning out quality
software. It is all about the number of desktops, not the quality of
the product. Ever notice how they shove the yahoo toolbar (another
company that has gone down the shady path of adware and other dubious
practices) down your throat? Have you noticed the ads that now are
part of Acrobat?

Ever notice that even though you turn off ALL automatic updates in
Acrobat, that it still forces you to go through the autoamtic update
dialogs a few times a month? Imagine trying to manage that crap on a
200 desktop network!

Try to install Acrobat and Reader on the same machine if you want a
real struggle. Who wants to wait for the Full Version (or light) of
Acrobat to load every time they want to look at a PDF. Remember they
started bundling the full version with many DELL, GATEWAY, HP and other
desktops that had MS Office small business edition installed.

We will not even get started on the Macrovision and registration
nightmares with the Adobe flagship products. I have had to
re-authorize Photoshop and Studio over a dozen times for some of our
clients who are legal license holding customers.

Sorry get so OT in my own thread...

Secondly, to confirm what some other have said. Yeah the HP and COMPAQ
desktops are garbage. They are crippled with bundleware and poor
architecture. The Compaq servers are not bad, but then they are not
designed and made by the same folks. I would not have ANYTHING but a
business class HP printer. HP printers are work horses and parts are
available anywhere, dirt cheap. Getting 2 million pages out of an HP
is a piece of cake. The same can not be said about the competition.

Back to logging current via a CT hooked to an A/D

I will be ordering the specified CT for this project ASAP. In the
meantime I am going to hack a Xformer off of a modem or something in an
attempt to breadboard the project to garner a better understanding of
the circuit in a working state.

Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.
 
H

Homer J Simpson

We will not even get started on the Macrovision and registration
nightmares with the Adobe flagship products.

Tried DejaVu?
I will be ordering the specified CT for this project ASAP. In the
meantime I am going to hack a Xformer off of a modem or something in an
attempt to breadboard the project to garner a better understanding of
the circuit in a working state.

Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.

Use a good quality fixed resistor. Use a pot across that if you must.
 
P

Paul E. Schoen

[snip good heads-up about Adobe and HP]
Back to logging current via a CT hooked to an A/D

I will be ordering the specified CT for this project ASAP. In the
meantime I am going to hack a Xformer off of a modem or something in an
attempt to breadboard the project to garner a better understanding of
the circuit in a working state.

Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.
Your latest schematic cmon2.jpg has some errors, and is also way more
complex than needed. Also, I don't think you need to worry too much about
these little CTs bursting into flame or exploding if the secondary is open
circuited, but it is always wise to use precautions. A true current source
would generate an output voltage high enough to arc across the terminals or
break down internal insulation, but these small CTs will just saturate and
put out at most maybe a hundred volts. If there are high frequency
components involved, it could be much higher, however.

I'll try to draw a suggested simple schematic that should work:

+-----+
AC-----)|(----|~ +|--+---R2---+----+----AD1
)|( | | | | |
)|( | BR1 | R1 C1 Z1
)|( | | | | |
AC-----)|(----|~ -|--+--------+----+----GND
T1 +-----+

I would suggest R1 about 200 ohms to get about 3 VDC at 10 AAC input. R2
can be about 10K, C1 about 5 uF, and Z1 a 4.7 V zener. You could put a pot
across R1 to make it adjustable, but you can also do that in software.

For best accuracy, however, I still suggest doing the rectification with an
absolute value routine in software, and eliminate the bridge rectifier.
Here's that circuit:
+----R3----> Vcc
|
AC-----)|(-----+---R2---+----+----AD1
)|( | | |
)|( R1 C1 Z1
)|( | | |
AC-----)|(-----+--------+----+----GND
T1

R1 should be about 150 ohms to get about 4 volts P-P at 10 amps input. R2
and R3 should be about 2K, and C1 should be about 0.1 uF. The input to AD1
will be just about 2.5 VDC with an AC signal varying from about 1 V to 4 V,
which is easily sampled by the A/D at about 300/sec. This should be done in
an interrupt service routine (ISR) using a microcontroller's programmable
resettable timer (PRT). You should read, accumulate and store the A/D at
the start of the routine, and then start the next conversion. When you have
accumulated a certain number of readings, send it out the serial port or
whatever you will use to display it.

Breadboard the above circuits and measure values to fine tune the resistors
and capacitors for best results, and to become familiar with how this
works. Use a scope for better visualization. You can worry about the
details of the A/D later.

Paul
 
J

Jim Thompson

On 15 Sep 2006 22:52:57 -0700, "beananimal" <[email protected]>
wrote:

[snip]
Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.

At 60Hz, this should be fine.

...Jim Thompson
 
J

Joerg

Hello Jim,
Do you have some references you can point me to?

The most concise outline for someone who is new to these filters (and
doesn't speak German) seems to be this nice introduction:

http://www-ccrma.stanford.edu/~jos/pasp/Wave_Digital_Filters.html

WDF's have been presented by Prof.Fettweis and not all stuff was written
in English. But I do have quite some material. So if you need more let
me know and I'll email. Best may be to email me because my NG computer
made some signs this morning that it may be about to croak.

Was out yesterday. Perspectives 2006 in Sacramento, moderated by Tom
Sullivan. But the best were the speakers. Bob Dole, Tom Ridge, Tom
Daschle, Soledad O'Brien, Dave Barry, Roy Firestone. This means I'll
have to work today but it was absolutely worth it.
 
J

Jim Thompson

Hello Jim,


The most concise outline for someone who is new to these filters (and
doesn't speak German) seems to be this nice introduction:

http://www-ccrma.stanford.edu/~jos/pasp/Wave_Digital_Filters.html

WDF's have been presented by Prof.Fettweis and not all stuff was written
in English. But I do have quite some material. So if you need more let
me know and I'll email. Best may be to email me because my NG computer
made some signs this morning that it may be about to croak.

Was out yesterday. Perspectives 2006 in Sacramento, moderated by Tom
Sullivan. But the best were the speakers. Bob Dole, Tom Ridge, Tom
Daschle, Soledad O'Brien, Dave Barry, Roy Firestone. This means I'll
have to work today but it was absolutely worth it.

I've been to several Bakersfield Business Conferences... great
speakers, but lousy accommodations in Bakersfield :-(

I'm off this morning for breakfast with Steve Forbes and Senator Kyl,
courtesy of the oldest daughter, Republican Party Chair of Yuma ;-)

...Jim Thompson
 
J

John Larkin

Hello Jim,


The most concise outline for someone who is new to these filters (and
doesn't speak German) seems to be this nice introduction:

http://www-ccrma.stanford.edu/~jos/pasp/Wave_Digital_Filters.html

I do something similar to design digital filters, although pretty much
devoid of theory: I design an opamp-based analog filter, then "model"
it in uP code or in an FPGA. It seems to be not only easy to design,
it's usually is easier to code, in that the internal scalers seem to
be less outrageous than the factors you get when you use more
conventional IIR DSP filter design techniques.



.SBTTL . ANALOG LOWPASS FILTERS


; INPUT SAMPLES ARE TAKEN AT THE 139-HZ RATE AND SOFTWARE LOWPASS
; FILTERED. THE FILTER IS A 4-POLE, STATE-VARIABLE (INTEGRATOR-BASED)
; SORTA GAUSSIAN GADGET WITH A 'TRANSITIONAL' (EG, HOMEBREW) TRANSFER
; FUNCTION.


NODE 1 NODE 2 NODE 3 NODE 4
| | | |
IN --(+)-[K1:INT]--(+)--[K2:INT]->-(+)-[K3:INT]--(+)-[K4:INT]-->--OUT
| | | | | |
| | | | | |
| ^---(-1)--- | | ^---(-1)--- |
| | | |
| | | |
'------<----(-1)----------' '-------<------(-1)-------'


; THE FOUR LOWPASS FILTER INTEGRATION COEFFICIENTS ARE ALL EXPRESSED
; AS RIGHT-SHIFT COUNTS, AVOIDING POKEY MULTIPLIES.

; CAUTIONS: EVEN IF ALL INPUTS ARE POSITIVE NUMBERS, OCCASIONAL
; SLIGHTLY-NEGATIVE OUTPUT GLITCHES ARE POSSIBLE.

; BIG SAMPLE-TO-SAMPLE EXCURSIONS CAN CAUSE WILD END-AROUNDS, SO
; IT'S PRUDENT TO KEEP INPUT RANGE BELOW +- 0.25 FRACTIONAL.

; OK, HERE'S THE FILTER. WE USE REGISTERS D0-D6, AND ASSUME
; THAT A0 AIMS INTO A 4-NODE FILTER BLOCK.

; ON ENTRY, D0.L SHOULD HOLD THE FRESH FILTER INPUT.

; FOR SLOW ITEMS, WE USE A FILTER WITH RISETIME OF ABOUT 2 SECONDS,
; CORRESPONDING TO BANDWIDTH OF ABOUT 0.17 HZ. CONSTANTS ARE...

K1 = 7 ; 0.0078125
K2 = 5 ; 0.03125
K3 = 6 ; 0.015625
K4 = 5 ; 0.03125


LOWPAS: MOVEM.L (A0)+, D1 D2 D3 D4 ; SCOOP UP ALL TABLE NODES


; DO THE FIRST 2-POLE LOWPASS...

SUB.L D2, D0 ; MAKE INTEGRATOR K1 INPUT

MOVE.L D1, D6 ; NOW COMPUTE INTEGRATOR K2'S
SUB.L D2, D6 ; INPUT

ASR.L # K1, D0 ; SCALE AND
ADD.L D0, D1 ; INTEGRATE K1

MOVE.L D2, D5 ; SNAP 2ND STAGE INPUT = OUR
OUTPUT

ASR.L # K2, D6 ; SCALE AND INTEGRATE
ADD.L D6, D2 ; K2


; NOW DO THE SECOND 2-POLE LOWPASS...

SUB.L D4, D5 ; AND MAKE THE K3 INTEGRATOR
INPUT

MOVE.L D3, D6 ; COPY K3 OUTPUT TO MAKE
SUB.L D4, D6 ; K4'S INPUT

ASR.L # K3, D5 ; SCALE AND
ADD.L D5, D3 ; INTEGRATE K3

ASR.L # K4, D6 ; SCALE AND
ADD.L D6, D4 ; INTEGRATE K4

MOVEM.L D4 D3 D2 D1, -(A0) ; REPLACE ALTERED TABLE NODES

RTS



John
 
J

John Larkin

Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.

Caution: most pots will tolerate only small wiper currents.

And yes, Adobe products are flakey garbage.

John
 
J

John Larkin

Your latest schematic cmon2.jpg has some errors, and is also way more
complex than needed. Also, I don't think you need to worry too much about
these little CTs bursting into flame or exploding if the secondary is open
circuited, but it is always wise to use precautions.

They just saturate and put out some spikes. No big deal. But they can
get magnetized if run unloaded, and that can subsequently degrade the
low-current linearity.

John
 
B

beananimal

Paul said:
[snip good heads-up about Adobe and HP]
Back to logging current via a CT hooked to an A/D

I will be ordering the specified CT for this project ASAP. In the
meantime I am going to hack a Xformer off of a modem or something in an
attempt to breadboard the project to garner a better understanding of
the circuit in a working state.

Question: Is it feasable to use a small pot in place of the resistor
that grounds the Rectifier (or a pot and Resistor in parallel for
safety). In my mind that would allow fine tuning of the CTs output
scale to match the A/Ds full scale voltage.
Your latest schematic cmon2.jpg has some errors, and is also way more
complex than needed. Also, I don't think you need to worry too much about
these little CTs bursting into flame or exploding if the secondary is open
circuited, but it is always wise to use precautions. A true current source
would generate an output voltage high enough to arc across the terminals or
break down internal insulation, but these small CTs will just saturate and
put out at most maybe a hundred volts. If there are high frequency
components involved, it could be much higher, however.

I'll try to draw a suggested simple schematic that should work:

+-----+
AC-----)|(----|~ +|--+---R2---+----+----AD1
)|( | | | | |
)|( | BR1 | R1 C1 Z1
)|( | | | | |
AC-----)|(----|~ -|--+--------+----+----GND
T1 +-----+

I would suggest R1 about 200 ohms to get about 3 VDC at 10 AAC input. R2
can be about 10K, C1 about 5 uF, and Z1 a 4.7 V zener. You could put a pot
across R1 to make it adjustable, but you can also do that in software.

For best accuracy, however, I still suggest doing the rectification with an
absolute value routine in software, and eliminate the bridge rectifier.
Here's that circuit:
+----R3----> Vcc
|
AC-----)|(-----+---R2---+----+----AD1
)|( | | |
)|( R1 C1 Z1
)|( | | |
AC-----)|(-----+--------+----+----GND
T1

R1 should be about 150 ohms to get about 4 volts P-P at 10 amps input. R2
and R3 should be about 2K, and C1 should be about 0.1 uF. The input to AD1
will be just about 2.5 VDC with an AC signal varying from about 1 V to 4 V,
which is easily sampled by the A/D at about 300/sec. This should be done in
an interrupt service routine (ISR) using a microcontroller's programmable
resettable timer (PRT). You should read, accumulate and store the A/D at
the start of the routine, and then start the next conversion. When you have
accumulated a certain number of readings, send it out the serial port or
whatever you will use to display it.

Breadboard the above circuits and measure values to fine tune the resistors
and capacitors for best results, and to become familiar with how this
works. Use a scope for better visualization. You can worry about the
details of the A/D later.

Paul

1) The latest schematic was cmon3.jpg. I had hoped to fix the errors
in cmon2.jpg.
Here is the URL http://tinyurl.com/znjvc

Can you please comment on this (cmon3.jpg)

2) With regards to being more complex than needed. I do understand
that there are many ways to skin a cat. Can you please explain your
reasoning and the pros and cons of your proposed schematic vs the one
Jim and John have helped me construct? I have (24) of these to build.

I don't mind more complex if there is a compeling reason or enhanced
functionality.

3) I would rather use as little sofware as possible. I am not AT ALL
versed in uC programming so just bit banging the A/D sample to the
serial port will be hard enough. I had planned on simply using a
service loop to sample the A/D ports in sequence and average every so
many. ISR and other complex uC work is again something I am not ready
to tackle. I am VERY new to uC coding. I would not know how to begin
using software to write an ABS routine to calculate the voltage in VB,
let alone doing it in uC speak.

The goal at this point is to use (3) PIC uC to do 8 A/D inputs each.
The PICs will either all be tied to another PIC that is tied to the PC,
or simply tied to (3) serial ports on the PC. I have a spare DIGI
serial board around here somewhere.

Lastly, regarding hte POT and wiper current. What size wattage
resistors and pot need to be considered for the burden and R1 and R2?
I understand the rest of them can be standard 1/4 watt types.
 
Top