Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Oct 29, 2012


Feedback


Yes No

Related Categories

Industry

Application Type

Related Links - Developer Zone

Related Links -Products and Services

H-Bridge DC Motor Controller Implementation with NI Circuit Design Suite and NI Single-Board RIO

1 Ratings | 5.00 out of 5
Read in  |  Print |  PDF

Overview

This page demonstrates how to integrate NI Multisim, NI LabVIEW, and NI Single-Board RIO to implement a complete system of analog circuitry and digital control, including power electronics components and Field-Programmable Gate Array (FPGA) code. The design is an H-bridge bushed DC motor controller featuring accurate control of performance parameters such as speed, current, and control signals. Cycle accurate simulation of the analog plant in Multisim and the control code in LabVIEW FPGA was performed using the new co-simulation feature. The graphical control code is directly ported to a Single-Board RIO 9605 target. The hardware interface of the design that connects to the Single-Board RIO is developed using the rapid prototyping environment, NI Ultiboard. For more information, view the tutorials and reference designs at the end of the document.

Table of Contents

  1. Introduction
  2. System Overview
  3. Circuit Design in Multisim with LabVIEW Co-Simulation
  4. Rapid Prototyping with NI Ultiboard
  5. Complete System Solution
  6. Tutorials

Introduction

An H-bridge circuit is an electronic power circuit that is used to control electric motors, such as DC motors for automotive applications.  The H-bridge is used to control the speed and direction of motors by allowing the right amount of current to flow in the right direction of the motor.   The H-bridge consists of four MOSFETs that are controlled by Pulse Width Modulation (PWM) control signals. 

The initial design of this DC Motor control uses Multisim-LabVIEW co-simulation, which allows the complete system performance to be validated on the desktop.  The motor is modeled in Multisim, including parameters such as the armature resistance, inductance, and the load weight to accurately verify the performance results.  The controller is designed using the LabVIEW Control Design & Simulation and LabVIEW FPGA modules.  Using Multisim-LabVIEW co-simulation avoids having to compile digital logic for an FPGA; you will no longer have to simulate analog and digital systems separately which results in design problems. At the implementation stage of the design, the analog circuitry can be quickly transferred to Ultiboard for rapid prototyping as will be further explained.  This seamless transition between Multisim and Ultiboard ensures accurate transfers of simulated designs.  The graphical control code is transferred to a Single-Board RIO 9605 FPGA target. Single-Board RIO 9605 is an embedded control and acquisition device, which integrates a real-time processor, a user-reconfigurable FPGA, and I/O on a single printed circuit board (PCB). 

 

System Overview

The closed-loop control of the motor starts off by user-defined inputs in the LabVIEW host application for the system simulation, such as the required speed and step size.  This information is sent back to the Multisim design using the co-simulation terminals. Time-step negotiations between Multisim and LabVIEW occur to guarantee simulation accuracy and conversion on both sides. If there are sudden peaks or drops in Multisim, time-step negotiation will allow Multisim to change the provided time-step in LabVIEW in order to view peaks and drops. Switching of the H-bridge MOSFETs is controlled by the information sent from the LabVIEW host application.  The analog circuit outputs encoded speed and current signals to the LabVIEW code to the feedback loop based on which switching decisions are made.  The point-by-point simulation between analog circuits and digital systems of Multisim and LabVIEW results in improved system behavior and accuracy. 

Once the system design has been verified with LabVIEW and Multisim co-simulation, the completed analog circuit can be easily transferred to Ultiboard for layout and routing.  In Multisim, the analog circuit is connected to a pre-defined connector symbol for the 240-pin RIO Mezzanine Connector (RMC).  The predefined connector symbol also has a footprint associated with it in Ultiboard. With these predefined connector symbols and footprints, you are able to customize your design with NI hardware and test platforms. The same LabVIEW graphical code used in simulation can be directly ported to the Single-Board RIO. The integration between the three platforms results in reduced prototype iterations to save you time and money.

 

Circuit Design in Multisim with LabVIEW Co-Simulation

The initial step of this design is to verify the H-bridge MOSFET analog circuit using Multisim-LabVIEW co-simulation.  The initial parameters are set in LabVIEW, which are then sent to Multisim to simulate the circuit accordingly.  The MOSFETs are turned ON and OFF by conditioned control signals sent from LabVIEW.  The state of the MOSFETs determines the direction and speed of the controller.  The MOSFETs used in the design are modeled from International Rectifier; IRF3710ZPBF.  NI’s relationships with leading manufacturers, such as International Rectifier, allow us to include standard manufacturer models in Multisim's database.  Having access to these components will allow you to simulate a circuit that will accurately predict how the component will work in the real-world.  Without these models available, you may encounter inconsistencies between simulation models and physical parts.

The transient time simulation is performed in Multisim to predict the current through the motor and its rotation of speed.  The feedback speed signals of the motor are passed through an encoder, sending the signals back to LabVIEW.  In LabVIEW the signals are decoded and passed to the Proportional Integral (PI) Controller, developed as a graphical FPGA IP.  The new switching information is encoded and sent back to Multisim.  This single-cycle simulation loop runs for a specific duration, for example 2 seconds of simulation time, at a 40 MHz frequency.

The simulation results are shown below

 

Rapid Prototyping with NI Ultiboard

Seamless transition between Multisim and Ultiboard allows you to transfer your analog circuitry to a PCB layout to rapidly prototype it.  This design uses the Single-Board RIO RMC connector symbol and footprint in the schematic capture step of the design process; when the circuit is transferred to Ultiboard, the footprint for the connector already exists along with many standard components used in this design.  Manual routing options are used to create thick traces  carrying up to 15A across the MOSFETs and the motor terminals.  The Single-Board RIO connector maps to pin connectors that have been defined in Multisim.  Advanced automatic routing options allocate routing components to the connector digital input and output pins on the Single-Board RIO.  Since Multisim and Ultiboard are integrated, the Multisim file annotates its specific I/O interfacing design elements to the Ultiboard layout.  Ultiboard’s fan-out option initializes traces from within the high pin-count SMT component (Single-Board RIO connector footprint) thus simplifying the routing procedure.  Without the fan-out option, it would not be possible to route from the pins inside the connector footprint.   The PCB includes an LCD screen, in which the user can view the current speed and direction of the motor controller and push buttons allowing the user to change the required speed of the motor.

Having predefined connector symbols and footprints allows you to save time.  When creating connector symbols and footprints, the smallest inaccuracy in pin spacing definition, or sizing can result in errors and prototype iterations.

Complete System Solution

Being able to simulate analog and digital circuits simultaneously allows for an improved and accurate system development in shorter time.  The point-by-point simulation provides Multisim with the required information from LabVIEW to alter the speed and direction of the motor accordingly.  Once the speed transient response, current peaks, and control signals of the motor control are evaluated in the simulation stage, the analog circuitry can quickly be transferred to Ultiboard for prototyping, while the graphical code is transferred to Single-Board RIO.  Predefined Single-Board RIO connector symbol and footprint allows you to save days of development and reduce prototype iterations instantly.   This implementation of an H-bridge bushed DC motor control, is an ideal example of how you can improve your design with accurate system simulation and design using the NI tools; Multisim , LabVIEW, and Single-Board RIO.

Tutorials

There are various resources available on ni.com, which provides you the tools to architect custom designs such as the H-Bridge brushed DC motor control.  To learn more, click on the links below.

System Simulation of Analog Circuitry and Digital Logic in NI Multisim and LabVIEW

Custom Circuit Design for NI Hardware

Download a 30 Day Free Evaluation of Multisim and Ultiboard

Downloads

ultiboarddesign.zip

1 Ratings | 5.00 out of 5
Read in  |  Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).