|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data CapturePrinciples of OperationEvan Daniel, Stephen Daniel Last Update, July 12, 2007 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionThe data capture board is designed as a low-cost system for capturing 0-5V sensor data during a test of an amateur class rocket motor. The basic goal is to capture reliable 4-channel by 12 bit data as cleanly as possible. We expect to capture data at 4 KHz, filtered by a 6th order Bessel filter calibrated to reduce gain by 70 dB at the Nyquist frequency. This should allow reasonable response out to 500 Hz. NOTE: first build-out will only populate two of the four channels. Captured data is stored on an MMC memory card. The memory card is transported to a computer for analysis. Major ComponentsPhysicalThe data capture system will be mounted in an all-metal box for both fire safety and electrical noise reasons. The box will be approximately 9" by 6" by 2.5" deep. All external connections will be made to connectors mounted on the front pannel. ElectricalElectrically the data capture system has two major subsystems. The analog subsystem is responsible for cleaning amplifying and filtering all sensor data. The digital subsystem converts the data to digital format and stores it on the MMC card. External Connections
External Controls
External Indicators
ConfigurationThe system has no configuration options. Operating StatesIdleWhen the system is powered up, it enters with an error state or an idle state. In the idle state the system believes it is ready to record. All sensors are sampled once per second and the sensor values are sent to the RS232 port once per second. During the idle state the system is also available to receive commands over the RS232 line. Command InputIf the system is in idle state and a '^C' character is received on the RS232 line it will enter the command input mode. Entering a blank line will return the system to idle mode. Pressing the start button will force the system into the run mode. ErrorIf any error occurs the system enters an error state. In this state the error light is lit and an error message is sent to the RS232 port once per second. The following error messages are possible:
The only way to clear the error state is to power off the system. RunThe system enters this state if the Start button is pressed while the system is in either the idle or command input state. During the run the system records sensor data at 4KHz to the data file. The system may enter an error state at any time during the run. The system can go from Run to Idle by pressing the Stop button. Each time the Run button is pressed a new data file is created. Data files are named DATAnnn.dat, where nnn is a sequence number. The system finds the lowest number nnn such that there is no file named DATAnnn.dat on the MMC card. The system cannot format the MMC card, overwrite a file, nor erase a file. While running the system will write data to the MMC card at just under 48 KB per second. Memory LowIf the system is completely out of memory, this is an error state. Both the Memory Low LED and the Error LED will be lit. If the memory low LED is lit solid, then the system has less than 5 minutes of data space available. This is a warning that can occur during either run or idle state. If the memory low LED is blinking slowly (once every two seconds), then the system has less than 30 minutes of memory. This is a warning that can occur during either run or idle state. 30 minutes of space is equivalent to about 84 MB of memory. File FormatOverviewData files have 3 sections. Each file begins with a header, contains a binary data section, and ends with an end marker. The formats are designed to be complete, simple to create, and somewhat extensible. HeaderThe header is an integral number of 512 byte blocks. The blocks are filled with ASCII data, terminated by a null byte. After the first null byte the 512 byte block is null padded. The header consists of multiple lines. Each line contains a keyword, one or more white space characters, a value, zero or more white space characters, and a linefeed. The following keywords are generated by the first version of the system:
DataThe data records are binary. Each is 12 bytes long. 12 byte records are placed into each 512-byte block until either data capture stops or there is no more room. Any unused bytes will be zero. (Note: the last 8 bytes of any data block will always be zero. Typically the system will put 42 records in each block. Each data record contains a sequence number. These are necessary because if the MMC card is slow then datra records may be dropped. This should not happen under normal circumstances, but if it does lost records can be detected by gaps in the sequence numbers.
End MarkerAfter the last data record the system writes an end marker, consisting of 12 consecutive bytes of all ones. Serial Port CommunicationAll serial port communcation happens at 9600 baud, 1 start bit, 1 stop bit, 8 data bits, no parity bit. Idle ModeWhen the system is idling, it will transmit the state of its inputs once per second. The four digital inputs are sent as a string of 4 digits, each a one or a zero. Each analog channel's state is sent as a decimal number in the range 0-4095, preceded by a space, with leading zeros. Command Input ModeThe system enters command input mode when a '^C' character is received on the serial port. In this mode the waits for input. Each input command is a single letter, followed zero or more whitespace characters, the data for that command, and then a newline. As part of processing the command the system may send data back to the operator. Once the command execution is complete the system returns to idle mode. The following commands are processed by the system:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||