An Application of NI SoftMotion RT System in A Motion Control Workbench
An Application of NI SoftMotion RT System in A Motion Control Workbench
net/publication/261496447
CITATIONS READS
5 958
3 authors, including:
Zorica Nedic
University of South Australia
86 PUBLICATIONS 949 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Zorica Nedic on 25 February 2017.
Abstract—In recent years, an advanced motion control Low level programming with Property, Invoke
software for rapid development has been introduced by and Axis Interface nodes for more complex
National Instruments, accompanied by innovative and system definition and control;
improved FPGA-based hardware platforms. The LabVIEW
Virtual prototyping of motion control systems by
NI SoftMotion module combines a graphical development
integration with SOLIDWORKS 3D CAD design
environment for motion control applications with a variety
software [6].
of tools for axis configuration, motor tuning and hardware
setup validation. This paper presents an application of a The National Instrument cRIO C-series Drive Interface
motion control system based on the NI SoftMotion module, modules provide an integrated hardware environment for
NI Compact RIO (cRIO) Real Time FPGA Controller and a various single axis motion control applications of stepper
flexible workbench. It replicates real industrial applications and servo drives. Combined with the use of NI
and is very useful for experimentation with Brushless DC/ SoftMotion Module and the RIO Scan Interface, a Real
Permanent Magnet Synchronous motors and drives, and Time application can be rapidly created in a very
feedback devices. convenient way. The NI 9516 C-series module [7] is a
precise motion control servo drive interface for
Index Terms—Brushless DC motor; LabVIEW; motion torque/position control, including separate microprocessor
control; Real Time Target; SoftMotion. with integrated functionality for spline interpolation, PID
and PID feed-forward control with 50µs loop rate, dual-
I. INTRODUCTION encoder interface and support for custom digital inputs
and outputs, end-limit and home switches.
Remote laboratories for motion control, part of the
growing field of computerised laboratories, emerge as a This article describes an application of the NI
valuable tool for performing real time experiments with SoftMotion module and the NI RIO Scan Interface, in an
usually expensive or unique laboratory equipment in a experimental remote laboratory motion control workbench
safe way. The development and constant improvement of presented in [8] and consisting of:
software applications such as National Instruments BLDC motor;
LabVIEW and Mathworks MATLAB allow easy High-performance FPGA-based motion controller
implementation of control algorithms and creation of user MC73110 [9] (for torque control);
friendly interfaces with virtual instruments (VI). The use
of embedded systems with integrated Field Programmable NI 9516 dual-encoder servo interface module (for
Gate Arrays (FPGAs) increases the robustness, reliability position and velocity control);
and determinism of the control applications [1-4]. NI cRIO-9076 real time controller [10];
The National Instrument SoftMotion module [5] is a Linear stage with a linear scale.
valuable addition to the LabVIEW graphical development The advantage of using a motorised linear stage in the
environment. Users benefit from the high-level application laboratory test bench is that it represents various industrial
programming interface (API), providing rapid means for applications for precise position control. The workbench
development of custom-oriented motion control is a valuable tool for remote experimentations with
applications. The key futures could be determined as: Brushless DC (BLDC)/Permanent Magnet Synchronous
High-level visual axes customisation with the motors (PMSM) and drives, single/multiple axes flexible
ability to define additional inputs and outputs, mechanical systems with friction/backlash uncertainties,
which is NI C-series modules oriented; etc. A number of control strategies can be applied to this
Integrated support for End-limit switches and very specific dynamical system and their advantages and
Home switch, Brakes, Gearing and Camming; disadvantages tested and proved.
Support of two-loop position and velocity control Firstly, the hardware set-up of the workbench will be
in conjunction with NI 9516 C-module; explained in details, including the hardware structure, the
functional block diagram and the MC73110 servo system
Gain Tuning Panel for adjustment of the control diagnostic screen. Then, a motion control application of
loop gains and visualisation of the step response; the NI SoftMotion module will be presented, including the
Test Move Panel for debugging and validation of servo axis configuration procedure, control loop gains
the hardware setup; adjustments and tuning results of the PID/ PIVff control
Integrated functionality for trajectory generation algorithms and limit switches referencing procedure,
and spline interpolation; accompanied by graphical plots of the experimental
movements.
Dedicated Functional Blocks for different
movements, axis referencing, status monitoring,
etc.;
Figure 1. Linear Stage for Motion Control Experimentation
II. HARDWARE SET-UP OF THE MOTION CONTROL MC73110 – an FPGA based, high-performance motion
WORKBENCH control IC, which incorporates all the needed internal
The developed motion control workbench replicates a blocks to work as a stand-alone servo controller [9]. In
motorised axis, widely used in industrial CNC machines addition, online programming is available by means of
and robots. Here is described the hardware structure, the RS232 or Synchronous Serial Input (SPI) interfaces. It can
functional block diagram of interaction between the control either BLDC motors (trapezoidal control) or
hardware/software modules and the high-performance PMSM motors (sinusoidal control) and has 3 inputs for
motion controller MC73110; its initialisation and velocity and position feedback signals: a DC tacho-
diagnostics screen. generator, a rotor position Hall sensor and an incremental
encoder signals. The operational modes are completed
A. Hardware Structure: with Field Oriented Control.
The hardware of the workbench is shown in Figure 1 12 inch linear stage - NEMA 23 standard motor
and is described in more details in [8]. The platform is a mounting with helical flexible coupling and anti-backlash
mechanical system with three control loops: lead-screw assembly.
current/torque, velocity and position. The following Precision linear scale – as a main feedback device, it
components have been used to utilise its functionality: provides a position feedback from the linear stage via
NI cRIO-9076 – an integrated 400MHz real-time incremental encoder interface.
controller with industrial real-time PowerPC processor
BLDC motor – it is driven by full IGBT bridge, and
and VxWorks robust real-time operating system for controlled by MC73110 (NEMA 23 mounting, 4 poles,
control, data-logging and analysis – it is highly reliable, nominal voltage 36V, rated speed 4000RPM, rated torque
responsible and have a deterministic behaviour; NI Scan 0.4Nm, torque constant 0.063 Nm/A).
engine; Spartan-6 LX45 FPGA, 43661 logic sells, 58
multipliers, 2088Kb RAM [10]. Rotor Excited Resolver – as an analogue feedback
device (a rotary electrical transformer) it gives the angular
NI 9516 C-series module – a precise motion control position and velocity of the rotor of the motor. It has an
servo drive interface, supporting position and velocity input winding with sinusoidal excitation and output two-
control loops. It comprises a dedicated processor for phase windings with sinusoidal and cosinusoidal signals.
spline interpolation, PID and PID feed-forward control
In order to evaluate the output signals, a resolver-to-digital
with 50µs loop rate; dual-encoder interface; customised converter has been used.
support for digital inputs and outputs, including end-limit
and home switches [7]. AD2S1210 – a complete 10-bit to 16-bit resolution
tracking resolver-to-digital converter, integrating an on-
NI USB-6341 – a high speed (500 kS/s), 16-bit board programmable sinusoidal oscillator that provides
resolution, multichannel (16 analog and 24 digital
sinusoidal wave excitation for resolvers [12]. It can
channels), multifunction USB data acquisition board emulate an incremental quadrature encoder, and output
(DAQ) with advanced timing and triggering [11]. The data for the angular position or velocity.
main application of the board is high speed signal
monitoring, system identification and model validation of
the controlled dynamical system.
Figure 2. Functional Block Diagram of the Motion Control Workbench
B. Functional Block Diagram of the Motion Control be achieved in this mode; drawback sometimes is
Workbench the very long compilation time; some applications
could be developed first in scan mode and tested,
The host LabVIEW application is running on the PC, and then redeveloped in FPGA mode. A hybrid
exchanging variables with the nondeterministic loop (a programming mode is also possible, which gives
low-priority application) on the real time target (the NI developers additional advantages.
cRIO system) through the network as shown in Figure 2. Apart from the standard PID/PIVff control algorithms
A second timed loop, which is deterministic, is running in running on the NI 9516 module, more complex and
real time the high-priority application and is synchronised advanced algorithms (as Fuzzy-logic and H-infinity) can
with the NI Scan engine. This application is be developed and executed on the FPGA target for
communicating with the NI 9516 servo interface module, maximum performance and reliability.
requiring data from the experiment and writing it into
shared variables, using a Real-Time FIFO. The acquired C. MC73110 Servo System Diagnostic Window
data is sent from the deterministic loop to the non- For the purpose of initialisation and diagnostics of the
deterministic loop by means of Shared Variable Nodes. MC73110 motion controller, more than 130 intelligent
Then the non-deterministic loop is using Network- profile commands have been implemented in a new
Published Shared Variables to send this data back to the LabVIEW Virtual Instrument with a Front Panel depicted
host application for analysis and plotting. in Figure 3. It allows the controller to be easier set-up and
It is worth to mention that the NI cRIO-9076 high- tuned, and valuable diagnostic information to be read
performance controller allows two different kinds of during the control experiment.
interface programming modes to be used in conjunction The LabVIEW diagnostic screen is divided into various
with the real-time target: diagnostic windows, according to their purpose and use:
Scan Interface – a high-level programming Activity Status and Limits – measured DC bus
interface, running a hardware-timed scan loop on voltage and board temperature, and limits, etc.;
the FPGA. It allows synchronous update rates of
up to 1 kHz. However, the advantage of using NI Signal Sensing – a visual indication is shown for
C-series modules is the combination of high- Hall-sensors phases, incremental encoder signals,
speed performance (since these modules contain amplifier and PWM output activation, emergency
the high-speed circuitry) and the convenience of stop and the signal sense mask;
the high-level programming, thus reducing Motor Status – provides information about the
dramatically the development time. motor control: type of the loop, engaged feedback
FPGA Interface – the highest possible loops, velocity command source, type of
performance, flexibility and reliability could commutation and phase correction;
Figure 3. LabVIEW Diagnostics Screen for MC73110
Serial Communication – provides complete the masks applied to the status registers for
information about the MC73110 serial amplifier error, amplifier disable and PWM
communication via the RS232 and SPI ports; disable;
Events Status – provides information about faults Analogue Signals Status – shows the captured
related to motion or programmable amplifier, analogue voltage for the analogue command,
EEPROM/Flash processing; occurrence of tachometer and motor currents;
encoder position wrapping and position capture; Other information for command status and
PWM Adjustment of the inverter bridge – bridge various errors, related to currents, velocity,
control mode, PWM frequency, duty cycle and velocity integrator, etc.
dead time, sampling time, etc.;
Figure 4 depicts a part of the LabVIEW code, which
PID Parameters – for current, velocity and establishes a RS-232 communication with the MC73110
velocity-integrator loops; motion controller, requires numerous system status
Condition Mask – provides information about information and displays it on the diagnostic screen.
Figure 4. LabVIEW code for RS-232 communication with MC73110 and display of system status data
III. AN APPLICATION OF NI SOFTMOTION MODULE Derivative Sample Period and Control Loop
The NI SoftMotion module provides a variety of tools Output Update Period (both measured in loop
for servo axis configuration, control loop gains rates);
adjustment, testing and debugging of the whole motion Gain Sets – allows setting-up a second set of PID
system and advanced functional blocks for programming gains with Gain Schedule Criteria for
and analysing of the experiment. An application of the Acceleration Profile, Cruise Profile and Reverse
module with the motion control workbench is described in Direction movements;
this section. Spline Interpolation – algorithms for calculation
of the set-points: Cubic B (for smoothness) and
A. Axis Configuration
Catmull-Rom (for accuracy);
The Servo Axis Configuration window (Figure 5) is
Home and Limit Switches Inputs Configuration –
module specific comprehensive tool for setting up a
type of the input (Sinking, Sourcing), Active
complete motion system. Some of the most important
State, Digital Filter configuration, Stop Mode,
settings are:
etc.;
Single/Dual Loop Feedback – since the NI 9516
Encoders Configuration – Units, Counts per unit,
module has inputs for two encoders, the feedback
Maximum Velocity of the axis, Active States,
loops could be configured as single position or
Velocity filter (for elimination of noise, jitter and
double position/velocity loops. In this application
feedback quantisation noise);
the linear scale is utilised as a feedback device for
position loop and the resolver (using the resolver- I/O Signals Configuration – Digital Inputs and
to-digital converter) – as a feedback device for the Outputs, Drive Command Analogue Output and
velocity loop. Drive Enable and Position Compare Outputs,
Position Capture Input;
Loop Gains Configuration – as depicted in the
control diagram in Figure 5, the following control The main system parameters are shown in Table 1:
parameters could be adjusted: Position Loop PID
parameters (Kp, Kd, Ki and Integral Limit), TABLE I. AXIS CONFIGURATION PARAMETERS
Position Loop Velocity Feedback Gain - Kv, Position control loop rate 0.05ms
Velocity Feed-forward Vff (decreases the position
error in periods of the constant velocity) and Position encoder configuration 200 counts/mm
Acceleration Feed-forward Vff (decreases the Velocity encoder configuration 4096 counts/rev
position error in periods of acceleration/ Proportional gain - Kp 150
deceleration);
Integral gain - Ki 0.2
Loop Rates – provides adjustment for the Position
Loop Rate (by default it is 0.05ms) which Derivative gain - Kd 1
corresponds to 20kHz update rate, Position Loop
C. Forward and Reverse Limit Switches seeking Read – acquires and outputs different kind of
procedure information (according to the selected method):
Data (position, position error, velocity, torque),
The NI SoftMotion module provides a number of high Axis Execution Status, Current Trajectory
level multi-functional blocks for movement of the Generator information, etc.
controlled system and acquiring of valuable information.
The needed functionality is selected by choosing the Two timed loops syncronised with the scan engine are
method and checking the appropriate inputs and outputs in running with different loop rates and priorities.
the property window. The first loop contains the functional blocks, which
Figure 8 depicts a part of the program used for execute the reference movements (forward and reverse
referencing of the axis and sending data to the host limit switches seeking) and then move the linear stage in
application. The functional blocks used in this diagram are zero position. It is slower and is executed at the rate of
named: every 10 samples of the scan engine. It also has lower
Find Reference Move – for referencing of the priority.
current axis. In conjunction with the hardware The referenced movement is a two-speed movement:
configuration different methods can be applied: search (cruise) velocity is set to 100mm/s, and the
Forward Limit Switch, Reverse Limit Switch, approach velocity is set to 20mm/s. The latter is slower
Home Switch, Encoder Zero Index searches; since a more precise reading is needed at the final stage of
Center between Forward and Reverse Limit the limit switch seeking. Another useful parameter is the
switches positioning; acceleration when the movement is initialised. It is set to
500mm/s2. An additional seeking procedure for encoder
Straight-Line Move – for point-to-point
index is not performed since the linear scale, used in the
movement using different methods: Absolute
workbench, provides only one index in the middle.
movement, Relative movement, Specified Velocity
movements and Relative movement to the last After the reference movement is completed, software
Captured/Index position; limit switches are set-up at the distance of 20mm away
from the hardware limit switches and the linear stage
moving table is moved to a desired position in between
the software limits. The velocity and acceleration are set
to 250mm/s and 1000mm/s2 respectively.
The second loop contains the functional blocks, which
acquire the real-time data for position, torque, velocity and
position error during the movements. It has higher priority
and is executed at the rate of every 3 samples of the scan
engine.
The acquired data are written in real time into Shared
Variables, using a Real-Time FIFO. Another low-priority
loop transfers the values from these variables into
Network-Published Shared Variables thus effectively
sharing them with the remote host application.
Then the host application (running independently from
the real-time system) is processing the received data,
analysing it and plotting the graphical information –as
Figure 9. Limit Switch Seeking Sequence shown in Figure 10.
Figure 10. Graphical Representation of Position, Position Error, Torque and Velocity during the Seeking Procedure
( ) (2)
(3)
(4)
Figure 11. Linear Stage Response to Square Pulse Excitation
Figure 12. Linear Stage Response to PRBS Excitation Figure 13. Linear Stage Response to Swept Sine Excitation