27-10-2016, 11:21 AM
1461605770-NITutorial3367en.pdf (Size: 205.44 KB / Downloads: 7)
Overview
This tutorial is part of the National Instruments Measurement Fundamentals series. Each tutorial in this series teaches you a
specific topic of common measurement applications by explaining theoretical concepts and providing practical examples. In this
tutorial, learn the fundamentals of a motion control system including software, motion controller, drive, motor, feedback devices,
and I/O.
Application software – You can use application software to command target positions and motion control profiles.
Motion controller – The motion controller acts as the brain of the system by taking the desired target positions and motion
profiles and creating the trajectories for the motors to follow but outputting a ±10 V signal for servo motors, or a step and direction
pulses for stepper motors.
Amplifier or drive – Amplifiers (also called drives) take the commands from the controller and generate the current required to
drive or turn the motor.
Motor – Motors turn electrical energy into mechanical energy and produce the torque required to move to the desired target
position.
Mechanical elements – Motors are designed to provide torque to some mechanics. These include linear slides, robotic arms, and
special actuators.
Feedback device or position sensor – A position feedback device is not required for some motion control applications (such as
controlling stepper motors) but is vital for servo motors. The feedback device, usually a quadrature encoder, senses the motor
position and reports the result to the controller, thereby closing the loop to the motion controller.
2. Software for Configuration, Prototyping, Development
Application software is divided into three main categories: configuration, prototype, and application development environment
2/9 www.ni.com
Application software is divided into three main categories: configuration, prototype, and application development environment
(ADE). Figure 2 illustrates the motion control system programming process and the corresponding National Instruments product
designed for the process:
Prototyping
When you have configured your system, you can start prototyping and developing your application. In this phase, you create your
motion control profiles and test them on your system to make sure they are what you intended. For prototyping, National
Instruments offers an interactive tool called the NI Motion Assistant, which you can use to configure moves using a point-and-click
environment and generate NI LabVIEW code based on the moves you configure. The key benefit of the NI Motion Assistant lies in
the difference between configurable and programmable environments. With configurable environments, you can start your
development without programming. You can think of the tasks in the NI Motion Assistant as prewritten blocks of code that you
simply configure to meet your needs. Programmable environments, on the other hand, require you to use standard programming
languages such as LabVIEW, C, or Visual Basic to accomplish your tasks. Unfortunately, many configurable environments may be
limited in functionality or in the ability to integrate with other I/O outside motion. The NI Motion Assistant bridges the gap between
programmable and configurable environments by offering all configurable system features as well as LabVIEW code generation
Evaluation Software
Development
After the prototyping phase, the next step is to develop the final application code. For this, you use driver-level software
in an ADE such as LabVIEW, C, or Visual Basic. For a National Instruments motion controller, you use NI-Motion driver
software.
The NI-Motion driver software contains functions you can use to communicate with NI motion controllers in the Windows
or LabVIEW Real-Time OS. NI-Motion also includes MAX to help you easily configure and tune your motion system.
For non-Windows systems, you can develop your own driver using the NI Motion Control Hardware DDK manual. It
explains how to communicate on a low level with NI motion controllers. If you do not have the expertise or time to
develop your own driver, National Instruments Alliance Partner Sensing Systems offers a Linux and VxWorks driver, and
can create drivers for other OSs, such as Mac OS X or RTX.
Application Notes
Understanding Input and Return Vectors in Onboard Programming
Understanding Loop and Conditional Structures in Onboard Programming
Understanding Variable Arithmetic in Onboard Programming
Advanced Object Management in Onboard Programming
Controlling an X-Y Stage with a Joystick
3. Motion Controller
A motion controller acts as the brain of the motion control system and calculates each commanded move trajectory. Because this
task is vital, it often takes place on a digital signal processor (DSP) on the board itself to prevent host-computer interference (you
would not want your motion to stop because your antivirus software starts running). The motion controller uses the trajectories it
calculates to determine the proper torque command to send to the motor amplifier and actually cause motion.
The motion controller must also close the PID control loop. Because this requires a high level of determinism and is vital to
consistent operation, the control loop typically closes on the board itself. Along with closing the control loop, the motion controller
manages supervisory control by monitoring the limits and emergency stops to ensure safe operation. Directing each of these
operations to occur on the board or in a real-time system ensures the high reliability, determinism, stability, and safety necessary
to create a working motion control system.
Learn more about the FlexMotion architecture of National Instruments DSP-based motion controllers.
Calculating the Trajectory
The motion trajectory describes the motion controller board control or command signal output to the driver/amplifier, resulting in a
motor/motion action that follows the profile. The typical motion controller calculates the motion profile trajectory segments based
on the parameter values you program. The motion controller uses the desired target position, maximum target velocity, and
acceleration values you give it to determine how much time it spends in the three primary move segments (which include
acceleration, constant velocity, and deceleration).
For the acceleration segment of a typical trapezoidal profile, motion begins from a stopped position or previous move and follows a
prescribed acceleration ramp until the speed reaches the target velocity for the move.
Motion continues at the target velocity for a prescribed period until the controller determines that it is time to begin the deceleration
segment and slows the motion to a stop exactly at the desired target position.
If a move is short enough that the deceleration beginning point occurs before the acceleration has completed, then the profile
appears triangular instead of trapezoidal and the actual velocity attained may fall short of the desired target velocity. S-curve
acceleration/deceleration is a basic trapezoidal trajectory enhancement where the acceleration and deceleration ramps are
modified into a nonlinear, curved profile. This fine control over ramp shape is useful for tailoring motion trajectory performance
based on the inertial, frictional forces, motor dynamics, and other mechanical motion system limitations.
Application Notes
Trajectory Settings for Motion Controllers
S-Curve Acceleration and Deceleration
Velocity Profiling
Selecting the Right Motion Controller
NI offers three main families of DSP-based motion controllers, including the low-cost NI 733x series, the mid-range NI 734x series,
and the high-performance NI 735x series. The NI 733x low-cost controllers offer four-axis stepper motor control and most of the
basic functions you need for a wide variety of applications, including single and multiaxis point-to-point motion. The NI 734x series
is the mid-range series that offers up to four axes of both stepper and servo control, as well as some higher-performance features
such as contouring and electronic gearing. The NI 735x series is the most advanced series that offers up to eight axes of stepper
and servo control, extra I/O, and many powerful features including sinusoidal commutation for brushless motors and 4 MHz
periodic breakpoints (or position triggers) for high-speed integration.
Selection Guides
View the Complete Motion Control Product Selection Guide
Creating Custom Motion Controllers
While current motion controllers with DSPs are suitable for many applications, when it comes to high-precision motion control with
servo update rates as fast as 200 kHz, machine builders turn to designing their own motion controllers on a custom printed circuit
board (PCB). Not only is the development expensive in terms of time and cost, but the fixed personality of the motion controller
makes the system inflexible for future redesigns or for accommodating variations in the motion control algorithms at run time.
Some applications that need such a high level of precision and flexibility include wafer processing machines in the semiconductor
industry or the inline vehicle sequencing (ILVS) reconfigurable-at-run-time assembly line for the automotive industry. National
Instruments reconfigurable I/O (RIO) technology combined with NI SoftMotion technology provides the right tools for machine
builders who want high-precision customized motion control with the complete flexibility of a field-programmable gate array
(FPGA). In addition to high-precision applications, machine builders and OEMs can use the LabVIEW NI SoftMotion Module to
implement multiaxis coordinated motion control using LabVIEW on a variety of platforms – from plug-in NI M Series data
acquisition (DAQ) devices for industrial PCs and PXI to rugged systems using NI CompactRIO and Compact FieldPoint
programmable automation controllers (PACs).
Tutorials:
White Paper: Create Your Custom Motion Controller on Any Platform with LabVIEW
4. Move Types
Single-Axis, Point-to-Point Motion
One of the most commonly used profiles is the simple, single-axis, point-to-point move, which requires the position to which the
axis needs to move. Often it also requires the velocity and acceleration (usually supplied by a default setting) at which you want
5/9 www.ni.com
axis needs to move. Often it also requires the velocity and acceleration (usually supplied by a default setting) at which you want
the motion to move. Figure 6 shows how to move a single axis in LabVIEW using the default velocity and acceleration.
Coordinated Multiaxis Motion
Another type of motion is coordinated multiaxis motion, or vector motion. This move is often point-to-point motion but in 2D or 3D
space. Vector moves require the final positions on the X, Y, and/or Z axes. Your motion controller also requires some type of
vector velocity and acceleration. This motion profile is commonly found in XY-type applications such as scanning or automated
microscopy. Figure 7 shows how to accomplish a three-axis move using LabVIEW. For more information on coordinated motion,
view the examples in the LabVIEW Multiaxis.llb library in NI-Motion driver software.
Blended Motion
Blended motion involves two moves fused together by a blend that causes the moves to act as one. Blended moves require two
moves and a blend factor that specifies the blend size. Blending is useful for applications requiring continuous motion between two
different moves. However, in blended motion, your system does not pass through all of the points in your original trajectory. If the
specific position along the path is important to you, consider a contouring motion.