For further support information, refer to the Technical Support and Professional Services appendix. To comment
on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter
the info code feedback.
The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects
in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National
Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives
notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be
uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before
any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are
covered by warranty.
National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for technical
accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent
editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected.
In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.
E
XCEPTASSPECIFIEDHEREIN, NATIONAL INSTRUMENTSMAKESNOWARRANTIES, EXPRESSORIMPLIED, ANDSPECIFICALLYDISCLAIMSANYWAR RANTYOF
MERCHANTABILITYORFITNESSFORAPARTICULARPURPOSE . CUSTOMER’SRIGHTTORECOVERDAMAGESCAUSEDBYFAULTORNEGLIGENCEONTHEPART OF
N
ATIONAL INSTRUMENTSSHALLBELIMITEDTOTHEAMOUNTTHERETOFOREPAIDBYTHECUSTOMER. NATIONAL INSTRUMENTSWILLNOTBELIABLEFOR
DAMAGESRESULTINGFROMLOSSOFDATA, PROFITS, USEOFPRODUCTS, ORINCIDENTALORCONSEQUENTIALDAMAGES, EVENIFADVISEDOFTHEPOSS IBILITY
THEREOF. This limitation of the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including
negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments
shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover
damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or
maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire,
flood, accident, actions of third parties, or other events outside reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying,
recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National
Instruments Corporation.
Trademarks
National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section
on
ni.com/legal for more information about National Instruments trademarks.
®
is the registered trademark of Apple Computer, Inc. Other product and company names mentioned herein are trademarks or trade
FireWire
names of their respective companies.
Patents
For patents covering National Instruments products, refer to the appropriate location: Help»Patents in your software, the patents.txt file
on your CD, or ni.com/patents.
WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
(1) NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF
RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN
ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT
INJURY TO A HUMAN.
(2) IN ANY APPLICATION, INCLUDING THE ABOVE, RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE
IMPAIRED BY ADVERSE FACTORS, INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY,
COMPUTER HARDWARE MALFUNCTIONS, COMPUTER OPERATING SYSTEM SOFTWARE FITNESS, FITNESS OF COMPILERS
AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION, INSTALLATION ERRORS, SOFTWARE AND
HARDWARE COMPATIBILITY PROBLEMS, MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL
DEVICES, TRANSIENT FAILURES OF ELECTRONIC SYSTEMS (HARDWARE AND/OR SOFTWARE), UNANTICIPATED USES OR
MISUSES, OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER (ADVERSE FACTORS SUCH AS THESE ARE
HEREAFTER COLLECTIVELY TERMED “SYSTEM FAILURES”). ANY APPLICATION WHERE A SYSTEM FAILURE WOULD
CREATE A RISK OF HARM TO PROPERTY OR PERSONS (INCLUDING THE RISK OF BODILY INJURY AND DEATH) SHOULD
NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE. TO AVOID
DAMAGE, INJURY, OR DEATH, THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO
PROTECT AGAINST SYSTEM FAILURES, INCLUDING BUT NOT LIMITED TO BACK-UP OR SHUT DOWN MECHANISMS.
BECAUSE EACH END-USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS' TESTING
PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN
COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL
INSTRUMENTS, THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING
THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE
INCORPORATED IN A SYSTEM OR APPLICATION, INCLUDING, WITHOUT LIMITATION, THE APPROPRIATE DESIGN,
PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION.
This manual provides information about the NI-Motion driver software,
including background, configuration, and programming information.
The purpose of this manual is to provide a basic understanding of the
NI-Motion driver software, and provide programming steps and examples
to help you develop NI-Motion applications.
This manual is intended for experienced LabVIEW, C/C++, or other
developers. Code instructions and examples assume a working knowledge
of the given programming language. This manual also assumes a general
knowledge of motion control terminology and development requirements.
This manual pertains to all NI motion controllers that use the NI-Motion
driver software.
Conventions
The following conventions appear in this manual:
<>Angle brackets that contain numbers separated by an ellipsis represent a
range of values associated with a bit or signal name—for example,
AO <3..0>.
[ ]Square brackets enclose optional items—for example, [
»The » symbol leads you through nested menu items and dialog box options
to a final action. The sequence File»Page Setup»Options directs you to
pull down the File menu, select the Page Setup item, and select Options
from the last dialog box.
This icon denotes a tip, which alerts you to advisory information.
This icon denotes a note, which alerts you to important information.
This icon denotes a caution, which advises you of precautions to take to
avoid injury, data loss, or a system crash.
boldBold text denotes items that you must select or click in the software, such
as menu items and dialog box options. Bold text also denotes parameter
names.
monospace boldMonospace bold text indicates a portion of code with structural
significance.
monospace italicMonospace italic text indicates a portion of code that is commented out.
Documentation and Examples
In addition to this manual, NI-Motion includes the following
documentation to help you create motion applications:
•Getting Started with NI-Motion for NI 73xx Motion Controllers—This
document provides installation instructions and general information
about the NI-Motion product.
•Getting Started: NI SoftMotion Controller for Ormec ServoWire SM Drives—Refer to this document for information about
getting started with the NI SoftMotion Controller for Ormec.
•Getting Started: NI SoftMotion Controller for Copley CANopen Drives—Refer to this document for information about getting started
with the NI SoftMotion Controller for CANopen.
•NI-Motion VI Help—Refer to this document for specific information
about NI-Motion LabVIEW VIs.
•NI-Motion Function Help—Refer to this document for specific
information about NI-Motion C/C++ functions.
•Measurement & Automation Explorer Help for Motion—Refer to this
document for configuration information.
•NI-Motion ReadMe—Refer to this HTML document for information
about hardware and software installation and information about
changes to the NI-Motion driver software in the current version. This
document also contains last-minute information about NI-Motion.
•Application notes—For information about advanced NI-Motion
concepts and applications, visit
ni.com/appnotes.nsf/.
NI-Motion User Manualxivni.com
About This Manual
•NI Developer Zone (NIDZ)—Visit the NI Developer Zone, at
ni.com/zone, for example programs, tutorials, technical
presentations, the Instrument Driver Network, a measurement
glossary, an online magazine, a product advisor, and a community area
where you can share ideas, questions, and source code with motion
developers around the world.
•Motion Hardware Advisor—Visit the National Instruments Motion
Hardware Advisor at
ni.com/devzone/advisors/motion/ to
select motors and stages appropriate to the motion control application.
In addition to the NI Developer Zone, you can find NI-Motion C/C++
and Visual Basic programming examples in the
FlexMotion\Examples
default directory is
NI-Motion
.
folder where you installed NI-Motion. The
Program Files\National Instruments\
NI-Motion\
You can find LabVIEW example programs under
examples\Motion
in the directory where you installed LabVIEW. You can find
LabWindows
™
/CVI™ examples under samples\Motion in the directory
where you installed LabWindows/CVI.
You can find the NI-Motion C/C++ and LabVIEW example code
referenced in this manual in the
This user manual provides information about the NI-Motion driver
software, motion control setup, and specific task-based instructions for
creating motion control applications using the LabVIEW and C/C++
application development environments.
NI-Motion is the driver software for National Instruments 73xx motion
controllers and the NI SoftMotion Controller. You can use NI-Motion to
create motion control applications using the included library of LabVIEW
VIs and C/C++ functions.
National Instruments also offers the Motion Assistant and NI-Motion
development tools for Visual Basic.
NI-Motion Architecture
The NI-Motion driver software architecture is based on the interaction
between the NI motion controllers and a host computer. This interaction
includes the hardware and software interface and the physical and
functional architecture of the NI motion controllers.
Figure 1-1. NI Motion Control Hardware and Software Interaction
Note
The last block in Figure 1-1 is not applicable to the NI SoftMotion Controller.
NI Motion Controller Architecture
This section includes information about the architecture for both the 73xx
family of NI motion controllers and the NI SoftMotion Controller.
NI 73xx Architecture
NI 73xx controllers use a dual-processor architecture. The two processors,
a central processing unit (CPU) and a digital signal processor (DSP), form
the backbone of the NI motion controller. The controller plugs into a
variety of slots, including PCI slots, or to a PC using a high-speed serial
interface, such as IEEE 1394 (FireWire
Application Development Environments:
LabVIEW, Visual Basic, and C++
®
).
NI-Motion User Manual1-2ni.com
Chapter 1Introduction to NI-Motion
The controller CPU is a 32-bit micro-controller running an embedded real
time, multitasking operating system. This CPU offers the performance and
determinism needed to solve most complex motion applications. The CPU
performs command execution, host synchronization, I/O reaction, and
system supervision.
The DSP has the primary responsibility of fast closed-loop control with
simultaneous position, velocity, and trajectory maintenance on multiple
axes. The DSP also closes the position and velocity loops, and directly
commands the torque to the drive or amplifier.
Motion I/O occurs in hardware on an FPGA and consists of
limit/home switch detection, position breakpoint, and high-speed capture.
This ensures very low latencies in the range of hundreds of nanoseconds
for breakpoints and high-speed captures. Refer to Chapter 12,
Synchronization, for information about breakpoints and high-speed
capture.
The motion controller processor is monitored by a watchdog timer, which
is hardware that can be used to automatically detect software anomalies and
reset the processor if any occur. The watchdog timer checks for proper
processor operation. If the firmware on the motion controller is unable to
process functions within 62 ms, the watchdog timer resets the motion
controller and disallows further communications until you explicitly reset
the motion controller. This ensures the real-time operation of the motion
control system. The following functions may take longer than 62 ms to
process.
•Save Defaults
•Reset Defaults
•Enable Auto Start
•Object Memory Management
•Clear Buffer
•End Storage
These functions are marked as non-real-time functions. Refer to the
NI-Motion Function Help or the NI-Motion VI Help for more information.
Figure 1-2 illustrates the physical architecture of the NI motion controller
hardware.
Host Computer
Microprocessor
Running a Real-Time
Operating System
PC
Supervisory/
Communications/
User-defined Onboard
Programs
Watchdog
Timer
Figure 1-2. Physical NI Motion Controller Architecture
Because the NI SoftMotion Controller is not a hardware device, information about
Tip
its architecture is not covered in this section. Refer to the NI SoftMotion Controller
Architecture section for information about the functional architecture that is specific to the
NI SoftMotion Controller.
NI Motion Controller Functional Architecture
Functionally, the architecture of the NI 73xx motion controllers and the
NI SoftMotion Controller is generally divided into four components:
supervisory control, trajectory generator, control loop, and motion I/O. For
the NI SoftMotion Controller, the motion I/O component is separate from
the controller. Refer to Figure 1-3 and Figure 1-4 for an illustration of how
the components of the 73xx and NI SoftMotion Controller interact.
NI Motion Controller
Processor (DSP)
Encoders and Motion I/O
Digital Signal
Control Loop and
Trajectory Generation
FPGAs
NI-Motion User Manual1-4ni.com
Chapter 1Introduction to NI-Motion
Figure 1-3 shows the components of the NI 73xx motion controllers.
Typical NI 73xx Motion Controller Architecture
Supervisory Control
Host
Host
Bus
Microcontroller running RTOS/DSPs/FPGAs
Trajectory Generation
Figure 1-3. Typical NI 73xx Motion Controller Functional Architecture
Figure 1-4 shows the components of the NI SoftMotion controller.
NI SoftMotion Controller Architecture
Supervisory Control
Trajectory Generation
Bus
Any CPU on a real-time environment
Software is separate from the I/O
Control Loop
Control Loop
To drive
From
feedback
Analog & Digital I/O
& sensors
To drive
From
feedback
Analog & Digital I/O
& sensors
Figure 1-4. NI SoftMotion Controller Functional Architecture
Figure 1-5 illustrates the functional architecture of NI motion controllers.
Supervisory Control
(ms)
User API
Interface
Supervisory
Control
Commands for
Trajectory Generator
Trajectory Generation
(ms)
Cruise
Jerk
Accel
Velocity
Time
dt
Set Point
Jerk
Decel
Interpolation
Control Loop (µs)
(with Interpolation)
PID
Output
Event Monitoring Interface
I/O
New
Set Point
Updated
Updates Trajectory
Generator Based on
I/O And User
Response
Feedback
Sensor
Figure 1-5. NI Motion Controller Functional Architecture
The following list describes how each component of the 73xx controllers
and the NI SoftMotion Controller functions:
•Supervisory control—Performs all the command sequencing and
coordination required to carry out the specified operation
–System initialization, which includes homing to a zero position
–Event handling, which includes electronic gearing, triggering
outputs based on position, updating profiles based on user defined
events, and so on
–Fault Detection, which includes stopping moves on a limit switch
encounter, safe system reaction to emergency stop or drive faults,
watchdog, and so on
•Trajectory generator provides path planning based on the profile
specified by the user
•Control loop—Performs fast, closed-loop control with simultaneous
position, velocity, and trajectory maintenance on one or more axes
NI-Motion User Manual1-6ni.com
Chapter 1Introduction to NI-Motion
The control loop handles closing the position/velocity loop based on
feedback, and it defines the response and stability of the system. For
stepper systems, the control loop is replaced with a step generation
component. To enable the control loop to execute faster than the
trajectory generation, an interpolation component, or spline engine, the
control loop interpolates between setpoints calculated by the trajectory
generator. Refer to Figure 1-5 for an illustration of the spline engine.
•Motion I/O—Analog and digital I/O that sends and receives signals
from the rest of the motion control system. Typically, the analog output
is used as a command signal for the drive, and the digital I/O is used
for quadrature encoder signals as feedback from the motor. The motion
I/O performs position breakpoint and high speed capture. Also, the
supervisory control uses the motion I/O to achieve certain required
functionality, such as reacting to limit switches and creating the
movement modes needed to initialize the system.
NI SoftMotion Controller Architecture
The NI-Motion architecture for the NI SoftMotion Controller uses standard
PC-based platforms and open standards to connect intelligent drives to a
real-time host. In this architecture, the software components of the motion
controller run on a real-time host and all I/O is implemented in the drives.
This separation of I/O from the motion controller software components
helps to lower system cost and improve reliability by improving
connectivity. Open standards, such as IEEE 1394 and CANopen, are
used to connect these components.
NI SoftMotion Controller for Ormec
When you use the NI SoftMotion Controller with an Ormec device, you can
daisy chain up to 15 drives together and connect them to the real-time host.
The real-time isochronous mode of the IEEE 1394 bus is used to transfer
data between the drives and the host. Figure 1-6 shows the NI SoftMotion
Controller component architecture that applies when the controller is used
with an Ormec device.
The supervisory control and trajectory generation loops execute every
millisecond. If the control loop is configured to execute faster than every
millisecond, the trajectory data is interpolated before the control loop
uses it.
Ormec DriveNI SoftMotion Controller on Host Device*
Supervisory
Control
*Host device is a PC or PXI chassis running the
LabVIEW Real-Time Module for RTX Targets
**I/O includes encoder implementation
Figure 1-6. NI SoftMotion Controller Functional Architecture for Ormec
Trajectory
Generation
Control
Loop
I/O**
IEEE 1394 Bus
NI SoftMotion Controller for CANopen
When you use the NI SoftMotion Controller with a CANopen device, you
can daisy chain up to 15 drives together and connect them to the real-time
host. The real-time Process Data Objects (PDOs) defined by the CANopen
protocol are used to transfer data between the drives and host.
All I/O required by the motion controller is implemented by CANopen
drives that support the Device Profile 402 for Motion Control. Currently,
the NI SoftMotion Controller supports only CANopen drives from Copley
Controls Corp. When used with CANopen devices, the Supervisory
Control and Trajectory Generation components of the NI SoftMotion
Controller execute in a real-time environment that is running LabVIEW
Real-Time Module (ETS).
If your motion control system uses 8 axes or fewer, the supervisory control
and trajectory generation loops execute every 10 milliseconds. If your
motion control system uses more than 8 axes, the supervisory control and
trajectory generation loops execute every 20 milliseconds. When you use
the NI SoftMotion Controller with a CANopen drive, the drive implements
the control loop and interpolation.
NI-Motion User Manual1-8ni.com
Chapter 1Introduction to NI-Motion
NI SoftMotion Controller
on Host Device*
Supervisory
Control
*Host device is a PC or PXI chassis running the
LabVIEW Real-Time Module
**I/O includes encoder implementation
Figure 1-7. NI SoftMotion Controller Functional Architecture for CANopen
Trajectory
Generation
Spline
Engine
CAN Bus
CANopen Drive
Control
Loop
I/O**
In this configuration, the I/O and the control loop execute on the CANopen
drive. The NI SoftMotion Controller uses an NI-CAN device to
communicate to the CAN bus.
NI SoftMotion Controller Communication Watchdog
The supervisory control in the NI SoftMotion Controller continuously
monitors all communication with the drives connected to the host. If any
drive fails to update its data in the host loop update period, the axis
corresponding to that drive is disabled and the communication watchdog
status bit, which is returned by the Read Per Axis Status function, is set to
TRUE. Similarly, all drives connected to the NI SoftMotion Controller are
configured to go into a fault state if the data from the
NI SoftMotion Controller is not updated every host loop update period on
the drives.
The communication watchdog functionality ensures that the NI SoftMotion
Controller operates in real time.
Tip To get an axis or axes out of the communication watchdog state, reset the
This chapter describes the basic form of an NI-Motion application and its
interaction with other I/O, such as a National Instruments data and/or image
acquisition device.
Creating a Generic NI-Motion Application
Figure 2-1 illustrates the steps for creating an application with NI-Motion,
and describes the generic steps required to design a motion application.
Figure 2-1. Generic Steps for Designing a Motion Application
Adding Measurements to an NI-Motion Application
Figure 2-2 illustrates an expanded view of the topics covered in Part III,
Programming with NI-Motion, of this manual. For information about items
in the diagram, refer to Chapter 12, Synchronization.
NI-Motion User Manual2-2ni.com
Chapter 2Creating NI-Motion Applications
1
Define control mechanism for I/O
Breakpoints*
2a
Define breakpoint position
Enable a breakpoint
Set data or image acquisition
device to trigger on breakpoint
Re-enable the breakpoint
after each occurrence
(absolute/relative/modulo
breakpoints only)
Synchronization
High-speed capture**
2b
Define triggering input type
Enable high-speed capture
Read the captured position
Re-enable high-speed capture
after each occurrence
(non-buffered high-speed
capture only)
Chapter 12:
* Breakpoints cause a digital output to change state when a specified position is reached
by an encoder. Breakpoints are not supported by the NI SoftMotion Controller when it is
used with an Ormec or CANopen device.
** A high-speed capture records the position of an encoder when a digital line is used as
a trigger. High-speed captures are not supported by NI SoftMotion Controller for
CANopen. You can use two high-speed captures per axis when you are using the
NI SoftMotion Controller with an Ormec device.
Figure 2-2. Input/Output with Data and Image Acquisition
Note If you are using RTSI to connect your motion controller to a National Instruments
data or image acquisition device, be aware that the NI SoftMotion Controller does not
support RTSI.
NI-Motion User Manual2-4ni.com
Configuring Motion Control
Motion control is divided into two parts: configuration and execution.
Part II of this manual discusses configuring the hardware and software
components of a motion control system using NI-Motion.
When your motion control system includes a servo motor, you must tune
and calibrate the system to ensure proper performance. This chapter covers
general information about tuning and calibrating your servo system using
control loop parameters. Refer to Measurement & Automation Explorer Help for Motion for more information about and instructions for tuning
servo motors in Measurement & Automation Explorer (MAX).
NI SoftMotion Controller Considerations
This section includes information you need if you are using the
NI SoftMotion Controller.
NI SoftMotion Controller for CANopen
This chapter does not apply if you are using the
NI SoftMotion Controller for CANopen because the control loop is
implemented on the drive. Refer to the drive documentation for
information about tuning the servo motors you are using with the CANopen
drive.
3
NI SoftMotion Controller for Ormec
If you are using the NI SoftMotion Controller for Ormec with an Ormec
ServoWire drive in position mode, you must tune the control loop using the
drive configuration utility provided by Ormec.
Using Control Loops to Tune Servo Motors
Tuning maximizes the performance of your servo motors. A servo system
uses feedback to compensate for errors in position and velocity.
For example, when the servo motor reaches the desired position, it cannot
stop instantaneously. There is a normal overshoot that must be corrected.
The controller turns the motor in the opposite direction for the amount of
distance equal to the detected overshoot. However, this corrective move
also exhibits a small overshoot, which must also be corrected in the same
manner as the first overshoot.
A properly tuned servo system exhibits overshoot as shown in Figure 3-1.
Overshoot
Commanded
Position
Time
0
Settling Time
Figure 3-1. Properly Tuned Servo Motor Behavior
The amount of time required for the motors to settle on the commanded
position is called the settling time. By tuning the servo motors, you can
affect the settling time, the amount of overshoot, and various other
performance characteristics.
Control Loop
NI motion servo control uses control loops to continuously correct errors in
position and velocity. You can configure the control loop to perform a
Proportional, Integral and Derivative (PID) loop or a more advanced
control loop, such as the velocity feedback (PIV) or velocity feedforward
(PIVff) loops.
NI-Motion User Manual3-2ni.com
Loading...
+ 275 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.