MSP Protocol Theory

Table of Contents

1 Introduction

2 SensorPulse Analog Input Format

3 SensorPulse Analog Output Format

Download this page as a Microsoft Word file "Notes.doc" for best printing.


  1. Introduction

  2. The SensorPulse communicates analog information to and from the PLC digitally via one of its patented single wire communications protocols. A library of PLC software drivers is included with the SensorPulse to interpret or generate the protocol for the major PLC brands and models. The user selects from the supplied SensorPulse Driver library the program that matches the PLC that they intend on using for their application. The selected program is then pasted into their PLC program or can be used as a starting point for their program development. Each supplied driver is a set of standard ladder logic rungs that has been optimized for the target PLC. Each of these drivers allows a single discrete PLC input or output to receive or send the SensorPulse digital pulse train of analog information.

    Because SensorPulse software drivers use standard ladder logic instructions SensorPulse can be configured to work with almost any PLC, even PLCs for which pre-written drivers are not currently available. This document provides a detailed description of the theory of operation that of the SensorPulse protocols for those that need to write a protocol or those that wish to understand the technical details of how the SensorPulse protocol works.

    Three different input or output communications protocols are available to the user.

    Basic SensorPulse: Transmits a 16 bit signed binary word in every message.

    Delta SensorPulse: (Default) transmits a 4 bit signed binary delta change in the value most of the time. At regular intervals or when there is a large change in the value the complete 16 bit signed binary word is transmitted.

    Hi-Speed Count: Transmits a string of pulses where the total count is equal to the value.


     

  3. SensorPulse Analog Input Format

    1. PLC As A Receiver

    2. Conventional serial transmission communications methods work with a bit string that is transmitted at a fixed rate. The burden is then completely on the receiver to synchronize it’s sampling with the transmission. This is usually done in hardware and software is presented with an interpretation of the transmitted string. Usually the factor that limits performance is the transmission media and much of the effort of the receiver goes into reading a blurred signal. Again, this is usually done in hardware.

      In the patented SensorPulse system the ability of receiver is the limiting factor. In the SensorPulse system the receiving hardware only presents an on or off signal to software. The transmission media is not a factor and the signal is received vitally as sharp as it is transmitted. The most important limitation is that software has a fixed sampling interval and cannot adjust its phase or frequency to accommodate the transmitter. The SensorPulse uses software exclusively to interpret the transmitted string. The software algorithm deals with the probabilities of what is received versus what is transmitted. Some of the patent claims have to do with methods of varying the timing of the transmission to bias the probabilities of how it will be received. Several methods have been patented that that provide varying degrees of stability and accommodate varying abilities of the transmitter. Described in this document is the method best suited for use with PLCs.

    3. Probabilities

    4. The under lying physical principal is found in the graph of received probabilities (Figure 1). The unit of time used on these curves is the Scan Time of the receiver. Scan time may also be thought of as the sampling interval. In general the sampling time of the receiver is very short compared to the sampling interval or scan time. The receiver takes a snap shot of the inputs then processes the interpretation logic and waits. The scan time timer is started when the receiver starts to look at its inputs. When the scan time is completed the cycle restarts. The scan timer is reset, a snap shot of the inputs is taken, the interpretation logic is executed and the receiver waits until the scan timer times out.

      Figure 1 - Received Probabilities

      If the transmitter transmits a pulse that is 3 scans long the receiver may see one of three signal lengths. Figure 2 shows the highest probability reception. In this case Transmission and Receiver Sampling are out of phase and the sampling occurs some time after the start of the transmission. In this case the receiver will see a signal that is 3 scans long which is the same as the transmission. From the probability graph this occurs 96% of the time.

      Figure 2 - High Probability Reception

      Figure 3 illustrates when the Transmission and Receiver Sampling are in phase or transmission starts during the sampling period. In this case it is unpredictable whether sampling will see the signal. If the results of the first sample are unpredictable then the fourth sample will also be unpredictable. If the transmission is seen in both sample 1 and 4 then logic will perceive the pulse being 4 scans long. If the transmission is missed in both sample 1 and 4 then logic will perceive the pulse being 2 scans long. There is also the chance that one sample may see the transmission and the other one will not so that logic will perceive the pulse being the proper length of 3 scans.

      Figure 3 - Low Probability Reception

      From the received probability graph (Figure 1) one can see that the 2% of the time logic will see a short scan and 2% of the time logic will see a long scan. This graph is the result of testing a single receiver and transmitter. Variations in the exact probabilities may vary depending on the accuracy of the two clocks in the system. While exact numbers may change the general principal outlined in this graph will always hold true since no two clocks will ever match exactly.

      Note from the probability graph that if the transmission is close to or less than one scan there is a chance that the transmission may be missed completely. Since this is unacceptable any, transmission method that calls for transmission timings close to 1 scan or less are not viable choices.

    5. Default Pulses

    6. The SensorPulse works with two types of pulses that have statistically unique lengths. These pulses are the ID pulse and Data pulse. The ID pulse occurs only once in a message and signals its start. All other pulses lengths are data pulses. This unique ID pulse allows synchronization between the transmitter and receiver.

      In order to achieve the highest throughput we have chosen a default ID pulse of 1.2 scans and data pulses as 3 scans. We have found this provides adequate statistical uniqueness to provide stable operation. From Figure 4 a pulse of 1.2 scans will be perceived as 1 scan 83% of the time and 2 scans 17% of the time. A pulse of 3 will be perceived as 3 scans 96% of the time , 2 scans 2% of the time, and 4 scans 2% of the time.

      Figure 4 - Received Probabilities

      This set of numbers may experience some short term instability at the power. Since all the time periods and the number of the data bits are known to both transmitter and receiver, the receiver knows when to look for the next identification pulse. There is a chance that there may be a few misses when the system is first started but once the system becomes synchronizes it will tend to remain synchronized with repetitive transmissions providing long term stability.

    7. Basic SensorPulse Message Format

    8. The Basic SensorPulse communication protocol from Digital output on SensorPulse unit to the PLC consists of an ID pulse followed by data pulses. The exact order is: an off data pulse, an ID pulse, an off data pulses, and 16 bits of data. The 16 bits of data consist of a signed twos compliment 16 bit binary number capable of representing a number between -32768 and 32767.

      Figure 5-Input Basic SensorPulse Message Format

    9. Delta SensorPulse Message Format

    10. The Delta SensorPulse communication protocol from Digital output on the SensorPulse unit to the PLC consists of an ID pulse, a delta type pulse and data pulses. The exact order is: an off data pulse, an ID pulse, an off data pulses, a delta type data pulse, and either 4 or 16 bits of data. The data consist of a signed twos compliment 4 or6 bit binary number. If the delta type bit is off the value following is a 16 bit number capable of representing a number between -32768 and 32767. If the delta type bit is on the value following is a 4 bit number capable of representing a number between -8 and 7. When the delta type is received the 4 bit number is added to the last 16 bit number to yield a new 16 bit number.

      Figure 6-Input Delta SensorPulse Message Format, Delta Bit Off

      Figure 7-Input Delta SensorPulse Message Format, Delta Bit On


  4. SensorPulse Analog Output Format

    1. SensorPulse As A Receiver

    2. The SensorPulse as a receiver is much more flexible than the PLC. The probability concepts of what is received verses what is transmitted are not necessary. A more conventional method of directly measuring pulse time is possible. This method leads to an output protocol that is easy to program in the PLC.

    3. Basic SensorPulse Message Format

    4. The Basic SensorPulse communication protocol from the PLC to Digital input on SensorPulse unit consists of an ID pulse followed by data pulses. The exact order is: an off data pulse, an ID pulse, an off data pulses, and 16 bits of data. The 16 bits of data consist of a signed twos compliment 16 bit binary number capable of representing a number between -32768 and 32767.

      Figure 8-Output Basic Output SensorPulse Message Format

      The difference between the output protocol and the input protocol is the shape of the data pulse. For the Scan of a data bit the output of the PLC is on. In the second scan the output is either on or off depending on the data bit. In the third scan the output is off. This provides an off to on transition for each bit and the SensorPulse input then measures the time to the on to off transition.

      Figure 9-Data Pulse Coding

    5. Delta SensorPulse Message Format

The Delta SensorPulse communication protocol from Digital output on the SensorPulse unit to the PLC consists of an ID pulse, a delta type pulse and data pulses. The exact order is: an off data pulse, an ID pulse, an off data pulses, a delta type data pulse, and either 4 or 16 bits of data. The data consist of a signed twos compliment 4 or6 bit binary number. If the delta type bit is off the value following is a 16 bit number capable of representing a number between -32768 and 32767. If the delta type bit is on the value following is a 4 bit number capable of representing a number between -8 and 7. When the delta type is received the 4 bit number is added to the last 16 bit number to yield a new 16 bit number.

Wave_Out_Delta_Full.gif (5476 bytes)

Figure 10-Output Delta SensorPulse Message Format, Delta Bit Off

Wave_Out_Delta_Delta.gif (3880 bytes)

Figure 11-Output Delta SensorPulse Message Format, Delta Bit On

 


SensorPulse Corp. • P.O. Box 8886 • Michigan City, IN 46361 • Ph: (800) 447-5900 or (219) 393-7218 • Fax: (219) 393-7318

© 1998-2002 SensorPulse Corp., All Rights Reserved.
Updated July 2003