`
`OF
`
`MOTION CONTROL SYSTEMS
`
`© 1994
`
`Jacob Tal
`
`All rights reserved
`
`No part of this book
`may be reproduced by any means,
`nor transmitted, not translated
`without written permission from the author.
`
`Galil Motion Control, Inc.
`
`203 Ravendale Drive
`Mountain View, CA 94043
`
`Telephone
`Fax
`
`4 1 5-967- 1700
`415967-1750
`
`ABB Inc.
`
`EXHIBIT 1043
`
`Page 1 of 23
`
`Page 1 of 23
`
`
`
`9. INTRODUCTION TO MOTION PROGRAMMING
`
`The previous chapters dealt with the fundamental questions of how to select
`
`the right components for the system and how to use them correctly. Special
`
`emphasis was placed on the subject of system stability, quick response, and
`
`accuracy.
`
`The second part of the book focuses on programming the motion. Here we
`
`assume that the control system is indeed stable and that the motor position
`
`follows the commanded trajectory. The emphasis now is on commanding the
`
`appropriate trajectory that results in the required motion.
`
`'1
`
`4.
`+
`E
`..1
`
`.
`.
`
`It was indicated previously that the generation of motion consists of two
`
`major parts: generating the required profile and following it. The first part of
`
`the book deals with forcing the motor to follow the required trajectory. The
`
`second part deals with generating the profile.
`
`Chapter 10 starts with a description of general programming tools. Chapters
`
`11 and I2 discuss two special modes of motion: coordinated motion and
`
`contouring. Chapters 13, 14, and 15 deal with special motion types known as
`
`electronic gearing, tension control, and dual—loop control.
`
`The discussion presented here is general in nature and the design methods
`
`apply to most motion controllers. However, in order to provide specific
`
`illustrations and examples, we describe the implementation of the motion
`
`programming with the language used by Galil controllers.
`
`997
`
`Page 2 of 23
`
`Page 2 of 23
`
`
`
`18. MOTION PROGRAMMLNG TOOLS
`
`This chapier fiescribes a variety cf metti-an pmgranxnmg £0013. “Phage £0015
`
`can be used as building blacks is develop 3 <:<:smp§e:e matisn cycie.
`
`Indeperzdeni Eviatisn Cammands
`
`A rrzaiian cmiroiier car: he ":<::id” by a has: mmpuier 33:3 perfenn 3 mews by
`
`any of the Cgntraiied matters. The IIEGSE simpie mew: is (me with a irapazoidal
`
`veisciiy pmfiie as iiiusiraisd if} Figure 38.1. This meve is csmpieieiy
`
`characterized by the distance? siew Vei0€:ity, and aaseiaratian and
`
`deceieratimz rates.
`
`VE§L{3Q!“E”‘~r’
`
`SLEEN‘ SPEED
`
`RATE
`
` ACSCELERATION
`
`GECEL*ER’“‘T’C‘N
`
`T§¥\./€93
`
`Figure 16.1: Trapezsi(ia1Vei0City Profile
`
`3?}: mas? basig fsmé af ggéaéfyéng $838 irzoiiaié §§¥“3§Yifi?€:i‘S £3 in iiiziis; sf
`
`I‘*€?;§§§§i,i§§§fEe.
`
`"fhs: gzegsss is iiizigiraieé E3; 3:: sxgizzglfi.
`
`Exarggie KL:
`
`Qgzizgiééy a $y:’«;§$m vshsfa {ks s::2:;:{}§$:“ 3T“€$8i§}2i§£’_?:§Z
`
`is 45% $£}i1fi§S§§€§? 322$
`
`tizsa i3§3§{‘:Ci§’%’§ E5; E8 gsiais 31$ :‘::{::§§;:‘ E 3:32: ii} 33
`
`F%;::‘£§1s:‘:‘::<}2‘$, bgih
`
`‘ihfi ascaisraiieg arid 31% éscafefsiies $121233 aga G} sgacaaé age}:
`
`ifiééééi
`
`Page 3 of 23
`
`Page 3 of 23
`
`
`
`:
`
`.
`
`'
`
`lnsttustlsznlntemzelallnn
`PR 4000
`Relative distance
`SP 20000
`Speed rate
`AC 200000
`Acceleration rate
`DC 200000
`Deceleration rate
`BGX
`Start motion of X motor
`
`,
`
`The host computer sends the characters indicated by the program
`
`shown above and the motion starts immediately.
`
`Another type of simple motion is the jog move. Here the motor is
`
`motion parameters
`commanded to run indefinitely at a specified speed.
`in this case are limited to the speed, acceleration, and deceleration. These
`
`parameters can be expressed in units of resolution as illustrated below.
`
`Example 10.2
`
`lnstmcllszn
`JG 40000
`AC 400000
`BGX
`
`lnlemtelatlnn
`Jog speed
`Acceleration rate
`Start X motion
`
`The generation of more complex moves is described in the following
`chapters.
`
`Stored Programs
`
`The instructions for performing the motion can be issued directly from the
`
`host computer, resulting in an immediate move. This mode, the immediate
`
`mode, requires the continuous involvement of the host computer. An
`
`1099
`
`Page 4 of 23
`
`
`
`alternative approach is the use of stored programs that reduce the involvement
`
`of the host computer.
`
`In this method the host computer downloads the motion program to the
`
`controller memory. To start the motion, the host sends a short command,
`
`such as "Execute Program A." The controller will then receive the
`
`instructions from its memory without the intervention of the host computer.
`
`To illustrate the concept, consider the move described in Example 10.1. To
`perform the same move from a stored program, the host modifies the program
`by adding a label. #A, for example, and an end statement. EN. The resulting
`program is as follows:
`
`I9
`1
`
`r
`
`Example 10.3
`
`lngtrgctign
`#A
`PR 4000
`SP 20000
`AC 200000
`DC 200000
`BGX
`EN
`
`Interpretation
`Program label
`Distance
`Speed
`Acceleration
`Deceleration
`Start X motion
`End of program
`
`The host downloads this program to the controller nieinory. where the
`
`program remains lIl‘dL,‘ll\'C. lo execute the prograni. the host sends the
`
`eoiiiiiiaiitl
`
`XQ#A
`
`Page 5 of 23
`
`Page 5 of 23
`
`
`
`which causes the controller to execute the program.
`
`Control Variables
`
`Variables allow the motion controller to perform certain mathematical
`
`functions and to make decisions accordingly. This capability increases the
`
`intelligence of the motion controller and allows it to perform some
`
`supervisory functions in addition to the simple motion control.
`
`A variable can be defined as a constant or can be equated to a controller
`
`parameter. For example, the instruction
`
`sets the value of the variable V to 3. The instruction
`
`P = _TPX
`
`reads the position of the X motor and equates the variable P to that value.
`
`Variables can be defined in a variety of ways. For example, the instructions
`
`YERROR = _TEY
`
`equates the variable YERROR to the position error of the Y motor.
`
`10-101
`
`Page 6 of 23
`
`Page 6 of 23
`
`
`
`Once the variable is defined, it can be used in mathematical operations.
`Motion controllers can perform mathematical functions that typically include
`algebraic, trigonometric, and logic operations.
`
`completed. the controller can use the
`
`s. For example. the results
`can be used to change the speed, set the distance. or change the filter gain.
`The use of variables is best illustrated by the
`following example.
`
`7 h
`
`xample 10.4
`Write a controller~level program that determines the maximum
`acceleration/deceleration rates that the motor can follow. To determine
`
`command signals. Once the controller output reaches saturation‘ we
`conclude that the maximum acceleration rate is exceeded.
`
`
`
`For a specific program, suppose we command the motor to move a
`distance of l0,000 counts and we increase the accele
`starting value of lU.OO() counts/s3. W
`
`e conclude that the controller is
`saturated itthe output signal is greater than ‘).8\/’ lor three eoitsectttixe
`readings.
`
`ration from the
`
`Page 7 of 23
`
`Page 7 of 23
`
`
`
`
`
`VELOCITY
`
`STARTING
`
`
`
`ACCELERATION
`
`Figure 10.2: Velocity Profiles with Increasing
`Acceleration/Deceleration Rates
`
`TIME
`
`I
`
`"
`
`The resulting velocity profile is shown in Figure 10.2. We start with
`
`curve (a) and incnease the acceleration/deceleration, leading to curves
`
`(b) and (c). The flowchart of the program is shown in Figure 10.3.
`
`
`
`
`INITIAL CONDITIONS
`And 0000
`FLAG-O
`
`
`
`DIST-1 0000
`SPEED-A
`ACCEL-A
`START MOTION
`SET FLAG-1 IF OUTPUT
`IS SATURATEO
`
`
`
`
`
` NO
`
`A-A/1.05
`
`MAX ACCEL.
`
`Figure 10.3: Flowchart for Example 10.4
`
`10403
`
`Page 8 of23i
`
`
`
`
`
`A-A"1 .05
`
`
`
`
`
`Page 8 of 23
`
`
`
`
`
`The actual program consists of two parts. The first part, #MOVE,
`
`performs the move repeatedly while increasing the parameter A by 5%
`
`each time. A is used as both the acceleration and deceleration rate.
`
`The second program, #TEST, tests for saturation.
`
`It monitors the
`
`controller outputs and checks for three consecutive tests where the
`
`magnitude of the controller output exceeds 9.8V.
`
`The specific programs are shown below. Note that the test program
`
`sets the FLAG variable to 1 when saturation is detected. The #MOVE
`
`program repeats the motion as long as the parameter FLAG is zero.
`
`The two programs run simultaneously.
`
`Lfl§.lLlLQ1i§L0
`#MOVE
`
`A=100000
`XQ#TEST, 1
`#LOOP1
`
`PR 10000
`
`SP 1000000
`AC A
`
`DC A
`
`lntetptetattqn
`Label
`
`initial value of acceleration
`Run program #TEST in multitasking
`Label
`
`Distance
`
`Speed
`Acceleration
`
`Deceleration
`
`Start motion of X motor
`BGX
`Wait for end of motion
`AMX
`lncrease A by 5%
`A=A*1.05
`Wait 1 sec between moves
`WT 1000
`JP#LOOP1, FLAG = 0 Repeat if not saturated
`A=A/1.05
`Restore previous value
`A:
`Report A value
`EN
`End program
`#TEST
`Label
`
`in ltl
`
`Page 9 of 23
`
`Page 9 of 23
`
`
`
`FLAG == 0
`N = 0
`#LOOP2
`M = @ABS LTTX]
`JP#TEST, M<9.8
`N = N+1
`J P#LOOP2, N<3
`FLAG = 1
`EN
`
`Initial value
`Initial count
`Label
`Magnitude of output
`Start if not saturated
`Count upif saturated
`Repeat test 3 times
`Set FLAG to 1
`End test
`
`Input/Output Interface
`
`Motion controllers can read some input signals, both digital and analog, and
`can generate some digital output signals. This enables motion controllers to
`control a complete process rather than be limited to the motion control
`function.
`_
`Inputsignals, both digital and analog, can be read by.the controller and their
`values can be stored in control variables. These variables can be used later in
`motion programs. The reading ofdigital inputs can be performed with the
`instruction
`DIGITAL = @ M21
`whichreads thedigital input#2and storesits content, 0or 1, inthevariable
`
`DIGITAL. Analog signals are similarly read with the instmction
`
`ANALOG -.- @ AN[3]
`
`-
`
`“:
`
`E
`
`i
`
`E
`I
`’
`
`‘I
`
`-u.
`
`,=
`
`The generation of digital output signals is performed by setting or clearing a
`bit with the instmctions
`
`I0-lflfi
`
` Page 10 of 23
`
`Page 10 of 23
`
`
`
`SB3
`
`CB3
`
`which sets and clears output bit #3.
`
`The interface with the inputs and the generation of the output signals allow
`the controller to perform complete process control without a host computer
`intervention. This is illustrated by the following example.
`
`Example 10.5
`
`Design a control system that controls the velocity of an XY table
`
`acording to the analog voltages generated by an XY joystick. The
`
`polarity and the magnitude of the motor velocities are determined by
`the corresponding potentiometer voltage.
`
`Suppose, for example, that the requiredspeed is l0,000 counts/s for
`
`every volt of input signal. The resulting program reduces to reading
`the voltage of the two analog input signals, multiplying both results by
`10,000, and adjusting the speeds of the X and Y motors accordingly:
`The program flowchart is given in Figure 10.4 and the instructions are
`
`shown below.
`
`#TABLE
`AC 100000100000
`DC 100000100000
`JG 0,0
`BGXY
`#LOOP
`VX = @ AN [1]*10000
`
`Label
`Acceleration rates
`Deceleration rates
`Set in jog mode
`Start motion
`Label
`Compute X velocity
`
`10-106
`
`Page 11 of 23
`
`Page 11 of 23
`
`
`
`W = @ AN [2]*1000O
`
`JG VX,VY
`
`JP #LOOP
`
`EN
`
`Compute Y velocity
`Update velocity
`Repeat the process
`End
`e
`
`SET SYSTEM lN JOG
`
`
`
`
`MODE WITH ZERO
`
`INITIAL CONDITIONS
`
` READ TWO ANALOG SIGNALS
`
`MULTlF’LY» THE VOLTAGES
`
`
`
`BY 1 0,000
`
`UPDATE THE SPEEDS
`
`
`
`Figure 10.4: Flowchart for Example 10.5
`
`Reading the analog input signals is beneficial in force control systems
`
`because the force feedback is analog. To illustrate this process, consider the
`
`following example.
`
`Example 10.6
`
`Drive the X motor against a slowly moving target and maintain a
`
`constant force between the two elements. The Contact force is
`
`10-107
`
`Page 12 of 23
`
`Page 12 of 23
`
`
`
`measured by a load cell whose output is applied to analog input #1.
`Assume that the
`foroelevel corresponds to a signal level of SV
`and that forward motion increases the tension between the two
`elements.
`
`The simpiest control procedure is to run the motor in the jog mode
`where the motor nmstcontinuously at a specified speed. The controller
`leads the analog signal to detezmine the force level and sets the speed
`of the motor in proportions wifla the error in the force level. The
`flowchart is shown in Figure 10.5. The program is shown below.
`
`DRIVE Xlfitkoton IN .163
`
`.
`
`. Moosewnwa-zsno INITIAL
`
`
`
`
`speso
`
`
` Rem meamnoe sremn
`
`COM PUTE THE TENSION
`
`E¥?tF!O$!.‘£:'l=t
`
`NEW.8PEf='D-=1°O'ER -
`
`
`
`
`_ Figure 10.5; Flowchart for Example 10.6
`
`18408
`
`_Page 13 of23
`
`Page 13 of 23
`
`
`
`#FORCE
`
`AC 100000
`
`DC 100000
`
`JG 0
`BGX
`
`#LOOP
`
`\
`
`ER = 5 — @AN [1]
`VEL = ER*100
`JG VEL
`JP#LOOP
`EN
`
`Label
`
`Acceleration rate
`
`Deceleration rate
`
`Set jog mode
`Start motion
`
`Label
`
`Measure error in force level
`Set velocity
`Update velocity
`Repeat the process
`End
`
`Trippoints
`
`Motion control programs often include several functions. These fimctions are
`scheduled by delaying the execution of each fimction until a ceitain condition
`
`occurs. These conditions are called tiippoints.
`
`L
`0
`
`it
`
`‘é
`
`'3
`
`For example, the "after distance" (AD) trippoint delays the execution of a
`
`function until after the motor moves a certain distance. Similarly, the
`execution of a function may be delayed until a move has been completed
`
`(AM), an input signal changes states (Al), or by a pure time delay (WT).
`
`The following example illustrates the use of tiippoints in executing a motion
`
`cycle.
`
`Consider the motion cycle illustrated by Figure 10.6. A forward
`
`Example 19.7
`
`motion of 10,000 counts must start upon a start pulse on input #1. The
`
`i
`
`t
`
`10409
`
`.
`
`Page 14 of23 fl
`
`-
`
`_1_-
`
`Page 14 of 23
`
`
`
`initial velocity, acceleration, and deceleration rates equal 20,000,
`
`100,000, and 100,000 respectively.
`
`INPUT 1
`
`t____..
`
`20000
`
`I I I I I I I
`
`[1
`
`M
`
`‘I
`
`I I I I V
`
`ELOCITY
`
`Figure 10.6: Motion Cycle of Example 10.7
`
`~2000O
`
`After the motor has moved a distance of 6000 counts, the controller
`
`starts a deceleration toward a speed of 10,000 counts/s. That speed is
`
`maintained for the rest of the move. Upon completion of the motion,
`
`the controller waits 100 ms before returning the motor to the starting
`
`position, at a speed of 20,000 counts/s. Once there, the controller is
`
`ready to repeat the cycle.
`
`Notice that the scheduling of the various functions requires the use of
`
`trippoints. The start of the motion is delayed by the trippoint All.
`
`When the motion starts, the velocity change is scheduled with the
`
`10-110
`
`Page 15 of 23
`
`-v;’;,’*‘"){f’\~11',f~*\>'*>\j)¢>«;\
`
`Page 15 of 23
`
`
`
`trippoint AD 6000. The controller must then wait until the completion
`
`of the move (AMX) and adds a pure delay of 100 ms (WT 100) before
`
`returning the motor to the starting position. The resulting flowchart is
`
`shown in Figure 10.7, and the Instruction Program follows.
`
` DlSTANCE=1 0000
`
`SPEEDa==20000
`
`WAIT FOR INPUT 1
`
`START THE MOTION
`
`
`
`
`AFTER A DISTANCE
`
`
`
`
`OF 6000 COUNTS
`SPEED=1000O
`
`
` WHEN MOTION IS COMPLETE
`
`WAIT 100 ms
`
`
`
`WHEN MOTION IS COMPLETE
`
`
`
`MOVE BACK 10000
`
`AT SPEED 20000
`
`Figure 10.7: Flowchart for Example 10.7
`
`mmmm
`#CYCLE
`Label
`
`PR 10000
`SP 20000
`AC 100000
`
`Distance
`Initial speed
`Acceleration rate
`
`10411
`
`Page l6of23 A E
`
`0
`
`Page 16 of 23
`
`
`
`DC 100000
`AH
`BGX
`
`AD 6000
`SP 10000
`AMX
`WT 100
`
`PR -10000
`
`SP 20000
`BGX
`
`AMX
`JP#CYCLE
`EN
`
`Deceieration rate
`Wait for start pulse
`Start motion
`
`Wait until X moves 6000 counts
`Change the speed
`Wait for completion of move
`Wait 100 ms
`
`Reverse motion
`
`Return speed
`Start motion
`
`Wait for end of motion
`Repeat the cycle
`End
`
`Arrays
`
`Arrays are structured memories where data can be stored and retrieved in a
`
`certain order. They are useful for storing sequences of position points or
`
`output signals.
`
`An array is characterized by a name and a size. Each element in the array is
`
`identified by its index. For example, the array XPOS may have a size of 100
`
`units. As a consequence, each point is identified as XPOS [N] where N
`
`varies between 0 and 99.
`
`To store data in the array, we use an instruction such as
`
`XPOS [5] = _TPX
`
`which reads the current position of the X axis and stones the value in the
`
`array. The value of the position may be retrieved later with instructions of the
`
`form
`
`
`
`10-112
`
`Page 17 of 23
`
`Page 17 of 23
`
`
`
`X = XPOS [5]
`
`which transfers the position value tothe variable X.
`
`The use of arrays is illustratedby the folloiiving example.
`
`Exam gle 10.8
`
`positions
`The controller is required to movean
`points
`characterized by their
`the controller reaches
`are stored in the arrays
`before
`a
`the specified point, it must
`resumingthe motion. The waiting time milliseconds is stored in the
`may WAIT.
`Vi
`
`#STORE,
`firs:
`The program is described in two parts.
`defines the arrays. The second part, RUN, performs the moves
`according to the requirements. The flowchart is given in Figure 10.8
`and the programs follow.
`V
`
`One of the main uses of the
`
`is for recording motion as described in the
`
`following section.
`
`10413
`
`Page 18 of 23
`
`Page 18 of 23
`
`
`
`
`
`
`
`SET X-Y SPEED, ACCEL
`
`AND DECEL
`
`N=O
`
`READ XPOS[N],YPOS[N]
`
`COMMAND x-v MOTION
`
`WAIT FOR END OF MOTION
`
`WAIT THE REQUIRED TIME
`
`N=N+1
`
` YES
`
`NO
`
`END
`
`Figure 10.8: Flowchart for Example 10.8
`
`inggrggzign
`
`#STORE
`
`lntergrejation
`
`Label
`
`Define arrays
`Set values
`
`Page 19 of 23
`
`Page 19 of 23
`
`
`
`YPOS [1] = 20
`YPOS (21: 153
`YPOS [3] = 200
`WAlT [0] = 50
`WAIT [I] = 100
`WAIT [2] = 60
`WAIT [3] = 120
`EN
`
`End of program
`
`I.
`
`-
`i
`#FtUN
`AC 200000,200000
`oc 2ooooo,2ooooo
`SP 50000,50000
`N = 0
`#LOOP
`PA XPOS [N], YPOS [N]
`BGXY
`AMXY
`WT WAIT [N]
`N = N+1
`JP#LOOP, N<4
`EN
`
`I
`
`I
`
`I.
`
`I
`I
`-
`V
`Label
`Accelerations
`Decelerations
`Speeds
`Initial count .
`V
`[
`Specify final position L
`Start motion
`Wait for completion
`Wait specified time interval
`Increment index
`Repeat fourtimes
`End of program
`
`Record
`
`Controllers may record motion data at a fixed rate and store the data in an
`
`array. This data can be used later to duplicate the motion or to analyze it.
`
`The recording process includes several steps. First the army where the data
`
`are stored must be specified, and later the type of data, such as position,
`
`position error, etc., must be defined before the actual recording is
`
`10-115
`
`Page 20 of 23
`
`
`
`Page 20 of 23
`
`
`
`1""/"‘,'r“,f‘7i>‘Xm\“fi",_,‘,,“,\:~"7,",.“,,
`
`accomplished at a specified rate. The process is illustrated by the following
`
`example.
`
`Example 10.9
`
`Write a program that records the position error of the Y axis every 16
`
`ms, a total of 100 times, and stores the results in the array YERROR.
`
`The actual recording is done with the instruction RC that has two
`parameters:
`the first parameter, n, defines the recording time interval
`as 2“ ms. In the given example, 11 = 4 results in 16 ms intervals. The
`
`second parameter sets the number of the recorded points.
`
`Instruction
`#RECORD
`RA YERROR [100]
`RD __TEY
`“
`RC 4,100
`i
`EN
`
`lntenzrfitatism
`Label
`Storage array
`Data type
`Actual recording
`End
`
`The following example illustrates how recorded data can be used for analysis.
`
`Example ;0.10
`
`Use the position error data collected in Example 10.9 to perform a
`
`statistical analysis on the positions error of Y. Determine the maximum
`
`and minimum values as well as the root mean square value. The
`
`following program performs the required tasks and stores the results
`
`under the variables MAX, MIN, and RMS. The program flowchart is
`
`shown in Figure 10.9.
`
`10116
`
`Page 21 of 23
`
`Page 21 of 23
`
`
`
`
` 2
`
`MAX-02
`
`LL MN-o SUM-0
`
`
`
`POINT E
`
`Figure 10.9: Flowchart for Example 10.10
`
`lnatmciiszn
`#STAT
`
`N == 0
`
`MAX == 0
`
`MIN = 0
`
`SUM a O
`
`#LO0P
`
`lntemtelatism
`Label
`
`Initiaf values
`
`Label
`
`E = YERROR [N]
`
`Read position error
`
`“"‘”
`
`Page 22 of 23
`
`Page 22 of 23
`
`
`
`I'
`
`E
`
`
`
`E
`
`
`
`JP#MAX, E<MAX
`MAX = E
`#MAX
`JP#M|N, E >M|N
`MIN = E
`#M|N
`SUM = E*E+SUM
`N = N+1
`JP#LOOP, N<1OO
`MEAN = SUM/100
`RMS=@SQR[MEAN]
`EN
`
`Compare with MAX
`Redefine MAX
`Label
`Compare with MIN
`Redefine MIN
`Label
`Compute sum of squares
`Increment Index
`Repeat 100 times
`Mean square
`Root mean square
`End of program
`
`The programming tools described above are used to generate motion
`
`programs as shown in the following chapters.
`
`Page 23 of 23
`
`Page 23 of 23