Design description, METSYS Meteorological Data Logger. MBARI 5590 Revision history: first draft 11:14 AM 1/6/98 Dave Wright more fiddling 11:59 AM 1/13/98 DKW revise deployment 2:15 PM 1/15/98 DKW more on compass 5:44 PM 1/22/98 DKW revise units and compass calibration 10:32 AM 2/12/98 DKW a few minor edits 4:56 PM 5/29/98 DKW clarification of wind sensor alignment 10:39 AM 6/9/98 DKW added section about reading/setting realtime clock 2:25 PM 11/30/98 DKW definition of buoy origin for compass checking 2:12 PM 04/30/1999 DKW Added description of Sonic Anemometer interface 1:31 PM 06/11/1999 DKW Related Documentation: Metsys.dsn OrCAD Capture design file. TCM2 Electronic Compass Module User's Manual, Precision Navigation Inc. CS105 Barometric Pressure Sensor Instruction Manual, Campbell Scientific Inc. RM Young Model 05103 Wind Monitor instructions, RM Young Company. Rotronic HP101A Series Instruction Manual, Rotronic Inc. CR10X Measurement and Control System Operator's Manual, Campbell Scientfic Inc. PC208W Datalogger Support Software Instruction Manual, Campbell Scientfic Inc. Overview: The METSYS was developed as a replacement for the met functions handled by the ATLAS system on the OASIS moorings. It is designed to provide basic meteorological data measurements on moorings, ships, or fixed installations. The METSYS is based on the Campbell Scientific model CR10X data logger with off-the-shelf sensors for the met measurements, and a small ammount of custom cicuitry to support low power operation. Measurements are made at 10 minute intervals and stored in the logger for later retrieval by the OASIS controller or other computer. The METSYS contains a tilt compensated magnetic compass, and corrects all wind measurements to magnetic direction as well as recording the orientation of the platform on which it is mounted. Wind measurements are sampled at one second intervals for a 59 second period and a vector average is computed and stored at each 10 minute interval. The magnetic compass heading information is subjected to an identical vector average during the wind sampling period. Air measurements occur at the end of the wind averaging period, and include temperature, humidity, and pressure. Sensors: The current version (prototype) of the METSYS contains the following sensors. Vaisala PT101B / Campbell CS105 analog Barometer, 600-1060 mB range, 1.5 mB total accuracy over a 0 to 40 C temperature range. RM Young model 05103 wind monitor. Rotronic HP101A Air Temperature / Relative Humidity probe. Precision Navigation TCM2 Electronic Compass Module. Data format: Note, refer to Metsys_arrays.txt for the latest information. The units below are for METLOG41.CSI, array ID 303. Measurements from the sensors are stored in engineering units as follows. Precision is 4 digit floating point in all cases. Day of the Year. Hour and Minute of the Day. Battery charge state as Volts. Barometric Pressure as Millibars minus 800 i.e. 1013.55 mB = 213.6, 1001.32 mB = 201.3, 982.36 mB = 182.4. Air Temperature as Degrees Celsius. Realtive Humidity as Percent. Wind Speed as Knots, one minute vector average. Wind Direction as degrees Magnetic, one minute vector average. MagWind = (WindVane + BuoyHeading) MODULO 360 Buoy Heading as degrees Magnetic, one minute vector average. Wind Vane orientation as degrees relative, one minute vector average. Power Requirements: The Metsys is capable of operating from internal batteries, an external supply, or both. Diode isolation is provided between internal and external supplies. The supply voltage can range between 10 and 16 volts. The average current consumption for the system is 1.67 mA, peak current is less than 100 mA during measurement. Daily consumption is 40 mA/Hr/Day based on a 10 minute cycle. Power Switching: All of the the external sensors which require power are connected to the supply via FET switches controlled by output bits on the logger. Power is applied to the sensor only long enough to make the required measurement. See metsys_*.pdf for a schematic of the connections to the logger, and powerswitch_*.pdf for the specifics of the FET circuit. Environmental: Temperature limits for operation are typically -20C to + 40C, exclusive of battery considerations. Communications interface: A micropower true RS-232 serial interface is provided in the METSYS to allow the OASIS controller to wake up the logger and extract stored data at any time. Refer to serial_adapter.pdf for a schematic diagram. When the RS-232 input to the METSYS enters the marking state for more than ~1mS, the wakeup signal to the logger is asserted on P11,3. The logger acknowledges the wakeup via P11,5 going high, and awaits a character for autobaud detection, to which it responds with a "*" prompt. The details of the download protocol can be found in Metlog_drv.txt. The recommended comm parameters are 9600N81. THE DB9 CONNECTOR ON THE CR10X LOGGER IS -NOT- RS-232!!! You must use the Metsys or Campbell serial adapters to connect to the logger. Deployment considerations: The Compass module within the Metsys contains electrolytic tilt sensors, which are used in conjunction with the output of the magnetometers to calculate the corrected magnetic heading. The tilt sensors will be affected by accelerations as well as tilt, and as a result the Metsys electronics package should be located at or near the center of motion of the platfrom to which it is attached. The origin of the Metsys compass within the housing is aligned with the axis between the wind sensor mast and the multi section "pie" connector. This origin axis should be aligned with the bow of the vessel, or if on an OASIS mooring, with the larger diameter leg of the tower (fat leg). The origin (0 degrees relative direction) of the wind sensor is defined as the electrical midpoint of the potentiometer (half resistance), and must be aligned with the origin of the compass. This is opposite from the electrical transition point of the wind sensor, and is done to avoid the 5 degree deadband sector when subjected to relative winds from ship forward motion. Program Notes: The control program for the METSYS is written in Campbell's proprietary logger language, the details of which are covered in the Campbel CR10X manual. A copy of the source code can be found in Metlog42.txt. Provision for a fast sampling mode is included in the program to allow data to be collected every minute instead of every ten. This was done to allow for calibration and testing (see statement 2). The TCM2 compass module must be configured to operate in SIN/COS analog output mode. This is done via the serial port on the TCM2 module when the system is first assembled. The configuration is kept in flash memory onboard the TCM2 module and should not need to be updated unless the unit is behaving strangely, see below. The logger's program is organized such that it is possible to "snoop" at the data as it is being collected using the tools included in the Campbell PC208W development environment. The logger samples data whenver power is present, and has non-volatile data storage and realtime clock. In the current revision of the program (metlog42.csi) each 10 (or 1) minute sample requires 22 bytes of storage within the logger (array type 302), and with a 128KB model logger works out to a capacity for 5661 arrays, or 39 days. If any changes are made to the logger program such that the number of data items stored, or their definition is changed, a new array type should be defined and documented in Metsys_arrays.txt so that consumers of the data can decode the output. TCM2-50 Compass Configuration: The Compass module should be set for the following modes before installation in the Metsys. Calibration may be required when compass is new or ferrous metal is present in the deployment environment. See TCM2-50 manual for details. If unsure of the status of the compass configuration do the following. Connect a terminal set for 9600N81 to the compass serial connector, and apply power to the compass. If data is appearing, enter "h" to halt the output. Enter ^e (control e) to enable echo mode. Enter "factory " to place the compass in the default configuration. All calibration is lost at this point. Enter the following configuration parameters: ec=e ep=d er=d ed=e sao=q clock=5 seriallp=e save Entering "go" at this point will cause a continuous output of heading. Enter "h" to halt the display. Now perform a multipoint calibration. To do so you must be able to tilt the Metsys package, with the compass in its final mounting, while turning a slow circle. Gyrate the Metsys through excursions of +-30 degrees in pitch and roll about every 3 seconds while turning through 2 complete circles of heading in 3 minutes. Enter "mpcal=ego" to start the sampling, and then begin the dance. After the two circles are complete enter "h" to halt the display, then "lc?" to see the score. You want to see H9V9Mxxx, where xxx is less than 30 and H and V are 9. M numbers greater than 30 indicate excessive magnetic field strength from an interfering object. If the score is good, enter "mpcal=d" to close the calibration, or "cc" to start over. Be sure to set "mpcal=d" before saving or powering down the unit. If it is not practical to perform the multipoint calibration, an alternative method exists. It requires that the compass and its housing be capable of precise orientation in three positions 180 degrees relative to each other (initial, rotated 180, upsidedown). See the CAL3 document for details. It is important that the calibartion be carried out in as near as possible the final magnetic environment it will see during deployment. Calibration should be done outdoors away from any ferrous metals. Buildings, ships, workbenches, partition frames, have all been observed to interfere with the compass. Before turning off power to the compass module, the "go" command must be entered so that it will wake up in a sampling state rather than a standby state. Otherwise no analog data will be output. If any of the above is not clear, it is important to refer to the TCM2 manual before attempting to configure or calibrate the compass. Program statement 8: reads the analog output of the compass module. The voltage swing of the SIN/COS signals is ~0-4V. This signal is fed to a 10:1 precision divider at the input of the logger, and read differentially. The multiplier and offset values are chosen to normalize the signal swing to ±1.0 for subsequent conversion to a polar value. Getting Most Recent Data: In some cases it may be desired to get a quick look at the most recent data collected by the Metsys, whether via the OASIS "connect to instrument" command, or by a direct serial connection to a laptop or dumb terminal. This is accomplished by setting serial parameters to 9600N81 (direct connection case), entering until a <*> is received, enter B, followed by D. You will get lines similar to what you see here in response; * *B A1 L+38116 C0744 *D 01+0302. 02+0015. 03+1330. 04+12.74 05+23.10 06+59.60 07+14.52 08+0.191 09+24.02 10+094.1 11+305.9 A1 L+38127 C5772 *E This is the most recent array stored by the logger, and can be decoded by noting the first record value, 01+0302., which is the array type id, and then referring to Metsys_arrays.txt, which defines the meaning of all values that follow. In this case; Array type 302: Generation interval, 10 minutes normal, 1 minute in test mode. 01 Array type 02 Day of year 03 Hour and Minute 04 Battery Voltage 05 Air Temperature, degrees C. 06 Realtive Humidity % 07 Barometric pressure in Millibars, modulo 1000. 08 Average Windspeed Knots 09 Average Wind direction, degrees TRUE 10 Average Buoy heading, degrees MAGNETIC 11 Average Wind direction, degrees relative to buoy or platform See Metsys_drv.txt for additional details. Realtime Data Viewing / Debugging: If it is desired to see data values on a second-by-second basis, you must use the tools provided by PC208W, the Campbell development environment. These tools are not designed to work over the MBARI packet radio link, only by direct hardwired connection. Checking / Setting the Realtime Clock: The Campbell logger contains its own realtime clock. It can be checked by entering 'C' at the * prompt. The format for the reply is Year, Day of Year, HH:MM:SS, and checksum. It would look like this: *C Y98 D0334 T00:30:48 C1257 To change the time you may enter HH:MM:SS immediately followed by an uppercase 'C' and , or DDD:HH:MM:SSC for the day of year as well as time, and also YY:DDD:HH:MM:SSC for the entire date/time state. For example: *98:334:21:31:00C 98:334:21:31:00C Y98 D0334 T21:31:01 C2079 * ...would set the date/time to 21:31:00 hours on November 30th. 1998. More detail can be found in the Campbell CR10X manual, Section 5, and table 5.1-1. ************************************* Addendum ********************************* Using the Handar Model 425 Ultrasonic Anemometer with the Metsys Related documentation: Handar Model 425 Users Manual, filename "SonicMan.pdf" Campbell CR10X sourcecode, filename "METLOG60.CSI" Metsys Data Array descriptions, filename "Metsys_arrays.txt" Schematic diagrams, "SonicCable.pdf" and "Metsys_sonic.pdf" The Sonic Anemometer replaces the function of the RM Young windvane. It provides a measurement of the speed and direction of winds from 0 to 125 MPH, and also the velocity of sound. The sourcecode file METLOG60.CSI is specific to the Sonic Anemometer version of the Metsys. What follows is a discussion of what is different between the Sonic and the RM Young versions of the Metsys. The electrical interface between the Sonic and the CR10X datalogger consists of three wires. They are Power, Ground, and Data. The data connection is bidirectional serial conforming to the SDI-12 specification. The power and ground connections are provided at the powerswitch board within the Metsys, and the serial connection is made to I/O port number 1 on the CR10X. The Sonic will return 5 data items each time it is triggered and polled by the CR10X. They are Windspeed in MPH, Wind direction in Degrees, X axis component of windspeed, Y axis component of windspeed, and Sound velocity in MPH. If the Sonic encounters an error in the measurement it returns 999 as a windspeed. This is detected, the M_ERR_CNT is incremented, and the velocity of that sample is set to zero so as to not affect the vector average (in the case of a transient error). If the CR10X receives no response to its command to the Sonic to sample, the C_ERR_CNT counter is incremented, and the velocity is set to zero. At the end of 59 consecutive samples, if there are no errors, the average of the velocity of sound is stored. If there were errors, the velocity of sound record is replaced with the count of measurement and/or communication errors for that averaging period and the counters are zeroed. The counts are represented in the form -MM.CC. The number is always negative to indicate that this is an error count rather than a velocity of sound record. MM is a number in the range 00-59 and is the number of measurement errors, CC is a number in the range 00-59 and is the number of communications errors, for the wind data recorded for that minute. The data that the Sonic returns are in MPH units, this is converted to Knots immediately after the error checking is done. When viewing the data in realtime with the Campbell PC208W tools, both Wind Velocity and Velocity of Sound will appear as Knots. The X and Y axis values are not converted as they are not used in any way. The METLOG60.CSI version of the code also differs from previous versions in that it samples the Barometer and RHT probes the same number of times as the Wind and Compass, and stores the average of those values as well. The code is also configured for the Rotronic RHT probe with a -40C to +60C / 0V to +1.00V output range. The mounting adapter supplied with the Sonic is designed for retrofit on masts that formerly held RM Young windvanes. The slotted portion fits over the alignment pin of the mast and will orient the origin of the Sonic with that of the Metsys. The top of the Sonic is marked to indicate two arms which form a North-South sighting line. If it is desired to replace the aluminum adpater with something more corrosion resistant, be sure to align the "North" direction with the Metsys origin. END