Documente Academic
Documente Profesional
Documente Cultură
Table of Contents
Table of Contents..................................................................................................I
Chapter 1 Introduction..........................................................................................1
1.1 Industry Overview......................................................................................1
2.6 Interpolation.............................................................................................24
2.9 Quiz..........................................................................................................29
3.5 Quiz..........................................................................................................40
5.7 Quiz........................................................................................................144
References.........................................................................................................147
References1
Chapter 1 Introduction
Due to the fact that the environment of industrial applications is always tough,
some specifications such as the temperature tolerance and vibration protection are
attention to the way of making products more reliable and flexible. For example,
industrial computers come with more PCI slots so as to meet the need of system
series) and remote I/O modules (ex: ADAM-4000/6000 series) is usually adopted to
ensure the security of buildings; in power and energy automation, green devices (ex:
xxx) can bring the efficiency of power consumption and reduce the emission of
machine designer, it is imperative to consider the motor moving theory and machine
protection; however, the most important thing is how to increase the speed of
manufacturing process and prevent the machine mechanism from damage in any
situation or operation. This textbook, therefore, will focus on the basic knowledge of
motion control system so that beginners will know how to use these modules in
will introduce the most popular applications of motion control system. After viewing
Solar cells convert solar energy into electricity through the photovoltaic effect,
which is useful for many applications. Individual cells can be used for powering small
devices, such as electronic calculators, while the larger photovoltaic arrays can
solar cell loader/unloader project which was aimed at reducing wiring costs and
complicated, that makes system maintenance and troubleshooting much difficult and
expensive. In order to reduce the cost and increase the reliability, the customer
The ability to integrate all production information into MES and CIM systems
In this solution, AMAX-2241/PMA was used to control the conveyer belt and the
solar cell lifting mechanisms. Due to special concerns from the customer, we
with a Panasonic servo motor. AMAX-2752SY/ 2754SY was adopted to integrate all
light indicators, switches and buttons. UNO-3074 is the main controller of the whole
system, it not only communicates with the solar cell process controller but also sends
besides, all of production information is also stored here for further integration into
Advantech products was the only way to meet the strict demands of this project. The
new solar cell loader/unloader machine reduced the dimension of the distribution
panel by 50% and reduced the overall wiring of the system by 37%. In addition, the
motion control solution). Compared with the old system, this new one was relatively
easier to maintain and troubleshoot; in other words, the customer no more needs to
stop production line and open the chassis of the machine to maintain plug-in motion
control and DAQ cards. The system diagram is shown in Figure 1 -2.
Although the global semiconductor market was relatively flat in 2007, back-end
test and handler machines. Due to the high cost of those machines, many customers
chose to inspect the dies manually with a microscope to reduce operation costs. Using
this method though, performance and yield rate were very low. Recently a machine
solution, but the system was very complex and the dimensions were quite big. The
machine builder turned to Advantech seeking help to decrease the complexity of the
electronic components while increasing the reliability and performance of the system.
This customer was considering to phase in new automatic test equipments that
All of production information can be integrated into both MES and CIM systems
control the power and the LEDs of the machine. Advantech offered a customized
circuit which allowed AMAX-2241/PMA to fit both Panasonic and Sanyo motor
drivers. The complex PC-based control scheme was completed through the
only way to meet our customers demands. This new handler machine reduced the
dimension of the distribution panel by 50% and saved wiring and effort by 33%. It
instead of centralized motion control). In the past, the customer needed to open the
chassis to maintain plug-in cards, but now its not necessary. Furthermore, the
consistent outlook and dimension of AMAX-2000 series brought more add-on value
to machine builders, and its DIN-rail mounting also facilitated easy installation. The
The customer received a new order for laser carving machines, and wanted to upgrade
their existing motion control solution so as to reduce the complexity of the system
architecture and the size of the machine. The customer had been evaluating our
AMAX-2000 series, but was a bit concerned that the connector was different from the
current solution. Advantech was willing to modify the design of the AMAX-2000
series, creating new and unique AMAX-2000 series modules for this customer.
The new laser carving system this customer would like to implement needs to
The smaller size of distribution panel to fit the need of machine dimensions
The ability to integrate production information into MES and CIM systems
UNO-3072L featured an onboard DI/O interface which was useful for power
management issues. After finishing all production in the factory floor, the operator
could press the shut down button to trigger the digital input of UNO-3072L to close
the application program and the operating system. After that, the digital output of
UNO-3072L would be enabled to notify the main controller to turn off the whole
system power. This function would not only protect UNO-3072L and its relative
interfaces but also bring better performance and lower maintenance effort.
devices through RS-232, that indicated PLCs and motor sets outside the system could
be integrated as well.
automation computers plus AMAX-2000 series could meet this demand. This solution
was more robust than traditional IPCs, and could save much wiring and maintenance
effort. It was the best choice for electronics manufacturing machines. This new laser
carving machine reduced 50% of the panel dimension and saved 33% of the wiring
time and effort, it increased the performance by 20% through a simplified architecture
Injection molding machines were used for manufacturing plastic parts, and in
recent years many of these machines had begun integrating intelligent features with
and auto system diagnosis were being integrated as well, not only improving systems
The purpose of this solution was to integrate an older injection molding machine
with a new Programmable Automation Controller (PAC). The customer was looking
Improved energy-efficiency
Injection location at 0.01 mm, over 10 times than hydraulic driving machine
machines response time through high-speed analog input, monitored its closed-loop
process through analog output, and controlled related machines motion through
digital input and output, so as to manage the location and dose of objectives through
the high-speed calculator module. The various modules inserted to the PAC could also
control diverse devices, such as push buttons, LED indicators, thermometer, heating,
storage, and so on. With FPM-3120G (12.1 LCD panel with resistive touch-screen),
reliability and power consumption. Additionally, this solution saved maintenance and
production costs for the customer. The system diagram is shown in Figure 1 -5.
The purpose of this textbook aims to assist beginners to learn the basic concept
of motion control and understand how to use Advantech motion modules. If you are
already familiar with this, please go to for advanced software programming. After
reading this textbook, we expect that the users can know the architecture of motion
control system well and enhance the skill of using Advantech utilities and examples in
relation to the control of servo motors. The users can go further to base on the
This textbook will be separated into six chapters. In Chapter 1, the overview of
industry, the application story of the motion control and whats the rule of the motion
control will be introduced in Section 1.2. In Chapter 2, the essential basic concept will
be described in more detail. The motion control system, actually, is like the human
moving, the differences between these two closed loop motion control systems will be
discussed in Section 2.1. The types of motors, motion control mode, pulse type of
motion control system will be illustrated in Section 2.2, 2.3, and 2.4. The types and
functions of the speed profile for motion control will be explained in Section 2.5.
Some advanced functions such as interpolation, position compare, and position latch
In Chapter 3, how to select the most suitable products to meet real situation will
will be explained in Section 3.1 and 3.2. In Section 3.3 and 3.4, there are some tips for
the users about how to select products to match their needs and recognize the
4, the startup of the centralized and decentralized motion control systems will be
5.2, the users will experience the programming tutorial of Microsoft Visual Studio
DLL programming. In Section 5.3, Labview software will be illustrated, especially for
PCI-1240U in centralized motion control systems. Through this section, the users will
be familiar with the way of using Labview software to control PCI-1240U. In Section
5.5 and 5.6, KW Multiprog programming will be highlighted and the users will learn
how to control the motion modules through KW. Furthermore, KW software can be
integrated with SCADA software such as Advantech Studio and WebAccess through
In order to learn more about motion control, this chapter will introduce the basic
Motion control system can be viewed as an action done by human. Please refer
to Figure 2 -6. The controller works as the brain to collect necessary information,
conduct calculation and make decisions. Motors and their corresponding drivers
provide power to move. Ball-screw and hardware are adopted to execute proper move.
In the end, vision devices and sensors detect the result and feedback information to
the controller. The closed loop control enables the controller to correctly react to
most companies adopt such control structure. In this structure, PCI card sends basic
function (ex: point to point, continuous move, and homing) and advanced function
(ex: linear interpolation and circular interpolation) commands to servo motor. The
servo driver takes advantage of closed loop control to manage the servo motor to
application. Some customers doubt the accuracy of the motor and gear combination.
For this reason, linear scale is adopted to measure the real position of the end point.
Thus, the second closed loop is used in order to get more accurate position control.
Generally, there are a lot of types of motors shown in Figure 2 -9. For the most
general motor, it just can be controlled by direction with constant speed. Such type of
motor is usually used in car models or other toys. The second general type of motor
has brake and clutch function, which can be stopped immediately so as to prevent the
motor from damage. If the motor has inverter, the user can control the acceleration
and deceleration. Stepping motor can do position and speed control. Basically,
stepping motors can be adopted for most of low-end applications. The four types of
motors described above do not involve encoder feedback. As a result, the user cant
know exactly what the real position is. In the industrial field, if customers want to do
precision control, servo motor is preferred and more popular. Therefore, there are
and Yaskawa.
Due to the fact that servo motors are usually adopted for industrial applications,
this section will put a stress on the introduction of the control mode of servo motors.
Position Control
understand its operation principle. The motion controller sends the servo motor the
pulse type command so as to control the motor to reach the target. The frequency of
the pulses, in fact, can determine the position, speed, and acceleration/deceleration.
The position control system contains a position controller, servo motor, and
First of all, the controller sends commands out, including end point, initial
speed, maximum speed, and acceleration/deceleration. When the servo driver receives
the commands, the servo motor is managed through the closed loop position control to
reach the target with desired velocity and acceleration/deceleration. Under this control
mode, the key issue is whether the motor arrives at the end position. If readings from
the logical counter and the real counter are not consistent (i.e., not arrive at the end
position), the servo driver will keep driving the motor until both readings are the
same..
Speed Control
Speed control means that the motor speed is controlled by different voltage. For
the supply voltage is descreased from 12 to 6 Volts, the speed of motor will be in half.
The striped thing between the motor and the dc generator is a shaft which
couples them together in a mechanical way. The motor drives the generator
(tachometer) via this shaft. The set speed control provides a dc voltage, say 12 volts
for maximum speed and zero for stationary. This could be a potentiometer providing
any voltage in a range from zero to +12 volts. The difference amplifier will magnify
the difference between its two input voltages. If the motor is stationary but the speed
control is moving to half of max speed, there must be a variation between two inputs
of the difference amplifier (i.e., speed control and tachometer). Consequently, the
Since this voltage is not high enough to drive the motor, it needs to be magnified
100 volts DC output. This amplified DC voltage enables the DC motor to increase its
speed of rotation. This in turn drivers the tachometer to produce a voltage based on
the speed of the motor. When the output voltage of the tachometer gradually increases
and reaches the voltage of "set speed", the outputs of the difference amplifier and DC
amplifier become zero, so the motor stays at correct speed. However, the motor is no
longer driven by the DC amplifier, its speed starts decreasing. As a result, the
tachometer output voltage becomes declined, and a difference between two inputs of
work again to correct this drop in speed. In a poorly designed system, the drop in
speed and its correction process could lead to the phenomenon of "hunting" (i.e., a
Torque Control
Direct torque control (DTC) is one method used in variable frequency drives to
control the torque (and thus finally the speed) of three-phase AC electric motors. This
involves calculating an estimate of the motor's magnetic flux and torque based on the
estimated as a cross product of estimated stator flux linkage vector and measured
motor current vector. The estimated flux magnitude and torque are then compared
with their reference values. If either the estimated flux or torque deviates from the
reference more than allowed tolerance, the transistors of the variable frequency drive
are turned off and on in such a way that the flux and torque will return in their
tolerance bands as fast as possible. Thus direct torque control is one form of the
Generally, there are three pulse types of output/input signals of position control
They all use 2 input signals to decide the position. For CW/CCW mode, one
signal (CW) is used as the positive command whereas the other (CCW) is used as
negative command. For Pulse/Direction mode, the signals Direction and Pulse
determine the direction and the distance of the move respectively. For AB phase, it is
falling edge, then the number of steps will be added by one, and vice versa. Due to the
phase shift feature of AB phase, the impact of noise interference can be minimized.
important. Users can take advantage of speed profile to have the motor meet the
requirements of moving.
There are two types of acceleration/deceleration profiles, that is, T-curve and S-
curve, which are shown in Figure 2 -13 and Figure 2 -14. T-curve is the speed profile
adopted for most applications often. Giving an acceleration, the time from initial
If the load the motor carries is heavy, S-curve speed profile may be taken into
the beginning and decreasing in the end, rather than constant acceleration/deceleration
in T-curve speed profile. This way can avoid mechanical damage caused by rapid
change in speed.
In some motion cards, change position on the fly and change velocity on the
fly may be addressed specially (see Figure 2 -15 and Figure 2 -16). For example,
the end position of motor the user sets in the first place is 10000 pulses, but for some
reasons, the end position needs to be changed to 20000 pulses during the motion, the
function of change position on the fly can be used to meet such situation.
2.6 Interpolation
1. Linear interpolation
Interpolation is the approximation of some lines within a certain range. With this
function, users can adopt 2 or 3 or even more axes to draw line, circle or even a
helical line. The picture below shows a linear interpolation with error of 0.5LSB.
For a 2-axis interpolation, the controller can base on the commands to decide the
long axis and the short axis. The long axis moves with an average pulse train and the
short axis moves according to the long axis (see Figure 2 -18, XPP means X-axis
2. Circular interpolation
For circular interpolation application, we can use circular to draw a circle, but
the precision is usually a little less than that of the linear interpolation.
Likewise, the 2-axis circular interpolation also uses the long and the short
3. Continuous interpolation
like the right diagram of Figure 2-16, deceleration and acceleration can be expected at
each node. If users adopt the function of continuous interpolation, acceleration and
deceleration just happen in the beginning (start) and in the end (stop), the motor
Not only the quality but also the efficiency of products are addressed in recent
years. For motion application, users always think how to increase the speed of
requirement. For example, the camera is required if users want to inspect the status of
ICs (see Figure 2 -22). In the past, the camera moves from point to point. That is to
say, the camera stops moving while arriving at a targeted point, and the actuator
enables the camera to take a picture, and then move the camera to next targeted
point.This way does waste some time on acceleration and deceleration. However,
when the function of position compare is adopted, the targeted points can be pre-
defined, so that the camera can base on the configuration to take pictures at a constant
The function of position latch can be used to detect the real position of certain
specific point. Figure 2 -23 gives an example, a sensor is installed at P006 of the die
saw machine. When the saw moves down to P006, the sensor sends the signal to the
motion module, so that the PC can recognize the difference between desired position
About Homing and Limit functions, it will be introduced in Chapter 4 through hands
on practice.
2.9 Quiz
1. Please try to describe the architecture of motion control system and explain the
2. Please list down the advantage of stepping motors and servo motors.
3. There are three types of motor control, please describe them and note that these
controls are done with what signal (Pulse Command or Voltage Command).
6. There are three types of pulse type signal, namely pulse/direction, CW/CCW,
Generally speaking, motion control systems can be classified into two types
centralized and decentralized. The centralized motion control system was often
employed in the past, but when the machine size was getting bigger, it increased the
section, the difference and comparison between centralized and decentralized control
The centralized motion control system is always adopted in the context of shorter
wiring distance and less motion axes. In general, one or few motion cards needs to be
inserted into one PC to comprise a centralized motion control system, the number of
axis depends on the amount of slots provided by the PC and the size of the plant is
concerned with the cable length. Here is an example of the centralized control system
This system includes several parts: PC, PC-based motion card, servo driver,
servo motor and sensors. The PC-based motion card is controlled directly by PCI bus
so that commands can be sent very fast. This structure tends to be selected for time-
the distance of the wiring between the PC and servo driver (or sensors) may be a
concern in the such system. For this reason, users may reduce the number of motion
into the motion control system, that is the turning point from the centralized to the
decentralized motion control system. Compared with the former, the latter can
protocol and applied to the decentralized motion control system. It is a high speed RS-
485 communication and the speed can be up to 20MHz. The system diagram is shown
in Figure 3 -25.
The system includes master controller, slave modules, servo drivers, servo
motors, and sensors. Through AMONet, the master controller can manage all slave
modules and the wiring distance between the master and slaves can be more than
100m. Furthermore, one master controller can drive up to 64 slave modules. The
master controller can be a PCI or PC-104+ card, ADAM module or a built-in ring on
AMAX-2050KW, which is equipped with AMONet; the slave can be motion, DIO or
AIO modules. RJ-45 LAN cable can be used for AMONet communication and the
modules in one ring shown in Figure 3 -27, the maximum distance could be 100m at
a speed of 10MHz.
more than one slave modules are connected in one ring, it is necessary to add the
terminal resistor in the last slave module to make sure the quality of communication.
users to deal with space issues, especially in large machine automation application.
Besides, there is one thing users need to note in relation to the decentralized motion
become aware of disconnection caused by LAN cables (e.g., bad contact or broken) or
software programs (e.g., bugs). This feature in AMONet is called watchdog timer.
For more detail information, users can refer to the AMONet User Manual to know
users should be able to realize the features of and the differences between these two
Roughly, the selection guide shown in Figure 3 -29 can be separated into two parts -
For the centralized solution, Advantech provides motion control cards, encoder
cards, and wiring boards which are listed in Table 3 -1. The customer can refer to this
table and choose proper products to meet their needs. The most popular motion
control card is PCI-1240U which is able to control stepping and servo motors through
In terms of the naming rule of AMAX modules, it is a little bit complicated and
confused. The below table (see Figure 3 -30) arranged by AE should be able to give
In Section 4.3, users will know how to build up the communication between the
master controller and slave modules by using AMONet Device Manager, please go to
Section 4.3 if you would like to learn it immediately. On the other hand, since this
textbook is concerned with motion control, the DIO and AIO functions of slave
modules will not be introduced here. If you are interested in this part, please refer to
The major difference between these two systems is distance issue. For
centralized motion control system, the length of cable could be limited to 3-5m.
Accordingly, the space for computers/wiring boards and the size of entire motion
system need to be taken into account before planning and implementing. For
decentralized motion control system, motion modules can be installed far away from
the main computer or controller. Under such situation, the implementation of wiring
becomes easy and convenient, the arrangement of space in the whole motion control
system turns into flexible. Thats the main reason why the decentralized motion
3.5 Quiz
1. How many slave modules can an AMONET master ring connect up to? And
what is the maximal distance the decentralized motion solution can support?
2. If a user would like to install a lot of AMAX slave modules, what should be
3. What should the transmission rate be if users adopt the maximal number of
4. Suppose that a user tends to control 6 motors with 8 encoder feedback signals.
Please base on following products to come out a solution to meet above need.
5. According to the naming rule of AMAX modules, please try to explain what
AMAX-2242 mean.
6. If a user prefers to control the servo motor in velocity mode, what kind of
7. Suppose that a user just wants a PCI card with the function of encoder feedback
8. Imagine to insert one motion control card into UNO-2170 so as to save space.
What motion card offed by Advantech could be a good choice in such context?
9. What AMAX slave modules can measure analog signal and output voltage?
Nowadays, with the growth of technology, the speed of PC is getting faster and
faster. For this reason, there are more and more users use PC to be the master to
control one motion control system. For this advantage of graphic unit interface (GUI)
in PC, the operator can easy to know how to use the system through GUI Microsoft
Visual Studio, Borland C++ Builder, Delphi, and etc. in later sections, startup of
In this section, the steps of PCI-1240 utility will be introduced. Through these
1. The centralized motion control system is shown in Figure 4 -31. For more
detailed information about pins wiring, please refer to the hardware manual.
will see PCI-1240.zip file which driver and utility are included is shown in
Figure 4 -32.
3. After the installation, the software and PCI-1240 utility can be found at
StartProgramsAdvantech AutomationMotionPCI-1240.
4. Open PCI-1240 Utility which is shown in Figure 4 -33. It helps users to test its
installation and functionality. Also most of these settings can be done in the tool.
6. Set parameter by clicking Parameter Setting, the Group 1 is for pulse output
configuration which is shown in Figure 4 -35. In this setting, user can configure
the pulse output type, acceleration mode, drive speed parameter, and etc.
7. Group 2 is for hardware input signal setting which is shown in Figure 4 -36. The
most important thing about group 2 setting is the alarm signal. If the alarm signal
is active, the servo driver will have alarm so that the motor will not move by any
command.
8. Group 3 is for the function of input and output pin configuration which is shown
in Figure 4 -37.
If some users would like to use compare function, the operation mode of output
compare output pin OUT4 and OUT5 are listed in Table 4 -4.
Jumper JP10
The XOUT4 is defined as the pulse output XOUT4, Pin1 and Pin 2 short (Default)
channel for the incremental position compare
mechanism. And its open collector type output.
Its a design only for PCI-1240U. The position CMP, Pin2 and Pin 3 short
compare signal for both directions will output
from XOUT4, and the output level of XOUT4 is
TTL level.
9. Group4 is for encoder, software limit, and compare setting which is shown in
Figure 4 -38. The user also can set interrupt for many situations. In the encoder
10. Group 5 is home mode setting which is shown in Figure 4 -39. There are totally
7 homing types we can select. And the detailed information about each homing
11. After the settings in the utility are done, the settings will be saved to registry
which is shown in Figure 4 -40. The user could export the registry to a file and
import it to other PC. Therefore, the configuration will be easy to get and
12. Click Input Status button in the PCI-1240 Utility, there will be indicators and
for each axis. But its not limited, so users can only use 1 axis and all 16 DO
channels at the same time. If the user wants to use one of the DO to do the servo
on, OUT6 of each axis is recommended. The status of digital input channels is
displayed in the Input Status. Among them, IN0 and IN3 are used for homing.
The external hardware signals for homing must be connected to these two pins.
In the bottom of the Input Status is the counter value, including the command
counter and the encoder feedback counter. Both values can be edited. The
Through the Drive End Status indicator, users can monitor the statuses of limit
motion control application. The hardware setting is shown in Figure 4 -42, and it is
always used to be a button on machine to let the operator stop the motor immediately
13. Click Operation button and the operation is shown as Figure 4 -43. After
configuration and check the input status, users can try to control the motor to
c. Configure the drive speed or end position which depends on the drive mode
is set
If users want to test the advanced functions such as linear interpolation and arc
interpolation, the utility is also supported. For more detail information about the
14. Profile Monitor button can help users to monitor two axes moving on the map
and it is shown in Figure 4 -44. Users can know the path of the axes motion
through monitoring the map. With the help of Profile Monitor, the locus can be
checked by plotting a two-axis profile. In this tool, any two of the four axes in
the same card can be selected to be traced. Also, the speed profile can be
checked. Please note that the path is just for reference, the real path will depend
After the steps, users should know the basic function of PCI-1240 Utility. For
In this section, there will be some hands on practices for centralized and motion
control system. After these examples are done, the customer can learn more
Use point to point function in PCI-1240 Utility such that the motor in X-axis
coordinate.
AutomationMotionPCI-1240.
with the hardware setting in servo driver. About the servo driver setting, please
3. Make sure the signal is OK in Input Status window especially EMG and ALM
4. Click operation button, select X-axis, set point to point mode, and set the end
point to 10000. Remember that the movement mode should be set as relative
5. Click start button and the value of logical counter and feedback counter on the
input status window will be to 10000, the error will be 0. (see Figure 4 -48)
6. If the values of logical counter and real counter are not the same, please check if
Use arc interpolation to let 2-axis motor move as a circle in PCI-1240 Utility
which center is (3000, 3000) and the end point is (6000, 6000) in the relative
coordinate.
AutomationMotionPCI-1240.
with the hardware setting in servo driver. About the servo driver setting, please
3. Make sure the signal is OK in Input Status window especially EMG and ALM
indicator and enable OUT6 of X-axis and Y-Axis. (see Figure 4 -49)
4. Click operation button, select X-axis and Y-axis, set arc profile drive mode, set
C1, C2 to 3000, and set E1, E2 to 6000. Remember that the movement mode
5. Click start button and the input status window will show the counter value. (see
Figure 4 -52)
6. The customer also can open the profile monitor to see the locus of two-axis
motion. (see Figure 4 -53) Users can configure the display parameter setting to
section, AMONet Device Manager Utility will be introduced and users can learn how
1. The Decentralized motion control system diagram is shown in Figure 4 -54. For
more detailed information about pins wiring, please refer to the hardware
manual.
http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-
1W8JTJ. On the webpage, the user will see AMONetDriver.zip file which
driver and utility are included is shown in Figure 4 -55. PCI-1202.exe file is
3. After the installation, the software and AMONet Device Manager utility can be
4. Open AMONet Device Manager which is shown in Figure 4 -56. Users will see
PCI-1202(X) master card and X means the board ID which range is 0~15.
Figure 4-56 AMONet Device Manager utility and hardware configuration of PCI-
1202U
5. Select PCI-1202U, baudrate setting and onboard DIO control will be shown as
Figure 4 -57. Please remember that the baudrate setting must be the same as the
slave modules.
6. Spread PCI-1202U and slave modules connected to master will be shown. Please
refer to Figure 4 -58, PCI-1202U has two rings and each ring could connect up
7. For DIO slave modules shown in Figure 4 -59, the operation is very simple.
Users just check the LEDs of DI to know the status and clicking DOs to control
them.
8. For motion slave modules shown in Figure 4 -60, it could be separated in several
parts.
About the configuration and information of these parts will be described below.
etc.
b. Speed Pattern: to decide the mode of Acc/Dec and there are T curve and S
setting which are shown in Figure 4 -61, Figure 4 -62, and Figure 4 -63.
There are 13 modes for home mode setting, and users can refer to the
AMONet User Manual to know about the operation principle about homing.
d. Motion Test: it contains move button, stop button, reset alarm (RALM), and
error counter clear (ERC). Users can control the motors through these
buttons
e. Position: through this frame, users can obtain the position command,
encoder feedback, and error. Due to the utility design, the range of error is
32768~32767.
f. Status: there are many indicators to let the users know the status about
9. Users also can use this utility to check the velocity profile shown in and know
10. For advanced function of interpolation, only AMAX-224X slave modules are
supported. Users can select Multi-Axis Operation for linear and arc interpolation
and monitor the locus of two-axis motion. The GUI is shown in Figure 4 -65.
After going through these steps, users can roughly know the operation of
In this section, there will be some hands on practices for Decentralized motion
control system. After these examples are done, the customer can learn more
Use point to point function in AMONet Device Utility such that the motor
coordinate.
2. Select the motion slave module. In this example, AMAX-224X slave modules is
3. Select the Single-Axis Operation tab window and configure motion IO and
input/output pulse type in configuration part to let all indicators to the normal
state. For the status definition, please refer to the software manual and hardware
4. Set move mode to P to P and distance to 10000 pulses. After settling done,
5. Click right arrow button and the motor will move 10000 pulses in clockwise
direction. Users also can see the command value and feedback value will be
10000.
6. If there is error counter, please make sure the pulse configuration is the same as
Use arc interpolation to let 2-axis motor move as a circle in AMONet Device
Utility which center is (3000, 3000) and the end point is (6000, 6000) in
relative coordinate.
2. Select the motion slave module. In this example, AMAX-224X slave modules is
3. Select the Single-Axis Operation tab window and configure motion IO and
input/output pulse type in configuration part to let all indicators to the normal
state. For the status definition, please refer to the software manual and hardware
manual. Since X and Y axes are needed, please remember to configure both axes
4. After making sure two axes can work well, select the tab to Multi-Axes
Operation window.
5. Configure C1, C2 to 3000, E1, E2 to 6000, and click Arc button and the motors
6. Users can click path plot button to monitor the locus of axes motion which is
If there is error counter, please make sure the pulse configuration is the same as
3. Please modify the setting of AMAX-2212 to make the motor move with the
4. Please use PCI-1240U to control motors to move as a circle which center point is
6. Please use PCI-1240U to change the speed to 20000 PPS on the fly. (X-axis
motor)
7. Please try to use AMAX-2242 to draw a locus as shown below with linear
than examples)
(Advanced)
and SCADA software will be introduced. After going through this chapter, the users
can know the programming method with DLL driver and KW DLL driver.
systems, supposed that the users already know the based knowledge about the motion
control and can test the motors by Advantech motion utility. In advance, if they want
to develop their own program for the specific application, the way to know how to
develop the program by Advantech driver is necessary. For some users, they usually
use the PLC by ladder language to control the motors for their application. For such
application, PAC based controller which follows the IEC-61131-3 protocol can be
compatible with PLC. For other users, Advantech provides the DLL drivers which
support VB, VC++, BCB, Delphi, C#, VB.Net software. Advantech also provides the
library for Win CE so that the customers can develop the applications by EVC or .Net
introduced.
In this section, the DLL programming for centralized and Decentralized motion
When the PCI-1240U driver is installed, the examples for PCI-1240U can be
supports Borland C++ Builder, Delphi, Visual Basic 6.0, Visual C++ 6.0, and VS.Net.
Visual Basic 6.0 language since it is quite easy to let the users to understand the
programming. By the way, it is better to test motors in the PCI-1240 Utility first when
knowing the flow chart of programming is very important. First of all, open the PCI-
1240U software manual and find the tutorial which is shown in Figure 5 -73.
For example, for point to point movingbasic function, the flow chart is shown
in Figure 5 -74.
There are four steps to complete the PTP motion and the first step
After open PCI-1240U, some parameters must be set. Users can use
Figure 5 -76.
If users want to set the parameters of line or arc interpolation, just change the
moving can be used. For the PTP motion, there are three kinds of APIs to support this
The mostly used one of the three PTP motion is P1240MotPtp, and its
function can stop the motor immediately or slow down the motor then stop.
Assuming the users already know the operation principle of PCI-1240U after
seeing the flow chart of Point to Point moving, below the example BasicDrv will be
introduced.
First of all, open the example and go to the form1 window and there will be the
Some specific functions For PCI-1240U in the main window form will be
introduced below.
The API function P1240MotRdMutiReg can read many parameters like initial
speed, driving speed, acceleration, logical position counter, and etc. For the RRn and
WRn parameter of P1240MotRdMutiReg API function, users can refer to the MCX-
Servo On button:
Stop Button:
The API P1240MotHome is used to control the motors to find the home sensor.
About the homing function, PCI-1240U supports totally 7 home types which are
Interpolation frame:
In this frame, if the selected axes are less than 2 axes, the operation will be
inhibited. The API function P1240MotLine is used to control the 2 or 3 axis motors to
do line interpolation and its description is shown in Figure 5 -82. This API can be set
Timer Component:
After viewing these functions in the BasicDrv example, users will know the
to move a path including line and arc interpolation. Users also can refer to the flow
Before moving a path, allocate and initial the path data buffer is needed. Users
can use the API P1240InitialContiBuf to allocate memory for path data and the
The size of the path data buffer depends on the PC memory and can be set up to
232 32 bytes. Normally it is enough to use. After allocating the buffer, users can use
P1240SetContiData to put the path data to the path data buffer for movement. When
moving the path, users can get the current movement path data sequence number
Figure 5 -86.
After completing every moving in the desired path, please remember to use API
There are still a lot of programming flow chart and examples for PCI-1240U.
Users can refer to the PCI-1240 manual to know more about this card. If there are still
any problems about programming, please call the service center: 0800-557-799. There
After installing the AMONet Device Manager, the examples for AMAX series
supports Borland C++ Builder, Delphi, Visual Basic 6.0, Visual C++ 6.0, and VS.Net.
Visual Basic 6.0 language since it is quite easy to let the users to understand the
programming. By the way, it is better to test motors in the AMONet Device Manager
The operation principle between PCI-1240 and AMONet is totally different. For
this reason, DLL programming of Decentralized motion system will be not the same
1202U will be introduced and step by step to describe the motion functions in more
detail.
are two NPMG9001A chips on board. Each chip controls one ring.
First of all, open the master card PCI-1202U and start ring. The flow chart is
shown in Figure 5 -88. Note that in the below calling flow, _1202_open can only
When opening the example, there will be two buttons which are shown below to
Start ring
and AMAX-2710, it can be controlled. But for slave motion modules, like AMAX-
2240 series, users must use Axis Init button shown below to configure the motion
modules.
Make sure the configuration is done and then click SVON button to let the servo
Next, set a trapezoidal velocity and S-curve velocity profile by clicking Set
speed button.
The STOP button is used to control the motor slow down to stop.
ERC (clear servo error counter signal output) and RALM (reset the ALM
status inside the servo driver) buttons are for specific application.
After introducing the essential API functions in all examples, below the
examples for AMAX-2240 series slave motion modules will be described. The basic
The arrow buttons control the direction of the motor moving and the code of
AMAX-2240 to plan the path. The form window is shown in Figure 5 -90.
Set Speed Profile button sets a T-Curve or S-Curve velocity profile for path
buffer movement. In the same path move, T-Curve and S-Curve path function cannot
be executed in turn.
Set Line Data and Set Arc Data buttons can be set the line and arc data to the
path buffer. Users choose the performed axes and related function, e.g. if selecting XY
plane, only those related axes functions can be adopted. The path buffer can store
1000 paths (from 0 to 999) and it acts like a First In First Out (FIFO). Users can check
AMAX-224x finish one path, the space in Path buffer will be released. The user
fixed by first path command. For example, The first path command uses both the X-
axis and Y-axis, then the following path command can use X-axis and Y-axis only.
defined in Figure 5 -92. In the DLL programming, timer component is usually used to
When path data is settle done, users can click Start path to start motor motion.
communication. If there are some disturbances such as LAN cable disconnect and
noise, it will cause the communication error. For this purpose, AMONet protocol has
the watch dog function to monitor the status of communication. Advantech provides
the WatchDog example which is shown in Figure 5 -93 that can protect the
Name Description
ERROR_NoError The API returns success
Before the watchdog in the ring is triggered, a communication error will occur. After
the watchdog will be triggered. To find the slave module which suffered a
module that triggers the watchdog. The programmer should pay attention to two
We can use the function mnet_get_com_status to know whether theres error in the
ring. When it returns Slave Error, we can then use the mnet_get_error_device
among all slave modules that have suffered communication errors. For instance,
consider the following four configurations where three AMONet slave modules,
Therefore, to make sure which device has the communication error, connect the
There are still a lot of API functions not introduced. Users can refer to the
AMONet Drivers Manual to see what function they want to use or call the service
There are many users using Labview to develop their applications. For this
reason, Advantech also develop the Labview driver for PCI-1240U. This driver can be
After installing it, the examples can be found at the path: C:\Program
ContiDrive which is used to control the motors moving by path planning is shown
in Figure 5 -94.
Centralized motion system is almost the same. For example, the flow chart of
continue move shown in Figure 5 -95 is the same as that in DLL programming. Users
can refer to the programming tutorial in Advantech Motion Vis Labview Manual to
Through this Labview driver for centralized motion control system, users can
MultiProg KW, one kind of software, is used to develop the PAC programming.
PAC stands for Programmable Automation Controller, and it combines the features of
PC and PLC. Therefore, users can use PAC to do many applications. It can do the
complicated calculation and can combine the SCADA software to do more convenient
PAC also follows IEC-61131-3 protocol which defines the protocol of the
software and hardware in PLC. For this advantage, users can replace PLC by PAC
users are interested in the this software, please refer to PAC textbook and there will be
introduced.
AMAX-2050KW, the most popular master controller in PAC motion control, has
WinCE operating system and can be developed the motion applications in KW. For
this reason, many users utilize it to implement the Decentralized motion system by not
only WinCE programming but also Multiprog KW. This section will focus on how to
develop the KW program using AMAX-2050KW master controller and AMAX slave
motion modules.
First of all, create a new project for WinCE system like below.
Configure the AMAX-2240 and set baud rate which is compatible with the
hardware setting. The Board ID should be also the same as the Device IP of AMAX
Configure the axis settings such as pulse output mode, pulse input, alarm input,
and etc.
If for DIO and AIO modules, remember to click Create All Input Variables
After creating the new project and configuring the AMAX slave modules, users
can connect the PC and AMAX-2050KW through Ethernet and the setting is shown in
Figure 5 -102. When the state on Project Control Dialog is on, it means the KW on
The following diagram shown in Figure 5 -103 defines the behavior of the axis
profile to handle exceptions within a program. The basic rule is that motion
commands are always taken sequentially, even if the PLC had the capability of real
parallel processing. These commands act on the axis state diagram. The axis is always
each axis. In this state, any movement has no effect. Only if Enable of MC_Power is
TRUE, the state leads to StnadStill without any axis error. Otherwise, the state leads
During this period, there still exist some function blocks not finished. All of them are
aborted forcibly. The intention of the state ErrorStop is that the motion of the axis is
stopped. Once the state is transited to ErrorStop, all function blocks without
completion are aborted forcibly. New motion command is accepted until MC_Reset
has been done. MC_Stop aborts any motion command and change the state to
this state, no another motion command can abort. The following administrative
MC_ReadBoolParameter, MC_WriteParameter,
3. In both states ErrorStop and Stopping, any function block is not allowed to
Below I will introduce some basic motion functional blocks by one simple
example.
(on/off). Whatever the motor type is, it should be enabled so that the motor can
home. The position is used to set the absolute position when the reference signal
is detected.
These graphical representations of the three function blocks are shown in Figure
5 -104. Please keep in mind that Enable pin means level active and Execute pin
parameter.
These graphical representations of the three function blocks are shown in Figure 5
-105.
the discrete motion. It is not allowed that the function block is actually executed
These graphical representations of the four function blocks are shown in Figure 5
-106.
Using these function block which is introduced above, users can try to control
In order to control multi-axis motor motion, advanced motion function blocks are
needed. In this section, multi-axis moving, advanced homing, and path planning
directly forcing an actual position without physical motion. When it is done, the
searching for zero pulse in encoder. When it is done, the axis state is transited
The example of advanced homing function blocks are shown in Figure 5 -107.
For line and arc interpolation, the relative function blocks are introduced below.
Note that if users want to use interpolation function, adding axes in one group is
necessary. First of all, adding and removing group function are listed below.
group. It has actual effect only when the group is not busy.
Next, there are some function blocks can read the group status. It is listed below.
group.
group.
MC_GpReset_A1: This function block makes the transition from the state
The example of adding axes in one group are shown in Figure 5 -108.
Third, after adding axes in one group, users can use line and arc interpolation
function blocks.
motion to absolute end positions for each dimension without taking care of how
motion to relative distances for each dimension without taking care of how the
position is reached.
motion to position for each dimension. The positions are defined relatively to the
transfers the axis group to the state GroupStopping. It aborts any ongoing
motion.
For the data type of the Distances pin, it should be set as an array. Users can
The last one is path planning. Users can save the path data in the path editor and
then execute the path. The path data also can be exported to an Excel file.
The multi axis motors will move by the path. The speed profile of the path only
has acceleration in the starting and deceleration in the end. It will maintain the
(ID = 1 or 2).
After setting the path data, users just use two function blocks to move path.
TP function block.
This function block can help users to do cyclic motion moving. Here is an
example shown below and it shows the way to control one axis motor moves CW to
CCW periodically.
For more detail description about every motion function block, users can refer to
After introducing the Multiprog KW, we can combine the Decentralized motion
control system and SCADA software to let operator easy to control the machine
server is included. TPC-660E is a touch panel computer and the SCADA software is
Slave Module for Mitsubishi MR-J2S and it is used to control two axes servo motors
AMAX-2050KW and develop the SCADA program into the TPC-660E. the
The GUI of SCADA software is shown in Figure 5 -116. Start button controls
the motors do homing motion and then enable the specific motion action buttons:
HOME, SPIRAL, MOVE, and Circle. The indicators PosZ and PosU can monitor the
After seeing this application, users can know it is easy to develop it even though
5.7 Quiz
disconnected.
4. Create a Project to use 2-Axes Line and Arc interpolation to complete a path
shown below and add 3-Axes Line Interpolation function from (0,0,0) to (5000,
10000,4500)
read the actual position and current status in X-Axis. (Hint: MC_Read_Status_A1)
References
May 1990.
May 1990.