Smart Star User's Manual

> ## 9. D/A Converter Cards

> Chapter 9 describes the features of the D/A 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.

> ### 9.1 D/A Converter Card Features

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

> Table 15. Smart Star D/A Converter Cards
> I/O Card | Model | Features
> D/A Converter | SR9400 | 12-bit D/A converter, 8 channels, 0 V - 10 V
> SR9410 | 12-bit D/A converter, 8 channels, -10 V - +10 V
> SR9420 | 12-bit D/A converter, 8 channels, 4 mA - 20 mA

> ### 9.2 User Interface

> Figure 38 shows the D/A converter circuit. A buffer, U6, buffers the data signals D0-D7 from the Smart Star backplane, and sends them to the D/A converter, U2-U5. Signals D2-D5 are used to switch the chip select line to identify which D/A converter will perform the conversion. The model of D/A converter card determines the analog output ranges (0 V to 10 V, -10 V to +10 V, or 4-20 mA). The different voltage or current ranges are handled with different feedback resistors, as shown in Figure 38. A switching regulator provides a regulated power supply for the op-amps.

> Figure 38. D/A Converter Card Circuit

> NOTE | The D/A_SEN[0-7] sensing inputs are not used when using the current source version (model SR9420) of the D/A converter card.

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

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

> The D/A converter card has eight analog output channels, D/A_OUT[0-7], and is also equipped with a remote sensing capability through sensing inputs D/A_SEN[0-7] for the voltage-amplifier versions of the D/A converter card (models SR9400 and SR9410). These sensing inputs compensate for the voltage drop across the wire leads of low-impedance loads to provide a more precise output across the load.

> Let's look at Figure 40 to see how this happens. Assume the load is 500 W. If the impedance of the wire used to connect the load to the output terminal on the D/A converter card is 5 W, there will be a voltage drop of about 5 W/500 W = 1% across the wire. The voltage across the load will then be 1% less, which is about 40 counts for the SR9400. By connecting D/A_SEN as shown in Figure 40, the output driver will be able to sense the voltage drop across the wire and provide a more accurate voltage output across the load. If the load impedance is much greater than the impedance of the wire leads, simply leave the D/A_SEN sensing inputs open.

> Figure 40. D/A Converter Output for Low-Impedance Loads

> ### 9.3 User FWT Connections

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

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

> #### 9.3.1 Pinouts

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

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

> ### 9.4 Power Distribution

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

> Figure 42. D/A Converter Card Power Distribution

> Figure 43 shows the power supply for the op-amps used as voltage amplifiers/current sources.

> Figure 43. Op-Amp Power Supplies

> There is provision in software using the `anaOutDisable` or the `anaOutEnable` function calls to turn the regulated ±12 V power supply off or on since pin 5 on U1 is connected to PE7 on the Rabbit 2000 microprocessor on the backplane. This type of disabling/enabling allows the analog output channels to float in a high-impedance state.

> The voltage regulator on/off is disabled by default when there is a reset or when the D/A converter card is first used. All output channels must be configured to the required voltage or current outputs before calling the `anaOutEnable` function since unconfigured channels are automatically set to the maximum output.

> The -12 V supply is provided only for the SR9410, which provides analog outputs up to ±10 V.

> ### 9.5 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.

> #### 9.5.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.

> #### 9.5.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, A/D converter and D/A converter cards, and serial communication.

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

> ## void anaOutDisable(void);

>   Turns off (disables) voltage regulator for output-channel op-amps on all D/A converter cards, leaving all output channels in a high-impedance state.

> ##### Return Value

>   None.

> ## See Also

>     anaOutEnable, anaOut, anaOutVolts, anaOutmAmps

> ## void anaOutEnable(void);

>   Turns on (enables) voltage regulator for output-channel op-amps on all D/A converter cards.

> NOTE | The voltage regulator on/off is disabled (off) at power-up or reset. All output channels must be configured to the required voltage or current outputs before calling the `anaOutEnable` function since unconfigured channels will be set automatically to the maximum output.

> ##### Return Value

>   None.

> ##### See Also

>     anaOutDisable, anaOut, anaOutVolts, anaOutmAmps

> ## int anaOutEERd(int channel);

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

> Parameters

>   `channel` is the D/A converter output channel. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

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

> ##### Return Value

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

> ##### See Also

>     anaOutEEWr

> ## int anaOutCalib(int channel, int value1, float voltamp1, int value2, float voltamp2);

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

> Parameters

>   `channel` is the D/A converter output channel. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-7.
>   `value1` is the first D/A conversion data point. Use a value near 4095 to produce a lower output measurement.
>   `voltamp1` is the voltage (volts) or current (milliamperes) measurement corresponding to the first D/A conversion data point.
>   `value2` is the second D/A conversion data point. Use a value near 0 to produce a higher output measurement.
>   `voltamp2` is the voltage (volts) or current (milliamperes) corresponding to the second D/A conversion data point.

> rawcount | Approximate Output Equivalent
> SR9400 | SR9410 | SR9420
> 0 (0000H) | +10 V | +10 V | 20 mA
> 2047 (07FFH) | +5 V | 0 V | 12 mA
> 4095 (0FFFH) | 0 V | -10 V | 4 mA

> ##### Return Value

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

> ##### See Also

>     anaOut, anaOutVolts

> ## int anaSaveCalib(int boardtype);

>   The calibration constants may also be saved in the flash memory on the Smart Star CPU card. Doing so will speed up D/A 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 or 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.
>   Calibration constants should first be established using `anaOutCalib` or obtained via `anaOutEERd`.

> ##### Parameter

>   `boardtype` is the type of board, which is 0 for the D/A converter card, 1 for the A/D converter card.

> ##### Return Value

>   0 if successful.
>   -1--attempt to write non-flash area, nothing written.
>   -2--`rootSrc` not in root.
>   -3--timeout while writing flash memory.
>   -4--attempt to write to ID block sector(s).

> ##### See Also

>     anaLoadCalib, anaOutCalib

> ## int anaLoadCalib(int boardtype);

>   Reads a complete set of calibration constants for the analog output channels from the Smart Star flash memory on the CPU card. These should have been loaded to the flash memory with the `anaSaveCalib` function.

> ##### Parameter

>   `boardtype` is the type of board, which is 0 for the D/A converter card, 1 for the A/D converter card.

> ##### Return Value

>   0 if successful.
>   -1--attempt to read from non-flash area.
>   -2--destination not all in root.

> ##### See Also

>     anaSaveCalib, anaOutCalib

> ## int anaOut(unsigned int channel, unsigned int rawcount);

>   Sets the voltage of an analog output channel by serially clocking in 16 bits to a D/A converter using the following format:

> · Program bits (D15...D12)

> · New data (D11...D0)

> D15 | D14 | D13 | D12 | D11 | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0
> R1 | SPD | PWR | R0 | MSB | 12 data bits MSB-LSB (0-4095) | LSB

> SPD--Speed control bit: 1 = fast mode (default), 0 = slow mode

> PWR--Power control bit: 1 = power down, 0 = normal operation (default)

> The following table lists all the possible combinations of the register-selects bits R1 (Register 1) and R0 (Register 0)

> R1 | R0 | Register
> 0 | 0 | Write data to D/A converter channel B
> 0 | 1 | Write data to buffer
> 1 | 0 | Write data to D/A converter channel A
> 1 | 1 | Reserved

> ##### Parameters

>   `channel` is the D/A converter output channel to write. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-7.
>   `rawcount` is a value corresponding to the voltage on the analog output channel (0-4095). The following `rawcount` data correspond to the analog outputs indicated.

>   rawcount | Approximate Output Equivalent
>   SR9400 | SR9410 | SR9420
>   0 (0000H) | +10 V | +10 V | 20 mA
>   2047 (07FFH) | +5 V | 0 V | 12 mA
>   4095 (0FFFH) | 0 V | -10 V | 4 mA

> ##### Return Value

>   0 if successful.
>   -1 if `rawcount` is greater than 4095.

> ##### See Also

>     anaOutVolts, anaOutCalib

> ## void anaOutVolts(unsigned int channel, float voltage);

>   Sets the voltage of an analog output channel by using the previously set calibration constants to calculate correct data values.

> ##### Parameters

>   `channel` is the D/A converter output channel. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-7.
>   voltage is the voltage desired on the output channel.

> ##### Return Value

>   None.

> ##### See Also

>     anaOut, anaOutCalib, anaOutmAmps

> ## void anaOutmAmps(unsigned int channel, float current);

>   Sets the current of an analog output channel by using the previously set calibration constants to calculate correct data values.

> ##### Parameters

>   `channel` is the D/A converter output channel. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-7.
>   voltage is the voltage desired on the output channel.

> ##### Return Value

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

> ##### See Also

>     anaOut, anaOutVolts, anaOutCalib

> ## int anaOutEEWr(int channel);

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

> ##### Parameters

>   `channel` is the D/A converter output channel. `channel` should be passed as

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

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

>     channel = ChanAddr(slotnumber, channelnumber)

>   where `slotnumber` is 0-6, and `channelnumber` is 0-7.
>   voltage is the voltage desired on the output channel.

> ##### Return Value

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

> ##### See Also

>     anaOutEERd

> #### 9.5.4 Sample Programs

> - `ANAVOUT.C`--Demonstrates how to set the D/A channel for the desired output.

> - `SSDAC1.C`--Demonstrates how to recalibrate a D/A converter channel using two known voltages, and shows how to define the two coefficients, gain and offset, that will be rewritten into the D/A converter card's EEPROM.

> - `SSDAC2.C`--Demonstrates how to recalibrate a D/A converter channel using an A/D converter card and two known voltages. Shows how to define the two coefficients, gain and offset, that will be rewritten into the D/A converter card's EEPROM.

> - `SSDAC3.C`--Demonstrates how to recalibrate a D/A converter channel using two known currents, and shows how to define the two coefficients, gain and offset, that will be rewritten into the D/A converter card's EEPROM.

> - `SSDAC4.C`--Demonstrates how to recalibrate a D/A converter channel using an A/D converter card, two known currents. Shows how to define the two coefficients, gain and offset, that will be rewritten into the D/A converter card's EEPROM.

> ##### 9.5.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.

> ### 9.6 Electrical and Mechanical Specifications

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

> Figure 44. D/A Converter Card Dimensions

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

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

> Table 17. D/A 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 50 mA typical from backplane (+5 V supply) 15 V to 30 V DC, 30 mA at 24 V DC, +RAW/+V_USER from backplane
> Number of Outputs | 8 channels
> Analog Output Ranges | SR9400: 0 V to +10 V, 20 mA/channel (maximum) SR9410: -10 V to +10 V, 20 mA/channel (maximum) SR9420: 4 mA to 20 mA, 10 V (maximum)
> Resolution | 12 bits (0-4095)
> Conversion Time (including Dynamic C) | 0.2 ms/channel
> Output Stability | ±½ count
> Output Impedance | SR9400: < 1 W, SR9410: < 1 W, SR9420: > 100 kW

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