Download presentation
Presentation is loading. Please wait.
1
Introduction to Multi-Tasking
2
Terminology Program: A BASIC or IEC program
Task: IEC task containing one or more programs Process: Processing slot that runs a Task or BASIC program Kernel: Processing of the servo and motion firmware
3
Controller type determines the max number of processes
Comparison table Controller type determines the max number of processes Controller # Processes Axes MC ½ / 3 (16 in s/w) MC ½ / 5 (16 in s/w) MC / 64 (64 in s/w) MC664-X / 128 (128 in s/w) Euro (16 in S/W) Euro (16 in S/W)
4
Multi-Tasking: Benefits
Division of Tasks Smaller, dedicated programs (processes) can be written to handle specific functions of the machine. Concurrency Each process acts like a virtual controller and operates independently of the others. Simplified Error Handling A simple process can be dedicated to error trapping with no overhead in the main tasks. Command Line The command line / Motion Perfect Link is always available, even when programs are running.
5
Multi-Tasking: Division of tasks
STARTUP: Initialise Axis Parameters and User Memory (Generated by MotionPerfect) MAIN: Error Handler and Safety Interlocks MAIN (Error Handler) STARTUP (Axis Params /Variables) Runs Once HOMING: Axis Datuming Continuous Loop MOTION1: Main Motion Loop HOMING MOTION1 LADDER IEC MOTION2 MOTION2: Alternative Motion Loop
6
Multi-Tasking: Servo Period
1 msec Servos & Motion System User User User Processor Interrupts Each interrupt causes a process switch. All data from running program and the line number are stored Data for next process slot is retrieved Programs run from where they left off last time As more programs are run, they appear to slow down.
7
Multi-Tasking: Servo Period
1 msec Servos & Motion System User User User 500 usec 500 usec Servos & Motion System User Servos & Motion User User 250 usec 250 usec 250 usec 250 usec Servos & Motion Sys Servos & Motion User Servos & Motion User Servos & Motion User
8
Multi-Tasking: Servo Period
1 msec Servos & Motion System User User User SYSTEM_LOAD (% of processing time) More axes running. Servo and Motion processing takes longer. Less time shared between multi-tasking processes.
9
Multi-Tasking: Program priority
10
Multi-Tasking: Program priority
11
Multi-Tasking: Program priority
12
Multi-Tasking: Program priority
13
* Expert tip ! See process % in Terminal #0
>>PROCESS Process Type Status Name Line hhhh:mm:ss.ms [CPU %] Slow Pause STARTUP :00: [ 0.00%] Fast Run USER_PROGRAM :00: [30.57%] Fast Run USER_PROGRAM :00: [33.20%] SYS Run Command Line :00: [ 0.06%] SYS Run Protocol Scheduler :00: [ 4.89%] SYS Run MPE :00: [ 4.89%] SYS Suspend CAN Server :00: [ 0.00%] SYS Run TCP/IP Server :00: [ 4.90%] SYS Run ECAT async :00: [ 4.89%] SYS Sleep[ 0] Data Backup :00: [ 0.98%] SYS Sleep[ 9] Directory Backup :00: [ 0.00%] SYS Run Display Manager :00: [ 1.75%] KERNEL SYS Run Motion/Housekeeping :00: [13.86%] >>
14
Kernel: Processing motion
1 msec Kernel System User User User SYSTEM_LOAD (% of processing time) Kernel runs closed loop and motion profile generation. System slot runs communications. User slots run BASIC and IEC programs. ?SYSTEM_LOAD >>
15
Multi-tasking and Motion
Servo loops and velocity profile Move type Next move type Motion Buffers and Alarms
16
Multi-tasking and Motion
BASIC Multi-Tasking Velocity Profile Unit Servo Control Runs BASIC programs SPEED=1200 ACCEL=3400 MOVE(340) WAIT IDLE PMOVE Generates motion profile points. NTYPE … MTYPE DPOS DEMAND_SPEED Calculates Servo control values for all axes. MPOS…ENCODER Servo control algorithm DAC_OUT Task switch 3 times per msec No guaranteed loop times. Processed once per servo period [Deterministic] Processed once per servo period [Deterministic]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.