Machine designers have a difficult task. More often than not they are asked to squeeze the maximum possible performance out of a machine for the lowest possible cost. To accomplish this the designer typically begins by selecting or designing components such as motors, bearings, mechanical linkages etc.
Then, the designer begins prototyping the system at which point a question comes up - How do you measure the performance of the system and optimize the settings of the motion controller?
The answer to this question begins with accurate and sophisticated data collection, more commonly known as motion trace, or just trace. Modern motion controllers allow the user to record a wide variety of internal and external system variables, thereby bringing to light the function of the actual system.
Coupled with the traced data motion controls vendors provide sophisticated display and analysis tools that help parse the data collected. In this article we will break all of this down to give you a solid working understanding of motion trace and how it can be used to optimize your next design.
Important Trace System Characteristics
What features of a motion trace system are most important? The next few sections give you practical information on what is important to optimize your machine's performance:
What Variables to Trace
Here is a high-level list of external and internal motion controller parameters you may want to trace:
- Motion controller status registers
- Encoder position, velocity
- Encoder capture value
- Signal status (index, home, position limits etc...)
- Commanded (instantaneous desired) position
- Commanded velocity
- Commanded acceleration
- Motor command (output command to amplifier)
- Position loop error (servo lag)
- Position loop integral (amount of wind-up)
- Biquad internal values (frequency-based filter values)
- Measured motor coil current
- Commutation angle
- FOC algorithm command, servo error, integral, and output values
- DC Bus voltage
- DC bus supply and return current
- Amplifier temperature
- Motor temperature
- i2t energy
As a real world reference, Performance Motion Devices, Inc. (PMD), which makes commercially available motor controller products, provides 132 separate traceable parameters in its ION/CME N-Series Digital Drive product, a representative general purpose motion control drive.
Number of Simultaneous Motion Trace Variables
Two is a bare minimum. Four hardware-traceable variables is probably the most common number offered by off-the-shelf controls vendors.
Hardware traceable means the motion controller has dedicated logic and memory to acquire and store the traced parameters on its own. Once the host sets up the trace parameters and conditions the actual process of high speed data collection occurs entirely in the motion controller with no host action needed.
Trace Period
The user should be able to select how often data is captured. The typical minimum trace period is a single servo cycle. So for a system offering a servo loop rate of 20 kHz the minimum traceable period would be 50 uSec (20 kHz).
Tracing at the high servo rates offered by modern motion controllers generates a lot of data. Happily, as motion controllers have gotten faster, their on-board memory capacity for trace storage has increased accordingly.
Trace Length
How much data to be stored should be selectable. Typical traces are at least 1,000 points. Often they are 10,000 or more. The associated amount of data is determined by the trace length, the number of traced variables, and the size of the stored value.
For example a trace of 2,500 points with 4 simultaneous traces and a stored word size of 4 bytes uses 2,500 * 4 * 4 bytes or 40 Kbytes. Typical total trace capacity of modern controllers is well above that.
Do you always want to trace as much data as possible? No. More traced data means more time required to transfer the data from the motion controller to the host that will analyze the results. And all that data may obscure what you are looking for.
In the next section we will talk about trace control, which is a way of managing this by specifying when trace capture starts and stops so that only the data you want is stored.
Trace Control
An absolutely vital feature associated with motion trace is specifying the method by which the trace can be started or stopped. This is called trace control and, in concept, is similar to what traditional oscilloscopes and data acquisition systems provide.
Here is a list of typical trace control settings:
- Time-based (start/stop trace at specified time)
- External signal (start/stop trace based on transition of external system signal)
- Profile position (start/stop when a programmed position is reached)
- Profile velocity (start/stop when a programmed velocity value is reached)
- Profile acceleration (start/stop when a programmed acceleration value is reached)
- Profile status (start/stop when specific states of the trajectory generator are achieved such as; axis in motion, maximum velocity reached, motion complete, axis settled)
- Position loop status (start/stop when specific states of the position loop are achieved such as servo lag exceeds a threshold, integral windup saturates)
- Anomalous conditions (start/stop when a specified anomaly occurs such as motion error, overtemperature, undervoltage, etc...)
Breakpoints Provide Double Duty for Trace Control
Many motion controllers including those from Performance Motion Devices repurpose mechanisms used to control changes in the profile or in the servo settings for trace. In the PMD control architecture this is called a breakpoint, and allows general compares to be performed for position, velocity, and many other internal system parameters.
This breakpoint mechanism can also be used to specify trace conditions. This flexibility allows nearly limitless control of when the trace starts or stops.
You may also be interested in: Servo Motor Tuning - Rocket Science or Walk in the Park?
Trace Capture Mode
A final important question for the user is whether tracing should occur continuously until stopped (often called rolling buffer mode) or just once (often called one-time capture mode).
Although one-time is probably the norm for most types of trace, rolling buffer mode is useful when the occurrence of an event being investigated is not known. For example if an error is occurring at random intervals the error can be set as the trace stop criteria with the trace function in rolling buffer mode.
In this example the resultant captured data will show what happened just prior and at the moment of the error occurring. If some additional tracing is desired most controllers support this. The user simply specifies an amount of additional data points to capture after the trace stop condition is satisfied. This can be useful to study the system behavior both leading up to and following the event being studied.
Motion Trace Data Display and Analysis
For the large majority of users the process of selecting the trace capture info (what variables to trace, when to trace, etc...), retrieving the data, and displaying the data all occur using software provided by the motion controller vendor.
The screen capture image below shows an example of this. This is the scope feature of PMD's Pro-Motion software package. Pro-Motion is the motion exerciser program provided with PMD product developer kits.
Figure 1: Trace Capture
The scope feature displays using a familiar oscilloscope metaphor with graphs of the data located above and specifications for collecting and displaying the data located below.
Each of the elements discussed earlier are selectable through this screen. This includes which variables to trace, the trace period, the conditions for trace start and stop, the trace mode (one-time or rolling buffer) and the number of data points to capture.
Pro-Motion handles all of these details including display of the results in one user friendly interface screen. Some other features of Pro-Motion specific to the management and display of trace data are re-sizing of the displayed graph area, overlay control, ability to probe graphed data points with a cursor, and the ability to export captured data to a spreadsheet for further analysis or graphing.
Note that the data being displayed above is from an actual motor trace. It shows three traced variables; the instantaneous current/torque command, the commanded trajectory velocity, and the position error (servo lag) of the system as it moves along a point to point trapezoidal trajectory.
The captured data shows that the maximum position error during the move was three encoder counts, which is impressive motor control performance considering the rapid acceleration and deceleration that occurred as the motion controller drove the motor from its initial resting position to its final resting position in just 0.175 seconds.
Typical Optimization Session
Typically, during a development session, the user will specify control settings and repeat the trace capture process many times, eventually arriving at the best settings. What control settings are specified and what data is traced depends on what parameter(s) are being optimized.
Here are some of the most common settings that machine builders optimize and that motion trace is well suited to be used on:
- Position loop PID settings - Manual tuning to set the P, I, and D (proportional, Integral, Derivative) position loop settings is still very common. Trace is an effective way to confirm the resultant motion is critically damped rather than over damped or underdamped. Trace data can be taken both of step response curves (instantaneous changes in commanded position) or more usefully the trajectory profiles that will actually be used in the real application.
- Maximum acceleration - To maximize transfer speeds the controller can increase the commanded acceleration. As acceleration increases however so too will the current sent to the motor. Trace can help determine the maximum acceleration value so that the current approaches, but does not exceed, the rated current limit of the motor. Exceeding the rated motor current will either put the motor at risk, or (if the motor's current limit rating has been programmed into the controller) drive the servo into saturation which means the position error will rapidly increase as the trajectory gets ahead of the motor position.
- Profile shape tuning - The shape of your profile can have a major impact on the settling time of the controlled mechanism and therefore the throughput. This is due to vibrational energy being injected into the mechanics during profile changes. Trapezoidal shaped profiles have instantaneous changes in acceleration which inject high levels of vibrational energy into the load. S-curve shaped profiles have gradual changes in acceleration resulting in far less injected vibrational energy. However, s-curves take longer to execute because of their slower ramps. A trace session is a very effective way of balancing the profile's "S" portion length to keep injected vibration low.
- Position error minimization - Some machines require that the servo lag be as small as possible throughout the entire move, not just when coming to the final target position. This is the case for systems such as CNC machine tools, laser markers, and 3-D printers. Even if the motion controller is capable of maintaining very accurate position control, imperfections in the mechanics such as 'sticky spots' in linear slides, bearing noise, and the effect of cable movement may increase tracking inaccuracies. Simultaneous trace of the commanded position and position error over the whole motion range is used to identify and reduce these imperfections.
- DC Bus voltage stability - An important consideration in machines that use motion controllers is the power supply used to drive the motors, particularly for larger motors driving relatively high inertia loads. Rapid acceleration or deceleration of the motor and load can cause undervoltage or overvoltage conditions in the DC supply as the motion controller requests current from the supply during acceleration, acts like a generator and tries to 'dump' current during deceleration. Tracing the trajectory and the DC Bus voltage simultaneously is an effective way to explore these interactions and make changes to the supply or trajectory.
You may also be interested in: Feedforward in Motion Control - Vital for Improving Positioning Accuracy
Bode Plots and Frequency-Based Analysis
There is another common use of motion controller trace facilities that looks very different than the oscilloscope-like approach shown above. This alternate model occurs with frequency-based analysis of the machine and motion controller's function.
The graph below shows a Bode plot output from PMD's Pro-Motion program which illustrates this.
Figure 2: Bode Plot
In many ways the overall presentation is similar. Graphed results are shown above, and settings for graph generation are below. A big difference however is that the control settings which determine the trace and the data analysis have no direct relation to the traced data.
This is because what is displayed is in the frequency domain, with the horizontal axis showing frequency in hertz, and the two vertical axes showing system gain and system bandwidth. Motion trace, at least as implemented in the vast majority of commercial motion control systems, captures data in repeated constant time intervals, not as a function of frequency.
As an aside, the specific graph shown is a Bode plot representative of systems with a mechanical resonance. In this case this resonance peaks at 10 hertz. To minimize such a resonance the next step might be to use functions offered by the controller to lower the magnitude of this resonance. For example PMD's motion controllers provide biquad filters in the control loop which can be used to reduce the magnitude of such resonances.
Summary
Data trace, the ability to precisely record external and internal parameters of a motion system, is a very important tool in optimizing the performance of your machine.
A state-of-the-art motion trace and data display facility can be used for sophisticated motor performance optimization and problem solving - greatly enhancing the ability of the designer to achieve the overall performance goals of the machine.
Not all trace facilities are created equal, so when selecting the motion controller for your next design be sure it supports the data trace capabilities you need to bring your design to its full potential.
PMD Products That Provide Motion Trace
Performance Motion Devices has been producing motion control ICs that provide advanced hardware motion trace for more than twenty-five years. Since that time, we have also embedded these ICs into plug and play modules and boards. While different in packaging, all of these products are controlled by C-Motion, PMD's easy to use motion control language and are ideal for use in pick & place machines, laboratory equipment, liquid handling, and a wide variety of other high performance motion control applications.
ION/CME N-Series Digital Drives
N-Series ION Digital Drives combine a single axis Magellan IC and a high performance digital amplifier into an ultra-compact PCB-mountable package. In addition to advanced servo and step motor control, N-Series IONs provide S-curve point to point profiling, field oriented control, downloadable user code, general purpose digital and analog I/O, and much more. With these all-in-one devices building a custom controller board is a snap, requiring you to create just a simple 2 or 4-layer interconnect board.
Learn more >>
MC58113 Series ICs
The MC58113 series of ICs are part of PMD's popular Magellan Motion Control IC Family and provide advanced position control for step motors, BLDC, and DC Brush alike. Standard features include FOC (Field Oriented Control), trapezoidal & s-curve profiling, direct encoder & pulse & direction input, and much more. MC58113 ICs have an advanced trace capability that lets you collect critical motor performance data as fast as twenty times per mSec. Whether used for spindle control, laboratory automation, or general-purpose automation, the MC58113 family of ICs are the ideal solution for your next machine design project.
Learn more >>
Prodigy Motion Control Boards
Prodigy®/CME Machine-Controller boards provide high-performance motion control for medical, scientific, automation, industrial, and robotic applications. Available in 1, 2, 3, and 4-axis configurations, these boards support DC brush, Brushless DC, and step motors and allow user-written C-language code to be downloaded and run directly on the board. The Prodigy/CME Machine-Controller has on-board Atlas amplifiers that eliminate the need for external amplifiers. To build a fully functioning system only a single HV power supply, motors, and cabling are needed. Host interface options include Ethernet UDP and TCP, CANbus, RS-232, and RS-485.
Learn more >>
Pro-Motion Analysis Software
Pro-Motion is PMD's easy-to-use Windows-based exerciser and motion analysis program. It offers ready-to-go capabilities your entire development team will be able to share. A step-by-step axis wizard allows designers to quickly and easily tune position loop, current loop, and field-oriented control motor parameters. Advanced users can access a complete motion analysis package with Bode plot generation and auto-tuning.