420 likes | 972 Views
CANbus Solutions and National Instruments. Agenda. Automotive test systems Introduction to CAN CAN basics Overview of National Instruments CAN solution Typical automotive test applications Synchronization capabilities with CAN and DAQ Real- time capabilities with CAN and DAQ.
E N D
Agenda • Automotive test systems • Introduction to CAN • CAN basics • Overview of National Instruments CAN solution • Typical automotive test applications • Synchronization capabilities with CAN and DAQ • Real- time capabilities with CANand DAQ
Traditional Test Systems PC Sensor-Based Vehicle DAQ Signal Conditioning Point to Point wiring Thick cable harness
PC CAN Requirement: Synchronization with DAQ DAQ CAN-based Test Systems Need: Validate vehicle CAN systems Single CAN cable
Introduction to CAN So, what is CAN?
CAN – Open Industry Standard • Invented by Bosch in mid-80s • High-speed CAN – ISO 11898 • Low-speed CAN – ISO 11519 (fault tolerant CAN) • Heavily used in automotive • Physical layer for DeviceNet, CANOpen, SDS
Huge Market in Automotive • Well established in German/European automotive • High growth in U.S./Japanese automotive
CAN – Automotive Applications Power Steering Power Windows Lights Instrument Panel ABS Transmission
Other CAN Markets Public Transportation CAN Military Systems Avionics Farm Machinery
Types of CAN • High speed CAN (ISO 11898) • Up to 1 M bits/sec transmission rate • Low speed CAN (ISO 11519) • Up to 125 K bits/sec transmission rate • Fault tolerant
Benefits of CAN • Lower cost from reduced wiring – Multidrop cable • Compared to two wire point-to-point wiring • Highly robust protocol • Built-in determinism • Fault tolerant (low-speed CAN) • Reliable – proven in field • Track history of 10+ years in the automotive industry
CAN Physical Layer Specifications • CAN data (up to 8 data bytes in a frame) • Maximum 1 Mbit/sec • 40 Meters at 1 Mbit/sec • 6 Km at 10 kbit/sec • Maximum 2032 nodes per bus (theoretical) • Approximately 100 node practical due to transceiver • About 3-10 nodes are used in practice
CAN Frame Types • Data frames - Arbitration ID (11 bit or 29 bit) • Indicates message priority • Remote frame • Error frame • Overload frame
Device A transmits ID = 110 0100 0111 (647 hex) 1 1 0 0 1 0 0 0 1 1 1 Device B transmits ID = 110 1100 0111 (6C7 hex) 1 1 0 1 Device B loses, and goes idle until end of frame Device A wins, and proceeds CAN Arbitration When two devices attempt to transmit simultaneously, CAN uses non-destructive bitwise arbitration to resolve the collision.
CAN Data Frame – Example Gearbox CAN Data Frame 0x5 Temperature Pressure Torque …. …. ID 4 bytes 2 bytes 2 bytes ABS CAN Data Frame Data – 8 bytes 0x10 Temperature Torque …. …. ID 4 bytes 2 bytes Data – 8 byte ( 2 bytes not used)
National Instruments CAN Hardware • High speed CAN (ISO 11898) • PCI, PXI/CompactPCI, PCMCIA, ISA • 1 and 2 ports • Max. Baud rate 1mb/s • Low speed CAN (ISO 11519) • PCI, PXI/CompactPCI, PCMCIA • 1 and 2 ports • Max. Baud rate of 125kb/s • Dual speed CAN (ISO 11898 & ISO 11519) • PCI, PXI/CompactPCI, PCMCIA • 2 ports (1 high speed and 1 low speed)
National Instruments CAN Software • LabVIEW VI library • LabWindows/CVI language interface • C/C++ language interface • Bus Monitor utility – for easy monitoring and logging • Special CAN bus features • Support for synchronization with NI-DAQ • Support for LabVIEW Real-Time under PXI
NI-CAN access to the CAN bus • Object oriented architecture • CAN Network Interface Object - CAN port • Low level access to CAN bus • When writing or reading you must specify the ID, data length, etc... of interest • CAN Object - encapsulates a specific arbitration ID along with its data • High level access • At configuration time, you specify ID, data length, etc.. of interest
NI-CAN – Network Interface Object ID3 ID1 ID2
NI-CAN – CAN Objects Receive data periodically using remote frame Transmit data periodically Transmit periodic waveform ID1 ID2 ID3 ID1 ID2 ID3
PC NI-CAN Architecture (Windows) Your Application NI-CAN Driver RTSI Shared Memory CAN Network CAN Stack
Typical CAN Applications • CAN device durability testing • CAN device validation testing • Examples: • Torture testing of a gear box • Testing instrument clusters • Testing an ABS system
P T T Temp DAQ Synchronized with CAN - “Hard” Temp Pressure Torque …. ….. Example – Gearbox Test DAQ-controlling the test stand -”Soft” PC CAN bus CAN DAQ CAN Frames
Software Synchronization • Loop/global variable controlled • Pros • Easy to implement • Cons • Non-deterministic due to software latency • Measurement data not time-correlated with CAN data • Requires manual correlation for charting or analysis
Hardware Synchronization • Hardware controlled • Pros • Very deterministic because no software timing • Measurements time-correlated with CAN data • Simplifies charting and analysis • Cons • Requires support from hardware vendor
RTSI™ – Real Time System Integration • Timing and Trigger bus used by National Instruments • PXI: implemented on PXI trigger bus • PCI: requires RTSI cable • CAN board configurable as RTSI master or slave • Synchronize to one or more CAN or DAQ interfaces • Synchronize to one or more CAN frames
DAQ as RTSI Master • Transmit CAN frame on RTSI input from DAQ • Synchronize to DAQ update clock for transmitting single frame or waveform • Timestamp RTSI trigger on RTSI input from DAQ • Synchronize to DAQ scan clock for data correlation • CAN read queue collects asynchronous CAN data as well as DAQ triggers
Log Time stamp when DAQ sends RTSI Transmit CAN when DAQ sends RTSI node node node node node node LabVIEW Memory CAN1 DAQ1 DAQ 2 CAN2 DAQ 3 CAN3 CAN card ….. ….. } RTSI DAQ card AI/AO AI/AO AI Scan Clock or AO Clock Update DAQ Masters Synchronization Event CAN card RTSI DAQ card AI Scan Clock or AO Clock Update
CAN as RTSI Master • Output RTSI trigger on receiving a CAN frame • DAQ uses RTSI signal as acquisition clock • Output RTSI trigger on transmission of CAN frame • similar to analog output from DAQ • Output RTSI trigger on demand • manual control via pushbutton
node node node node node node CANcard RTSI DAQcard AI/AO AI/AO CAN Masters Synchronization Event Output RTSI on CAN frame received Output RTSI on CAN frame transmit Ack CAN card RTSI DAQ card
NI-CAN and LabVIEW Real-Time • Applications: ECU testing, simulation, & validation • Develop on a PC with LabVIEW • Deploy on a PXI controller with LabVIEW Real-Time • No modification to your code • Supports synchronization of CAN and DAQ • Deterministic timing
PC LabVIEW™ Real-Time CAN Architecture LabVIEW Front Panel Download (Ethernet) Controller Running LabVIEW-RT NI-CAN driver RTSI (Trigger) Bus on back plane CAN Interface DAQ Board PXI Chassis Shared Memory LabVIEW Application CAN Stack CAN Network
Summary • Open standard used in: • Automotive • Public Transportation • Avionics • Military • CAN & DAQ synchronization – a must for validation • CAN + LabVIEW Real-Time = deterministic timing
Useful Information • LabVIEW Starter Kits on NI’s Developer Zone • Go to “Development Library” then “Industrial Networks” • Or click here:CAN Starter Kits • Starter Kit examples: • CAN-DAQ Synchronization • CANdb for LabVIEW • SAE J1939