|
by Ernesto
Gradin & Aubrey Kagan
Start ý Features
ý Magnetics ý Primary
and Secondary Turns ý Primary and Secondary
Winding ý Primary Inductance ý Hardware
ý Firmware ý Analog
to Digital Conversion ý User Interface
ý Sources and PDF
ANALOG TO DIGITAL CONVERSION
Three A/D channels are read. When all
three have been read, they are transferred to a register and a flag
set. Averaging is only done on Channel 1, which is used for the 4-
to 20-mA signal from the true RMS Current Monitor.
Most of the functions and their implementation
are self-explanatory. On reset, the parameters stored in the EEPROM
are read, with some loaded into RAM. The process (mode) number is
one of these. On command, it can be changed from the host PC.
The closed-loop process is based on a
PID loop. Provisions are made for suitable integral, differential,
and proportional constants. In reality, it was found that the system
worked best as a purely proportional loop. This was attributed to
the long settling time and filtering affect of the external AC-to-mA
converter, coupled with the coarse AC current adjustment of only nine
bits.
SERIAL COMMUNICATIONS
The serial communications portion of the
software implements the Intercommunications Protocol as detailed in
Listing
2.
Parameters are stored in EEPROM. The
original driver software for the EEPROM was developed in assembler.
It was then ported to applications in C. There are simple translation
routines to match the used registers to the calling conventions used
in IAR C. Only a small portion of the EEPROM is used for the application.
These locations are protected by a checksum to detect whether the
unit has been set up. It is possible to access all the available locations
in the EEPROM for any purpose by following the communications protocol.
Most constants are only stored in EEPROM
and read from EEPROM when needed. A few are read and stored in RAM,
so they can be changed "on the fly" by the host PC when
the change in operations is desired without having to go through an
EEPROM change. These include the process type and the target output
for closed- or open-loop operation.
As part of failure protection, an EEPROM
read must provide two identical reads for the procedure to continue.
Failure of the two subsequent readings to agree in three attempts
will lead to a hardware reset.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |