© 2013 SPiiPlus Training Class Motion Profile Generation 1.
-
Upload
josiah-arne -
Category
Documents
-
view
247 -
download
2
Transcript of © 2013 SPiiPlus Training Class Motion Profile Generation 1.
![Page 1: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/1.jpg)
© 2013
SPiiPlus Training Class
Motion Profile Generation
1
![Page 2: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/2.jpg)
© 2013
What is Motion Profile Generation?
Motion profile generation is the process by which the controller takes a high level command and creates a finely sampled motion profile
o At a minimum the controller will calculate a new position every update cycle
Advanced controllers will also calculate velocity, acceleration, and jerk (acceleration/sec)
o High level command can be streamed by a host or executed directly by the motion controller
o Many different algorithms can be used to generate the motion profile / trajectory
o Motion profile / trajectory can be for a single or multi-axis move
2
![Page 3: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/3.jpg)
© 20133
Position
Time
Sampled Motion Trajectory
![Page 4: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/4.jpg)
© 20134
Motion Generation: SPiiPlus
SP0SP1
MasterFormula
ECATECATECAT
MasterPosition(MPOS)
Motion Generator
Axis Position (APOS)
CONNECT formula
Reference Position (RPOS)
Convert units to counts (EFAC)
Convert counts to
units (EFAC)
Feedback Position (FPOS)
User Commands / External
Signals
Feedback FeedbackDrive
CommandDrive
Command
MPU
![Page 5: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/5.jpg)
© 2013
Important ACSPL+ Motion VariablesVEL: Commanded Velocity
o Motor commanded velocity in user units / secondo This is the maximum velocity of the motion profile
ACC: Commanded Accelerationo Motor commanded acceleration in user units / second2
o This is the maximum acceleration of the motion profile
DEC: Commanded Decelerationo Motor commanded deceleration in user units / second2
o This is the maximum deceleration of the motion profile
JERK: Commanded Jerko Motor commanded jerk in user units / second3
o This is the maximum jerk of the motion profile
KDEC: Kill Decelerationo Used for the KILL command only
5
![Page 6: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/6.jpg)
© 2013
Important ACSPL+ Motion VariablesAPOS: Axis Position
o Logical axis position in user-defined unitso Calculated directly from motion generator every MPU cycleo Comes before the CONNECT function
RPOS: Reference Positiono Motor commanded position in user-defined unitso Calculated via the CONNECT function every MPU cycleo Sent to servo processor servo loop every MPU cycleo Typically RPOS = APOS
FPOS: Feedback Positiono Sensor feedback position in user-defined unitso Read from servo processor every MPU cycle
PE: Position Erroro Difference between RPOS and FPOSo Updated every MPU cycle
6
![Page 7: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/7.jpg)
© 2013
Important ACSPL+ Motion Variables
EFAC: Encoder Factoro Used to translate between encoder counts on the servo processor and user-
defined units on the MPU
EOFFS: Encoder Offseto Offset between zero position on the servo processor and zero position on the
MPUo Updated whenever RPOS or FPOS is SET (homed).
7
Note: FP is feedback position stored in the Servo Processor
RP is the reference position stored in the Servo Processor
![Page 8: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/8.jpg)
© 2013
Important ACSPL+ Motion VariablesRVEL: Reference Velocity
o Motor commanded velocity in user units / secondo Calculated as the first difference of RPOS, with optional smoothing, every
MPU cycle
FVEL: Feedback Velocityo Sensor feedback velocity in user units / secondo Calculated as first difference of FPOS, with optional smoothing, every MPU
cycle
8
![Page 9: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/9.jpg)
© 2013
Important ACSPL+ Motion Variables
RACC: Reference Accelerationo Motor commanded acceleration in user units / second2
o Calculated as the first difference of RVEL every MPU cycle
FACC: Feedback Accelerationo Sensor feedback acceleration in user units / second2
o Calculated as the first difference of FVEL every MPU cycle
9
RACC𝑛=(RVEL𝑛−RVEL𝑛− 1 )
𝑇
FACC𝑛=(FVEL𝑛−FVEL𝑛− 1)
𝑇
![Page 10: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/10.jpg)
© 2013
Important ACSPL+ Motion Variables
GPHASE: Group Motion Phaseo Integer value for current motion phase
0: no motion 1: acceleration buildup 2: constant acceleration 3: acceleration finishing 4: constant velocity 5: deceleration buildup 6: constant deceleration 7: deceleration finishing
GRTIME: Group Remaining Motion Timeo Estimated value of time (in milliseconds) until end of current motion
10
![Page 11: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/11.jpg)
© 2013
Important ACSPL+ Motion Variables
MST: Motor Stateo Bitwise encoded physical motor state information
Bit 0: Enabled Bit 1: Open Loop Bit 5: In motion Bit 6: Accelerating
AST: Axis Stateo Bitwise encoded logical axis state information
Bit 2: PEG is in progress Bit 3: Data collection is in progress Bit 5: In motion Bit 6: Accelerating
11
![Page 12: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/12.jpg)
© 2013
Move vs. Move and Settle
Move time: time it takes for commanded motion to finishMove and settle time: time it takes for commanded motion to finish AND physical axis to settle within a specified window
12
TimeMotion Start
Event
Motion Time
Po
sit
ion
Motion Complete
Event
Feedback Position
SETTLE var. (msec) TARGRAD variable (user
units)
Target position MST.#MOVE=0
AST.#MOVE=0
![Page 13: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/13.jpg)
© 2013
Trajectory Algorithms
13
![Page 14: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/14.jpg)
© 2013
Step Profile: BasicsStep Profile:
o Instantaneous change in position
o Infinite velocityo Infinite accelerationo Infinite jerk
Comments:o Not realistico Should never be used in
real motion systems
14
![Page 15: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/15.jpg)
© 2013
Step Profile: Equations
15
![Page 16: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/16.jpg)
© 2013
Step Profile: ACSPL+ ExampleShould not be run on real systems!
16
![Page 17: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/17.jpg)
© 2013
1st Order Profile: Basics1st Order Profile:
o Linear position profileo Instantaneous change in
velocityo Infinite accelerationo Infinite jerk
Comments:o Not realistico Should never be used in
real motion systems
17
![Page 18: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/18.jpg)
© 2013
1st Order Profile: Equations
18
![Page 19: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/19.jpg)
© 2013
1st Order Profile: ACSPL+ ExampleShould not be run on real systems!
19
![Page 20: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/20.jpg)
© 2013
2nd Order Profile: Basics2nd Order Profile:
o Quadratic position profileo Linear velocity profileo Instantaneous change in
accelerationo Infinite jerk
Comments:o Not realistico Simple controllers use this
type of interpolationo Results in ‘jerky’ behavior
of motion systems
20
![Page 21: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/21.jpg)
© 2013
2nd Order Profile: Equations
21
![Page 22: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/22.jpg)
© 2013
2nd Order Profile: ACSPL+ ExampleNot ideal for real systems
22
![Page 23: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/23.jpg)
© 2013
3rd Order Profile: Basics3rd Order Profile:
o Cubic position profileo Quadratic velocity profileo Linear acceleration profileo Instantaneous change in
jerk
Comments:o Realistico Results in smooth motiono Complex profileo Requires appropriate jerk
setting
23
![Page 24: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/24.jpg)
© 2013
3rd Order Profile: Equations
24
![Page 25: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/25.jpg)
© 2013
3rd Order Profile: Equations
25
![Page 26: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/26.jpg)
© 2013
3rd Order Profile: ACSPL+ Example
26
![Page 27: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/27.jpg)
© 2013
Jogging: BasicsJogging:
o Accelerating to constant velocityo No defined end-pointo Can be done with 1st order, 2nd order or 3rd order profiles
27
![Page 28: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/28.jpg)
© 2013
Jogging: ACSPL+ Example
28
![Page 29: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/29.jpg)
© 2013
CAM Motion: Basics
CAM Motion:o Multi-axis motion along a continuous path 2 or 3 dimensional spaceo Can involved more than 3 axeso Common in CAD/CAM applications where motion profile is a tool path
created from a CAD fileo Typically composed of arc and line segments
29
![Page 30: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/30.jpg)
© 2013
CAM Motion: Equations
Line Segment:o Constant linear velocity along an n-dimensional patho Requires knowledge of start point, end point, and velocity
Arc Segment:o Constant angular velocity along circumference of a circleo Confined to 2D planeo Requires knowledge of start point, center point or end point (or
equivalent)
30
![Page 31: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/31.jpg)
© 2013
CAM Motion: ACSPL+ Example
31
![Page 32: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/32.jpg)
© 2013
Master / Slave: Basics
Master / Slave Motion:o Axis is slaved to a master signalo Master signal could be an encoder, virtual axis, analog input, etco Slave is moved to track the masters position (position lock) or velocity
(velocity lock) as best as possible without exceeding its maximum velocity or acceleration
o There will always be a delay between the master and slaveo Common in applications where the master signal has unknown
dynamics or controlled externally
32
![Page 33: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/33.jpg)
© 2013
Master / Slave: ACSPL+ Example
33
![Page 34: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/34.jpg)
© 2013
Spline: BasicsSpline:
o Smooth piece-wise polynomial functiono Used for interpolating in between data points to any degree of
interpolationo Different types of splines have different properties
Catmull-Rom:o Guarantees motion through control pointso Guarantees continuous position and velocity profiles (does not
guarantee continuous acceleration profile)
B-Spline:o Does not guarantee motion through control pointso Guarantees continuous position, velocity and acceleration profiles
34
![Page 35: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/35.jpg)
© 2013
Spline: PVT Motion
PVT Motion:o User provides position, velocity, and time pointso Motion generator interpolates between time points to determine
position at each controller cycleo Acceleration is implicitly defined by the PVT points
35
![Page 36: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/36.jpg)
© 2013
Spline: ACSPL+ Example
36
![Page 37: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/37.jpg)
© 2013
Kinematics: Basics
Kinematics:o Relationship between actuators positions and end-effector positionso Common with multi-axis applications where end-effector motion is
dependent on multiple actuators
Forward Kinematics:o Determining end-effector position as a function of actuator positions
Inverse Kinematics:o Determining actuator positions as a function of end-effector position
37
![Page 38: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/38.jpg)
© 2013
Kinematics: Inverse Kinematics Example
For the flexible gantry table below, determine the actuator positions as a function of the end-effector X-q position.
38
![Page 39: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/39.jpg)
© 2013
Kinematics: ACSPL+ Example
39
![Page 40: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/40.jpg)
© 2013
ACSPL+ Programming Example: 1
1. Load program “Programming 06 – SetMotionParams.prg” to the controllero Should populate buffer 19
2. Open communication terminal and set it up to show DISP messages3. From the communication terminal start buffer 19 at label ‘Begin’
(“START 19, BEGIN”). Follow the instructions on the screen
What happens?
40
![Page 41: © 2013 SPiiPlus Training Class Motion Profile Generation 1.](https://reader037.fdocuments.in/reader037/viewer/2022102515/551740b355034603568b633f/html5/thumbnails/41.jpg)
© 2013
ACSPL+ Programming Example: 2
An application requires an axis to have two modes: slow and fast. The customer wants to use a digital input (IN(0).0) to toggle between the two modes (if ‘0’, set for slow mode, if ‘1’, set for fast mode). They will use a second digital input (IN(0).1) to toggle motion.
1. Use buffer 20 to write the program. Once running program should not stop (hint: WHILE 1 loop).
2. Anytime IN(0).0 is toggled the motion parameters should switch between a slow and fast mode (determine your own slow and fast parameters)
3. Anytime IN(0).1 goes from low to high a new motion should be started. Use the motion command “PTP/r (axis), distance” for the motion.
4. Run the program and test.
41