Modeling HDL components for FPGAs in control applications

Similar documents
Motor Control: Model-Based Design from Concept to Implementation on heterogeneous SoC FPGAs Alexander Schreiber, MathWorks

Model-Based Design: Generating Embedded Code for Prototyping or Production

Hardware and Software Co-Design for Motor Control Applications

Hardware and Software Co-Design for Motor Control Applications

Extending Model-Based Design for HW/SW Design and Verification in MPSoCs Jim Tung MathWorks Fellow

How Real-Time Testing Improves the Design of a PMSM Controller

Hardware and Software Co-Design for Motor Control Applications

Targeting Motor Control Algorithms to System-on-Chip Devices

Advanced AC Motor Control S/W Development Sang-Ho Yoon Senior Application Engineer The MathWorks

Model-Based Design for effective HW/SW Co-Design Alexander Schreiber Senior Application Engineer MathWorks, Germany

Real-Time Testing in a Modern, Agile Development Workflow

2015 The MathWorks, Inc. 1

Design and Verify Embedded Signal Processing Systems Using MATLAB and Simulink

MATLAB/Simulink 기반의프로그래머블 SoC 설계및검증

Intro to System Generator. Objectives. After completing this module, you will be able to:

Accelerate FPGA Prototyping with

Floating-Point to Field-Tests: A Unified Development Environment for Algorithm Research

[Sub Track 1-3] FPGA/ASIC 을타겟으로한알고리즘의효율적인생성방법및신기능소개

Design and Verify Embedded Signal Processing Systems Using MATLAB and Simulink

Lab 3 Sequential Logic for Synthesis. FPGA Design Flow.

Making the Most of your MATLAB Models to Improve Verification

Modeling a 4G LTE System in MATLAB

Cover TBD. intel Quartus prime Design software

Automatic Code Generation Technology Adoption Lessons Learned from Commercial Vehicle Case Studies

High-Level and Model-Based Design Targeting FPGAs and SoCs

Cover TBD. intel Quartus prime Design software

Hardware Implementation and Verification by Model-Based Design Workflow - Communication Models to FPGA-based Radio

Control System Design and Rapid Prototyping Using Simulink Chirag Patel Sr. Application Engineer Modeling and Simulink MathWorks India

Implementing MATLAB Algorithms in FPGAs and ASICs By Alexander Schreiber Senior Application Engineer MathWorks

OP5600 & OP7000. High performance Real-Time simulators. Yahia Bouzid 25 th June2013

Integrated Workflow to Implement Embedded Software and FPGA Designs on the Xilinx Zynq Platform Puneet Kumar Senior Team Lead - SPC

Avnet Speedway Design Workshop

Team-Based Collaboration in Simulink Chris Fillyaw Application Engineer Detroit, MI

Designing and Targeting Video Processing Subsystems for Hardware

Real Time Testing of PMSM Controller using xpc Target Turnkey solution

Designing and Prototyping Digital Systems on SoC FPGA The MathWorks, Inc. 1

FPGA design with National Instuments

Model-Based Design: Design with Simulation in Simulink

Rapid Control Prototyping Solutions Electrical Drive, Power Conversion and Power Systems

Design and Verification of FPGA Applications

System-on Solution from Altera and Xilinx

MATLAB/Simulink in der Mechatronik So einfach geht s!

AccelDSP tutorial 2 (Matlab.m to HDL for Xilinx) Ronak Gandhi Syracuse University Fall

Model-Based Design for Altera FPGAs Using HDL Code Generation The MathWorks, Inc. 1

Verification, Validation, and Test with Model-Based Design

Model-Based Design Using Simulink, HDL Coder, and DSP Builder for Intel FPGAs By Kiran Kintali, Yongfeng Gu, and Eric Cigan

A Deterministic Flow Combining Virtual Platforms, Emulation, and Hardware Prototypes

Reducing the cost of FPGA/ASIC Verification with MATLAB and Simulink

Reconfigurable Computing. Design and implementation. Chapter 4.1

Moving MATLAB Algorithms into Complete Designs with Fixed-Point Simulation and Code Generation

Embarquez votre Intelligence Artificielle (IA) sur CPU, GPU et FPGA

Model-Based Design for Video/Image Processing Applications

Chapter 1 Overview of Digital Systems Design

Small rectangles (and sometimes squares like this

Tutorial - Using Xilinx System Generator 14.6 for Co-Simulation on Digilent NEXYS3 (Spartan-6) Board

Basic Xilinx Design Capture. Objectives. After completing this module, you will be able to:

Ein Modell - viele Zielsysteme

Optimize DSP Designs and Code using Fixed-Point Designer

Introduction to Control Systems Design

Hardware-Software Co-Design and Prototyping on SoC FPGAs Puneet Kumar Prateek Sikka Application Engineering Team

Audio Signal Processing in MATLAB Youssef Abdelilah Senior Product Manager

Model-Based Embedded System Design

Modeling and Verifying Mixed-Signal Designs with MATLAB and Simulink

Speeding up Simulink. Murali Yeddanapudi The MathWorks, Inc. 1

Introduction to C and HDL Code Generation from MATLAB

Reconfigurable Computing. Design and Implementation. Chapter 4.1

A Matlab/Simulink Simulation Approach for Early Field-Programmable Gate Array Hardware Evaluation

Atlys (Xilinx Spartan-6 LX45)

Optimization and Implementation of Embedded Signal Processing Algorithms Jonas Rutström Senior Application Engineer

Rapid Control Prototyping with MATLAB/Simulink Case Study: Ball-on-Wheel

5I20 ANYTHING I/O MANUAL

Agenda. Introduction FPGA DSP platforms Design challenges New programming models for FPGAs

ADPCM-LCO Voice Compression Logic Core

DAQ in MATLAB HANS-PETTER HALVORSEN,

Avnet Speedway Design Workshop

Experiment 3. Getting Start with Simulink

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Introduction to LabVIEW and NI Hardware Platform

DSD: Delta Sigma Demodulator. XMC microcontrollers September 2016

Weapon System Fault Detection, Isolation, and Analysis using Stateflow

Usable Simulink Embedded Coder Target for Linux

Virtex 6 FPGA Broadcast Connectivity Kit FAQ

On-Chip Design Verification with Xilinx FPGAs

Automated Generation Of Code From Simulink To An Event-Based Simulation Framework

Implementing the Top Five Control-Path Applications with Low-Cost, Low-Power CPLDs

S2C K7 Prodigy Logic Module Series

Déploiement embarqué et connectivité hardware avec MATLAB et Simulink

Full Linux on FPGA. Sven Gregori

What s New in Simulink Release R2016a and R2016b

What's new in MATLAB and Simulink for Model-Based Design

Agenda. Programming FPGAs Why Are They Useful? NI FPGA Hardware Common Applications for FPGAs How to Learn More

Actel s SX Family of FPGAs: A New Architecture for High-Performance Designs

Virtex-6 FPGA ML605 Evaluation Kit FAQ June 24, 2009

Introduction to PoliArd

The Embedded computing platform. Four-cycle handshake. Bus protocol. Typical bus signals. Four-cycle example. CPU bus.

Developing Measurement and Control Applications with the LabVIEW FPGA Pioneer System

Architecture and Partitioning - Architecture

Accelerating FPGA/ASIC Design and Verification

Interrupts, timers and counters

System-Level ASIC Algorithm Simulation Platform using Simulink

Transcription:

Modeling HDL components for FPGAs in control applications Mark Corless, Principal Application Engineer, Novi MI 2014 The MathWorks, Inc. 1

Position sensing High resolution voltage modulation Critical diagnostics Why would I use an FPGA for a controls application? Low latency control loops System cost reduction FPGA = Field Programmable Gate Array 2

How do I get an idea out of my head and into an FPGA? 3

How do I get an idea out of my head and into an FPGA? How do I get an idea out of my head and into a microprocessor? 4

desktop simulation rapid prototyping production code generation 5

That sounds nice, but Show me! 6

Begin with existing C component models Current Units Position Velocity Units Mode Scheduler Disabled Open Loop Encoder Calibration Velocity Control Field Oriented Control Voltage Units 7

Create new HDL component models C HDL Mode Scheduler Disabled Open Loop Encoder Peripheral Current Units Position Velocity Units HDL = Hardware Description Language Encoder Calibration Velocity Control Field Oriented Control Voltage Units PWM Peripheral 8

Migrate some component models from C to HDL C HDL Mode Scheduler Disabled Open Loop Encoder Peripheral Current Units Position Velocity Units Encoder Calibration Velocity Control Field Oriented Control Voltage Units PWM Peripheral 9

How did models help us design C components? 10

Baseline three-phase motor control hardware setup Simulink Real-Time TM scheduler and peripheral interface FPGA with vendor provided peripherals We will use this for HDL implementation Controller model for C implementation 11

Rapid prototyping model with Speedgoat bitstream Controller model for C implementation Field-oriented controller is the fastest loop and runs at 25 khz 12

Rapid prototyping model with Speedgoat bitstream Interface block to PWM peripheral on FPGA Interface block to encoder peripheral on FPGA Controller model for C implementation 13

Rapid prototyping model with Speedgoat bitstream This is the end result, but it s not where we started 14

Simulate design on the desktop We started designing the controller at our desktops Mathematical models of motor, load, and peripherals Controller model for C implementation 15

Simulate design on the desktop Lumped parameter model of encoder sensor and peripheral 16

Compare desktop simulation and hardware data Correlation of simulation and hardware results provided confidence in the workflow 17

How do I create a new HDL component model? 18

Begin with existing C component models Current Units Position Velocity Units Mode Scheduler Disabled Open Loop Encoder Calibration Velocity Control Field Oriented Control Voltage Units 19

Create new HDL component models C HDL Mode Scheduler Disabled Open Loop Encoder Peripheral Current Units Position Velocity Units Encoder Calibration Velocity Control Field Oriented Control Voltage Units PWM Peripheral 20

Example workflow to design an HDL component 1. Design the component with a unit-level testbench 2. Integrate the component with the system-level testbench 3. Partition the design for code generation 4. Generate a bitstream for the FPGA 5. Prototype the design on real-time hardware 21

1. Design the component with a unit-level testbench Lo-fidelity model to capture 25 khz dynamics of combined sensor and peripheral Peripheral will run at 33 MHz on the FPGA 22

1. Design the component with a unit-level testbench 23

1. Design the component with a unit-level testbench 24

1. Design the component with a unit-level testbench Simulation results provide confidence in lo-fidelity and implementation fidelity peripheral models 25

2. Integrate the component with the system-level testbench Implementation fidelity peripheral models require a 1/33 MHz simulation step size so simulation time will be longer than the testbench with lo-fidelity peripherals 26

2. Integrate the component with the system-level testbench Use hi-fidelity peripheral implementation models to confirm integrated behavior Use lo-fidelity peripheral models for interactive control design 27

3. Partition the design for code generation Group C components Group HDL components Optionally generate algorithmic HDL code 28

4. Generate a bitstream for the FPGA Use HDL Workflow Advisor to specify additional information required to create a bitstream 29

4. Generate a bitstream for the FPGA Specify card and FPGA toolchain 30

4. Generate a bitstream for the FPGA Associate ports in model with pins on FPGA or PCI interface to processor HDL Workflow Advisor will automate interacting with the Xilinx toolchain to create the bitstream for the FPGA 31

4. Generate a bitstream for the FPGA HDL Workflow Advisor also generates an interface block which can be used with Simulink Real-Time 32

4. Generate a bitstream for the FPGA We use a MATLAB script to only expose ports of interest and make a prettier mask 33

5. Prototype the design on real-time hardware Integrate bitstream interface block into Simulink Real- Time model 34

5. Prototype the design on real-time hardware Correlation of simulation and hardware results provides confidence in the workflow 35

How do I migrate a component model from C to HDL? 36

Migrate some component models from C to HDL C HDL Mode Scheduler Disabled Open Loop Encoder Peripheral Current Units Position Velocity Units Encoder Calibration Velocity Control Field Oriented Control Voltage Units PWM Peripheral 37

Migrate some component models from C to HDL C HDL Mode Scheduler Disabled Open Loop Encoder Peripheral Current Units Position Velocity Units Encoder Calibration Velocity Control Field Oriented Control Voltage Units PWM Peripheral 38

Example workflow to migrate a component to HDL 1. Design the component with a unit-level testbench 2. Integrate the component with the system-level testbench 3. Partition the design for code generation Modify component to account for differences between C and HDL 4. Generate a bitstream for the FPGA 5. Prototype the design on real-time hardware Model to simplify timing constraints for disparate rates Add timing constraint file to FPGA project 39

Modify to account for differences between C and HDL States can be reset through enable or trigger ports States are explicitly reset using signals 40

Modify to account for differences between C and HDL Parameters are tunable directly from blocks or data objects Tunable parameters are explicitly routed to ports 41

Modify to account for differences between C and HDL Typically floating point for rapid prototyping Typically fixed-point for rapid prototyping 42

Model to simplify timing constraints for disparate rates Integrate 25 khz control loop with 33 MHz peripheral components 43

Model to simplify timing constraints for disparate rates Insert slow delay at fast to slow rate transitions, this makes it simple to author timing constraint file Example constraint file 44

Compare simulation and hardware results Correlation of simulation and hardware results provides confidence in the workflow 45

What did we learn? 46

Position sensing High resolution voltage modulation Critical diagnostics Models can help you design FPGA components for control applications Low latency control loops System cost reduction 47

Through this exercise we learned that C and HDL components often run at disparate rates Design components with similar rates of interest Confirm system level behavior by integrating components Consider low fidelity peripheral models for control design tasks There are some differences when modeling for HDL than C Explicitly reset states and route tunable parameters for HDL Typically model HDL algorithms in fixed-point Consider adding delays to simplify timing constraint specification Overall Model-Based Design is similar for C and HDL Simulate components to reduce dependency on hardware Rapid prototype to verify behavior on hardware Generate algorithm code for integration into production environment 48