SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
CAN BUS
    &
ALMA AMB




   ALMA - ADE   1
General Information
•  History
       The abbreviation CAN stands for Controller Area Network. This bus
       system was developed by the Robert Bosch GmbH in the 1980s.
       The original area of application was the automotive sector. The
       reason for developing was the increasing share of controller and
       automating technology (ABS, ASR) that required a communication
       between different components. The foundations were laid by the
       high quantities and a wide distribution. This caused that meanwhile
       CAN is applied in wide areas that need a field bus.




11/06/2012                           ALMA - ADE                          2
Pedro Campana
Antenna Control Specialist
General Information
•      Basics
        The Controller Area Network (CAN) is a serial communications protocol
       which efficiently supports distributed real-time control with a very high level
       of security. Its domain of application ranges from high speed networks to
       low cost multiplex wiring. In automotive electronics, engine control units,
       sensors, anti-skid-systems, etc. are connected using CAN with bitrates up
       to 1 Mbit/s. At the same time it is cost effective to build into vehicle body
       electronics, e.g. lamp clusters, electric windows etc. to replace the wiring
       harness otherwise required.

Some characteristics:
• Minimization of wiring effort
     • High error safety (fail-safe), robustness
     • Small latency time (i.e. time between desired start of sending and actual start of
        sending is as small as possible)
     • Distributed systems, several receiver
     • Good extensibility
     • Priorization of messages
     • Lower-cost


11/06/2012                                 ALMA - ADE                                       3
Pedro Campana
Antenna Control Specialist
Overview ISO / OSI Layer Model
                                             Layer 7:
                                             Execution of the field bus tasks




                                             Layer 2:
                                             Bus access, frame format and testing,addressing

                                             Layer 1:
                                             Definition of transmission medium and plug-andsocket
                                             connection, level, coding, bit rate


        Out of the 7 layers, only the blue colored ones ( 1, 2, and 7 ) are considered for field busses

11/06/2012                                          ALMA - ADE                                            4
Pedro Campana
Antenna Control Specialist
Overview ISO / OSI Layer Model




11/06/2012                   ALMA - ADE   5
Pedro Campana
Antenna Control Specialist
Description of CAN
•  OSI Layer 1: “Physical Layer”

       In principle, CAN is designed for serial data transmission in a bus topology.
       But the CAN specification doesn’t determine the transmission medium. In
       the ISO standards it was planned that the transmission medium for CAN is
       an electrical differential two-wired line. However, in case of an error the
       transmission can also take place with a one-wired line and the same
       reference potential (ground). The advantage of the differential voltage
       transmission on a two wired line compared to a one-wired line is the low
       liability to potential differences and interferences on the line.




11/06/2012                              ALMA - ADE                                 6
Pedro Campana
Antenna Control Specialist
Description of CAN
•  OSI Layer 2a: “MAC=Media Access Control”
       The CAN bus is using CSMA/CA (Carrier Sense Multiple Access / Collision
       Avoidance) as access method. It is working with the following scheme:
        –  Carrier Sense
                Each participant that wants to send listens if the bus is occupied ( carrier sense)
                and starts the sending process when the bus was idle for a certain time.
         –  Multiple Access/Collision Avoidance
                There is the possibility that several participants start to send at the same time
                ( multiple access). The resolving of an eventually appearing collision is carried
                out as part of the arbitration process. Hereby all the affected participants start by
                putting their frames (starting with the identifier) bit by bit on the bus. After each bit
                the sender checks if the actual level on the bus corresponds with the level that it
                applied on the bus. If not it stops sending immediately. This results that message
                with the highest priority gains the bus access without the destruction of the
                message (collision avoidance).




11/06/2012                                          ALMA - ADE                                          7
Pedro Campana
Antenna Control Specialist
Description of CAN
•            OSI Layer 2b: “LLC-Logical Link Control”
             The communication on the bus is based on four different frame formats:
1.          Data Frame
            The data frame transfers data from a transmitter to one or more receivers on the data source’s
            ( transmitter) initiative.
2.          Remote Frame
            A participant of the bus uses the remote frame to trigger the sending of a special data frame
            with the same identifier by a data source. Data frame and remote frame only differ in a varying
            RTR bit ( RTR bit of remote frame =1, RTR bit for data frame=0 ) and a missing data field of
            the remote frame. This results that the data frame will prevail when there is a simultaneous
            request and transmission of a frame.
3.          Error Frame
            If a participant of the bus recognizes an erroneous frame ( e.g. wrong checksum in CRC field),
            it reports this by sending an error frame. Therefore a sequence ( 6 bits with the same polarity)
            that isn’t permissible during normal operation is switched on the bus. This implicates that all
            the other ( fully functional node) switch themselves an error frame on the bus as the bit stuffing
            rule was violated. An error frame is terminated with 8 recessive bits.
4.          Overload Frame
            An overload frame is used to enlarge the spacing between two frames. It can only be sen dat
            the beginning of the spacing. By switching of 6 dominant bits (overload flag) on the bus the
            defined form of the spacing is destroyed and overload is signalized. As a result all the nodes
            are also sending overload frames.



11/06/2012                                           ALMA - ADE                                              8
Pedro Campana
Antenna Control Specialist
Description of CAN
•      Frame 2.0 A Standard

                                                 Start of Frame: 1 dominant bit to identify
                                                 start
                                                 Arbitration field: 11 bit identifier + 1 bit
                                                 RTR (remote transmission request bit)
                                                 Control field: 2 bits reserved for extended
                                                 CAN, 4 bits for data length
                                                 Data field: 0-8 byte of data possible,
                                                 starting with MSB
                                                 CRC-field: 15 bit generator polynom
                                                 (x15+x14+x10+x8+x7+x4+x3+1) + 1
                                                 recessive CRC delimiter bit
                                                 ACK-field: 1 bit ACK-slot + 1 bit ACK
                                                 delimiter (recessive): transmitter sends
                                                 recessive bit in the slot; recipients that
                                                 received error free, send a dominant bit in
                                                 the slot.
                                                 End of Frame: 7 bit

11/06/2012                          ALMA - ADE                                           9
Pedro Campana
Antenna Control Specialist
Description of CAN
•      Frame 2.0 B Extended Format (Used in ALMA)




       SOF: Start of Frame
       SRR: Substitute Remote Request BIT
       IDE: Identifier Extension Bit
       RTR: Remote Transmission Request BIT
       r1: Reserved bit
       r0: Reserved bit
       DLC: Data Length Code




11/06/2012                                    ALMA - ADE   10
Pedro Campana
Antenna Control Specialist
Description of CAN
•  OSI Layer 7: Applications
       While layer 1 and 2 are already intended for international standardizations (ISO-DIS
       11 898 and ISO-DIS 11 519), there is not yet a norm for the application layer. The
       introduction of a layer 7 the application process can be completely uncoupled from
       the communication processes.




11/06/2012                                  ALMA - ADE                                        11
Pedro Campana
Antenna Control Specialist
Safety Mechanisms
             In order to reduce the fault liability of the CAN bus the following safety
             mechanisms are realized:

1.)          Bit Monitoring Each transmitting network node monitors whether or not the bus level it has
             transmitted is actually present on the bus. Otherwise a fault has appeared that has to be
             dissolved or the sending process has to be terminated (arbitration phase).

2.)          Frame Format Check As the frame format is fixed, every participant of the bus can check
             whether this format is maintained ( e.g. recessive delimiter bits). Otherwise a fault is existent.

3.)          Cyclic Redundancy Check The transmitted message is secured again by CRC. Thereby the
             message is divided by a special polynomial generator and the result is deposit in the CRC
             field. The message is divided again by this polynomial generator by the receiver and the result
             is compared with the transmitted CRC field. If there are not identical a transmission error has
             appeared. (polynomial generator x15+x14+x10+x8+x7+x4+x3+1)

4.)          Bit-Stuffing The CAN protocol uses the NRZ bit coding ( non-return to zero). But this means
             that there are longer phases without bit edges for synchronization. To avoid this an inverted
             stuff bit is set after 5 bits of the same polarity. This bit permits the synchronization of every
             node and is deleted when received.

11/06/2012                                             ALMA - ADE                                                 12
Pedro Campana
Antenna Control Specialist
Bus Topology
•  Generalities
       The cables can be parallel bus, twisted and / or shielded, depending on
       requirements of the electromagnetic capacity. The topology of the wiring
       should be as close as possible to structure a single line, to minimize
       reflections. The segments of cable for connecting nodes in the bus should
       be as short as possible, especially at higher bit rates.
       The bus topology is with derivations short length. With loss of benefits in
       terms of speed or maximum length structures can be taken into star. The
       bus closes at the ends with load impedances (see Figure 3). The use of
       differential voltages enables networks CAN work when one of the signal
       lines are separate




11/06/2012                               ALMA - ADE                                  13
Pedro Campana
Antenna Control Specialist
Bus Topology
           •  Generalities




11/06/2012                        ALMA - ADE   14
Pedro Campana
Antenna Control Specialist
Bus Topology
•      Signal Level
       In the original specification of CAN, the physical layer was not defined, allowing different options
       for choosing the means and levels of electric transmission. The characteristics of the electrical
       signals on the bus were later established by the ISO 11898 standard




                             Absolute levels of bus lines with respect to ground, according to the ISO 11 898
11/06/2012                                                    ALMA - ADE                                        15
Pedro Campana
Antenna Control Specialist
Bus Topology
•      CAN Conector

                                                            Male




                                                                                            Female



                                                   Connector used in ALMA
                                               1    RST            Global Slave Node Reset, Line A
                                               2    CAN_L          CAN_L bus line (Dominant Low)
                                               3    CAN_GND        CAN Ground
                                               4    TE             Time Event Signal A
                                               5    CAN_SHIELD     CAN Bus Shield
                                               6    RST            Global Slave Node Reset, Line B
                                               7    CAN_H          CAN_H bus line (Dominant High)

11/06/2012                        ALMA - ADE   8    TE             Time Event Signal B               16
Pedro Campana
Antenna Control Specialist                     9    N/A            Not Used
ALMA Monitor and control System
•  Purpose

           This is the Networking specification for communicating with ALMA electronic
            modules.
           Reading status (Monitoring)
           Sending commands and settings (Controlling)

                                   Components and structure



                                                          “IFP0”
                                 “DA41”
                                                          “IFP1”




                                 “PM02”



11/06/2012                                   ALMA - ADE                                   17
Pedro Campana
Antenna Control Specialist
11/06/2012                   ALMA - ADE   18
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS


         It’s the networking specification for the communication with ALMA electronic
         modules.


         El BUS:
         • CAN - Controller Area Network, Industrial communication standard. In our case wea are
         mainly using the profile CAN 2.0B.
         • Twisted pair cable 100 Ω, Terminator Resistor in both end of bus 120 Ω.
         • Transition Speed 1 Mb/s
         • Maximum Bus Length BUS 35 meters.
         • Differential Signal




11/06/2012                                         ALMA - ADE                                      19
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS

•      ALMA node location in the BUS
       Each device connected to the Bus must have an unique identifier, this identifier is a decimal number between 0
       to 2047, for example in our system we have a standard number of ID in order to identify every device in the BUS:




                             Node Address (ID)
                                                                                           Device Name
                             Hex                Dec
                         0x00                    0            Antenna Control Unit ACU
                     0x29 & 0x2A             41 & 42          Production IF Processor (0x29 is Polarization 0)
                     0x50 – 0x53             80 - 83          DTS Transmitter Module DTX
                     0x40 – 0x43             64 - 67          LO2 synthesizer
                     0x60 & 0x61             96 & 97          BE antenna analog and digital power supply

                       http://edm.alma.cl/forums/alma/dispatch.cgi/icd/showFile/100149/d20070213045555/Yes/AMB+Node+allocations.pdf



11/06/2012                                                              ALMA - ADE                                                    20
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS

•      RCA (Relative CAN Address)

       The address RCA is the memory address to which we access to read (Monitor Point) or write
       (Command Point) in one device. RCA addresses are defined in the document ICD (Interface
       Control Document) for each device.

       For example:

       In the ICD (ALMA-57.03.00.00-70.35.30.00-A-ICD) are defined the monitor and control points of
       the power supply.
       Then the monitor point:

       GET_MID_1_Voltage the address RCA is = 0x00005 (hex) with a length of 2 bytes.




11/06/2012                                       ALMA - ADE                                            21
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS

•      Message identifier structure (Message ID) in the AMB (CAN)
       In the ALMA project we are using the CAN Bus profile 2.0B. This means that the message ID has
       a 29 bits of length with 8 bytes of data :




If we want to read the voltage value of PSD, we should make the following :

Message ID = ((Node Address + 1)* 2^18)+RCA                         convert to HEX

GET_MID_1_Voltage = ((97+1)*2^18)+5 = 25690117                      0x0188 0005

                                                             Identifier A   Identifier B

11/06/2012                                      ALMA - ADE                                         22
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS




                                                0x0188                0x0005          DATA= 0     CRC




                                                0x0188                0x0005       D0= 02 D1=D3   CRC




                                          Reply Data from slave = 0x02D3 ( 2 Bytes)
                                          in decimal = 723
                                          According the ICD the reply value should be divided by 30.088
                                          Then we have the final value:
                                          GET_MID_1_VOLTAGE = 724 / 30.088 = 24.029514 Volts.




11/06/2012                   ALMA - ADE                                                             23
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS

•      Timing signal TE (Time Event)
       The TE is an electrical signal distributed to most electronic devices in ALMA, as a reference for
       the execution of commands so that they are synchronized in time. The pulse TE is delivered every
       48 ms.
        TE does not necessarily signal is generated by the Master of the CAN BUS, but it can be
       generated by any other node. The signal generator contains a transmitter RS485 which will keep
       the bus idle state with a logical "0" (FALSE), and takes the bus to logic state "1" (TRUE)
       periodically with a duty cycle between 1% to 25% , Currently is 12.5%. The cycle is defined in 48
       ms.
                                                                                                                100 % of cycle
                                                                                                                (48 ms)




                                                                                                                12,5 % of cycle
                                                                                                                (6 ms)




                             Example of TE signal. The voltages levels should be according the standard RS485


11/06/2012                                                        ALMA - ADE                                                      24
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS
•            Time Event
             By default, every command transmitted to a device over the AMB is effective immediately upon receipt; and
             every monitor request should return the most recent data available at the time the request is received.
             However, under some circumstances the effective times may be different, as described in the following
             paragraphs. These commands are sometimes referred to as “time critical”.
             When specified in an Interface Control Document (ICD), a specific command may be considered effective at a
             later time than its time of receipt. In such cases, the command is associated with the timing event (TE) that
             immediately follows receipt of the command. See Figure 6. In exceptional circumstances a time-critical
             command may be active at a TE later than the TE that immediately follows the receipt of a command.
             Typically this is done to allow the slave extra time to execute the command. These exceptions must be noted
             in the ICD.
             The monitoring and control system begin transmission of a "Frame" CAN command associated with the TE
             considering that the transfer must be completed no later than 24 ms. , That is no more than 50% of the cycle
             of the TE.




11/06/2012                                                ALMA - ADE                                                   25
Pedro Campana
Antenna Control Specialist
AMB: ALMA Monitor and Control BUS
•      Time Event

       The monitoring and control system can initiate the transmission of the response of request associated with the TE
       not later than the last 24 ms, and the transfer must be completed no later than 4 ms before the next TE. This
       means that any response to a request for monitoring should be passed during a window of 20ms in the latter half
       of the range of 48 ms. Between each TE




11/06/2012                                              ALMA - ADE                                                   26
Pedro Campana
Antenna Control Specialist
AMB: Using the Oscilloscope

       Then we'll use the oscilloscope for analyzing the behavior of the CAN BUS.

       For CAN Bus analyzing we need use the following instruments:

         –      Tektronic Oscilloscope DPO 4034
         –      Differential CAN probe Tektronic P6246
         –      Connector to CAN BUS
         –      Pen Drive or Memory Stick

       In order to make the measurements is necessary connect the differential probe to the point 2 and 7 of DB9
       connector, for this is necessary open the bus and connect the special connector in order to maintain the daisy
       chain of the bus (see picture).




11/06/2012                                               ALMA - ADE                                                     27
Pedro Campana
Antenna Control Specialist
n
AMB: Uso de Osciloscopio

•      Setting the Oscilloscope
                                    • Select Chanel
                                           • Connect differential probe to channel #1
                                           • The impedance is 50 Ohms default
                                           • Coupling = DC
                                           • Invert = Off
                                           • Band With = Full
                                           • Vertical = 1.00 V/div
                                           • Offset = 0 V (Press button MORE )
                                           • Position = -2.5 div (Press button MORE)
                                           • Hz. Scale = 1.0 ms


                                    • Select button B1
                                           • Source = B1(CAN)
                                           • Threshold = 300 mV
                                           • Bit rate = 1 Mbps

11/06/2012                                  ALMA - ADE                                  28
Pedro Campana
Antenna Control Specialist
AMB: Uso de Osciloscopio
                                                    Signal Type = Differential




                                                    Trigger = “Start of Frame
                                                                  or

                                                         If you need to find a specific frame the you
                                                         can select “Identifier” and use your
                                                         message ID as a mask.
                                                         Always you should use the Extended
                                                         identifier.




11/06/2012                             ALMA - ADE                                                  29
Pedro Campana
Antenna Control Specialist
Bibliography and References
•      Paper “ANÁLISIS DE LA CAPA FÍSICA DEL BUS DE CAMPO CAN”, Ing. Hector Cashel y Ernesto Pinto
•      “Can Specifications”, Robert Bosch, BOSCH 1991
•      Lecturas ALMA, “Lectura 3”, Juan Pablo Caram, AIV EE.
•      ALMA Monitor and Control Interface Specification “ALMA-70.35.10.03-001-A-SPE”




11/06/2012                                      ALMA - ADE                                           30
Pedro Campana
Antenna Control Specialist

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Can bus
Can busCan bus
Can bus
 
Control Area Network
Control Area NetworkControl Area Network
Control Area Network
 
CAN- controlled area network
CAN- controlled area networkCAN- controlled area network
CAN- controlled area network
 
CAN Bus
CAN BusCAN Bus
CAN Bus
 
CAN (Controller Area Network)
CAN (Controller Area Network)CAN (Controller Area Network)
CAN (Controller Area Network)
 
Automotive bus technologies
Automotive bus technologiesAutomotive bus technologies
Automotive bus technologies
 
Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)
 
Controller area network protocol
Controller area network protocolController area network protocol
Controller area network protocol
 
Can bus m.n.r
Can bus m.n.rCan bus m.n.r
Can bus m.n.r
 
Canbus presentation
Canbus presentationCanbus presentation
Canbus presentation
 
Comparison Between CAN and CAN FD
Comparison Between CAN and CAN FDComparison Between CAN and CAN FD
Comparison Between CAN and CAN FD
 
Ca npp t
Ca npp tCa npp t
Ca npp t
 
Lin bus
Lin busLin bus
Lin bus
 
CAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus ProtocolCAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus Protocol
 
Can Transport Protocol : UDS
Can Transport Protocol : UDS Can Transport Protocol : UDS
Can Transport Protocol : UDS
 
Canbus
CanbusCanbus
Canbus
 
Can overview
Can overviewCan overview
Can overview
 
LIN protocol description
LIN protocol descriptionLIN protocol description
LIN protocol description
 
Lin protocol
Lin protocolLin protocol
Lin protocol
 
Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)
 

Semelhante a Can Bus communication Protocol

Semelhante a Can Bus communication Protocol (20)

CAN BUS.ppt
CAN BUS.pptCAN BUS.ppt
CAN BUS.ppt
 
CAN BUS.pptx
CAN BUS.pptxCAN BUS.pptx
CAN BUS.pptx
 
IJSTEV2I12120
IJSTEV2I12120IJSTEV2I12120
IJSTEV2I12120
 
Role of CAN BUS in automotives
Role of CAN BUS in automotivesRole of CAN BUS in automotives
Role of CAN BUS in automotives
 
CAN Networks
CAN NetworksCAN Networks
CAN Networks
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
CAN_Introduction.docx
CAN_Introduction.docxCAN_Introduction.docx
CAN_Introduction.docx
 
Computer network (1)
Computer network (1)Computer network (1)
Computer network (1)
 
can bus theory solution
can bus theory solutioncan bus theory solution
can bus theory solution
 
UNIT 2b.pptx
UNIT 2b.pptxUNIT 2b.pptx
UNIT 2b.pptx
 
802 11 2
802 11 2802 11 2
802 11 2
 
wireless.ppt
wireless.pptwireless.ppt
wireless.ppt
 
MEDIUM ACCESS CONTROL Sublayer IN CN.ppt
MEDIUM ACCESS CONTROL Sublayer IN CN.pptMEDIUM ACCESS CONTROL Sublayer IN CN.ppt
MEDIUM ACCESS CONTROL Sublayer IN CN.ppt
 
3-MACSublayer.ppt
3-MACSublayer.ppt3-MACSublayer.ppt
3-MACSublayer.ppt
 
Mac
MacMac
Mac
 
CAN.ppt
CAN.pptCAN.ppt
CAN.ppt
 
Can basics
Can basicsCan basics
Can basics
 
Can Protocol For Automobiles
Can Protocol For AutomobilesCan Protocol For Automobiles
Can Protocol For Automobiles
 
The fundamentals of sonet
The fundamentals of sonetThe fundamentals of sonet
The fundamentals of sonet
 

Can Bus communication Protocol

  • 1. CAN BUS & ALMA AMB ALMA - ADE 1
  • 2. General Information •  History The abbreviation CAN stands for Controller Area Network. This bus system was developed by the Robert Bosch GmbH in the 1980s. The original area of application was the automotive sector. The reason for developing was the increasing share of controller and automating technology (ABS, ASR) that required a communication between different components. The foundations were laid by the high quantities and a wide distribution. This caused that meanwhile CAN is applied in wide areas that need a field bus. 11/06/2012 ALMA - ADE 2 Pedro Campana Antenna Control Specialist
  • 3. General Information •  Basics The Controller Area Network (CAN) is a serial communications protocol which efficiently supports distributed real-time control with a very high level of security. Its domain of application ranges from high speed networks to low cost multiplex wiring. In automotive electronics, engine control units, sensors, anti-skid-systems, etc. are connected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective to build into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replace the wiring harness otherwise required. Some characteristics: • Minimization of wiring effort • High error safety (fail-safe), robustness • Small latency time (i.e. time between desired start of sending and actual start of sending is as small as possible) • Distributed systems, several receiver • Good extensibility • Priorization of messages • Lower-cost 11/06/2012 ALMA - ADE 3 Pedro Campana Antenna Control Specialist
  • 4. Overview ISO / OSI Layer Model Layer 7: Execution of the field bus tasks Layer 2: Bus access, frame format and testing,addressing Layer 1: Definition of transmission medium and plug-andsocket connection, level, coding, bit rate Out of the 7 layers, only the blue colored ones ( 1, 2, and 7 ) are considered for field busses 11/06/2012 ALMA - ADE 4 Pedro Campana Antenna Control Specialist
  • 5. Overview ISO / OSI Layer Model 11/06/2012 ALMA - ADE 5 Pedro Campana Antenna Control Specialist
  • 6. Description of CAN •  OSI Layer 1: “Physical Layer” In principle, CAN is designed for serial data transmission in a bus topology. But the CAN specification doesn’t determine the transmission medium. In the ISO standards it was planned that the transmission medium for CAN is an electrical differential two-wired line. However, in case of an error the transmission can also take place with a one-wired line and the same reference potential (ground). The advantage of the differential voltage transmission on a two wired line compared to a one-wired line is the low liability to potential differences and interferences on the line. 11/06/2012 ALMA - ADE 6 Pedro Campana Antenna Control Specialist
  • 7. Description of CAN •  OSI Layer 2a: “MAC=Media Access Control” The CAN bus is using CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) as access method. It is working with the following scheme: –  Carrier Sense Each participant that wants to send listens if the bus is occupied ( carrier sense) and starts the sending process when the bus was idle for a certain time. –  Multiple Access/Collision Avoidance There is the possibility that several participants start to send at the same time ( multiple access). The resolving of an eventually appearing collision is carried out as part of the arbitration process. Hereby all the affected participants start by putting their frames (starting with the identifier) bit by bit on the bus. After each bit the sender checks if the actual level on the bus corresponds with the level that it applied on the bus. If not it stops sending immediately. This results that message with the highest priority gains the bus access without the destruction of the message (collision avoidance). 11/06/2012 ALMA - ADE 7 Pedro Campana Antenna Control Specialist
  • 8. Description of CAN •  OSI Layer 2b: “LLC-Logical Link Control” The communication on the bus is based on four different frame formats: 1.  Data Frame The data frame transfers data from a transmitter to one or more receivers on the data source’s ( transmitter) initiative. 2.  Remote Frame A participant of the bus uses the remote frame to trigger the sending of a special data frame with the same identifier by a data source. Data frame and remote frame only differ in a varying RTR bit ( RTR bit of remote frame =1, RTR bit for data frame=0 ) and a missing data field of the remote frame. This results that the data frame will prevail when there is a simultaneous request and transmission of a frame. 3.  Error Frame If a participant of the bus recognizes an erroneous frame ( e.g. wrong checksum in CRC field), it reports this by sending an error frame. Therefore a sequence ( 6 bits with the same polarity) that isn’t permissible during normal operation is switched on the bus. This implicates that all the other ( fully functional node) switch themselves an error frame on the bus as the bit stuffing rule was violated. An error frame is terminated with 8 recessive bits. 4.  Overload Frame An overload frame is used to enlarge the spacing between two frames. It can only be sen dat the beginning of the spacing. By switching of 6 dominant bits (overload flag) on the bus the defined form of the spacing is destroyed and overload is signalized. As a result all the nodes are also sending overload frames. 11/06/2012 ALMA - ADE 8 Pedro Campana Antenna Control Specialist
  • 9. Description of CAN •  Frame 2.0 A Standard Start of Frame: 1 dominant bit to identify start Arbitration field: 11 bit identifier + 1 bit RTR (remote transmission request bit) Control field: 2 bits reserved for extended CAN, 4 bits for data length Data field: 0-8 byte of data possible, starting with MSB CRC-field: 15 bit generator polynom (x15+x14+x10+x8+x7+x4+x3+1) + 1 recessive CRC delimiter bit ACK-field: 1 bit ACK-slot + 1 bit ACK delimiter (recessive): transmitter sends recessive bit in the slot; recipients that received error free, send a dominant bit in the slot. End of Frame: 7 bit 11/06/2012 ALMA - ADE 9 Pedro Campana Antenna Control Specialist
  • 10. Description of CAN •  Frame 2.0 B Extended Format (Used in ALMA) SOF: Start of Frame SRR: Substitute Remote Request BIT IDE: Identifier Extension Bit RTR: Remote Transmission Request BIT r1: Reserved bit r0: Reserved bit DLC: Data Length Code 11/06/2012 ALMA - ADE 10 Pedro Campana Antenna Control Specialist
  • 11. Description of CAN •  OSI Layer 7: Applications While layer 1 and 2 are already intended for international standardizations (ISO-DIS 11 898 and ISO-DIS 11 519), there is not yet a norm for the application layer. The introduction of a layer 7 the application process can be completely uncoupled from the communication processes. 11/06/2012 ALMA - ADE 11 Pedro Campana Antenna Control Specialist
  • 12. Safety Mechanisms In order to reduce the fault liability of the CAN bus the following safety mechanisms are realized: 1.) Bit Monitoring Each transmitting network node monitors whether or not the bus level it has transmitted is actually present on the bus. Otherwise a fault has appeared that has to be dissolved or the sending process has to be terminated (arbitration phase). 2.) Frame Format Check As the frame format is fixed, every participant of the bus can check whether this format is maintained ( e.g. recessive delimiter bits). Otherwise a fault is existent. 3.) Cyclic Redundancy Check The transmitted message is secured again by CRC. Thereby the message is divided by a special polynomial generator and the result is deposit in the CRC field. The message is divided again by this polynomial generator by the receiver and the result is compared with the transmitted CRC field. If there are not identical a transmission error has appeared. (polynomial generator x15+x14+x10+x8+x7+x4+x3+1) 4.) Bit-Stuffing The CAN protocol uses the NRZ bit coding ( non-return to zero). But this means that there are longer phases without bit edges for synchronization. To avoid this an inverted stuff bit is set after 5 bits of the same polarity. This bit permits the synchronization of every node and is deleted when received. 11/06/2012 ALMA - ADE 12 Pedro Campana Antenna Control Specialist
  • 13. Bus Topology •  Generalities The cables can be parallel bus, twisted and / or shielded, depending on requirements of the electromagnetic capacity. The topology of the wiring should be as close as possible to structure a single line, to minimize reflections. The segments of cable for connecting nodes in the bus should be as short as possible, especially at higher bit rates. The bus topology is with derivations short length. With loss of benefits in terms of speed or maximum length structures can be taken into star. The bus closes at the ends with load impedances (see Figure 3). The use of differential voltages enables networks CAN work when one of the signal lines are separate 11/06/2012 ALMA - ADE 13 Pedro Campana Antenna Control Specialist
  • 14. Bus Topology •  Generalities 11/06/2012 ALMA - ADE 14 Pedro Campana Antenna Control Specialist
  • 15. Bus Topology •  Signal Level In the original specification of CAN, the physical layer was not defined, allowing different options for choosing the means and levels of electric transmission. The characteristics of the electrical signals on the bus were later established by the ISO 11898 standard Absolute levels of bus lines with respect to ground, according to the ISO 11 898 11/06/2012 ALMA - ADE 15 Pedro Campana Antenna Control Specialist
  • 16. Bus Topology •  CAN Conector Male Female Connector used in ALMA 1 RST Global Slave Node Reset, Line A 2 CAN_L CAN_L bus line (Dominant Low) 3 CAN_GND CAN Ground 4 TE Time Event Signal A 5 CAN_SHIELD CAN Bus Shield 6 RST Global Slave Node Reset, Line B 7 CAN_H CAN_H bus line (Dominant High) 11/06/2012 ALMA - ADE 8 TE Time Event Signal B 16 Pedro Campana Antenna Control Specialist 9 N/A Not Used
  • 17. ALMA Monitor and control System •  Purpose   This is the Networking specification for communicating with ALMA electronic modules.   Reading status (Monitoring)   Sending commands and settings (Controlling) Components and structure “IFP0” “DA41” “IFP1” “PM02” 11/06/2012 ALMA - ADE 17 Pedro Campana Antenna Control Specialist
  • 18. 11/06/2012 ALMA - ADE 18 Pedro Campana Antenna Control Specialist
  • 19. AMB: ALMA Monitor and Control BUS It’s the networking specification for the communication with ALMA electronic modules. El BUS: • CAN - Controller Area Network, Industrial communication standard. In our case wea are mainly using the profile CAN 2.0B. • Twisted pair cable 100 Ω, Terminator Resistor in both end of bus 120 Ω. • Transition Speed 1 Mb/s • Maximum Bus Length BUS 35 meters. • Differential Signal 11/06/2012 ALMA - ADE 19 Pedro Campana Antenna Control Specialist
  • 20. AMB: ALMA Monitor and Control BUS •  ALMA node location in the BUS Each device connected to the Bus must have an unique identifier, this identifier is a decimal number between 0 to 2047, for example in our system we have a standard number of ID in order to identify every device in the BUS: Node Address (ID) Device Name Hex Dec 0x00 0 Antenna Control Unit ACU 0x29 & 0x2A 41 & 42 Production IF Processor (0x29 is Polarization 0) 0x50 – 0x53 80 - 83 DTS Transmitter Module DTX 0x40 – 0x43 64 - 67 LO2 synthesizer 0x60 & 0x61 96 & 97 BE antenna analog and digital power supply http://edm.alma.cl/forums/alma/dispatch.cgi/icd/showFile/100149/d20070213045555/Yes/AMB+Node+allocations.pdf 11/06/2012 ALMA - ADE 20 Pedro Campana Antenna Control Specialist
  • 21. AMB: ALMA Monitor and Control BUS •  RCA (Relative CAN Address) The address RCA is the memory address to which we access to read (Monitor Point) or write (Command Point) in one device. RCA addresses are defined in the document ICD (Interface Control Document) for each device. For example: In the ICD (ALMA-57.03.00.00-70.35.30.00-A-ICD) are defined the monitor and control points of the power supply. Then the monitor point: GET_MID_1_Voltage the address RCA is = 0x00005 (hex) with a length of 2 bytes. 11/06/2012 ALMA - ADE 21 Pedro Campana Antenna Control Specialist
  • 22. AMB: ALMA Monitor and Control BUS •  Message identifier structure (Message ID) in the AMB (CAN) In the ALMA project we are using the CAN Bus profile 2.0B. This means that the message ID has a 29 bits of length with 8 bytes of data : If we want to read the voltage value of PSD, we should make the following : Message ID = ((Node Address + 1)* 2^18)+RCA convert to HEX GET_MID_1_Voltage = ((97+1)*2^18)+5 = 25690117 0x0188 0005 Identifier A Identifier B 11/06/2012 ALMA - ADE 22 Pedro Campana Antenna Control Specialist
  • 23. AMB: ALMA Monitor and Control BUS 0x0188 0x0005 DATA= 0 CRC 0x0188 0x0005 D0= 02 D1=D3 CRC Reply Data from slave = 0x02D3 ( 2 Bytes) in decimal = 723 According the ICD the reply value should be divided by 30.088 Then we have the final value: GET_MID_1_VOLTAGE = 724 / 30.088 = 24.029514 Volts. 11/06/2012 ALMA - ADE 23 Pedro Campana Antenna Control Specialist
  • 24. AMB: ALMA Monitor and Control BUS •  Timing signal TE (Time Event) The TE is an electrical signal distributed to most electronic devices in ALMA, as a reference for the execution of commands so that they are synchronized in time. The pulse TE is delivered every 48 ms. TE does not necessarily signal is generated by the Master of the CAN BUS, but it can be generated by any other node. The signal generator contains a transmitter RS485 which will keep the bus idle state with a logical "0" (FALSE), and takes the bus to logic state "1" (TRUE) periodically with a duty cycle between 1% to 25% , Currently is 12.5%. The cycle is defined in 48 ms. 100 % of cycle (48 ms) 12,5 % of cycle (6 ms) Example of TE signal. The voltages levels should be according the standard RS485 11/06/2012 ALMA - ADE 24 Pedro Campana Antenna Control Specialist
  • 25. AMB: ALMA Monitor and Control BUS •  Time Event By default, every command transmitted to a device over the AMB is effective immediately upon receipt; and every monitor request should return the most recent data available at the time the request is received. However, under some circumstances the effective times may be different, as described in the following paragraphs. These commands are sometimes referred to as “time critical”. When specified in an Interface Control Document (ICD), a specific command may be considered effective at a later time than its time of receipt. In such cases, the command is associated with the timing event (TE) that immediately follows receipt of the command. See Figure 6. In exceptional circumstances a time-critical command may be active at a TE later than the TE that immediately follows the receipt of a command. Typically this is done to allow the slave extra time to execute the command. These exceptions must be noted in the ICD. The monitoring and control system begin transmission of a "Frame" CAN command associated with the TE considering that the transfer must be completed no later than 24 ms. , That is no more than 50% of the cycle of the TE. 11/06/2012 ALMA - ADE 25 Pedro Campana Antenna Control Specialist
  • 26. AMB: ALMA Monitor and Control BUS •  Time Event The monitoring and control system can initiate the transmission of the response of request associated with the TE not later than the last 24 ms, and the transfer must be completed no later than 4 ms before the next TE. This means that any response to a request for monitoring should be passed during a window of 20ms in the latter half of the range of 48 ms. Between each TE 11/06/2012 ALMA - ADE 26 Pedro Campana Antenna Control Specialist
  • 27. AMB: Using the Oscilloscope Then we'll use the oscilloscope for analyzing the behavior of the CAN BUS. For CAN Bus analyzing we need use the following instruments: –  Tektronic Oscilloscope DPO 4034 –  Differential CAN probe Tektronic P6246 –  Connector to CAN BUS –  Pen Drive or Memory Stick In order to make the measurements is necessary connect the differential probe to the point 2 and 7 of DB9 connector, for this is necessary open the bus and connect the special connector in order to maintain the daisy chain of the bus (see picture). 11/06/2012 ALMA - ADE 27 Pedro Campana Antenna Control Specialist n
  • 28. AMB: Uso de Osciloscopio •  Setting the Oscilloscope • Select Chanel • Connect differential probe to channel #1 • The impedance is 50 Ohms default • Coupling = DC • Invert = Off • Band With = Full • Vertical = 1.00 V/div • Offset = 0 V (Press button MORE ) • Position = -2.5 div (Press button MORE) • Hz. Scale = 1.0 ms • Select button B1 • Source = B1(CAN) • Threshold = 300 mV • Bit rate = 1 Mbps 11/06/2012 ALMA - ADE 28 Pedro Campana Antenna Control Specialist
  • 29. AMB: Uso de Osciloscopio Signal Type = Differential Trigger = “Start of Frame or If you need to find a specific frame the you can select “Identifier” and use your message ID as a mask. Always you should use the Extended identifier. 11/06/2012 ALMA - ADE 29 Pedro Campana Antenna Control Specialist
  • 30. Bibliography and References •  Paper “ANÁLISIS DE LA CAPA FÍSICA DEL BUS DE CAMPO CAN”, Ing. Hector Cashel y Ernesto Pinto •  “Can Specifications”, Robert Bosch, BOSCH 1991 •  Lecturas ALMA, “Lectura 3”, Juan Pablo Caram, AIV EE. •  ALMA Monitor and Control Interface Specification “ALMA-70.35.10.03-001-A-SPE” 11/06/2012 ALMA - ADE 30 Pedro Campana Antenna Control Specialist