Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded




                          Besturen met FPGA‘s




              Erik van Hilten
          Technical Engineer
        National Instruments




Agenda
• Intro
• What is an FPGA
• Why are FPGAs important in
  automation
• Engineering FPGAs (hardware)
• Engineering FPGAs (software)




What we do

 Low-Cost, Modular         Productive Software        Highly Integrated,
 Measurement and           Development Tools             Expandable
 Control Hardware                                    Industrial Platforms




    Used by thousands of engineers and scientists for automated test,
         industrial control, and embedded design applications.




www.ni.com                                                                  1
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


What is an FPGA?


                                                     Programmable
                                                     Interconnects




  Logic
  Blocks

                                                           I/O Blocks




Simplified FPGA Example
           Implementing Logic on FPGA: F = {(A+B)CD} ⊕ E
                                 E
                                           F
                                               LabVIEW FPGA Code




               A
               B
               C
               D




FPGAs are truly parallel
                                 E
                                           F




               A
               B
               C
               D
                                                    Z




                             W X       Y




www.ni.com                                                              2
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


   Benefits FPGAs in Systems
• Reliability – Designs become a custom circuit
• Determinism – Runs algorithms at deterministic
  rates down to 25 ns (faster in many cases)
• Parallelism – Enables parallel tasks and
  pipelining
• Reconfigurable – Create new and alter existing
  task-specific personalities
• Timing – Nanosecond precision for timing and
  synchronization




   Decision Making in Software
       Decision Making in Software
                                                 Crash Possible
                                                                                       Application Software
                                                 Operating System




                                                                                                              Calculation
                                                                    Driver API
                                      Hardware




                    ~25 ms
      PROCES
                   Respons
                       e

                        Outputs




   Decision Making in Hardware
       Decision Making in Hardware



                     Highest
                                                                                                              Application Software




                   Determinism
                                                                    Operating System
                                                 Calculation




                                                                                       Driver API
                                      Hardware




                    25 ns*
     PROCES
                   Respons
                      e

                        Outputs

* Faster response for
80 and 120 MHz clocks             Highest Reliability




   www.ni.com                                                                                                                        3
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


Reliable: CERN
Control World’s Largest Particle Accelerator

•    FPGA-based motion control system for
     intercepting misguided or unstable particle
     beams.

•    Measuring and controlling, in real time, the
     position of bulk components to absorb energetic
     particles out of the nominal beam core with high
     reliability and accuracy at the world’s most
     powerful particle accelerator, the Large Hadron
     Collider (LHC).

•    Custom motion control using small, rugged
     controllers for approximately 600 stepper motors
     with millisecond synchronization.




    Deterministic: VAPO - Controlling the Movement
    of 20 Tons of Concrete with 2 mm accuracy
    • Custom 4-axis hydraulic motion control system for unbalanced
      concrete trays
    • Advanced control, signal processing and high precision
      hydraulic motion




    Timing: Increased Production Throughput
    and Welding Quality
    • Welding of metal sheets used in cold rolling steel mils

    • In old factories strip breakage occurs around 2%, and in
      modernized European factories around 0.5%.

    • With a FPGA based control system we
      have achieved 0.05%

    • The result: a huge economic saving by
      having less downtime and higher
      production throughput.




    www.ni.com                                                       4
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


    Processing: Bearing Monitoring
     • Custom analysis algorithm on
       FPGA
     • Real-Time system for managing
       analysis and communication
     • Host application for control & asset
       management

          Digital Demodulation online
           20KHz         20kHz / 50kS/s       FPGA                    20kHz / 50kS/s           20 Hz / 50 S/s ∆f = 0,0122 Hz
                               A                         Z-n     x                20Hz
             Sensor                                                  +   √                                         FFT
                                   D                     +90     x
                                                         °
                                                                                              4k Samples
http://www.fis-services.de/site/en/pst/1.Products/13.Condition_monitoring/29.Condition_Monitoring/103.FAG_ProCheck/FAG_ProCheck.html




       Developing the FPGA code
               FPGA (hardware)                                               Processor (software)
         Time critical control                                           Data analysis/conversion
         Acquisition                                                     Data Logging
         Timing in the FPGA                                              User interface
         In line processing & data                                       Communication (TCP/IP,
         reduction                                                       UDP/Modbus/…)
         Sensor processing                                               Interface to FPGA code
         Custom triggering                                               Supervise / control FPGA
                                                                         (setpoints…)
         Control
         Digital filtering




       Industrial Embedded Architecture
                                                                                                            I/O
      Processor                                          FPGA                                               I/O
                                                                                                            I/O

   • Floating-point • High-speed                                                           • Low-level access
     processing       control &                                                              to hardware
   • Communications   processing                                                           • Custom timing &
   • Multicore      • Reconfigurable                                                         triggering
     technology       hardware                                                             • Modular I/O
                    • Reliability




      www.ni.com                                                                                                                       5
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


                               The Challenge
                                                                                                    I/O
                               Processor                            FPGA                            I/O
                                                                                                    I/O

                               • Multicore                    • Low-level tools          • Custom drivers
                                 programming                    Verilog & VHDL             and middleware
                                 challenge                    • Fixed-point
                                                                algorithms
                                           • Custom digital                   • Custom timing for
                                             interface/buses                    different types of I/O




                               NI CompactRIO Architecture




                                   Real-Time                FPGA
                                   Processor




                 • Reconfigurable FPGA for high-speed and custom I/O timing, triggering, and control

                    • I/O modules with built-in signal conditioning for connection to sensors/actuators

                    • Real-time processor for reliable measurement, analysis, connectivity, and control




                               NI RIO Deployment Curve
                                                                                                       I/O

                                                                                                       I/O
System Flexibility and Price




                                                                                                       I/O
                                   PXI RIO                  Windows      Real-time   FPGA
                                                                         Processor
                                                                                                    Custom I/O

                                             PCI RIO



                                                       CompactRIO


                                                                      CompactRIO
                                                                       Integrated                   LabVIEW
                                                                                     Single-Board
                                                                                         RIO

                                                          Number of Systems Deployed




                               www.ni.com                                                                        6
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


               Handling Complexity through
                       Abstraction

                                                        System Design Tools

                                                     IEC 1131

                                                .NET
 Abstraction




                                           C, C++
                                 VHDL
                          Assembly

               Machine code

                                 System complexity




   LabVIEW Development Environment




• Intuitive graphical programming for engineers and
    scientists
• Tools to acquire, analyze, and present real-world data
• LabVIEW programs are called virtual instruments, or VIs




   Ladder logic and LabVIEW




 www.ni.com                                                                   7
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


   LabVIEW: Graphical System
   Design
  Timing                                                                          Textual Math



I/O integration                                                                       Data Flow



  Parallel                                                                      C and HDL Code



 Statecharts                                                                          Simulation




   LabVIEW Graphical System Design Platform
       Dataflow             C Code           Textual Math      Simulation       Statechart




                  LabVIEW        Real-Time              FPGA        Microprocessors
                  Desktop




             PC             PXI Systems       CompactRIO        SB RIO          HMI




   How Does LabVIEW FPGA Work?
1. Same graphical programming

2. Generate VHDL

3. Compile VHDL through Xilinx

4. Generate downloadable bit
   file




  www.ni.com                                                                                       8
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


LabVIEW FPGA Code Abstraction
     Counter                       Analog I/O                            I/O with DMA




        LabVIEW FPGA                                                        VHDL




   Developing the FPGA code
     Interactive Front Panel Communication




       FPGA front panel                                      FPGA block diagram

            Development PC                                              FPGA hardware




CompactRIO Software Architecture
     Host Program                                 Real-Time Processor                        FPGA

                         Network                     Inter -Thread              FPGA
                       Communication                 Communication    Time      Interface
        User                           Normal                                               LabVIEW
      Interface                        Priority                      Critical               FPGA VI
                                        Loop                          Loop

       Enterprise

         LabVIEW for                          LabVIEW                                          LabVIEW
         Windows                              Real-Time                                        FPGA


• User interface                  • Time Critical Loop                              • I/O timing
• Connect to enterprise              – Interface to FPGA code                       • Custom triggering
• Supervisory control             • Normal Priority Loop                            • Control
• Non real-time analysis             – Data conversion                              • Digital filtering
                                     – Analysis and control                         • Sensor processing
                                     – Data logging
                                     – Networking (TCP/IP, UDP,
                                       Modbus/TCP)




  www.ni.com                                                                                              9
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded


LabVIEW IEC 1131 Function Blocks




                                            I/O

Summary                  Processor   FPGA   I/O
                                            I/O




FPGAs:
• reliable, fast, reconfigurable hardware
• applications: fast/tight/advanced control,
  data/sensor processing, triggering,
  acquisition
• flexible hardware architecture with processor
• VHDL or graphical software




• Learn more:
    LabVIEW:         ni.com/labview
    FPGA hardware    ni.com/compactrio


• Bonus: download the developers guide
  (200+ pages!)
    http://www.ni.com/compactriodevguide/




www.ni.com                                                  10
Themadag PLC of IPC - LabVIEW en FPGA's voor IPC/embedded




www.ni.com                                                  11

15.00 hr van Hilten

  • 1.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded Besturen met FPGA‘s Erik van Hilten Technical Engineer National Instruments Agenda • Intro • What is an FPGA • Why are FPGAs important in automation • Engineering FPGAs (hardware) • Engineering FPGAs (software) What we do Low-Cost, Modular Productive Software Highly Integrated, Measurement and Development Tools Expandable Control Hardware Industrial Platforms Used by thousands of engineers and scientists for automated test, industrial control, and embedded design applications. www.ni.com 1
  • 2.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded What is an FPGA? Programmable Interconnects Logic Blocks I/O Blocks Simplified FPGA Example Implementing Logic on FPGA: F = {(A+B)CD} ⊕ E E F LabVIEW FPGA Code A B C D FPGAs are truly parallel E F A B C D Z W X Y www.ni.com 2
  • 3.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded Benefits FPGAs in Systems • Reliability – Designs become a custom circuit • Determinism – Runs algorithms at deterministic rates down to 25 ns (faster in many cases) • Parallelism – Enables parallel tasks and pipelining • Reconfigurable – Create new and alter existing task-specific personalities • Timing – Nanosecond precision for timing and synchronization Decision Making in Software Decision Making in Software Crash Possible Application Software Operating System Calculation Driver API Hardware ~25 ms PROCES Respons e Outputs Decision Making in Hardware Decision Making in Hardware Highest Application Software Determinism Operating System Calculation Driver API Hardware 25 ns* PROCES Respons e Outputs * Faster response for 80 and 120 MHz clocks Highest Reliability www.ni.com 3
  • 4.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded Reliable: CERN Control World’s Largest Particle Accelerator • FPGA-based motion control system for intercepting misguided or unstable particle beams. • Measuring and controlling, in real time, the position of bulk components to absorb energetic particles out of the nominal beam core with high reliability and accuracy at the world’s most powerful particle accelerator, the Large Hadron Collider (LHC). • Custom motion control using small, rugged controllers for approximately 600 stepper motors with millisecond synchronization. Deterministic: VAPO - Controlling the Movement of 20 Tons of Concrete with 2 mm accuracy • Custom 4-axis hydraulic motion control system for unbalanced concrete trays • Advanced control, signal processing and high precision hydraulic motion Timing: Increased Production Throughput and Welding Quality • Welding of metal sheets used in cold rolling steel mils • In old factories strip breakage occurs around 2%, and in modernized European factories around 0.5%. • With a FPGA based control system we have achieved 0.05% • The result: a huge economic saving by having less downtime and higher production throughput. www.ni.com 4
  • 5.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded Processing: Bearing Monitoring • Custom analysis algorithm on FPGA • Real-Time system for managing analysis and communication • Host application for control & asset management Digital Demodulation online 20KHz 20kHz / 50kS/s FPGA 20kHz / 50kS/s 20 Hz / 50 S/s ∆f = 0,0122 Hz A Z-n x 20Hz Sensor + √ FFT D +90 x ° 4k Samples http://www.fis-services.de/site/en/pst/1.Products/13.Condition_monitoring/29.Condition_Monitoring/103.FAG_ProCheck/FAG_ProCheck.html Developing the FPGA code FPGA (hardware) Processor (software) Time critical control Data analysis/conversion Acquisition Data Logging Timing in the FPGA User interface In line processing & data Communication (TCP/IP, reduction UDP/Modbus/…) Sensor processing Interface to FPGA code Custom triggering Supervise / control FPGA (setpoints…) Control Digital filtering Industrial Embedded Architecture I/O Processor FPGA I/O I/O • Floating-point • High-speed • Low-level access processing control & to hardware • Communications processing • Custom timing & • Multicore • Reconfigurable triggering technology hardware • Modular I/O • Reliability www.ni.com 5
  • 6.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded The Challenge I/O Processor FPGA I/O I/O • Multicore • Low-level tools • Custom drivers programming Verilog & VHDL and middleware challenge • Fixed-point algorithms • Custom digital • Custom timing for interface/buses different types of I/O NI CompactRIO Architecture Real-Time FPGA Processor • Reconfigurable FPGA for high-speed and custom I/O timing, triggering, and control • I/O modules with built-in signal conditioning for connection to sensors/actuators • Real-time processor for reliable measurement, analysis, connectivity, and control NI RIO Deployment Curve I/O I/O System Flexibility and Price I/O PXI RIO Windows Real-time FPGA Processor Custom I/O PCI RIO CompactRIO CompactRIO Integrated LabVIEW Single-Board RIO Number of Systems Deployed www.ni.com 6
  • 7.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded Handling Complexity through Abstraction System Design Tools IEC 1131 .NET Abstraction C, C++ VHDL Assembly Machine code System complexity LabVIEW Development Environment • Intuitive graphical programming for engineers and scientists • Tools to acquire, analyze, and present real-world data • LabVIEW programs are called virtual instruments, or VIs Ladder logic and LabVIEW www.ni.com 7
  • 8.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded LabVIEW: Graphical System Design Timing Textual Math I/O integration Data Flow Parallel C and HDL Code Statecharts Simulation LabVIEW Graphical System Design Platform Dataflow C Code Textual Math Simulation Statechart LabVIEW Real-Time FPGA Microprocessors Desktop PC PXI Systems CompactRIO SB RIO HMI How Does LabVIEW FPGA Work? 1. Same graphical programming 2. Generate VHDL 3. Compile VHDL through Xilinx 4. Generate downloadable bit file www.ni.com 8
  • 9.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded LabVIEW FPGA Code Abstraction Counter Analog I/O I/O with DMA LabVIEW FPGA VHDL Developing the FPGA code Interactive Front Panel Communication FPGA front panel FPGA block diagram Development PC FPGA hardware CompactRIO Software Architecture Host Program Real-Time Processor FPGA Network Inter -Thread FPGA Communication Communication Time Interface User Normal LabVIEW Interface Priority Critical FPGA VI Loop Loop Enterprise LabVIEW for LabVIEW LabVIEW Windows Real-Time FPGA • User interface • Time Critical Loop • I/O timing • Connect to enterprise – Interface to FPGA code • Custom triggering • Supervisory control • Normal Priority Loop • Control • Non real-time analysis – Data conversion • Digital filtering – Analysis and control • Sensor processing – Data logging – Networking (TCP/IP, UDP, Modbus/TCP) www.ni.com 9
  • 10.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded LabVIEW IEC 1131 Function Blocks I/O Summary Processor FPGA I/O I/O FPGAs: • reliable, fast, reconfigurable hardware • applications: fast/tight/advanced control, data/sensor processing, triggering, acquisition • flexible hardware architecture with processor • VHDL or graphical software • Learn more: LabVIEW: ni.com/labview FPGA hardware ni.com/compactrio • Bonus: download the developers guide (200+ pages!) http://www.ni.com/compactriodevguide/ www.ni.com 10
  • 11.
    Themadag PLC ofIPC - LabVIEW en FPGA's voor IPC/embedded www.ni.com 11