Smart Star User's Manual

> ## 8. A/D Converter Cards

> Chapter 8 describes the features of the A/D converter card, one of the I/O cards designed for the Smart Star embedded control system.

> The Smart Star is a modular and expandable embedded control system whose configuration of I/O, A/D converter, D/A converter, and relay cards can be tailored to a large variety of demanding real-time control and data acquisition applications.

> The typical Smart Star system consists of a rugged backplane with a power supply, a CPU card, and one or more I/O cards. The CPU card plugs into a designated slot on the backplane chassis, which has seven additional slots available for I/O cards to be used in any combination. A high-performance Rabbit 2000 microprocessor on the CPU card operates at 25.8 MHz to provide fast data processing.

> ### 8.1 A/D Converter Card Features

> Three models of A/D converter cards are available, as shown in Table 12.

> Table 12. Smart Star A/D Converter Cards
> I/O Card | Model | Features
> A/D Converter | SR9300 | 12-bit A/D converter, 11 channels, 0 V - 10 V
> SR9310 | 12-bit A/D converter, 11 channels, -10 V - +10 V
> SR9320 | 12-bit A/D converter, 11 channels, 4 mA - 20 mA

> ### 8.2 User Interface

> Figure 33 shows the circuit used to condition the analog signal before it goes to the A/D converter chip. Depending on the model of A/D converter card you have, it is designed to handle analog inputs of 0 V to 10 V, -10 V to +10 V, or 4-20 mA. The two different voltage ranges are handled with different gain resistors, Rg: 23.7 kW for the SR9300 and 12.1 kW for the SR9310. The input shown in Figure 33 is configured differently for the SR9320, which handles analog inputs of 4-20 mA.

> Figure 33. Analog Input Amplifier Circuit

> Figure 34 shows the complete pinout for the user interface on header J2. Note that pin 1 is indicated by a small arrow on the ribbon cable connector.

> Figure 34. A/D Converter Card User Interface Pinout

> ### 8.3 User FWT Connections

> Connections to the A/D converter cards are made via a ribbon cable connector or optional field wiring terminals that are either pluggable or have screw terminals. Table 13 lists the the Z-World part numbers for the FWTs.

> Table 13. Guide to FWT Selection
> FWT Description | I/O Cards | Z-World Part Number
> Pluggable Terminals | Screw Terminals
> FWT18 | A/D Converter | 101-0421 | 101-0425

> ### 8.4 Pinouts

> Figure 35 shows the pinout for the FWTs used on the A/D converter cards.

> Figure 35. FWT Pinout for
> A/D Converter Cards

> ### 8.5 Power Distribution

> Figure 36 shows the power distribution on the A/D converter card.

> Figure 36. A/D Converter Card Power Distribution

> ### 8.6 Software

> Dynamic C Premier is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Z-World controllers and other controllers based on the Rabbit microprocessor.

> Dynamic C Premier is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Z-World controllers and other controllers based on the Rabbit microprocessor.

> #### 8.6.1 Dynamic C Libraries

> With Dynamic C running, click File > Open, and select `Lib`. The following list of Dynamic C libraries and library directories will be displayed.

> One library directory is specific to the Smart Star.

> - `SMRTSTAR`--libraries associated with features specific to the Smart Star control system.

> Other functions applicable to all devices based on the Rabbit 2000 microprocessor are described in the Dynamic C Premier User's Manual.

> #### 8.6.2 Library Directories

> The `SMRTSTAR` directory contains libraries required to operate the Smart Star control system.

> - `SMRTSTAR.LIB`--This library supports all the functions needed by the Smart Star systems including digital I/O cards, relay cards, D/A converter and A/D converter cards, and serial communication.

> #### 8.6.3 Smart Star A/D Converter Card Function APIs

> ## int anaInEERd(int channel);

>   The A/D converter card calibration constants, gain, and offset are stored in the factory in the upper half of the EEPROM on the A/D converter card. Use this function to read the A/D converter card calibration constants, gain, and offset from the upper half of the EEPROM on the A/D converter card

> ##### Parameters

>   `channel` is the analog input channel. `channel` should be passed as

>     channel = (slotnumber * 128) + (channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10
>   or

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10.

> ##### Return Value

>   0 if successful.
>   -1--control command unacceptable.
>   -2--EEPROM address unacceptable.

> ##### See Also

>     anaInEEWr

> ## int anaSaveCalib();

>   The calibration constants may also be saved in the flash memory on the Smart Star CPU card. Doing so will speed up A/D conversions since a memory access from flash memory will be faster than from EEPROM. Use `anaSaveCalib` to save the current set of calibration constants for the analog input and output channels in the Smart Star flash memory. The calibration constants stored in flash memory can then be accessed at any time with the `anaLoadCalib` function.
>   If the factory-set calibration are not used, customer-measured calibration constants should first be established using the `anaInCalib` function.

> ##### Return Value

>   None.

> ##### See Also

>     anaLoadCalib, anaInCalib

> ## void anaLoadCalib();

>   Reads a complete set of calibration constants for the analog input and output channels from the Smart Star flash memory on the CPU card. These should be set using the `anaInCalib` or `anaInEERd` function, then saved to flash memory using the `anaSaveCalib` function.

> ##### Return Value

>   None.

> ##### See Also

>     anaSaveCalib, anaInCalib

> ## int anaInCalib(int channel, int value1, float volt1, int value2, float volt2);

>   Used to recalibrate the response of the A/D converter channel as a linear function using the two conversion points provided. Gain and offset constants are calculated and placed into the global table `_adcCalib`.

> ##### Parameters

>   channel is the A/D converter input channel (0-10). channel should be passed as

>     channel = (slotnumber * 128) + (channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10
>   or

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10.
>   `value1` is the first A/D converter value.
>   `volt1` is the voltage corresponding to the first A/D converter value.
>   `value2` is the second A/D converter value.
>   `volt2` is the voltage corresponding to the first A/D converter value.

> ##### Return Value

>   0 if successful, -1, if not able to make calibration constants.

> ##### See Also

>     anaIn, anaInVolts

> ## int anaInEEWr(int channel);

>   Writes the calibration constants, gain, and offset to the upper half of the EEPROM on the A/D converter card.

> ##### Parameters

>   `channel` is the analog input channel. `channel` should be passed as

>     channel = (slotnumber * 128) + (channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10
>   or

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10.

> ##### Return Value

>   0 if successful.
>   -1--control command unacceptable.
>   -2--EEPROM address unacceptable.
>   -3--data value unacceptable.

> ##### See Also

>     anaInEERd, _anaInEEWr

> ## unsigned int anaIn(unsigned int channel);

>   Reads the state of an analog input channel and converts it to a digital value. A timeout occurs, causing the function to exit, if the end of the conversion is not detected within 13 µs.

> ##### Parameters

>   `channel` is the analog input channel to read. `channel` should be passed as

>     channel = (slotnumber * 128) + (channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10
>   or

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10.

> ##### Return Value

>   A value corresponding to the voltage on the analog input channel, 0-4095. A value outside this range indicates a failure

> ##### See Also

>     anaInCalib, anaInVolts

> ## int anaInVolts(int channel);

>   Reads the state of an analog input channel and uses the previously set calibration constants to convert the state to volts.

> ##### Parameters

>   `channel` is the analog input channel. `channel` should be passed as

>     channel = (slotnumber * 128) + (channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10
>   or

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-10.

> ##### Return Value

>   A voltage value corresponding to the voltage on the analog input channel, 0-4095.

> ##### See Also

>     anaIn, anaInCalib

> #### 8.6.4 Sample Programs

> - `SSTARAD1.C`--Demonstrates how to calibrate an A/D converter channel using two known voltages, and defines the two coefficients, gain and offset. These coefficients are then read back to compute the equivalent voltage.

> - `SSTARAD2.C`--Reads and displays voltage and equivalent values of each A/D converter channel. Calibrations must have been previously stored into flash memory before running this program. See sample program `SSTARAD3.C`.

> - `SSTARAD3.C`--Demonstrates how to calibrate all A/D converter channels using two known voltages and defines the two coefficients, gain and offset. These coefficients are then read back to compute the equivalent voltage and are saved to flash memory.

> ##### 8.6.4.1 Using Dynamic C

> To run a sample program, open it with the File menu (if it is not still open), compile it using the Compile menu, and then run it by selecting Run in the Run menu. The CPU card must be in Program Mode (see Section 4.1, "Programming Cable") and must be connected to a PC using the programming cable as described in Section 2.3, "Programming Cable Connections."

> More complete information on Dynamic C is provided in the Dynamic C Premier User's Manual.

> ### 8.7 Electrical and Mechanical Specifications

> Figure 37 shows the mechanical dimensions for the A/D converter card.

> Figure 37. Relay Card Dimensions

> NOTE | All diagram and graphic measurements are in inches followed by millimeters enclosed in parentheses.

> Table 14 lists the electrical, mechanical, and environmental specifications for the A/D converter card.

> Table 14. A/D Converter Card Specifications
> Parameter | Specification
> Board Size | 2.73" × 3.00" × 0.44" (70 mm × 76 mm × 11 mm)
> Connectors | one 2 × 10 latch/eject ribbon connector, 0.1 inch pitch
> Operating Temperature | -40°C to +70°C
> Humidity | 5% to 95%, noncondensing
> Power Requirements | 5 V DC at 40 mA from backplane (+5 V supply) 9 V to 30 V DC, 35 mA at 24 V DC, +RAW/+V_USER from backplane
> Number of Inputs | 11 conditioned channels
> Analog Input Ranges1 | 0 V to +10 V (max. ±22 V DC) -10 V to +10 V (max. ±40 V DC) 4 mA to 20 mA (max. 30 mA)
> Resolution | 12 bits (0-4095)
> Conversion Time (including Dynamic C) | 0.13 ms/channel (includes 0.08 ms/channel for raw count)
> Repeatability | Typical ±½ count, maximum ±1 count @ -20°C to +70°C Typical ±1 count, maximum ±2 counts @ -40°C to -20°C
> Accuracy | Typical ±1 count, maximum ±2 counts @ 25°C ±4 counts @ -40°C and +70°C2
> Input Impedance | SR9300 (0 V to +10 V): 100 kW min. SR9310 (-10 V to +10 V): 100 kW min. SR9320 (4 mA to 20 mA): 249 W ± 1%
> Linearity Error (end to end) | ±1 count

> 1 The A/D converter card is protected against transients that might exceed the maximum ratings. 2 Accuracy at temperature extremes can be improved by recalibrating the A/D converter card at the temperature it will be used at.

Z-World http://www.zworld.com Voice: (530) 757-3737 FAX: (530) 757-3792 sales@zworld.com