Delta Tau PMAC MINI PCI, PMAC PCI, PMAC PCI LITE, PMAC VME, TURBO PMAC VME User Manual

^1 USER MANUAL
^2 PMAC
^3 Programmable Multi-Axis Controller
^4 3Ax-602264-xUxx
^5 June 28, 2007
Single Source Machine Control Power // Flexibility // Ease of Use
21314 Lassen Street Chatsworth, CA 91311 // Tel. (818) 998-2095 Fax. (818) 998-7807 // www.deltatau.com
Copyright Information
© 2007 Delta Tau Data Systems, Inc. All rights reserved.
This document is furnished for the customers of Delta Tau Data Systems, Inc. Other uses are unauthorized without written permission of Delta Tau Data Systems, Inc. Information contained in this manual may be updated from time-to-time due to product improvements, etc., and may not conform in every respect to former issues.
To report errors or inconsistencies, call or email:
Delta Tau Data Systems, Inc. Technical Support
Phone: (818) 717-5656 Fax: (818) 998-7807 Email: support@deltatau.com Website: http://www.deltatau.com
Operating Conditions
All Delta Tau Data Systems, Inc. motion controller products, accessories, and amplifiers contain static sensitive components that can be damaged by incorrect handling. When installing or handling Delta Tau Data Systems, Inc. products, avoid contact with highly insulated materials. Only qualified personnel should be allowed to handle this equipment.
In the case of industrial applications, we expect our products to be protected from hazardous or conductive materials and/or environments that could cause harm to the controller by damaging components or causing electrical shorts. When our products are used in an industrial environment, install them into an industrial electrical cabinet or industrial PC to protect them from excessive or corrosive moisture, abnormal ambient temperatures, and conductive materials. If Delta Tau Data Systems, Inc. products are exposed to hazardous or conductive materials and/or environments, we cannot guarantee their operation.
REVISION HISTORY
REV. DESCRIPTION DATE CHG APPVD
1 CORRECTION TO PID EQUATION, P. 108 06/28/07 CP S. MILICI
PMAC User Manual
Table of Contents
INTRODUCTION .......................................................................................................................................................1
Flexibility..............................................................................................................................................................1
Configuration for a Task.......................................................................................................................................1
PMAC is a Computer............................................................................................................................................1
Manual Layout ..........................................................................................................................................................2
Conventions Used in this Manual.........................................................................................................................2
Safety Summary ........................................................................................................................................................2
Keep Away from Live Circuits..............................................................................................................................2
Live Circuit Contact Procedures ..........................................................................................................................2
Electrostatic Sensitive Devices .............................................................................................................................3
Magnetic Media....................................................................................................................................................3
Related Technical Documentation ............................................................................................................................3
Technical Support .....................................................................................................................................................3
By Telephone ........................................................................................................................................................3
By Fax and E-Mail................................................................................................................................................3
Bulletin Board Service (BBS) ...............................................................................................................................3
GETTING STARTED WITH PMAC........................................................................................................................5
Preparing the Card.....................................................................................................................................................5
E-Point Jumpers ...................................................................................................................................................5
Card Number Jumpers..........................................................................................................................................5
Communications Baud Rate Jumpers...................................................................................................................6
PCbus Address Jumpers .......................................................................................................................................6
STDbus Address Jumpers .....................................................................................................................................6
PMAC VME Interface Setup.................................................................................................................................6
Encoder Jumpers ..................................................................................................................................................6
Analog Circuit Jumpers........................................................................................................................................7
Re-initialization Jumper .......................................................................................................................................7
Standard and Option 5 PMACs ............................................................................................................................7
PMAC with Options 4A, 5A, and 5B.....................................................................................................................8
Connecting PMAC to the Host Computer.................................................................................................................8
Bus Connection.....................................................................................................................................................8
Serial Port Connection .........................................................................................................................................8
Installing the PMAC Executive Program..............................................................................................................9
Establishing Host Communications......................................................................................................................9
Terminal Mode Communications..........................................................................................................................9
Connecting PMAC to the System..............................................................................................................................9
Machine Connectors...........................................................................................................................................10
Connecting the Analog Power Supply ................................................................................................................10
Incremental Encoder Connection .......................................................................................................................10
Amplifier Connection..........................................................................................................................................11
Auxiliary Connections ........................................................................................................................................11
Software Setup for a Motor.....................................................................................................................................12
Encoder I-Variables............................................................................................................................................13
Motor I-Variables ...............................................................................................................................................13
Motor Activation.................................................................................................................................................13
For PMAC-Commutated Motors Only................................................................................................................13
For Motors Not Commutated By PMAC.............................................................................................................14
For All Types of Motors......................................................................................................................................14
Testing the Output and Polarity..........................................................................................................................16
Non-PMAC Commutated Motors........................................................................................................................16
Overtravel Limit Polarity....................................................................................................................................16
Setting up the Servo Loop ...................................................................................................................................17
Closing the Loop.................................................................................................................................................17
Jogging Moves....................................................................................................................................................17
Table of Contents i
PMAC User Manual
Power-Up Mode..................................................................................................................................................18
Homing Search Move .........................................................................................................................................18
Setting up a Coordinate System ..............................................................................................................................19
Defining an Axis .................................................................................................................................................19
Scaling an Axis ...................................................................................................................................................19
Multiple Axes ......................................................................................................................................................19
Writing a Motion Program ......................................................................................................................................19
Using the Program Editor ..................................................................................................................................20
Executing a Motion Program ..................................................................................................................................20
Starting the Program ..........................................................................................................................................20
Stopping the Program.........................................................................................................................................20
Refining the Program .........................................................................................................................................20
Writing and Executing a PLC Program...................................................................................................................21
Starting the PLC Program..................................................................................................................................21
Stopping the PLC Program.................................................................................................................................21
PMAC FEATURES...................................................................................................................................................23
Executing Motion Programs....................................................................................................................................23
Executing PLC Programs........................................................................................................................................23
Servo Loop Update..................................................................................................................................................23
Commutation Update ..............................................................................................................................................23
Housekeeping..........................................................................................................................................................23
Communicating With the Host............................................................................................................................23
Task Priorities ....................................................................................................................................................24
TALKING TO PMAC...............................................................................................................................................25
Basic Aspects of Communicating with PMAC.......................................................................................................25
Communications Ports ............................................................................................................................................25
Active Response Port ..........................................................................................................................................25
Serial Interface ...................................................................................................................................................25
PC Bus Interface.................................................................................................................................................27
STD Bus Interface...............................................................................................................................................27
VME Bus Interface..............................................................................................................................................27
Giving Commands to PMAC ..................................................................................................................................27
PMAC Processing of Commands........................................................................................................................27
Command Acknowledgement..............................................................................................................................28
Data Response ....................................................................................................................................................28
Data Integrity .....................................................................................................................................................28
Data Response Format .......................................................................................................................................28
On-Line (Immediate) Commands............................................................................................................................29
Types of On-Line Commands..............................................................................................................................29
Motor-Specific Commands .................................................................................................................................29
Coordinate-System-Specific Commands.............................................................................................................29
Global Commands ..............................................................................................................................................30
Buffered (Program) Commands ..............................................................................................................................30
Rotary Motion Program Buffer...........................................................................................................................30
Multiple-Card Applications.....................................................................................................................................31
Bus Communications ..........................................................................................................................................31
Simultaneous Commands....................................................................................................................................31
Serial Communications.......................................................................................................................................31
Serial Card Addressing.......................................................................................................................................32
Setting Up the Addresses ....................................................................................................................................32
Multi-Card Mode Variable .................................................................................................................................33
Addressed-Card Actions .....................................................................................................................................33
Simultaneous Addressing....................................................................................................................................33
Handling Data Response ....................................................................................................................................33
Power-Up State...................................................................................................................................................34
ii Table of Contents
PMAC User Manual
Control-Character Commands ...........................................................................................................................34
Resetting PMAC .....................................................................................................................................................35
PMAC Reset Actions...........................................................................................................................................35
PMAC Re-initialization Actions: Standard CPU................................................................................................35
PMAC Re-initialization Actions: Flash CPU .....................................................................................................36
Re-initialize Command .......................................................................................................................................37
TROUBLESHOOTING............................................................................................................................................39
PMAC Card Troubleshooting .................................................................................................................................39
General ...............................................................................................................................................................39
Bus Communications ..........................................................................................................................................39
Serial Communications.......................................................................................................................................39
Commutation Troubleshooting................................................................................................................................39
Servo Loop and Jogging Troubleshooting...............................................................................................................39
Homing Search Troubleshooting.............................................................................................................................40
No Movement at All ............................................................................................................................................40
Movement, But Sluggish. ....................................................................................................................................40
Runaway Condition ............................................................................................................................................40
Brief Movement, Then Stop.................................................................................................................................40
Motion Program Troubleshooting...........................................................................................................................40
INPUT/OUTPUT: CONNECTING PMAC TO THE MACHINE.......................................................................41
Capabilities and Features.........................................................................................................................................41
Quadrature Encoder Inputs (JMACH Port).............................................................................................................41
Single-Ended vs. Differential..............................................................................................................................41
Differential Encoders..........................................................................................................................................42
Analog Encoders.................................................................................................................................................42
Power Supply and Isolation................................................................................................................................43
Wiring Techniques..............................................................................................................................................43
Encoder Signal Sampling....................................................................................................................................43
Digital Delay Filter ............................................................................................................................................44
Error Detection...................................................................................................................................................44
Optically Isolated Dedicated Digital Input Flags (JMACH Port)............................................................................45
Flag Wiring.........................................................................................................................................................45
Overtravel Limit Inputs.......................................................................................................................................45
Home Flag Input.................................................................................................................................................45
Amplifier Fault Input ..........................................................................................................................................45
Flag Isolation .....................................................................................................................................................45
Dedicated Digital Output Flags (JMACH, JEQU Ports) .........................................................................................45
Amplifier-Enable/Direction Output ....................................................................................................................45
Amplifier Enable/Disable Use ............................................................................................................................46
Transition............................................................................................................................................................46
Sinking Drivers ...................................................................................................................................................46
Sourcing Drivers.................................................................................................................................................46
Polarity Control..................................................................................................................................................46
Direction Bit Use ................................................................................................................................................47
General-Purpose Use .........................................................................................................................................47
Compare-Equals Outputs ...................................................................................................................................47
Optically Isolated Analog Outputs (JMACH Port) .................................................................................................48
Connections ........................................................................................................................................................48
Isolation..............................................................................................................................................................48
Drive Capability .................................................................................................................................................48
General-Purpose Use .........................................................................................................................................48
General-Purpose Digital Inputs and Outputs (JOPTO Port)....................................................................................48
Software Access ..................................................................................................................................................48
Standard Sinking Outputs ...................................................................................................................................48
Option for Sourcing Outputs...............................................................................................................................49
Table of Contents iii
PMAC User Manual
Input Source/Sink Control ..................................................................................................................................49
Thumbwheel Multiplexer Port I/O (JTHW Port) ....................................................................................................49
Multiplexed Uses ................................................................................................................................................49
Non-Multiplexed Uses ........................................................................................................................................50
Control-Panel Port I/O (JPAN Port)........................................................................................................................50
Discrete Inputs....................................................................................................................................................50
Alternate Use ......................................................................................................................................................50
Reset Input ..........................................................................................................................................................50
Handwheel Inputs ...............................................................................................................................................50
Analog Input .......................................................................................................................................................51
Display Port Outputs (JDISP Port)..........................................................................................................................52
SETTING UP A MOTOR.........................................................................................................................................53
What is a Motor?.....................................................................................................................................................53
Defining the Motor..................................................................................................................................................53
Motor I-Variables ...............................................................................................................................................53
Activating the Motor ...............................................................................................................................................53
Does PMAC Commutate this Motor? .................................................................................................................53
Address I-Variables ............................................................................................................................................53
Hex vs. Decimal Reporting .................................................................................................................................54
Selecting the Output(s)........................................................................................................................................54
Selecting the Position Loop Feedback................................................................................................................54
Selecting the Velocity Loop Feedback ................................................................................................................54
Dual Feedback Systems ......................................................................................................................................54
Accuracy vs. Stability..............................................................................................................................................55
Selecting the Master Position Source .................................................................................................................56
Selecting the Flag Register.................................................................................................................................56
Selecting the Power-Up Mode ............................................................................................................................56
Types of Position Sensors .......................................................................................................................................56
Quadrature Encoder Feedback ..........................................................................................................................56
Hardware Changes.............................................................................................................................................58
Software Changes ...............................................................................................................................................58
Parallel Position Feedback ................................................................................................................................58
Parallel Absolute Feedback................................................................................................................................60
Linear Displacement Transducer Feedback.......................................................................................................60
Analog Position Feedback..................................................................................................................................61
Resolver Feedback..............................................................................................................................................62
Absolute Power-Up Position...................................................................................................................................62
Absolute Position Range.....................................................................................................................................62
Parallel-Data Position........................................................................................................................................63
Resolver Position................................................................................................................................................63
Axis Offset...........................................................................................................................................................64
Encoder Offset ....................................................................................................................................................65
Encoder Conversion Table......................................................................................................................................65
Incremental Encoder Entries..............................................................................................................................68
1/T Interpolation.................................................................................................................................................68
Parallel-Bit Interpolation ...................................................................................................................................68
No Interpolation..................................................................................................................................................68
Acc-28 Analog-to-Digital Conversion Register Entries .....................................................................................68
Parallel Position Feedback Conversion .............................................................................................................70
Time-Base Conversion Entries ...........................................................................................................................73
Triggered Time-Base Conversion Entries ..........................................................................................................74
Exponential-Filter Entries ..................................................................................................................................75
Setting up the Encoder Conversion Table...........................................................................................................76
Further Position Processing.....................................................................................................................................78
Software Position Extension ...............................................................................................................................78
iv Table of Contents
PMAC User Manual
Axis Position Scaling ..........................................................................................................................................79
Leadscrew Compensation...................................................................................................................................79
Backlash Compensation......................................................................................................................................82
Torque Compensation Tables.............................................................................................................................84
SETTING UP PMAC COMMUTATION ...............................................................................................................87
Introduction .............................................................................................................................................................87
Incremental Encoder Feedback Requirement..........................................................................................................87
Phase Referencing...................................................................................................................................................87
Two-Analog-Output Requirement...........................................................................................................................87
Basic Parameter Specification.................................................................................................................................88
Counts per Commutation Cycle..........................................................................................................................88
Angle Between Phases ........................................................................................................................................88
Permanent Magnet Brushless Motor Commutation ................................................................................................89
Getting the Polarity Right...................................................................................................................................89
Power-on Phasing Search ..................................................................................................................................89
Phasing Referenced to Absolute Sensor .............................................................................................................92
Phasing Referenced to Hall-Effect Sensor..........................................................................................................94
Phase Advance....................................................................................................................................................95
Switched Reluctance Motor Commutation..............................................................................................................96
AC Induction Motor Commutation .........................................................................................................................96
Setting the Slip Gain ...........................................................................................................................................96
Setting the Magnetization Current......................................................................................................................97
Experimental Setting of Induction Motor Parameters........................................................................................98
Open-Loop Microstepping Commutation ...........................................................................................................99
Setting the I-Variables ......................................................................................................................................100
Using the Motor................................................................................................................................................101
User-Written Commutation Algorithm .................................................................................................................101
Memory Space, Software Interface, and Program Restrictions........................................................................101
CLOSING THE SERVO LOOP ............................................................................................................................103
The Purpose of the Servo Loop.............................................................................................................................103
Servo Update Rate.................................................................................................................................................103
Reasons to Increase Rate..................................................................................................................................103
Reasons to Decrease Rate.................................................................................................................................103
Ramifications of Changing the Rate .................................................................................................................103
Amplifier Types ....................................................................................................................................................104
Velocity-Mode Amplifiers .................................................................................................................................104
Torque-Mode Amplifiers...................................................................................................................................104
Voltage-Mode Amplifiers..................................................................................................................................105
Sinusoidal-Input Amplifiers ..............................................................................................................................105
Pulse-and-Direction Amplifiers........................................................................................................................106
Hydraulic Servo Amplifiers ..............................................................................................................................106
PID Servo Filter ....................................................................................................................................................106
How the PID Filter Works................................................................................................................................106
Tuning the PID Filter .......................................................................................................................................107
Actual PID Algorithm.......................................................................................................................................108
Notch Filters..........................................................................................................................................................108
Automatic Notch Specification..........................................................................................................................109
Manual Notch Specification..............................................................................................................................109
Other Uses of the Notch Filter..........................................................................................................................110
Extended (Pole-Placement) Servo Filter ...............................................................................................................111
User-Written Servo Filter......................................................................................................................................111
What is needed to write the Filter.....................................................................................................................112
Download and Enable Procedure.....................................................................................................................112
Memory Space, Software Interface, and Program Restrictions.............................................................................112
Usable Data Spaces..........................................................................................................................................112
Table of Contents v
PMAC User Manual
Interface to Other Firmware.............................................................................................................................112
Restrictions .......................................................................................................................................................113
Alternative Uses for User-Written Servo ..........................................................................................................113
Simple User-Written Servo Example ................................................................................................................113
C Program to Convert .LOD File to PMAC Format........................................................................................114
MAKING THE APPLICATION SAFE ................................................................................................................117
Responsibility for the Safety of a Control System ................................................................................................117
Hardware Overtravel Limit Switches....................................................................................................................117
Software Overtravel Limits...................................................................................................................................118
Following Error Limits..........................................................................................................................................118
Fatal Following Error Limit.............................................................................................................................118
Warning Following Error Limit .......................................................................................................................118
Integrated Following Error Protection ............................................................................................................118
Velocity Limits......................................................................................................................................................119
Acceleration Limits...............................................................................................................................................119
Command Output Limits.......................................................................................................................................120
Integrated Current (I2T) Protection .......................................................................................................................120
Amplifier Enable and Fault Lines .........................................................................................................................121
Watchdog Timer....................................................................................................................................................122
Hardware Stop Command Inputs ..........................................................................................................................122
Host-Generated Stop Commands..........................................................................................................................122
Program Checksums..............................................................................................................................................123
Firmware Checksum.........................................................................................................................................123
User-Program Checksum .................................................................................................................................123
Communications Data Integrity Features..............................................................................................................123
BASIC MOTOR MOVES.......................................................................................................................................125
Commanding Some Basic Moves for the Motor...................................................................................................125
Jogging Move Control...........................................................................................................................................125
Jog Acceleration ...............................................................................................................................................125
Jog Speed..........................................................................................................................................................125
Jog Commands..................................................................................................................................................125
Homing Search Move Control...............................................................................................................................128
Homing Acceleration ........................................................................................................................................128
Homing Speed...................................................................................................................................................128
Home Trigger Condition...................................................................................................................................128
Specify Flag Set ................................................................................................................................................128
Software Capture Option..................................................................................................................................128
Trigger Signals and Edges.....................................................................................................................................129
Torque-Mode Triggering..................................................................................................................................129
Home Command ...................................................................................................................................................130
On-Line Command............................................................................................................................................130
Monitoring for Finish .......................................................................................................................................130
Homing from a PLC Program ...............................................................................................................................131
Motion vs. PLC Program Homing.........................................................................................................................131
Zero-Move Homing...........................................................................................................................................131
Homing into a Limit Switch ..............................................................................................................................132
Multi-Step Homing Procedures ........................................................................................................................133
Storing the Home Position................................................................................................................................135
Open-Loop Moves.................................................................................................................................................136
SETTING UP A COORDINATE SYSTEM..........................................................................................................137
Coordinating Multiple Motions.............................................................................................................................137
What is a Coordinate System?...............................................................................................................................137
What is an Axis? ...................................................................................................................................................137
One-to-One Matching.......................................................................................................................................137
vi Table of Contents
PMAC User Manual
Multiple-Motor Axes.........................................................................................................................................137
Phantom Axes ...................................................................................................................................................138
Axis Definition Statements ...................................................................................................................................138
Matching Motor to Axis....................................................................................................................................138
Scaling and Offset.............................................................................................................................................138
Axis Types ............................................................................................................................................................139
Cartesian Axis...................................................................................................................................................139
Rotary Axis .......................................................................................................................................................139
Feedrate Axis....................................................................................................................................................139
Axis-Motor Position Re-matching ........................................................................................................................139
What Is Coordinate System Time-Base?...........................................................................................................141
COMPUTATIONAL FEATURES.........................................................................................................................143
Advanced Computational Features........................................................................................................................143
Computational Priorities........................................................................................................................................143
Numerical Values..................................................................................................................................................145
Internal Formats...............................................................................................................................................145
Receiving Values...............................................................................................................................................145
Examples...........................................................................................................................................................146
Reporting Values ..............................................................................................................................................146
Addresses ..............................................................................................................................................................147
Variables ...............................................................................................................................................................147
I-Variables........................................................................................................................................................147
Value Assignment..............................................................................................................................................148
P-Variables............................................................................................................................................................149
Array Capabilities ............................................................................................................................................149
Special-Use P-Variable ....................................................................................................................................150
Q-Variables ...........................................................................................................................................................150
Allotting Q-Variables........................................................................................................................................150
Addressing a Q-Variable Set ............................................................................................................................151
Array Capabilities ............................................................................................................................................152
Special-Use Q-Variables ..................................................................................................................................153
M-Variables...........................................................................................................................................................153
M-Variable Definitions.....................................................................................................................................153
Limited Range...................................................................................................................................................154
Using M-Variables............................................................................................................................................154
Operators...............................................................................................................................................................154
Arithmetic Operators........................................................................................................................................154
Modulo Operator..............................................................................................................................................154
Logical Operators.............................................................................................................................................155
Functions ...............................................................................................................................................................155
SIN ....................................................................................................................................................................155
COS...................................................................................................................................................................155
TAN...................................................................................................................................................................155
ASIN..................................................................................................................................................................156
ACOS ................................................................................................................................................................156
ATAN ................................................................................................................................................................156
ATAN2 ..............................................................................................................................................................156
LN .....................................................................................................................................................................157
EXP...................................................................................................................................................................157
SQRT.................................................................................................................................................................157
ABS ...................................................................................................................................................................157
INT....................................................................................................................................................................157
Expressions ...........................................................................................................................................................158
Data .......................................................................................................................................................................158
Variable Value Assignment Statement..................................................................................................................158
Table of Contents vii
PMAC User Manual
I-Variable Default Value Assignment...............................................................................................................158
Synchronous M-Variable Value Assignment.....................................................................................................158
Syntax................................................................................................................................................................160
Execution ..........................................................................................................................................................160
Special Boolean Feature...................................................................................................................................160
Limitations ........................................................................................................................................................160
Comparators ..........................................................................................................................................................161
Conditions .............................................................................................................................................................161
Simple Conditions.............................................................................................................................................161
Compound Conditions ......................................................................................................................................162
Single-Line Condition Actions..........................................................................................................................162
Multiple-Line Conditions..................................................................................................................................162
Timers ...................................................................................................................................................................162
Computational Considerations ..............................................................................................................................163
WRITING PROGRAMS FOR PMAC..................................................................................................................165
Writing a Motion Program ....................................................................................................................................165
Flow Control.....................................................................................................................................................165
G-Codes............................................................................................................................................................165
Modal Commands.............................................................................................................................................165
Move Commands ..............................................................................................................................................165
Motion Program Trajectories ................................................................................................................................166
Linear Blended Moves ..........................................................................................................................................166
Acceleration Parameters ..................................................................................................................................166
Acceleration Limit ............................................................................................................................................166
Feedrate or Move-Time Specification...................................................................................................................168
Short Moves ......................................................................................................................................................169
Long Moves.......................................................................................................................................................169
Feedrate Axes ...................................................................................................................................................174
Velocity Limit....................................................................................................................................................174
The Blending Function .....................................................................................................................................174
Rapid-Mode Moves...........................................................................................................................................175
Motion Program Move-Until-Trigger ...................................................................................................................175
Circular Blended Moves........................................................................................................................................176
Specifying the Interpolation Plane....................................................................................................................176
Circle Modes.....................................................................................................................................................177
Center Vector....................................................................................................................................................177
Radius Size Specification ..................................................................................................................................178
No Center Specification....................................................................................................................................178
Feedrate Axes ...................................................................................................................................................179
Circle Radius Errors.........................................................................................................................................179
Move Segmentation...........................................................................................................................................179
PVT-Mode Moves.................................................................................................................................................179
Mode Statement ................................................................................................................................................179
Move Statements ...............................................................................................................................................179
PMAC Calculations..........................................................................................................................................180
Problems in Stepping........................................................................................................................................180
Use to Create Arbitrary Profiles.......................................................................................................................180
Use in Contouring.............................................................................................................................................180
Splined Moves.......................................................................................................................................................181
How They Work ................................................................................................................................................182
Added Pieces.....................................................................................................................................................183
Quantifying the Position Adjustment ................................................................................................................183
5-Point Spline Correction.................................................................................................................................183
Non-Uniform Spline..............................................................................................................................................183
Cutter Radius Compensation.................................................................................................................................184
viii Table of Contents
PMAC User Manual
Defining the Plane of Compensation................................................................................................................184
Defining the Magnitude of Compensation ........................................................................................................184
Turning on Compensation ................................................................................................................................185
Turning off Compensation ................................................................................................................................185
How PMAC Introduces Compensation.............................................................................................................185
Treatment of Compensated inside Corners.......................................................................................................186
Treatment of Outside Corners ..........................................................................................................................187
Treatment of Full Reversal ...............................................................................................................................189
Note on Full Circles..........................................................................................................................................189
Speed of Compensated Moves...........................................................................................................................190
Changes in Compensation ................................................................................................................................190
How PMAC Removes Compensation................................................................................................................191
Failures in Cutter Compensation .....................................................................................................................193
Single-Stepping While in Compensation...........................................................................................................194
Lookahead ........................................................................................................................................................195
Axis Transformation Matrices...............................................................................................................................195
Setting Up the Matrices ....................................................................................................................................195
Using the Matrices............................................................................................................................................195
Calculation Implications........................................................................................................................................196
Examples...........................................................................................................................................................196
Entering a Motion Program...................................................................................................................................198
Learning a Motion Program ..................................................................................................................................198
Motion Program Structure.....................................................................................................................................199
Basic Move Specifications ................................................................................................................................199
Defaults.............................................................................................................................................................199
Controlling Parameters ....................................................................................................................................199
Simultaneous Moves on Multiple Axes .............................................................................................................199
Sequential Moves..............................................................................................................................................200
Adding Logic.....................................................................................................................................................200
Line Labels .......................................................................................................................................................200
GOTO Command..............................................................................................................................................200
Adding Variables and Calculations.......................................................................................................................200
Subroutines and Subprograms...............................................................................................................................201
Passing Arguments to Subroutines ...................................................................................................................201
What Has Been Passed? ...................................................................................................................................201
PRELUDE Subprogram Calls ..........................................................................................................................202
Running a Motion Program...................................................................................................................................202
Pointing to the Program ...................................................................................................................................203
Running the Program .......................................................................................................................................203
Stepping the Program.......................................................................................................................................203
What PMAC Checks For...................................................................................................................................203
Implementing a Machine-Tool Style Program......................................................................................................203
G, M, T, and D-Codes.......................................................................................................................................204
Standard G-Codes ............................................................................................................................................204
Spindle Programs .............................................................................................................................................208
Standard M-Codes............................................................................................................................................209
Default Conditions............................................................................................................................................211
Rotary Motion Program Buffers............................................................................................................................211
Defining a Rotary Buffer...................................................................................................................................211
Preparing to Run ..............................................................................................................................................212
Opening for Entry.............................................................................................................................................212
Staying Ahead of Executing Line ......................................................................................................................212
Closing and Deleting Buffers............................................................................................................................213
How PMAC Executes a Motion Program .............................................................................................................213
Calculating Ahead ............................................................................................................................................213
Starting Calculations........................................................................................................................................214
Table of Contents ix
PMAC User Manual
Calculation of Subsequent Moves.....................................................................................................................214
Implications of Calculating Ahead ...................................................................................................................216
SYNCHRONIZING PMAC TO EXTERNAL EVENTS.....................................................................................219
Features to Help Synchronize Motion...................................................................................................................219
Position Following (Electronic Gearing)...............................................................................................................219
Position Following I-Variables ........................................................................................................................219
Changing Ratios on the Fly ..............................................................................................................................220
Superimposing Following on Programmed Moves...........................................................................................220
Time-Base Control (Electronic Cams) ..................................................................................................................220
What Is Time-Base Control?.............................................................................................................................220
Real-Time Input Frequency ..............................................................................................................................221
Constraints on Selection of RTIF......................................................................................................................221
How It Works ....................................................................................................................................................222
Instructions for Using an External Time-Base Signal ......................................................................................222
Time-Base Example ..........................................................................................................................................224
Triggered Time Base.............................................................................................................................................225
Instructions for the Triggered Time-Base.........................................................................................................226
Triggered Time-Base Example .........................................................................................................................226
Set up and Definitions.......................................................................................................................................227
Motion Program ...............................................................................................................................................227
PLC Program ...................................................................................................................................................227
Synchronizing PMAC to Other PMACs ...............................................................................................................228
Clock Timing.....................................................................................................................................................228
Sharing Clock Signals.......................................................................................................................................228
Connections ......................................................................................................................................................228
External Time Base...........................................................................................................................................229
Motion Program Timing...................................................................................................................................229
Minimizing Initial Offset...................................................................................................................................229
Position-Capture Functions ...................................................................................................................................230
Setting the Trigger Condition ...........................................................................................................................230
Using for Homing .............................................................................................................................................230
Using in User Program ....................................................................................................................................230
Offset from Motor Position...............................................................................................................................230
Position-Compare Functions .................................................................................................................................231
Required M-Variables ......................................................................................................................................231
Preloading the Compare Position ....................................................................................................................231
Offset from Motor Position...............................................................................................................................232
Synchronous M-Variable Assignment ..................................................................................................................232
WRITING A PLC PROGRAM..............................................................................................................................233
PLC Programs .......................................................................................................................................................233
When to Use......................................................................................................................................................233
Common Uses ...................................................................................................................................................233
32 PLC Programs ..................................................................................................................................................233
Entering a PLC Program..................................................................................................................................233
Opening the Buffer............................................................................................................................................234
Downloading the Program ...............................................................................................................................234
Closing the Buffer .............................................................................................................................................234
Erasing the Program ........................................................................................................................................234
PLC Program Structure .........................................................................................................................................235
Calculation Statements .....................................................................................................................................235
Conditional Statements.....................................................................................................................................235
Level-Triggered Conditions..............................................................................................................................235
Edge-Triggered Conditions ..............................................................................................................................235
WHILE Loops ...................................................................................................................................................236
Precise Timing..................................................................................................................................................237
x Table of Contents
PMAC User Manual
Compiled PLC Programs.......................................................................................................................................237
Execution of Compiled PLCs............................................................................................................................238
Preparing Compiled PLCs................................................................................................................................238
Variable Value Assignment Statements ............................................................................................................240
Integrating PLC Files ............................................................................................................................................243
Link Address File..............................................................................................................................................243
Executing the Compiler ....................................................................................................................................243
Compiler Errors................................................................................................................................................244
Compiler Processing ........................................................................................................................................244
Downloading the Compiled Code to PMAC.........................................................................................................245
Running the Compiled PLCs.............................................................................................................................245
WRITING A HOST COMMUNICATIONS PROGRAM...................................................................................247
Communicating From a Host Computer ...............................................................................................................247
Polled vs. Interrupt-Based Communications ....................................................................................................247
Serial Port Communications.............................................................................................................................247
Setting up the Interface.....................................................................................................................................247
Host Port Bus (PC/STDbus) Communications......................................................................................................249
Host Port Structure...........................................................................................................................................249
Base Address Selection .....................................................................................................................................249
Register Functions............................................................................................................................................249
Registers for Simple Polled Communications...................................................................................................249
Setting up the Port ............................................................................................................................................249
Sending a Character .........................................................................................................................................250
Reading a Character.........................................................................................................................................250
Using the PMAC PC/STD to Interrupt the Host Computer...................................................................................250
What Signals Can Be Used...............................................................................................................................250
Selecting a Host Interrupt Line (PMAC PC or Lite).........................................................................................252
Selecting a Host Interrupt Line (PMAC STD) ..................................................................................................252
Interrupt Functions...........................................................................................................................................252
Setting Up .........................................................................................................................................................255
Finding an Open Interrupt Line........................................................................................................................255
Hardware Considerations.................................................................................................................................255
Initializing the PC’s PIC...................................................................................................................................255
Vectoring ..........................................................................................................................................................256
Setting up the Host Request Function...............................................................................................................256
Initializing the PMAC PIC................................................................................................................................256
Unmasking Interrupts .......................................................................................................................................256
Using the Interrupts..........................................................................................................................................257
Restoring Previous Vectors ..............................................................................................................................257
VMEbus Communications ....................................................................................................................................257
Setting up The Base Address for PMAC VME ..................................................................................................257
Address Modifier ..............................................................................................................................................258
Address Modifier Do Not Care Bits..................................................................................................................259
PMAC Base Address Bits..................................................................................................................................259
Interrupt Level ..................................................................................................................................................259
Interrupt Vector Number ..................................................................................................................................259
Dual-Ported RAM Base Address ......................................................................................................................259
DPRAM Enable ................................................................................................................................................260
Address Bus Width............................................................................................................................................260
Saving These Setup Values ...............................................................................................................................260
Setting up VME Dual-Ported RAM (Option 2V)..................................................................................................261
Starting Address................................................................................................................................................261
Talking to PMAC VME through the Mailbox Registers....................................................................................262
Sending Commands to PMAC VME through Mailbox Registers......................................................................263
Reading Data from PMAC VME through Mailbox Registers...........................................................................264
Table of Contents xi
PMAC User Manual
Example ............................................................................................................................................................266
Dual-Ported RAM Communications.....................................................................................................................267
Uses of DPRAM................................................................................................................................................267
Using Multiple PMAC VME Cards on the VME bus........................................................................................268
Data Integrity Checks .......................................................................................................................................270
Data Gathering.................................................................................................................................................272
Real-Time Data Gathering through Dual-Ported RAM....................................................................................273
xii Table of Contents
PMAC User Manual
Table of Figures
Figure 1 PMAC Motion Controller Custom Gate Array IC ........................................................................................41
Figure 2 PMAC Encoder Input Circuitry ....................................................................................................................42
Figure 3 Encoder Digital Delay Filter .........................................................................................................................44
Figure 4 Using the PMAC Control Panel Analog (Wiper) Input.................................................................................52
Figure 5 Address I-Variables.......................................................................................................................................55
Figure 6 PMAC Pulse and Direction Output ...............................................................................................................55
Figure 7 PMAC 1/T Extension....................................................................................................................................57
Figure 8 Interpolated Encoder Feedback.....................................................................................................................59
Figure 9 Encoder Conversion Table Process...............................................................................................................65
Figure 10 Configure Encoder Conversion Table Editing Screen.................................................................................66
Figure 11 Conversion Table Example for Time-Base Entry .......................................................................................74
Figure 12 PMAC Position Processing .........................................................................................................................79
Figure 14 Two Dimensional Compensation Table......................................................................................................82
Figure 15 PMAC Commutation...................................................................................................................................88
Figure 16 Hall Effect Waveform Diagram ..................................................................................................................94
Figure 17 PMAC/PMAC2 Direct Microstepping System ...........................................................................................99
Figure 18 PMAC PID and NOTCH Servo Filter.......................................................................................................107
Figure 19 PMAC PID Servo Loop Modifiers............................................................................................................107
Figure 20 Extended Control Alogorithm Block Diagram..........................................................................................111
Figure 21 Motor x Motion Variables.........................................................................................................................127
Figure 22 Homing Search Move Trajectory..............................................................................................................128
Figure 23 PMAC Coordinate Definition ...................................................................................................................140
Figure 24 PMAC Multitasking Example...................................................................................................................146
Figure 25 PMAC Memory Mapping .........................................................................................................................149
Figure 26 Coordinate System Variables ....................................................................................................................167
Figure 27 Automatic S Curve Acceleration...............................................................................................................168
Figure 28 Linear Mode Trajectories (Sheet 1 of 4) ...................................................................................................170
Figure 29 Linear Mode Trajectories (Sheet 2 of 4) ..................................................................................................171
Figure 30 Linear Mode Trajectories (Sheet 3 of 4) ...................................................................................................172
Figure 31 Linear Mode Trajectories (Sheet 4 of 4) ...................................................................................................173
Figure 32 PMAC Circular Interpolation....................................................................................................................178
Figure 33 PVT Mode Contouring (Hermite Spline)..................................................................................................180
Figure 34 PVT Segment Shapes................................................................................................................................181
Figure 35 Splined Moves (All Segments at Same Time)...........................................................................................181
Figure 36 Cubic Spline Trajectories..........................................................................................................................182
Figure 37 PMAC Transition Point Moves (PVT Mode, Parabolic Velocity)............................................................182
Figure 38 Compensation – Inside Corner..................................................................................................................185
Figure 39 Compensation Outside Corner ..................................................................................................................186
Figure 40 Inside Corner Cutter Compensation..........................................................................................................187
Figure 41 Outside Corner Cutter Compensation Sharp Angle ..................................................................................188
Figure 42 Outside Corner Cutter Compensation – Shallow Angle............................................................................188
Figure 43 Reversal in Cutter Compensation..............................................................................................................189
Figure 44 Failure When Compensation Extends Full Circle .....................................................................................190
Figure 45 Cutter Compensation Change of Direction ...............................................................................................191
Figure 46 Cutter Compensation Change of Direction – No Intersection...................................................................191
Figure 47 Removing Compensation – Inside Corner ................................................................................................192
Figure 48 Removing Compensation – Outside Corner..............................................................................................193
Figure 49 Failures in Cutter Compensation...............................................................................................................194
Figure 50 PMAC Motion Program Recalculation .....................................................................................................214
Figure 51 PMAC Motion Program Recalculation .....................................................................................................219
Figure 52 Position Following Parameters..................................................................................................................220
Figure 53 PMAC PC/VME Custom Gate Array (DSPGATE) Encoder Functions ...................................................231
Table of Contents xiii
PMAC User Manual
Figure 54 PMAC PC/PMAC Lite Interrupt Structure ...............................................................................................253
Figure 55 PMAC STD Interrupt Structure ................................................................................................................254
Figure 56 PMAC VME Communications Flow Diagram .........................................................................................269
Figure 57 Dual-ported RAM Data Gathering Format................................................................................................274
xiv Table of Contents
PMAC User Manual
Table of Contents xv
PMAC User Manual
INTRODUCTION
The Delta Tau Data Systems, Inc. Programmable Multi-Axis Controller (PMAC) is a family of high­performance servo motion controllers capable of commanding up to eight axes of motion simultaneously with a high level of sophistication. Through the power of a Digital Signal Processor (DSP), PMAC offers a price-performance ratio for multi-axis control that was not previously available. Motorola’s DSP56001 is the CPU for PMAC, and it handles all the calculations for all eight axes.
There are four hardware versions of PMAC: the PMAC PC, the PMAC Lite, the PMAC VME, and the PMAC STD. These cards differ from each other in their form factor, the nature of the bus interface, and in the availability of certain I/O ports. All versions of the card have identical on-board firmware, so PMAC programs written for one version will run on any other version. The PMAC STD has a different memory mapping of some I/O.
Any version of PMAC may run as a standalone controller, or it may be commanded by a host computer, either over a serial port or over a bus port.

Flexibility

As a general purpose controller, PMAC can serve in a wide variety of applications, from those requiring sub-micro inch precision to those needing hundreds of kilowatts or horsepower. Its diverse uses include robotics, machine tools, paper and lumber processing, assembly lines, food processing, printing, packaging, material handling, camera control, automatic welding, silicon wafer processing, laser cutting, and many others.

Configuration for a Task

PMAC is configured for a particular application by choice of the hardware set (through options and accessories), configuration of parameters, and the writing of motion and PLC programs. Each PMAC possesses firmware capable of controlling eight axes. The eight axes can be associated all together for completely coordinated motion; each axis can be put in its own coordinate system for eight completely independent operations; any intermediate arrangement of axes into coordinate systems is also possible.
The PMAC CPU communicates with the axes through specially designed custom gate array ICs, referred to as DSPGATES. Each of these ICs can handle four analog output channels, four encoders as input, and four analog-derived inputs from accessory boards. One PMAC can utilize from one to four of these gate array ICs, so specifying the hardware configuration amounts to counting the numbers and types of inputs and outputs. Up to 16 PMAC may be ganged together with complete synchronization, for a total of 128 axes.

PMAC is a Computer

It is important to realize that PMAC is a full computer in its own right, capable of standalone operation with its own stored programs. Furthermore, it is a real-time, multitasking computer that can prioritize tasks and have the higher priority tasks pre-empt those of lower priority (most personal computers are not capable of this). Even when used with a host computer, the communications should be thought of as those from one computer to another, not as computer to peripheral. In these applications, the ability of to run multiple tasks simultaneously, properly prioritized, can take a tremendous burden off the host computer (and its programmer), both in terms of processor time, and of task-switching complexity.
Introduction 1
PMAC User Manual
Manual Layout
This manual provides a quick step-by-step guide for the beginner setting up a typical system, as well as explaining how to use the various features available on PMAC. It is organized by subject (safety, I/O, servos, trajectories, etc.) to allow quick access by the area of concern. The subjects are ordered by the typical sequence of events to go through to set up a system.
The commands are organized in alphabetical order, and the variables, registers, jumpers and connectors are in numerical order. There is extensive cross-referencing between the chapters. Any variable, command, register, jumper, or connector mentioned in chapter 2 is covered in more detail in the appropriate reference chapters.
Reading the chapters, there may be topics or depth of coverage not needed at the time. Simply skip these chapters and proceed to a chapter that is of more immediate use.
This manual assumes the system integrator who is responsible for this installation knows the basics of working in a Microsoft machine tool technology, and the PMAC motion control board. If any questions about a particular aspect of the installation arise, do not attempt the task until a thorough understanding is gained. Feel free to contact Technical Support at any time during installation. Refer to the Technical Support section below for information on contacting our technical support department.
®
Windows environment and has more than a basic understanding of electronics,

Conventions Used in this Manual

The following conventions are used throughout the manual:
<ENTER> <CTRL+F4>
OPEN PROGRAM

Warning

Caution

Note

Text inside arrows is used to represent keyboard keys or key combinations.
Mono-spaced is used for code listings. Information that, if not observed, may cause serious injury or death.
Information that, if not observed, may cause damage to equipment or software. A note concerning special functions or information of special interest.
Safety Summary
The following are general safety precautions not related to any specific procedures and therefore may not appear elsewhere in this publication. These are recommended precautions that personnel must understand and apply during many phases of operation and maintenance.

Keep Away from Live Circuits

Do not replace components or make adjustments inside equipment with power applied. Under certain conditions, dangerous potentials may exist when power has been turned off due to charges retained by capacitors. To avoid casualties, always remove power, discharge, and ground a circuit before touching it.

Live Circuit Contact Procedures

Never attempt to remove a person from a live circuit with bare hands. To do so is to risk sure and sudden death. If a person is connected to a live circuit, the following steps should be taken:
Call for help immediately. De-energize the circuit, if possible. Use a wood or fiberglass hot stick to pull the person free of the circuit. Apply cardiopulmonary resuscitation (CPR) if the person has stopped breathing or is in cardiac arrest. Obtain immediate medical assistance.
2 Introduction
PMAC User Manual

Electrostatic Sensitive Devices

Various circuit card assemblies and electronic components may be classified as Electrostatic Discharge (ESD) sensitive devices. Equipment manufacturers recommend handling all such components in accordance with the procedures described in Appendix A. Failure to do so may void THE warranty.

Magnetic Media

Do not place or store magnetic media (tapes, discs, etc.) within ten feet of any magnetic field.
Related Technical Documentation
Manual Number Manual Title
3A0-602204-363 PMAC and PMAC2 Software Reference 3A0-602191-363 PMAC PC Hardware Reference Manual 3A0-602274-363 PMAC Lite Hardware Reference Manual 3A0-602244-363 PMAC STD Hardware Reference Manual 3A0-602199-363 PMAC VME Hardware Reference Manual 3A0-602812-363 PMAC Mini Hardware Reference Manual
Technical Support
Delta Tau is happy to respond to any questions or concerns regarding PMAC. Contact the Delta Tau Technical Support Staff by the following methods:

By Telephone

For immediate service, contact the Delta Tau Technical Support Staff by telephone Monday through Friday. Our support line hours and telephone numbers are listed below.

By Fax and E-Mail

Fax or E-Mail a request or problem to us overnight and we will deal with it the following business day. Our Fax numbers and E-Mail addresses are listed below. Supply all pertinent equipment set-up information.

Bulletin Board Service (BBS)

In addition, messages can be left on one of the Bulletin Board Services (BBSs). The BBSs are provided for customers, distributors, representatives, and integrators, et al. Download and upload files and read posted bulletins and Delta Tau newsletters. Messages may be left for anyone who is a member/user of the Bulletin Board System(s). A modem and Procomm-Plus or similar communications program is all that is needed to use this service. Many download-upload protocols such as Z-Modem are supported.
Delta Tau Data Systems, Inc. Technical Support
Phone: (818) 717-5656
Fax: (818) 998-7807
Email: support@deltatau.com
Website: http://www.deltatau.com
Delta Tau Europa AG
Rheinweg 4
CH-8200 Schaffhausen
Switzerland PH: 41 (0) 52 625 20 88 FX: 41 (0) 52 625 44 82
Email: dteuropa@deltatau.com
Introduction 3
PMAC User Manual
PMAC Japan
3-6-7, Nihonbashi Ningyocho
Chuo-Ku
Tokyo 103
Japan PH: 011-81-3-3665-6421 FX: 011-81-3-3665-6888
Email: info@pmac-japan.co.jp
Website: www.Pmac-japan.co.jp
4 Introduction
PMAC User Manual
GETTING STARTED WITH PMAC
PMAC is a very flexible controller, suitable for many different types of applications, with different types of hosts, amplifiers, motors, and sensors. As such, the card must be configured for a specific application, using both hardware and software features, in order to run that application properly. (PMAC is shipped from the factory with defaults set in hardware and software setup to be satisfactory for the most common application types.) This section explains this configuration process for the inexperienced user.

Note:

The PMAC Setup (PS) program that is provided on the Executive program diskette walks you through each of these steps in an interactive fashion. Use of that program may enable some to skip this part of the manual.
By following this procedure, those unfamiliar with PMAC should be able to get the card going quickly and reliably. Once more acquainted with the card, these tasks may be performed in a different order and some of the checking steps may be skipped to perform the installation more quickly.
The Getting Started section is a quick introduction to exercise the basic functionality of the card. Each of the areas dealt with in this section is also covered in later chapters in more detail.
Preparing the Card
First, inspect the card for any signs of damage. PMAC was thoroughly tested, burned in, and tested again (including actually running motors), before it left the factory, but there always exists the (remote) possibility of shipping damage. If any visible damage is seen, report this to Delta Tau immediately.

E-Point Jumpers

On the PMAC, there are many jumpers (pairs of metal prongs) called E-points (on the bottom board of the PMAC STD they are called W-points). Some have been shorted together; others have been left open. These jumpers customize the hardware features of the board for a given application. The PMAC was shipped with jumpers configured for the needs of a typical user, so it can be started initially without changing any jumpers. However, we will check a few jumpers here to make sure they are correct before we start.
In the Hardware Reference manual for the specific version of the board is a map of the jumper locations and a detailed description of each jumper’s function. Check the jumpers according to the instructions and refer to the map. For more detailed instructions on changing a setting, refer to the detailed jumper descriptions.

Card Number Jumpers

The PMAC was preset in the factory at card number (software address) 0 by the jumper configuration of E40 - E43 on the PMAC PC, -Lite, and -VME which should all be ON (for the PMAC STD this is controlled by DIP switches SW1-1 to SW1-4 which should all be OFF).
The card number is important for two reasons. First, if several cards are daisy-chained together on the serial interface, it is the software addressing that determines which card should send data and receive commands. Second, card 0 creates its own servo clock signal; all the other cards receive the servo clock signal from the outside as a synchronizing signal. If they do not receive it, they will shut down.
Each set of synchronized PMAC cards must have one, and only one, card 0. For the initial setup with PMAC, it is advised that the card be set at software address 0. If this must be changed, refer to the detailed E-point description.
Getting Started with PMAC 5
PMAC User Manual

Communications Baud Rate Jumpers

The PMAC was shipped configured to be able to communicate either over the bus interface, or over the serial interface at 9600 baud. The communications setting is controlled by jumpers E44-E47 on the PMAC PC, Lite, and VME, and by DIP switches SW1-5 to SW1-8 on the PMAC STD.
If communicating over the bus port for the initial setup of the board, the settings of these jumpers is not important. However, if the initial communications is over the serial port, make sure these jumpers enable the serial port and provide the baud rate desired. (The Setup program and Executive program do have automatic baud rate search algorithms.
As sent from the factory, E44 and E47 should be OFF, while E45 and E46 should be ON (on PMAC STD, SW1-5 and SW1-8 should be ON; SW1-6 and SW1-8 should be OFF). PMAC can receive commands from both the bus and serial ports. (Keep commands on the two ports from overlapping.) PMAC powers up or resets in a mode to respond over the serial interface, but any character received over the bus interface changes the mode so it will respond over the bus interface instead. A <CTRL-Z> character received over the serial port changes PMAC back to responding over the serial port. If the default jumper setting must be changed, refer to the detailed E-point description.

PCbus Address Jumpers

PMAC PC and PMAC Lite are shipped from the factory set to communicate over the PC-bus at I/O address 528 decimal (210 hex). This setting is controlled by jumpers E91-E92 and E66-E71 located on the rightmost of the lower-edge bank of jumpers (for this default address, E91-E92 are ON, E66 is OFF, E67­E70 are ON, and E71 is off). Unless there is a conflict at this address, start using the first card at this address. If the address must be changed, change the jumpers as shown in the detailed E-point descriptions in the Hardware Reference manual.

STDbus Address Jumpers

PMAC STD is shipped from the factory set to communicate over the STD-bus at I/O address 61,584 decimal (F090 hex). This setting is controlled by jumpers W11 to W22 on the bottom circuit board (for this default address, W11-W14 are OFF, W15-W18 are ON, W19 is OFF, W20-W21 are ON, and W22 is OFF). Unless there is a conflict at this address, start using the first card at this address. If the address must be changed, change the jumpers as shown in the detailed E-and W-point descriptions in the Hardware Reference manual.

PMAC VME Interface Setup

The VMEbus interface is set up by writing to PMAC registers through the serial port. If using the PMAC VME, the initial development is done by communicating to the PMAC over the serial port from an IBM­PC or compatible host. Follow the directions for using the serial port. Information for setting up the VME bus interface is provided in the Writing a Host Communications Program section of this manual.

Encoder Jumpers

PMAC can take either non-differential (single-ended A, B, C) or differential inputs (A, A/, B, B/, C, C/) from encoders. As shipped from the factory, the card is set up for non-differential encoders, individually selectable by jumpers E18-E21 (not available on PMAC Lite or PMAC STD) and E24-E27. In this setup with pins 1 and 2 of each E-point connected, the main signal line is pulled up to +5V with a 470 ohm resistor, and the complementary lines are held at +2.5V with 1 kohm pull-up and pull-down resistors, allowing them to be a steady comparison point for the signal lines. If using single-ended encoders, leave the complementary lines (A/, B/, and C/) floating, so PMAC can hold them at 2.5V. Do not ground these inputs.
6 Getting Started with PMAC
PMAC User Manual
If using single-ended encoders, have the jumpers set up for non-differential. If using differential encoders with open-collector drivers on each channel (this is rare), have the jumpers set up for differential (pins 2 and 3 connected, providing an effective 500 ohm pull-up on the complementary line). If using encoders with differential line drivers, the jumpers can be set either way, although it is preferable to have them set for differential to balance the lines.

Note:

If not using a certain encoder input, it is better to leave it jumpered for single-ended input; otherwise it is much more likely to pick up extraneous noise as count information.

Analog Circuit Jumpers

On PMAC, the analog output circuitry can be optically isolated from the digital logic circuitry for noise reduction purposes. PMAC is shipped from the factory with the circuits optically isolated (E85, E87, and E88 OFF). It is recommended that the card be used in this configuration, but it is possible to jumper the bus supply voltage (+/- 12V) over to the analog circuitry by putting these jumpers ON, defeating the optical isolation, but eliminating the need for an separate power source.
Isolated Setup
With the optical isolation in effect, it is necessary to provide separate power supply to the analog output circuitry. On the JMACH connectors, the A+15V analog supply should be brought in on pin 59, the A-15V analog supply on pin 60, and the analog ground (AGND) on pin 58. (Jumper E89 should be ON, and Jumper E90 should connect Pins 1 and 2 to permit this +15V to pull up the limit-switch and other optically isolated inputs, which is required for PMAC to command motion. PMAC is shipped with E89 and E90 in this configuration.) Most amplifiers provide supply outputs for this purpose. Alternatively, an external supply may be used.
Non-Isolated Setup
The +12V and -12V bus supplies may be used to power the analog output circuitry by jumpering them across to the analog side with E85 (+12V), E87 (Analog GND), and E88 (-12V); however, this defeats the isolation and connects the whole computer electrically to the amplifier. This is not recommended and should only be done for low power systems. To power the flags from the bus +12V supply as well, Jumper E90 must be moved to connect Pins 2 and 3, so the +12V can pull up the limit-switch and other optically isolated inputs.

Re-initialization Jumper

If the card powers up or resets with jumper E51 in its default state (OFF for PMAC PC, Lite, and VME; ON for PMAC STD), PMAC will go through its normal reset cycle, utilizing the setup parameters (such as I-variables that were previously saved in EAROM.

Standard and Option 5 PMACs

If a PMAC with the Standard or Option 5 CPU powers up or resets with E51 in the non-default state (ON for PMAC PC, Lite, and VME; OFF for PMAC STD), PMAC will re-initialize as it resets, utilizing the factory default parameters. Usually, this setting will be used only if the card software and parameters are so confused that even basic communications is impossible. For startup, make sure this jumper is in its default state.
Getting Started with PMAC 7
PMAC User Manual

PMAC with Options 4A, 5A, and 5B

If the jumper E51 is ON when a PMAC with the Option CPU executes its reset cycle, PMAC enters a special re-initialization mode that permits the downloading of new firmware. In this mode, the PMAC can communicate over the serial port only at a baud rate of 38,400, regardless of the setting of the baud rate jumpers. Bus communications is also possible on PMAC with bootstrap version 1.01 and newer (most PMAC have one of these versions). To verify the bootstrap version, type the command VER while communicating to PMAC in bootstrap mode.
To bypass the download operation in this mode, send a <CONTROL-R> character to PMAC. This puts PMAC in the normal operational mode with the existing firmware. Factory default values for I-variables, conversion table settings, and bus addresses for DPRAM and VME are copied from the firmware section of flash memory into active memory. The saved values of these values are not used, but they are kept in the user section of flash memory.
For more information on PMAC bootstrap mode and downloading new firmware, refer to the PROM Update Specification sheet included with the PROM.
Connecting PMAC to the Host Computer

Bus Connection

Caution:

With the board plugged into the bus, it will pull +5V power from the bus automatically. In this case, there must be no external +5V supply, or the two supplies will fight each other, possibly causing damage.
With computer power off, plug the PMAC into an open bus slot. The PMAC Lite requires one slot on the bus, the PMAC PC requires 1-1/2 slots (permitting a half-size board in the next slot), the PMAC VME requires two slots (one double slot), and the PMAC STD requires two slots for the 4-channel version, and three slots for the 8-channel version.

Serial Port Connection

For serial communications, use a serial cable to connect the PC’s COM port to the PMAC serial port connector (J4 on PMAC PC, -Lite, and -VME; J1 on PMAC STD’s bottom board). Delta Tau provides cables for this purpose: Acc-3D connects PMAC PC or VME to a DB-25 connector; Acc-3L connects PMAC Lite to a DB-9 connector; and Acc-3S connects PMAC STD to a DB-25 connector. Standard DB­9-to-DB-25 or DB-25-to-DB-9 adapters may be needed for a particular setup.
If using the Acc-26 Serial Communications converter, connect from the PC COM port to Acc-26 with a standard DB-9 or DB-25 cable, and from Acc-26 to PMAC using the cable provided with Acc-26. Since the serial ports on PMAC PC and PMAC VME are RS-422, this accessory can provide the level conversion between RS-232 and RS-422 (communications is possible without this conversion, but at reduced noise margin). Because the conversion is optically isolated, the accessory also helps prevent noise and ground loop problems.

Note:

If the PMAC is not plugged into a bus, it will need an external 5V supply to power its digital circuits. The +5V line from the supply should be connected to pin 1 or 2 of the JMACH connector (usually through the terminal block), and the digital ground to pin 3 or 4.
8 Getting Started with PMAC
PMAC User Manual

Installing the PMAC Executive Program

The initial communications to the card will be done with Delta Tau’s PMAC Executive program (PE) or the accompanying PMAC Setup (PS) program, which are provided on a diskette (Acc-9D or 9W). The diskette contains an Install utility to make this easy. Refer to the Executive Program section in the Pewin User’s Manual, 3A0-0PEWIN-363, for details.

Establishing Host Communications

Either the Executive or Setup program can be used to establish initial communications with the card. Both programs have menus that tell the PC where to expect to find the PMAC and how to communicate with it at that location. If it is told to look for PMAC on the bus, also tell it the PMAC base address on the bus (this was set up with jumpers on PMAC). If it is told to look for PMAC on a COM port, tell it that the baud rate (this was set up with jumpers or switches on the PMAC). The Executive program (Acc-9W) does have an automatic baud rate search to find out how the card is set up.
Instructions for setting up the communications are given in detail in the PMAC Executive for Windows User’s manual, 3A0-0PEWIN-363, p1 Setup Manual, 3A0-1SETUP-363, and P2 Setup Manual, 3A0­2SETUP-363. Refer to those manuals for more explanation.
Once the program has been told where and how to communicate with PMAC, it will attempt to find PMAC at that address by sending a query command and waiting for the response. If it gets the expected type of response, it will report that it has found PMAC.
If it does not get the expected type of response after several attempts, it will report that it has not found PMAC.

Terminal Mode Communications

Once the program reports that it has found PMAC, and a key has been pressed to escape the Found/Not­Found window, the program should be in terminal emulation mode, so that the PC is acting as a dumb terminal to PMAC. Check to see if a response is received by typing I10<CR> (<CR> means carriage return, the Enter or Return key). PMAC should respond with a six or seven digit number. Now type
III<CR>. PMAC should respond with a beep, signifying an unrecognized command and the error-code ERR003 if the I-variable I6 is set to its default value of three. For more information on the error-codes,
refer to the explanation of I-Variable I6 in PMAC and PMAC2 Software Reference Manual.
Next, if satisfied that communications with the card is at a basic level, type a P <CR> (case does not matter). This command requests a position. PMAC should respond with a number, probably a 0. Now type a <CONTROL-F. Eight numbers (one for each axis) should appear since <CONTROL-F> requests following error from all eight motors; some or all may be 0.

Note:

Even with encoder counts as read-out (no scaling) PMAC position is displayed with fractional counts.
Connecting PMAC to the System
Once the basic operation of the card and the host communications have been established, it is time to connect PMAC to the amplifier, motor, and feedback device.
Of course, most PMAC systems will have more than one motor attached. The process described here can be repeated for multiple motors. As our example here, we will discuss the setup of motor #1. The procedure is parallel for any other motors.
Getting Started with PMAC 9
PMAC User Manual
There are many combinations of amplifier types, motor types and feedback device types that can be connected to PMAC, each requiring a somewhat different procedure. The easiest connection is that of a DC motor and amplifier with an incremental encoder. That is what is described first here. Other options will be discussed later, or in other sections.
Typically, connections are made to a terminal block that is attached to the JMACH connector by a flat cable (Acc- 8D or 8P). The pinout numbers on the terminal block are the same as those on the JMACH connector for PMAC PC. Make sure PMAC is un-powered while the connections are being made. Leave any loads disconnected from the motor at this point.

Machine Connectors

The primary machine interface connector is JMACH1 (J8 on PMAC PC, J11 on PMAC Lite, P2 on PMAC VME, J4 on PMAC STD top board). It contains the pins for four channels of machine I/O: analog outputs, incremental encoder inputs, and associated input and output flags, plus power-supply connections. These four channels can be used for two to four motors, depending on the configuration. Our example will use this connector.
The next machine interface connector is JMACH2 (J7 on PMAC PC, P2A on PMAC VME, J4 on the middle board of an 8-channel PMAC STD, not available on a PMAC Lite). It is essentially identical to the JMACH1 connector for two to four more axes. It is present only if the PMAC card has been fully populated to handle eight axes (Option 1), because it interfaces the optional extra components.

Note:

While the numbering scheme for the pins on machine connectors on PMAC VME is different from that for PMAC PC, the physical arrangement is the same, and PMAC VME can use the same terminal numbers on the terminal block board.

Connecting the Analog Power Supply

The analog output circuitry on PMAC is optically isolated from the digital computation circuitry, and so requires a separate power supply. This is brought in on the JMACH connector. The positive supply (+12 to +15 volts) should be brought in on the A+15V line on pin 59. The negative supply (-12 to -15V) should be brought in on the A-15V line on pin 60. The analog common should be brought in on the AGND line on pin 58.
Typically, this supply can come from the servo amplifier. Many commercial amplifiers provide such a supply. If this is not the case, an external supply may be used. Even with an external supply, the AGND line should be tied to the amplifier common.
As mentioned before, it is possible to get the power for the analog circuits from the bus, but doing so defeats optical isolation. In this case, no new connections need to be made. However, be sure jumpers E85, E87, E88, E89, and E90 are set up for this circumstance as explained previously in the Preparing the Card section. (The card is not shipped from the factory in this configuration.)

Incremental Encoder Connection

Each JMACH connector provides two +5V outputs and two logic grounds for powering encoders and other devices. The +5V outputs are on pins 1 and 2; the grounds are on pins 3 and 4. The encoder signal pins are grouped by number: all those numbered 1 (CHA1, CHA1/, CHB1, CHC1, etc.) belong to encoder #1. The encoder number does not have to match the motor number, but usually does. If the PMAC is not plugged into a bus and drawing its +5V and GND from the bus, use these pins to bring in +5V and GND from the power supply.
10 Getting Started with PMAC
PMAC User Manual
Connect the A and B (quadrature) encoder channels to the appropriate terminal block pins. For encoder 1, the CHA1 is pin 25, CHB1 is pin 21. If using a single-ended signal, leave the complementary signal pins floating. Do not ground them. For a differential encoder, connect the complementary signal lines (CHA1/ is pin 27, and CHB1/ is pin 23). The third channel (index pulse) is optional; for encoder 1, CHC1 is pin 17, and CHC1/ is pin 19.

Amplifier Connection

If PMAC is not performing the commutation for the motor, only one analog output channel is required to command the motor. This output channel can be either single-ended or differential, depending on what the amplifier is expecting.
Single-Ended Command Signal
For a single-ended command using PMAC channel 1, connect DAC1 (pin 43) to the command input on the amplifier. Connect the amplifier’s command signal return line to PMAC AGND line (pin 58). In this setup, leave the DAC1/ pin floating. Do not ground it.
Differential Command Signal
For a differential command using PMAC channel 1, connect DAC1 (pin 43) to the plus-command input on the amplifier. Connect DAC1/ (pin 45) to the minus-command input on the amplifier. PMAC AGND should still be connected to the amplifier common.
Sign and Magnitude Command Signal
If the amplifier is expecting separate sign and magnitude signals, connect DAC1 (pin 43) to the magnitude input. Connect AENA1/DIR1 (pin 47) to the sign (direction input). Amplifier signal returns should be connected to AGND (pin 58). This format requires some parameter changes on PMAC; refer to variable Ix02 and Ix25 below. Jumper E17 controls the polarity of the direction output; this may have to be changed during the polarity test.
Motor Commutated by PMAC
If using PMAC to commutate the motor, use two analog output channels for the motor. Each output may be single-ended or differential, just as for the DC motor. The two channels must be consecutively numbered, with the lower-numbered channel having an odd number (e.g., use DAC1 and DAC2 for a motor, or DAC3 and DAC4, but not DAC2 and DAC3, or DAC2 and DAC4).
For motor #1 example, connect DAC1 (pin 43) and DAC2 (pin 45) to the analog inputs of the amplifier. Do not worry about the phasing polarity yet; it will be checked later. If using the complements as well, connect DAC1/ (pin 45) and DAC2/ (pin 46) the minus-command inputs; otherwise leave the complementary signal outputs floating. To limit the range of each signal to +/- 5V, do so with parameter I169, as discussed below.

Auxiliary Connections

There are several other lines for each motor that are important. These are:
Limit Signals (+LIMn and -LIMn)
PMAC has two inputs for each motor intended for the hardware overtravel limit switches. These lines must actively be held low (to draw current through the LED in the optoisolator) in order for the motor to able to move. This requires the use of normally closed (or normally conducting, if solid state) limit switches. These inputs are direction sensitive; they only stop movement in one direction.
To implement limit switches, wire the -LIM1 input (pin 53) to one side (positive-voltage end if there is a polarity) of the limit switch expected to be on the positive end of travel; wire the +LIM1 input (pin 51) to the equivalent side of the limit switch expected to be on the negative end of travel. Wire the other side of the limit switches (negative-voltage end if there is a polarity) to PMAC AGND (pin 58), unless keeping the flags on the digital circuit side, isolated from the analog circuitry, in which case, wire the other side to PMAC GND line (pins 3 and 4).
Getting Started with PMAC 11
PMAC User Manual
If not using limit switches (e.g., for a rotary axis, or for a preliminary test set-up), either tie the limits (pins 51 and 53) to analog ground (pin 58), or disable the limit function in software (refer to variable Ix25, below).

Note:

The direction polarity of the limit pins is the opposite of what many would consider intuitive. That is, the limit switch at the positive end of travel should be wired into the -LIM input, and the limit switch at the negative end of travel should be wired into the +LIM input. If the direction input of the encoder is ever changed, the wiring of the limit switches must be changed as well. It is important to check and re-check the direction sense of the limit inputs.
Amplifier Enable Signal (AENAx/DIRn)
Most amplifiers have an enable/disable input that permits complete shutdown of the amplifier regardless of the voltage of the command signal. PMAC AENA line is meant for this purpose. If not using a direction and magnitude amplifier or voltage-to-frequency converter, use this pin to enable and disable the amplifier (wired to the enable line). AENA1/DIR1 is pin 47. This signal is an open-collector output and requires a pull up resistor to A+15V. For early tests, this amplifier signal may be under manual control. The polarity of the signal is controlled by jumper(s) E17. The default is low-true (conducting) enable.
Home Flag Signal (HMFLn)
A home switch can be wired between this pin (HMFL1 is pin 55) and analog ground (AGND), or if powered from the bus, to digital ground (GND). The switch may be normally open or normally closed; open is high (1), and closed is low (0). The polarity of the edge that causes the home position capture is programmable with Encoder I-Variables 2 and 3 (I902 and I903 for HMFL1).
Amplifier fault signal (FAULTn)
This input can take a signal from the amplifier so PMAC knows when the amplifier is having problems, and can shut down action. The polarity is programmable with I-variable Ix25 (I125 for motor #1) and the return signal is analog ground (AGND). FAULT1 is pin 49. With the default setup, this signal must be actively pulled low for a fault condition. In this setup, if nothing is wired into this input, PMAC will consider the motor not to be in a fault condition.
Software Setup for a Motor
PMAC has a large set of Initialization parameters (I-variables) that determine the personality of the card for a specific application. Many of these are used to configure a motor properly. Once set up, these variables may be stored in non-volatile EAROM memory (using the SAVE command) so the card is always configured properly (PMAC loads the EAROM I-variable values into RAM on power-up).
Run the PMAC Executive Program on the PC. The value of an I- variable may be queried simply by typing in the name of the I- variable. For instance, typing I900 <CR> causes the value of the I900 to be returned. The value may be changed by typing in the name, an equals sign, and the new value (e.g. I900=3<CR>).

Note:

Remember that if any I-variables are changed during this setup, use the SAVE command before powering down or resetting the card, or the changes that were made will be lost.
Alternatively, use the I-variable pages (under the Configuration menu) to view and change these variables in a more user-friendly fashion.
12 Getting Started with PMAC
PMAC User Manual

Encoder I-Variables

Several I-variables are linked to particular encoder inputs, regardless of which motor the encoder is assigned to. These control how the encoder signal is interpreted. They are numbered in the 900s: I900­I904 belong to Encoder 1, I905-I909 belong to Encoder 2, and so on, to I975-I979 belonging to Encoder
16. Initially we will only concern ourselves with the first encoder I-variable.
I900, I905, I910, Etc.
These control the decoding of the encoder signal into counts. Quadrature x1, x2, and x4, plus pulse and direction decode, are all possible. PMAC is shipped with counterclockwise x4 decode set up (I900, I905, ... = 7). Check this value for Encoder 1 (I900), and change it to 7, if it is different.
I901, I906, I911, etc.
Encoder digital filter disable – This controls whether the digital delay filter for noise spike elimination is turned on. PMAC is shipped with the filters on (I901, I906, ... = 0).
I902, I907, I912, etc.
Encoder position capture control – This controls which transitions of those associated encoder signals trigger a position capture for that encoder. This must be used for homing moves. It can also be used for other purposes. It specifies an edge of the encoder third channel, the edge of one of the encoder flags, or the edge of a logically combined signal from both. If it uses a flag, also set the next variable. The default value for this variable is 1 specifying the rising edge of the third channel.
I903, I908, I913, etc.
Encoder flag select controlThis controls which of the encoder flags is used to trigger a position capture if the previous I-variable has specified that a flag be to be used. Usually, this is set to 0 to specify the home flag (HMFLn).

Motor I-Variables

PMAC can be attached to up to eight motors, called 1 to 8. A motor is defined in PMAC by setting up I­variables that tell the I/O addresses of the input and output data (where to look for the feedback position, and where to send the output command).
The I-variables for motor 1 are in the 100s (I100-I184); for motor 2 in the 200s, and so on, to the 800s for motor 8. As a shorthand to refer to a particular variable independent of a particular motor, the hundreds digit is replaced with the letter x. For instance, Ix20 refers to I120 for motor 1, or I220 for motor 2, and so on.
In this example, set up motor 1. In preparation, disable motor 1 by cutting power to the amplifier.

Motor Activation

The first thing to do in the software setup of a motor is to activate the software algorithms for the motor by setting Ix00 to 1. For Motor #1, set I100 to 1.

For PMAC-Commutated Motors Only

If using PMAC to commutate this motor, set up the commutation algorithm I-variables at this point. First, set I101 to 1 to tell PMAC that motor 1 is to be commutated by PMAC.
Analog Outputs
Tell PMAC which pair of analog outputs are being used to command the amplifier. Do this by setting Ix02 to the lower address of the pair of outputs that have been wired to the amplifier. To tell motor 1 to use DAC1 and DAC2 in the example, set I102 to $C002 (49154).
Getting Started with PMAC 13
PMAC User Manual
Commutation Encoder
The encoder register used for commutation feedback must be specified with Ix83. The default value of Ix83 specifies Encoder 2x-1; e.g. ENC1 for Motor 1, ENC3 for Motor 2, and ENC15 for Motor 8. The actual value of Ix83 is the address of the phase position register for that encoder. For ENC1 (Motor 1), this value is 49153 ($C001). If setting up a PMAC-commutated Motor 1 using ENC1, make sure I183 is set equal to 49153 ($C001).
Counts per Commutation Cycle
Next, determine the number of encoder counts per commutation cycle (per pole pair). I900 defines an encoder count here (1, 2, or 4 counts per line). For instance, if using a 2500 line per revolution encoder with x4 decode and a 4-pole motor, the calculation would be: (2500 lines/rev) * (4 counts/line) / (2 pole­pairs/rev) = 5000 counts/pole-pair.
If this value is an integer, set I170 to 1, and set I171 to the value. If the value is not an integer (for example, a 6-pole motor and a 1024-line encoder), figure out the integer multiplier required to make it an integer (usually 3). In this case, set I170 to the multiplier, and I171 to the multiplied integer value.
Angle Between Phases
If it is a 3-phase motor, set I172 to 85. This tells PMAC that the two phases are 85/256 (1/3) cycle apart. This may be changed later to 171 if the polarity of the signals are wrong. If it is a 4-phase motor, set I172 to 64 (64/256 = 1/4); the may be changed later to 192.
Phase Search Parameters
Now, if using a brushless DC (synchronous AC) motor, establish the parameters for the power-up phase­finding search. Initially, set I173 (the magnitude of the phase-finding output) to 8192 which is one-quarter of full output. Next, set I174 (the time for each half of the phase-finding routine) to five servo cycles. These can be optimized later. Now make sure the induction motor parameters I177 and I178 are set to 0, so PMAC will not think this is an induction motor.
Slip Gain and Magnetization Current
If using an AC induction motor, do not worry about power-up phase finding. Set I173 and I174 to 0. Also, set I177 (magnetization current) and I178 (slip gain). Initially, set I177 to 3200 (1/10 full current) and I178 to 2500 (for a low-slip motor) or 5000 (for a high-slip motor). These can be optimized later. The fact that I178 is greater than zero prevents a phasing search, so I173 and I174 are irrelevant.

For Motors Not Commutated By PMAC

If PMAC is not performing the commutation for the motor, set Ix01 to 0 so that the commutation routines are disabled and only one analog output is used. In the example using motor 1, set I101 to 0. This is the default.
DAC Output Address
If not commutating from PMAC, Ix02 must be set to the register address of the single analog output used to command the amplifier. Define the output register address for motor #1 using I102. In order to send the motor 1 output command to the DAC1 pin connected, set I102 address $C003 (49155 decimal). This is the default value. If the amplifier is expecting sign and magnitude input, set I102 to $1C003 instead.

For All Types of Motors

Regardless of whether PMAC is commutating the motor or not, several variable values must be established to tell PMAC where to get its servo loop information.
Position-Loop (Load) Feedback Address
Variable Ix03 defines the register to be used for the position-loop servo feedback. Typically, this reads a processed encoder value from what is known as the encoder conversion table. To have motor 1 read the processed input from Encoder 1, I103 must be set to 1824 ($720). This should be the value preset at the factory.
14 Getting Started with PMAC
PMAC User Manual
Velocity-Loop (Motor) Feedback Address
It is possible to have separate motor and load feedback encoders (this can allow good control even with poor coupling). In this case, the sensor on the load is used to close the position loop; it is addressed by Ix03 above. The sensor on the motor is used to close the velocity loop; it is addressed by Ix04. The vast majority uses only one feedback encoder, whether it is on the motor, or on the load. For these, Ix04 will be set to the same value as Ix03, addressing the same encoder. If only using one feedback encoder (ENC1) for the Motor #1 in the example, make sure I104 is set to 1824, just as I103 is (this is the default).
Flag Address
Now, make sure the card knows where to look for its limit and home flag inputs, which is controlled by I125 (remember that this is essential to command a move). To use +LIM1, -LIM1, and HMFL1, I125 should be set to ($C000) 49152. This should be the value set at the factory. If not using overtravel limit switches and the limit pins have not been wired to ground, set I125 to $2C000 instead.
If the amplifier is expecting sign (direction) and magnitude command, disable the use of AENAn/DIRn as an amplifier-enable line so it can be used for direction. For motor 1, set I125 to $1C000. If the limits should be disabled, set I125 to $3C000.
Reading Position
Now start checking on some basic motor functions. First, try to read motor position. With the Executive program in terminal mode, type #1<CR> to address motor 1. Next, type P<CR>, and PMAC should return a position value to the terminal screen. Now turn the motor shaft by hand and type P<CR> again. The reported position should have changed. (Alternately, use the F7 position reporting window of the PMAC Executive program, which automatically polls position repeatedly.)
Repeat this as often as needed to verify that the position counting is working properly in both directions. If it is not, check the following:
Is the encoder receiving power (+5V and GND)?
Are both quadrature channels connected properly?
If single-ended, are the complementary lines floating?
If single-ended, is E27 (or equiv.) in default setting?
If differential, has E27 been changed?
Is the motor activated (I100=1)?
Is I103 set to the proper encoder input?
Is I900 set for proper decode of the signal?
Can a signal be detected with a scope or voltmeter?
Changing Position Direction
If getting position feedback, but want to change the positive and negative directions, use I900 (for ENC 1) to change the direction sense (or exchange the Channel A and Channel B inputs). For example, if I900 is 7, changing it to 3 will change the direction sense.
Setting DAC Output Range
Check the output range by looking at I169. This is the maximum value that can be written to the DAC, whose full range is -32,768 to +32,767 (16 bits for +/- 10V). The default value of I169 is 20,480, which is about +/-6.25V. If the amplifier is expecting +/-10V and the full range is being used, set I169 to 32,767. If the amplifier is expecting a differential signal with up to +/- 10V between the lines (each line is +/-5V), set I169 to 16,384 or less.
Getting Started with PMAC 15
PMAC User Manual

Testing the Output and Polarity

Next, check the outputs and whether the output polarity matches the feedback polarity. To do this, provide power to the amplifier. First, have PMAC disable its own outputs for the motor by typing K<CR> (kill). Make sure that the motor has no load at this point so that uncontrolled motion cannot damage anything. Now provide power to the amplifier.
PMAC-Commutated Motors
If PMAC is commutating this motor, get the polarity of the commutation feedback and the phased commutation outputs to match. If the feedback polarity direction has been set to get it to count up when moving in the proper direction, test whether the phasing polarity of the outputs as set by I172 is correct. (There is a 50% chance of having this correct.)
Permanent-Magnet Brushless Motors
If using a permanent-magnet brushless motor, check the polarity match by a technique that drives the motor like a stepper motor. First, type O0<CR> (open-loop output of zero magnitude). Then type I129=2000<CR>, which puts an offset on one of the phases, forcing current through it. Note the position of the motor in this state. Next type I179=2000<CR>, which puts the same offset in the next phase. Note the position again, and determine whether it counted up or counted down since the first check.
If the position counted down, I172 should be set to 85 for a 3-phase motor, or 64 for a 4-phase motor. If the position counted up, I172 should be set to 171 for a 3-phase motor or 192 for a 4-phase motor. Before continuing, make sure to set the offset parameters I129 and I179 back to 0.
Induction Motors
If this motor is an induction motor, check the polarity by trying to run the motor with both polarities (settings of I172), and seeing which produces satisfactory results. Type $<CR> to initiate the phasing of the motor. Now type O10<CR> (open-loop output 10%) and see if the motor spins well (even if it does not accelerate quickly). The position should be counting up. Next, kill the output temporarily with K<CR> and change the output polarity by giving I172 a new value (e.g. if it was 85, change it to 171). Now type O10<CR> again and observe the response. Kill the motor again and set I172 to the value that gave decent response. If there is no movement with either setting, check the troubleshooting guide immediately above.

Non-PMAC Commutated Motors

If PMAC is not doing the commutation for a motor, make sure that the servo feedback and output polarities match. Do this by giving the motor an open-loop output command and seeing which way the position counts. Type O10<CR> (open-loop output 10%). The position counter should count up. If it counts down, there is a polarity mismatch. Now type O-10<CR>. The position counter should count down. If it counts up, there is a polarity mismatch. If the counter does not count in opposite directions for the two tests, there is an encoder and/or amplifier problem.
If there is a polarity mismatch, there will be a potentially dangerous runaway condition when trying to close the loop. To fix this, change I900 (e.g. from 7 to 3, or 3 to 7) to reverse the counting sense. This will change the positive direction of the axis. Alternatively, exchange the motor leads instead.
If there is no movement, check the voltage on the output pin. It should be approximately 1V relative to AGND. If it has not changed, recheck I102, the analog power supply, and the limit-input configuration. If the voltage has changed but there is still no movement, recheck the amplifier and motor connections.

Overtravel Limit Polarity

Make sure as the direction sense of the motor is verified the hardware position limit switches are wired into the proper inputs. That is, the limit switch on the positive (counting up) end of travel must be wired into the -LIMn input, and the switch on the negative end must be wired into the +LIMn input. If these are reversed, the hardware limit functions will not work.
16 Getting Started with PMAC
PMAC User Manual

Setting up the Servo Loop

Warning:

Make sure the motor is in open-loop mode before restoring the proportional gain. Otherwise, it may lurch to an old commanded position.
This is enough to see if the motor is working. Make sure the motor can run free (preferably no plant attached at this point) and that things can be stopped quickly so that no damage can be caused. Type K<CR> to disable the output(s), then restore the proportional gain by setting I130 (try 2000 initially for very fine resolution systems, 50,000 for very coarse systems, or somewhere in between for medium resolution).

Closing the Loop

Now close the motor’s servo loop by typing J<CR> (the jog-stop command, which brings the motor into zero-velocity position control). It should hold position at this point, resisting attempts to move it away, at least gently. If it runs away, there is a mismatched polarity; re-run the above polarity tests. If there is loss of control or the motor starts behaving wildly, type K<CR> to disable the motor.
Weak Loop
If it does not resist being turned, or does so very weakly, try increasing proportional gain (I130). Try doubling it until there is some reasonable stiffness, but do not try yet to get the maximum possible stiffness. The tests described below will help do that.
Oscillations
If the motor has a tendency to oscillate at low to moderate frequency, there is inadequate derivative gain. Try doubling I131 and see if the oscillation goes away.
Buzzing
If the motor has a tendency to oscillate at high frequency (a "buzz"), there is too much proportional gain, or maybe too much derivative gain. Try lowering I130 (or I131) until the buzz disappears.
Extensive Servo Loop Tuning
The PMAC Executive Program for PC-compatibles has a large section devoted to assisting the user in optimizing the servo loop parameters for a motor. It allows performance of step moves and profiled moves and the response is plotted to the screen with key statistics calculated, so that easy choices may be made about changing gains. This process is documented in detail with examples in the manual for the PMAC Executive Program.
In addition, there is an auto-tuning feature that lets the Executive program make the decisions about what the gains should be. The program excites the system, evaluates the response, and calculates the gains necessary to achieve the desired response. Remember that precise tuning cannot be done until the load has been connected to the motor. Our goal at this point is simply to get the motor moving reasonably well without a load.

Jogging Moves

With these two parameters (I130 and I131) at reasonable levels, good performance in moves should be achieved. Try a jog move first. Before doing the move, set up the jog speed (I122, in counts/msec) acceleration time (I120, in milliseconds), and S-curve time (I121, in msec) to desired values (to be safe, use low speed and high acceleration times at first). Now type J<CR> — the motor should turn in the positive direction.
Getting Started with PMAC 17
PMAC User Manual
Type J<CR> and the motor should stop. If it takes a while to stop, either slow down the move next time or increase I130 to reduce the error. J-<CR> should cause the motor to turn in the negative direction, and J<CR> should stop it again. J=<CR> should cause the motor to jog to the last pre-jog position and stop there automatically.
Optimizing Jog Performance
If your jog speed seems slower than desired, one or more of PMAC automatic safety limit parameters may have been used, particularly if there is a fine-resolution system. The first of these is I119, which is the
maximum permitted motor jog acceleration, expressed in counts/msec most systems. Increase it several orders of magnitude for now to get it out of the way.
2
. The default value is quite low for
Velocity Feedforward Gain
When jogging at constant speed, monitor following error and increase velocity feedforward gain (I132) to minimize the following error. If there is a current-loop amplifier, set I132 equal to I131 or just slightly greater.
Integral Gain
To eliminate steady-state error, bring in some integral gain. Set I133 to 10,000. This should provide weak integral action, but enough to eliminate steady-state error over a few seconds. Now try increasing I133 some more to get quicker action. It should be safe to raise it in increments of 10,000 to get the performance needed (quick restoration of commanded position without introducing oscillation). If there is oscillation, reduce the integral gain until the oscillation is eliminated.
If there is no effect from adding integral gain, check the integration limit parameter I163. If this is low (100,000 or less), it will limit what integral gain can do. If this is the problem, set this parameter to its default value by typing I163=*<CR>.

Power-Up Mode

For future power-up/reset cycles, set I180 so power up is done in the mode wanted. If I180 is zero, Motor #1 will power up "killed" (0V output, AENA signal false). It will not attempt to control until a servo command is given (usually J, A, or <CTRL-A) for a non-PMAC-commutated motor, or a $ command for a PMAC-commutated motor. This I-variable must be stored in non-volatile memory (with the SAVE command) to be effective at the next power-up/reset cycle.

Homing Search Move

To do a homing search move, first check the position-capture I-variables (I902 and I903 in the example). Make sure they are set up to capture the position where the home position should be. With a bare motor, only use the third channel of the encoder. Set I902 to 1 to force a capture on the rising edge of the third channel.
Next, set the homing speed with I123 (in units of counts/millisecond). Changing the sign of I123 changes the direction of the homing move. Homing accel/decel is controlled by I120 and I121 (which also affect jog moves). Now command a homing move with the HM command, and the motor will move as specified until the proper signal edges is found, then decelerate to a stop and come back to the position of the trigger, plus or minus an offset amount determined by I126.
18 Getting Started with PMAC
PMAC User Manual
Setting up a Coordinate System
In order to run a program on PMAC, first define a coordinate system. These motors execute a program. For this example, set up coordinate system 1.

Defining an Axis

Type &1<CR>. This will address coordinate system 1. (Confirm which coordinate system is addressed by typing &<CR> and PMAC will return the number of the currently addressed coordinate system.) Next, type #1->X<CR> (the arrow between 1 and X is comprised of the minus sign and the greater- than symbol; there should be no space before the arrow). This matches the X axis of coordinate system 1 (&1) to motor
1. As it is here, one unit in X is one encoder count.

Scaling an Axis

To scale the X units, place a scale factor before the X in the definition statement. (i.e., this axis definition statement is what defines the scale of the user position units.) For instance, if using a 500-line encoder on the motor, with 4X decoding (refer to I900), and a 5-pitch (five turns per inch) screw converting to linear motion, yielding 10,000 counts/inch, use the command #1->10000X to define the X axis in inches.

Multiple Axes

Caution:

Every motor in the coordinate system must have its limit inputs held low in order for any program to run in that coordinate system, even if the program does not use that motor.
If another motor is set up, include it in this same coordinate system. For instance #2->10000Y matches the second motor to the Y-axis in this coordinate system at 10,000 counts per user unit. This is about all there is to defining a coordinate system. If a motor is assigned to a coordinate system, make sure that both its limits are held low, either through switches or directly to AGND (nothing else for that motor needs to be connected).
Define the time units to work in (I190 for coordinate system 1). This parameter holds the number of milliseconds in the time units being used. For instance, to specify the velocity in user position units per second (e.g., inches/sec), set I190 to 1000 (this should be the default). To work in minutes (e.g. rpm), set I190 to 60,000.
Writing a Motion Program
With the coordinate system(s) defined, begin to write a program. Open a program buffer for entry by typing OPEN PROG 1<CR>. and CLEAR<CR> to erase anything that might exist in the buffer. Now the program lines entered will be held in program buffer 1. A program to do a simple back-and-forth trapezoidal move will look like this (with comments):
LINEAR ; Linear interpolation mode ABS ; Absolute move mode F2.00 ; 2 inches/sec X10.0 ; move to X = 10 inches X0.0 ; move back to X = 0 inches
If the X-axis is defined with a 1-to-1 scaling {#1->X}, this program would only cause a 10 count move over 5 seconds {and back}, which might not be noticeable.
The acceleration time for the moves is controlled by Ix87, and the S-curve portion of that acceleration time is controlled by Ix88 (for the coordinate system x that is running the program).
Getting Started with PMAC 19
PMAC User Manual
When finished entering the program, type CLOSE <CR> to exit the program buffer. To enter a new program in the place of the one in the buffer, open the buffer, type CLEAR, and enter the new program. An example follows:
OPEN PROG 1 CLEAR ; erase old program F2.36 ; 2.36 in/sec
X5.346 Y0 ; first side of square X5.346 Y5.346 ; second side X0 Y5.346 ; third side
X0 Y0
CLOSE
; fourth side

Using the Program Editor

It is easiest to type programs using the program editor in the PC Executive (terminal) Program. Here the program can be changed at will, and then it can be downloaded to the card by selecting the Download Editor to PMAC menu option, or by hitting <ALT-D> when the editor screen is displayed. Include in each program space the lines to open the buffer, to clear out the old program, and to close the buffer at the end.
Executing a Motion Program

Starting the Program

With a program held in PMAC buffer, it is easy to run. To run program 1, make sure the coordinate system to run the program is addressed (&1 in this case), type B1<CR> (point to beginning of program 1), then type R<CR>. The B command with a number makes the specified program the working (operative) program for the coordinate system. The R command will start execution of the program.

Stopping the Program

There are several ways to stop a running program. Q<CR> (Quit) stops the program at the end of the presently executing move. A<CR> (Abort) causes the motors in the coordinate system to start decelerating immediately. Both of these commands leave the program ready to execute (run or step) the next line in the program. To re-start the program at the beginning, type B<CR> (the B command without a number operates on the current working program). This resets the program counter to the top (completion of a program automatically resets the counter to the top).
Remember that the motor velocity and acceleration limits (Ix16 and Ix17) are in effect for all motors in the coordinate system. If a motor is asked to exceed one of these limits, all motors in the coordinate system are slowed to honor the limit. If the programmed moves seem slower than what as expected, this could be the cause.

Refining the Program

Few times will the program work exactly right the first time. Go through an iterative process of editing, downloading, executing, and evaluating. This is one of the key reasons for using the program editor. The required changes can be made in the editor without re-typing the entire program. Then, the entire revised program can be downloaded to PMAC. This process is why it is a good idea to have the CLEAR command immediately after the OPEN command: it erases the old version in PMAC so the new version can replace it.
There is no reason in this process to upload the program from PMAC. The program editor maintains its copy even after the download, and it keeps comments with it. The only reasons to upload a program are to confirm that it is downloaded properly, and to restore a program that was lost by the host computer.
20 Getting Started with PMAC
PMAC User Manual
Writing and Executing a PLC Program
PLC programs are useful for doing monitoring and calculations in background, asynchronously to any motion programs. They are written much like motion programs, and have much of the same language (although no motion commands). There can be up to 32 PLC programs, which can be enabled and disabled individually. The enabled programs cycle through continually in background, as time allows.
Start by writing a simple PLC program that increments a variable each time through. Using either Terminal mode or (preferably) the Program Editor in the Executive Program, type the following:
CLOSE OPEN PLC 1 CLEAR P1=P1+1 CLOSE
If using the Editor, download what has been written to PMAC by selecting the Download Editor to PMAC menu option, or by typing <ALT-D>.
Now, see if the program got to PMAC properly. From the Terminal mode, type LIST PLC 1<CR>. The following response should appear:
P1=P1+1 RETURN
PMAC adds a RETURN statement {short form: RET} automatically to the end of a program when it gets a CLOSE command. The OPEN, CLOSE, and CLEAR commands are not actually part of the program; they
are on-line commands to control the program buffer operation.

Starting the PLC Program

Now type I5=2<CR>. This permits PLCs 1 to 31 to be enabled. Next, type ENABLE PLC 1. This should actually start operation of the PLC program. The variable P1 should be incrementing steadily. Verify this by repeatedly typing P1<CR>. The reported value should be greater each time. If it is not, recheck the value of I5, the listing of the program, and try re-enabling the PLC.
Other things can be happening in between cycles of the PLC program. Reset the value of P1 by typing P1=0<CR>. PMAC will execute this command, and then PLC 1 will start incrementing the value again from that point.
Motion programs can be run simultaneously. Re-run the motion program and notice that P1 keeps incrementing during the operation of the motion program.

Stopping the PLC Program

To halt operation of the PLC program, type DISABLE PLC 1. Note that repeated queries of P1’s value yield the same answer. ENABLE PLC 1 will re-enable operation of the program.
Each time a PLC program buffer is opened for editing, the program is automatically disabled. Closing the buffer does not automatically re-enable the program. When working on a PLC program with the program editor, follow the CLOSE command with an ENABLE PLC 1 command, so that this command does not need to be re-typed every time the edited PLC program is downloaded to PMAC.
Getting Started with PMAC 21
PMAC User Manual
22 Getting Started with PMAC
PMAC User Manual
PMAC FEATURES
Executing Motion Programs
The most obvious task of PMAC is executing sequences of motions given to it in a motion program. When told to execute a motion program, PMAC works through the program one move at a time, performing all the calculations up to that move command (including non-motion tasks) to prepare for actual execution of the move. PMAC is always working ahead of the actual move in progress, so it can blend properly into the upcoming move, if required. Refer to the Writing Programs for PMAC section of this manual for more details.
Executing PLC Programs
The sequential nature of motion program suits it well for commanding a series of moves and other coordinated actions; however these programs are not good at performing actions that are not directly coordinated with the sequence of motions. For these types of tasks, PMAC provides the capability for users to write PLC programs. These are named after Programmable Logic Controllers because they operate in a similar manner, continually scanning through their operations as fast as processor time allows. These programs are very useful for any task that is asynchronous to the motion sequences. Refer to the Writing Programs for PMAC section of this manual for more details.
Servo Loop Update
In an automatic task that is essentially invisible to the PMAC user, PMAC performs a servo update for each motor at a fixed frequency (usually around 2 kHz). The servo update for a motor consists of incrementing the commanded position (if necessary) according the equations generated by the motion program or other motion command, comparing this to the actual position as read from the feedback sensor, and computing a command output based on the difference. This task occurs automatically without the need for any explicit commands. Refer to the Closing the Servo Loop section of this manual for more details.
Commutation Update
If PMAC is requested to perform the commutation for a multiphase motor, it will perform commutation updates automatically at a fixed frequency (usually around 9 kHz). The commutation, or phasing, update for a motor consists of measuring and/or estimating the rotor magnetic field orientation, then apportioning the command that was calculated by the servo update among the different phases of the motor. This task occurs automatically without the need for any explicit commands. Refer to the Setting up PMAC Commutation section of this manual for more details.
Housekeeping
PMAC regularly and automatically performs housekeeping tasks that make sure the system is in good working order. These tasks include the safety checks, such as following error limits, hardware overtravel limits, software overtravel limits, and amplifier faults. They also include the update of the watchdog timer.
If any problem in hardware or software keeps these tasks from executing, the watchdog timer will trip, and the card will shut down. Refer to the Making Your Application Safe section of this manual for more details.

Communicating With the Host

PMAC can communicate with the host at any time, even in the middle of a sequence of motions. PMAC will accept a command, and take the appropriate action (putting the command in a program buffer for later execution), providing a data response to the host, starting a motor move, etc. If the command is illegal, it will report an error to the host.
PMAC Features 23
PMAC User Manual

Task Priorities

These tasks are ordered in a priority scheme that was optimized to keep applications running efficiently and safely. While the priority levels are fixed, the frequency at which various tasks are performed is under user control. Refer to the Setting up PMAC Commutation and Closing the Servo Loop sections of this manual for more details.
24 PMAC Features
PMAC User Manual
TALKING TO PMAC
Basic Aspects of Communicating with PMAC
This section covers basic aspects of communicating with PMAC from a host computer. At this level, there is a program for the host computer that processes these communications. The PMAC Executive Program (Accessory 9D) is the most common of these programs.
If there will be a host computer in the final application, communications routines must be written for the host computer as part of the front-end software for the application. That is a more advanced topic, and it is covered in the Writing a Host Communications Program section of this manual. This section concentrates on the actual communications.
At a basic level, PMAC can communicate to a host dumb terminal, either over the serial (RS-422) or the parallel (bus) interface. The communications mostly consists of lines of ASCII characters sent back and forth. Of course, most of the time the host will be a computer with considerably more intelligence, but at root it will talk to the card as if it were a terminal. The PMAC Executive PC program has a terminal emulator mode to do this directly.
Communications Ports
Each version of PMAC can communicate either over its serial port or its parallel (bus) port. The main difference between the different hardware versions of PMAC is the type of bus interface: PC, STD, or VME.

Note:

It is important not to command PMAC simultaneously from both ports; the characters can be intermixed and the commands garbled.

Active Response Port

Either the serial port or the bus port is the active response port, where PMAC will send its responses to the commands. PMAC powers up/resets with the serial port as the active response port. However, any command received over the bus port makes the bus port the active response port (this happens immediately in most bus-host applications, so is transparent to the user). Further responses are returned to the bus port.
A subsequent command from the serial port does not automatically make the serial port the active response port again, so it is possible that PMAC will respond to a command over the serial port by sending data to the bus port. This will probably confuse both host computers. To make the serial port the active response port again, you must send a <CTRL-Z character to PMAC.

Caution:

If using a bus-based system with an auxiliary computer over the serial port to do some diagnostic work, such as data gathering or tuning with the PMAC Executive Program, it is important to stop bus communications.

Serial Interface

The hardware configuration for the PMAC serial interface port is slightly different on different versions of PMAC.
Talking to PMAC 25
PMAC User Manual
Hardware Configuration PMAC PC, -VME
PMAC PC and -VME have an RS-422 interface on a 26-pin IDC connector (J4). This port connects directly to a standard DB-25 connector on a host computer with a straight-across 26-strand flat-cable connector. For a DB-9 host connector, a standard 9-to-25-pin adapter should be used on the other end of the cable.
PMAC Lite
PMAC Lite has an RS-232 interface on a 10-pin IDC connector (J4). This port can connect directly with a standard DB-9 connector on a host computer with a straight 10-strand flat-cable connector. For a DB­25 host connector, a standard 25-to-9-pin adapter should be used on the other end of the cable. For an RS-422 interface, the Option 9L piggyback board can be added. This provides a DB-25 connector for the RS-422 port. The RS-232 port is disabled.
PMAC STD
PMAC STD has both an RS-232 interface on a 5-pin SIP connector (bottom board J1) and an RS-422 interface on a 20-pin mini-IDC connector (bottom board J3). Only one of these interfaces should be connected at any one time.
PMAC 1.5 STD
PMAC 1.5 STD has an RS-232 interface on a 5-pin SIP and a 10-pin IDC connector; the 10-pin connector can connect directly with a standard DB-9 connector on a host computer with a straight-across 10-strand flat cable. It also has an RS-422 interface on a 26-pin IDC connector, which can connect directly with a standard DB-25 connector on a host computer with a straight-across 26-strand flat cable.
RS-422 vs. RS-232
The PMAC RS-422 serial interface is very similar to the RS-232 interface that most PCs have. RS-422 has differential 0 to +5V signals, whereas RS-232 has single-ended -10 to +10V signals. The PMAC RS­422 receivers accept inputs from RS-232 well, with significant noise margin. Most PCs’ RS-232 receivers can read the PMAC RS-422 signals quite well, but noise margin tends to be minimal, and communications in this direction can be garbled, especially in the presence of PWM amplifiers. For robust communications to an RS-232 host, PMAC Acc-26 provides conversion capabilities and optical isolation. Of course, direct connection to a host RS-422 port can be made.
Baud Rate
The serial-port baud rate is determined at power-up by jumpers E44-E47 (PMAC PC, Lite, 1.5 STD, VME) or switches SW1-1 to SW1-4 (PMAC STD), and the PMAC master clock rate. Serial baud rate can be set up to 76,800 baud on a 20 or 40 MHz board, up to 115,200 baud on a 30 or 60 MHz board. If E44- E47 are all ON (SW1-1 to SW1-4 all OFF), the serial port is disabled.
Signal Lines
Since serial interfaces vary from system to system, PMAC provides a simple but flexible interface. In addition to the signal ground, only four lines are required (eight counting the complements): data­transmit, data-receive, clear-to- send, and ready-to-send. These pairs of lines may be exchanged through jumpers (E9-E16), if necessary, to match the host configuration. PMAC simply shorts together the DSR and DTR lines to provide an automatic return signal on this strobe for those systems that require it.
Data Format
The serial communications data format is eight bits, one start bit, one stop bit, with no parity if jumper E49 is ON, or odd parity if jumper E49 is OFF (opposite for PMAC STD). PMAC can echo back to the host each character it receives from the host; the <CTRL-T command toggles this function on and off. No XON/XOFF handshaking is supported. Line-by-line checksums can be computed. Variable I4 controls this function.
26 Talking to PMAC
PMAC User Manual

PC Bus Interface

The PC bus interface for the PMAC PC and the PMAC Lite can work with just the PC-XT bus (eight bits wide). The additional AT-bus connecter is provided, but it can only be used to access the additional AT interrupt lines. One PMAC occupies 16 addresses in the PC’s port I/O space. The base address of this space is determined by jumpers E91-E92 and E66-E71. Of course, the address should be chosen so as not to conflict with anything else in the PC. The factory default setting is for address 528 (210 hex). The Jumper Description section contains a thorough mapping of a typical PC’s I/O mapping and likely empty addresses.
Characters are passed one at a time through one of these addresses. The software to support this interface is very similar to that for the serial port. Of course, characters can be sent much faster over the bus port. The Option 2 dual-ported RAM board provides 8k x 16 bits of shared memory for passing data back and forth between PMAC and the host computer. The data path for this memory is 16 bits wide, and so supports the AT bus directly.

STD Bus Interface

The bus interface for the PMAC STD works virtually identically to the PC bus interface on the PMAC PC or Lite. The interface can work with either the original 8-bit STD bus, or the new 32-bit STD 32 bus. It occupies 16 words in the I/O space of the host computer. The base address of these 16 words is determined using jumpers W11-W22 on the baseboard of the PMAC STD. The factory default setting is for address 61,584 (F090 hex). The Jumper Description section contains a thorough mapping of a typical STD bus computer's I/O mapping and likely empty addresses.
The new PMAC1.5 STD does not support the 32-bit features of STD 32, although it will work in either STD 80 or STD 32 buses with 16-bit addressing. On the PMAC 1.5 STD, the DIP switch bank S1-1 to S1-12 controls the address of the board on the STD bus.

VME Bus Interface

The PMAC VME interfaces to the VME bus as a slave device. Commands and responses are sent through a set of 16 8-bit mailbox registers. Binary data can be passed through the on-board Option 2V dual-ported RAM (8k x 16 bits). The data bus is eight bits wide for the mailbox, and 16 bits wide for the DPRAM. The address bus can be configured for 16, 24, or 32 bits. The address and nature of this interface must be set up through the serial port by writing to registers in PMAC, saving the values to non­volatile memory, and resetting the card. Typically, for this model of board, the initial setup and development is done through the serial port with an IBM-PC or compatible, using the supplied PMAC Executive program. Instructions for setting up the VME bus interface are given in the Writing a Host Communications Program section of this manual.
Giving Commands to PMAC
PMAC is fundamentally a command-driven device, unlike other controllers that are register driven. PMAC will do things if it is issued ASCII command text strings. Generally, PMAC provides information to the host in ASCII text strings.

PMAC Processing of Commands

When PMAC receives an alphanumeric text character over one of its ports, it does nothing but place the character in its command queue. It requires a control character (ASCII value 1 to 31) to cause it to take some actual action. The most common control character used is the carriage return (<CR>; ASCII value
13), which tells PMAC to interpret the preceding set of alphanumeric characters as a command and to take the appropriate action.
Talking to PMAC 27
PMAC User Manual

Note:

If using the Option 2 dual-ported RAM, command PMAC by writing values to specific registers in the DPRAM. PMAC can provide information by placing binary values in these registers, but the ASCII commands must have been sent already to PMAC that cause it to take the proper action when these values are received, and to place the values in these registers.
Control Characters
Other control characters cause PMAC to take an action independent of the alphanumeric characters sent before it. These control characters can be sent in the middle of a line of alphanumeric command characters without disturbing the flow of the command. PMAC will respond first to the control-character command, storing the text string until the <CR> character is received.

Command Acknowledgement

The exact nature of the PMAC acknowledgement of commands and its data response is controlled by I­variables I3, I4, and I9, with I3 as the most important. If I3 is 1, PMAC acknowledges a valid alphanumeric command by sending the line-feed (<LF>; ASCII value 10) character back to the host. If
I3 is 2 or 3, it uses the <ACK> character (ASCII value 6) instead. If I3 is 0, it does not provide any acknowledging character. Regardless of the setting of I3, PMAC responds to an invalid command by returning the <BELL> character (ASCII value 7).
When working interactively with PMAC in terminal mode, it is often nice to use the <LF> as acknowledgement because it spaces commands and responses automatically on the terminal screen.

Data Response

When the command received requires a data response, PMAC will precede each line of the data response with a line feed character if I3 is set to 1 or 3. It will not do so if I3 is set to 0 or 2. PMAC will terminate each line of the data response with a carriage return character regardless of the setting of I3. For these commands, the command acknowledgement character — <LF> or <ACK> — is sent after the data response, serving as an end-of-transmission character. For computer parsing of the response, the <ACK> should serve as a unique EOT character.

Data Integrity

Variable I4 determines some of the data integrity checks PMAC performs on the communications, the most important of which is a line-by-line checksum. The Writing a Host Communications Program section covers this feature in detail.

Data Response Format

Variable I9 controls some aspects of how PMAC sends data to the host. Its setting determines whether PMAC lists program lines back to the host in long or short form, whether it reports I-variable values and M-variable definitions as full command statements or not, and whether address I-variable values are reported in decimal or hexadecimal form.
28 Talking to PMAC
PMAC User Manual
On-Line (Immediate) Commands
Many of the commands given to PMAC are on-line commands; that is, they are executed immediately by PMAC to cause some action, change some variable, or report some information back to the host. The command itself is thrown away after executing (so cannot be listed back), although its effects may stay in PMAC.
Some commands, such as P1=1, are executed immediately if there is no open program buffer, but are stored in the buffer if one is open. Other commands, such as X1000 Y1000, cannot be on-line commands; there must be an open buffer, even if it is a special buffer for immediate execution. These commands will be rejected by PMAC (reporting an ERR005 if I6 is set to 1 or 3) if there is no buffer open. Still other commands, such as J+, are on-line commands only, and cannot be entered into a program buffer (unless in the form of CMD"J+", for instance).

Types of On-Line Commands

There are three basic classes of on-line commands:
Motor-specific commands, which affect only the motor that is currently addressed by the host.
Coordinate-system-specific commands, which affect only the coordinate system that is currently
addressed by the host
Global commands, which affect the card regardless of any addressing modes.
In the reference chapter, each command is classified into one of these types under the Scope descriptor.

Motor-Specific Commands

Motor Addressing
A motor is addressed by a #n command, where n is the number of the motor, with a range of 1 to 8, inclusive. This motor stays the one addressed until another #n is received by the card. For instance, the command line #1J+#2J- tells Motor 1 to jog in the positive direction, and Motor 2 to jog in the negative direction (like most commands, the jog command does not take effect until the carriage return character is received, so both axes start acting on the command at roughly the same time in this case).

Note:

Each program that can use the COMMAND statement to issue on-line commands from within the card has its own motor and coordinate system addressing, independent of which motor and coordinate system the host is addressing. Changing the host’s addressing modes does not affect the program’s, or vice versa. Also independent of the host addressing, the control panel selects a motor and coordinate system for its hardwired inputs to affect with its BCD-coded (low-true) FDPn/ lines (determined by a rotary switch on Delta Tau’s Acc-16 Control Panel).
Motor Commands
There are only a few types of motor-specific commands. These include the jogging commands, a homing command, an open loop command, and requests for motor position, velocity, following error, and status.

Coordinate-System-Specific Commands

Coordinate System Addressing
A coordinate system is addressed by a &n command, where n is the number of the coordinate system, with a range of 1 to 8, inclusive. This coordinate system remains the one addressed until another &n command is received by the card. For instance, the command line &1B6R&2B8R tells Coordinate System 1 to run Motion Program 6 and Coordinate System 2 to run Motion Program 8.
Talking to PMAC 29
PMAC User Manual
Coordinate System Commands
There are a variety of types of coordinate-system-specific commands. Axis definition statements act on the addressed coordinate system, because motors are matched to an axis in a particular coordinate system. Since it is a coordinate system that runs a motion control program, all program control commands act on the addressed coordinate system. Q-variable assignment and query commands are also coordinate system commands, because the Q-variables themselves belong to a coordinate system.

Note:

A command to a coordinate system can affect several motors if more than one motor is assigned to that coordinate system. For instance, if motor 4 is assigned to coordinate system 1, a command to coordinate system 1 to run a motion program can start motor 4 moving.

Global Commands

Some on-line commands do not depend on which motor or coordinate system is addressed. For instance, the command P1=1 sets the value of P1 to 1 regardless of what is addressed. Among these global on-line commands are the buffer management commands. PMAC has multiple buffers, one of which can be open at a time. When a buffer is open, commands can be entered into the buffer for later execution.
Control character commands (those with ASCII values 0 - 31D) are always global commands. Those that do not require a data response act on all cards on a serial daisychain. These characters include carriage return <CR>, backspace <BS>, and several special-purpose characters. This allows, for instance, commands to be given to several locations on the card in a single line, and have them take effect simultaneously at the <CR> at the end of the line (&1R&2R<CR> causes both Coordinate Systems 1 and 2 to run).
Buffered (Program) Commands
As their name implies, buffered commands are not acted on immediately, but held for later execution. PMAC has many program buffers — 256 regular motion program buffers, 8 rotary motion program buffers (1 for each coordinate system), and 32 PLC program buffers. Before commands can be entered into a buffer, that buffer must be opened (e.g., OPEN PROG 3, OPEN PLC 7).
Each program command is added onto the end of the list of commands in the open buffer; to replace the existing buffer, use the CLEAR command immediately after opening to erase the existing contents before entering the new ones. After finishing entering the program statements, use the CLOSE command to close the opened buffer.

Rotary Motion Program Buffer

The rotary motion program buffer is a special program buffer that can execute motion programs at the same time it is open for entry of program commands from the host computer. If an open rotary program buffer is executing, but has already executed every command sent to it, it will execute the next buffered program command sent to it almost immediately.
30 Talking to PMAC
PMAC User Manual
Multiple-Card Applications
If there are several cards communicating with the host, there must be a way for the host to distinguish between the different cards. The host computer must be able to talk to each of the cards individually, and sometimes to talk to the cards collectively. Therefore, the host must have a means of addressing the cards.
This section covers the basic concepts of communications issues dealing with multiple cards. For more detailed information, refer to the Writing a Host Communications and Synchronizing PMACs to Other PMACs sections of this manual.

Bus Communications

When the interface is a bus-type interface (e.g., PC-bus, STD-bus or VME-bus), the distinction between cards is taken care of by hardware addressing. This means that the different cards respond to different bus address locations as selected by the bus address lines. The setup of the hardware addressing of multiple cards is done just as it is for single cards (above); one simply cannot put two different cards at the same hardware address on the bus.

Simultaneous Commands

A little trickier task is to initiate simultaneous action on all boards, because commands must be issued sequentially to the different boards. However, characters can be sent to all of the boards in sequence so quickly that this delay will not be the major limitation in keeping action simultaneous between the boards.
The commands should be sent so that everything except the carriage return character is sent to all of the boards; then the <CR> command is sent to each board in rapid succession. (If checking for the write­ready bits, make sure they are true on all boards before sending the character to any board.) On a typical bus system, send these characters one microsecond apart. This is much faster than the approximately one millisecond software scan time of the command interpreters on PMAC, so the commands are effectively issued simultaneously.

Serial Communications

However, if serial communication is being used (RS-232 or RS-422), the daisychaining of PMAC does not permit separate hardware addressing, so there must be a software addressing scheme.
PMAC cards equipped with PROM version 1.13 and higher are capable of daisychained communication using the RS-422 port. PMAC Lites and PMAC STDs cannot use daisychained communication with the RS-232 port; the RS-422 port is required (Option 9L for PMAC Lite). Up to 16 PMAC cards can be connected and synchronized using serial port communications. To do this however, a few hardware and software set up procedures must be followed.
Connections
When using serial communications to multiple PMACs from a single host serial port, the connection is made through a single multi-drop daisy chained cable. At one end is the connector for the host computer (usually a DB-25 connector). At the other end of the cable is one connector (drop) for each PMAC on the chain. Each strand of the cable is brought out on the same pin of each connector.
Multi-Drop Cable
The PMAC STD has both a RS-232 port and a RS-422 port. If daisy chaining is desired, the RS-422 port must be used. Delta Tau does not provide this cable. The Acc-3D cable provides serial connection to the RS-422 port of a single PMAC PC or PMAC VME, and each Acc-3E ordered with it provides an extra drop for an additional PMAC PC or PMAC VME. If connected to an RS-232 port of a host computer, it is strongly recommended that an Acc-26 or similar converter be used, especially in multi-drop applications.
Talking to PMAC 31
PMAC User Manual

Note:

The Option 9L RS-422 interface is required on a PMAC Lite to tie it to another PMAC. In this case, the Acc-3D 26-pin serial cable should be used, not the Acc­3L 10-pin serial cable.

Serial Card Addressing

This software addressing is done by the @n command, where n is a hexadecimal digit from 0 to F (15 decimal). Up to sixteen cards may be chained together under one host. The command addresses all cards simultaneously, but it is not legal to send a querying command for response over the serial port when the system is in this mode (which card would respond?).

Setting Up the Addresses

The software address command issued by the host must match the card number of the particular PMAC as determined by jumpers E40-E43 on PMAC PC, PMAC Lite, PMAC 1.5 STD, and PMAC VME, or by switches SW1-1 to SW1-4 on PMAC STD. See Table 4-1 for the proper jumper configurations. One card on the chain must be set up as card @0. It is recommended that the other cards be numbered sequentially from zero (@1, @2, etc.).
Card Address Control E Points for PMAC PC, Lite, 1.5 STD and VME
E40 E41 E42 E43 Card Address Default
ON ON ON ON @0 @0
OFF ON ON ON @1
ON OFF ON ON @2
OFF OFF ON ON @3
ON ON OFF ON @4
OFF ON OFF ON @5
ON OFF OFF ON @6
OFF OFF OFF ON @7
ON ON ON OFF @8
OFF ON ON OFF @9
ON OFF ON OFF @A
OFF OFF ON OFF @B
ON ON OFF OFF @C
OFF ON OFF OFF @D
ON OFF OFF OFF @E
OFF OFF OFF OFF @F
32 Talking to PMAC
PMAC User Manual
Switch Address Control For PMAC STD
SW1-1 SW1-2 SW1-3 SW1-4 Card Address Default
OFF OFF OFF OFF @0 @0
ON OFF OFF OFF @1
OFF ON OFF OFF @2
ON ON OFF OFF @3
OFF OFF ON OFF @4
ON OFF ON OFF @5
OFF ON ON OFF @6
ON ON ON OFF @7
OFF OFF OFF ON @8
ON OFF OFF ON @9
OFF ON OFF ON @A
ON ON OFF ON @B
OFF OFF ON ON @C
ON OFF ON ON @D
OFF ON ON ON @E
ON ON ON ON @F

Multi-Card Mode Variable

When talking to multiple cards over a single daisy-chained connector, variable I1 should be set to 2 or 3 (usually 2) on every PMAC on the chain for proper communications (usually, I1 is set to 0, sometimes 1, if it is the only card on the connecting cable). If this setting has not been made already, as would be the case on the initial connection, simply set I1 to 2 as the first command to the cards, then immediately address one of the cards. For example, the command string I1=2@0<CR> could be used to set up all the cards for daisy chained communications, and then address card 0.
Once this setting has been made (and stored with the SAVE command), it is not necessary to issue this command, but it will not hurt to do so. Setting I1 to 3 rather than 2 disables the CTS handshaking, so the host cannot hold off characters from a PMAC; typically this is undesirable.

Addressed-Card Actions

The addressed card at any time can accept alphanumeric commands and respond to them. Only it tries to control the communications and handshake lines back to the host computer. The cards not addressed at a given time ignore alphanumeric characters sent over the serial port, and their communications and handshake outputs are tri-stated so as not to interfere with those of the addressed card. The cards not addressed still can respond to certain control characters (not those querying a card, below), and, of course, are listening to see if the addressed card number changes.

Simultaneous Addressing

It is possible to address all cards simultaneously for alphanumeric commands with @@ software addressing. In this case, all cards will accept alphanumeric characters. Card @0 will provide the handshake response characters. Query commands are not permitted in addressing. If the host sends such a command in this mode, card @0 will respond with the <BELL> character.

Handling Data Response

When sending commands that require a data response, it is important to ask for data from only one card per command line (a command line is terminated by the <CR> character), and to accept the response before querying another card. Otherwise, more than one card may try to control the lines at once when responding. For example, the command string @1P@2P<CR> could lead to contention as both cards try to send position data (neither card starts to process the command until it sees the <CR> character).
Talking to PMAC 33
PMAC User Manual

Power-Up State

With the cards set up for daisy chained communications (i.e., I1 = 2 or 3 saved in EAROM), card @0 comes out of the power-up/reset cycle as the addressed card, ready to respond to commands; all other cards come out of the power-up/reset cycle not addressed, so they will ignore alphanumeric commands until they are addressed.

Control-Character Commands

Control-character commands that do not require a data response are always addressed to all cards on the chain. The commands in this class are:
<CTRL-A> Abort all programs and moves <CTRL-D> Disable all PLC programs <CTRL-I> Repeat last command line (tab) <CTRL-K> Kill all motors <CTRL-M> Feed hold all coordinate systems <CTRL-Q> Quit all motion programs <CTRL-R> Run all coordinate systems <CTRL-S> Step all coordinate systems <CTRL-W> Take command line from (bus port) dual-ported RAM <CTRL-X> Erase command and response queues <CTRL-Z> Make serial port the active response port
<CTRL-M>
The carriage return character causes the command line just transmitted to every card in the chain to be accepted by that card and processed. This allows separate command lines to be sent to each card, but processed simultaneously. If a particular card in the chain has not been sent a command when it sees the carriage return command, it will process a "no-operation" command.
Example:
The command string @0&1B4R@1&3B25R<CR> will cause card @0’s coordinate system 1 to start executing motion program 4, and card @1’s coordinate system 3 to start executing motion program 25.
Control-character commands that require a data response are accepted and processed by the currently addressed card, and ignored by the other cards. They will be rejected in the addressing mode. Commands in this category are:
<CTRL-B> Report all motor status words <CTRL-C> Report all coordinate system status words <CTRL-E> Report data-gathering address contents in binary <CTRL-F> Report all following errors <CTRL-G> Report global status words <CTRL-P> Report all motor positions <CTRL-V> Report all motor velocities <CTRL-Y> Report and repeat last command line
A control-character command requiring a data response will be acted on by the card addressed by the most recently processed addressing command. Since an addressing command is not processed until the next carriage return character, but a control-character command is acted on before a carriage return, it is important to send a carriage return character between the addressing and the control-character command.
Other control character commands and their properties in multiple-card applications are:
34 Talking to PMAC
PMAC User Manual
<CTRL-H>
<CTRL-H> (backspace to erase last character sent) actually acts on the entire data stream as it is sent to the cards. It erases the last alphanumeric character sent in the stream. Repeated <CTRL-H> characters can erase all the alphanumeric characters sent since the latest carriage return character. If this includes addressing characters, these are erased as well.
<CTRL-T>
Full duplex communication (echoing of characters) is not permitted in daisy-chained serial mode. Therefore, the <CTRL-T> command (full/half-duplex toggle) will be rejected in this mode.
Resetting PMAC
There are several ways that PMAC can be reset. The first way is by cycling the 5V power off, then on. The second way is by taking the INIT/ line on the JPAN connector low, then high. The third way is to use the backplane-bus reset line. This method depends on the setting of jumper E39, and in PC-bus versions, E93 and E94. The fourth method is to send the command to PMAC over either port.

PMAC Reset Actions

When PMAC receives the reset signal or command from any of these sources, it immediately stops all active computations and starts its reset cycle. At the beginning of the reset cycle, it disables all outputs and loads the firmware into active memory. It then proceeds to load active memory in a manner dependent on the hardware configuration and the setting of re-initialization jumper E51. The PMAC memory can be retained through a power-down or reset cycle with either EEPROM or battery-backed RAM (the standard CPU section, which comes with the default configuration, Options 4 and 5), or completely with flash memory (the Option CPU section, which comes with Options 4A, 5A, and 5B). With the standard CPU section, the basic user card setup information (I-variables, conversion table settings, VME and DPRAM address settings) are held in non-volatile EEPROM after being written there with the SAVE command. User programs, tables, buffers, and definitions are simply retained in RAM by the battery. No command or action is required to keep these items through a power-down or reset cycle.
With the Option CPU section, all user card information is held in non-volatile flash memory after being written there with the SAVE command. No information is held in RAM through a power-down or reset cycle, so the SAVE command must be used to keep any information in the card through a reset.
If jumper E51 is in its default state (OFF for PMAC PC, Lite, VME, and 1.5 STD; ON for PMAC STD), PMAC copies the contents that were last saved into its non-volatile memory into active memory. For PMACs with the standard CPU section, this involves just the items stored in the little EEPROM. Other items are kept just as they were before the reset. For PMACs with the Option CPU section, this involves all user settings: variables, definitions, programs, buffers, and tables.
All incremental encoder counters are set to zero during the reset cycle. At the end of the reset cycle, all activated motors that have Ix80 set to 1 are enabled, with the commanded position set to the actual position. Other motors are left in the killed state; these require a command to enable them at a future time.

PMAC Re-initialization Actions: Standard CPU

If Jumper E51 is in its non-default state on a PMAC with the standard CPU section (ON for PMAC PC, Lite, and VME; OFF for PMAC STD), PMAC performs a re-initialization during the reset cycle. Instead of copying saved values of parameters from EEPROM into active memory, it copies the factory default values from the firmware PROM into active memory.
Talking to PMAC 35
PMAC User Manual
Typically, this re-initialization procedure is necessary only if the card has been locked up due to errant software or parameter settings, and communications are impossible to establish. The most common instances of this type are PLC programs with accidentally repeating SEND or CMD statements (try sending a <CTRL-D> before re-initializing), or a fast servo time with too many motors activated.

PMAC Re-initialization Actions: Flash CPU

If the jumper E51 is ON when a PMAC with the Flash CPU executes its reset cycle, PMAC enters a special re-initialization mode that permits the downloading of new firmware. In this mode, the PMAC can communicate only over the PC/STD bus port, or over the serial port at a baud rate of 38,400, regardless of the setting of the baud rate jumpers. Only a very basic bootstrap firmware is executing in this mode.
In this bootstrap mode, there are very few command options. PMAC will respond to any of the status-bit query commands (?, ??, or ???) with the response BOOTSTRAP PROM. This permits the host to know whether PMAC is in this mode or not. PMAC will respond to the VERSION query command with the
number of the bootstrap firmware (e.g. 1.01) which will probably be different than the operational firmware version.
Normal Re-initialization
To bypass the download operation in this mode, send a <CONTROL-R> character to PMAC. This puts PMAC in the normal operational mode with the existing firmware. Factory default values for I-variables, conversion table settings, and bus addresses for DPRAM and VME are copied from the firmware section of flash memory into active memory. The saved values of these values are not used, but they are still kept in the user section of flash memory.
For any change in the operational firmware, the compiled PLCs will have to be re-compiled with the
LIST LINK file for the new firmware version. It is important to delete all compiled PLCs (DELETE PLCC n) before attempting to change the operational firmware version. Compiled PLC programs
running under a firmware version other than that which they were compiled for can have unpredictable consequences.
To download new operational firmware to the PMAC, send a <CONTROL-O> character to PMAC over the serial port. The bootstrap firmware interprets this as a signal to prepare for downloading of new operational firmware. All subsequent bytes received over the serial port will be considered as binary­coded bytes of machine-code firmware, and will be written into the flash memory.

Note:

Before attempting to upgrade PMAC operational firmware, make sure all of PMAC configuration has been stored to disk. If the new firmware provides a different user memory map, PMAC will clear memory on power-up after new firmware has been loaded. Even if this is not the case, the easiest way to establish a new firmware checksum reference value is to send the $$$*** command, which clears the buffers.
The host computer should wait at least five seconds after the <CONTROL-O> command before starting to download the operational firmware. This delay ensures that the flash memory is ready to be written to. After downloading, the PMAC should be powered down. No other communications should be attempted with PMAC at this time.
After turning off power to PMAC, the E51 jumper should be removed. When power is re-applied to PMAC, it should operate normally with the new firmware. The user settings stored in other segments of the flash memory with the SAVE command are not affected by the downloading of new firmware (unless the new firmware has a different user memory map).
36 Talking to PMAC
PMAC User Manual
The PMAC Executive program V3.x and newer, when it establishes communications with a PMAC in this re-initialization mode, will notice automatically that PMAC is in this mode. In this mode, the menu selection Download binary firmware file in the File menu can be selected to take a binary file from disk and copy over the serial port to PMAC. The program then forces an exit to the operating system. At this point, turn off power to PMAC and remove the E51 jumper.
With older versions of the PMAC Executive program, or with a terminal emulator program running on a PC, the procedure for downloading new firmware is as follows (remember to back up the PMAC software and delete any compiled PLC programs first):
Establish communications to PMAC over the serial port at 38400 baud. Confirm that PMAC is in
this re-initialization mode by seeing that it responds to the ? command with BOOTSTRAP PROM. If using the Executive program, make sure that all windows other than the Terminal window (such as the position window) are closed, so no other commands are being sent to PMAC.
Type a <CONTROL-O> character in the terminal window and immediately exit to DOS. Do not send
any other characters to PMAC here.
Use the binary version (/B) of the DOS COPY command to download the file containing the new
firmware to PMAC. The command typed at the DOS prompt will look something like:
COPY/B B:V115A.BIN COM1:
Where B:V115A.BIN is the directory and name of the file containing the operational firmware in binary machine code format, and COM1: is the serial port being used for communications.
Shut off power to PMAC and remove the E51 jumper.
Restore power to PMAC and resume normal operation with the new firmware.
To update the firmware checksum reference value so PMAC does not report a firmware checksum
error, the easiest method is to send the $$$*** command, which causes PMAC to compute the new reference value automatically (but it also clears all of your programs and buffers from active memory). As an alternative method, send the command RHX:$0794 several times. If the same value is received each time, PMAC has stopped its checksum calculations on an error, and the reported value is the value it calculated for the firmware checksum. Write this value into reference register X:$07B1. For example, if RHX:$0794 returns 9A3B12 several times, send the command WX:$07B1,$9A3B12 to PMAC. Remember that for either method, store this reference value to flash memory with the SAVE command.
To re-compile PLC programs, either use the LISTLINK.TXT file that corresponds to the new
firmware version, or create this file by sending the LIST LINK command to the PMAC with the new firmware and storing the response in a text file of this name.

Re-initialize Command

The $$$*** command causes a reset and full re-initialization of PMAC. In addition to loading default parameter values, it also clears out all of the buffers in battery-backed RAM: motion program, PLC program, tables, etc.
Some users will always have the card set up to re-initialize during the reset cycle; they then download all parameter settings and programs immediately after each cycle. The logic behind this strategy is that the same startup sequence of operations is used even if a new replacement board has just been put in. It is also useful for those applications that do not wish to rely in any way on the PMAC own non-volatile storage (EEPROM and battery-backed RAM or flash).
Talking to PMAC 37
PMAC User Manual
For a complete re-initialization of PMAC to known state, the following commands can be added:
P0..1023=0 Q0..1023=0
M0..1023->* UNDEFINE ALL
Remember that these commands directly affect only active memory (RAM). To copy new settings into non-volatile memory (EEPROM or Flash), use the SAVE command.
38 Talking to PMAC
PMAC User Manual
TROUBLESHOOTING
PMAC Card Troubleshooting

General

Is the green LED (power indicator) on PMAC CPU board ON, as it should be? If it is not, find out why PMAC is not getting a +5V voltage supply.
Is the red LED (watchdog timer indicator) on PMAC CPU board OFF, as it should be? If it is ON, make sure PMAC is getting close to 5V supply (at less than 4.75V), the watchdog timer will trip, shutting down the card. The voltage can be probed at pins 1 and 3 of the J8 connector (A1 and A2 on the PMAC VME). If the voltage is satisfactory, inspect PMAC to see that all inter-board connections and all socketed ICs are well seated. If the card will not run with the red LED off, contact the factory.

Bus Communications

Do the bus address jumpers (E91-E92, E66-E71) set an address that matches the bus address that the Executive program is trying to communicate with?
Is there something else on the bus at the same address? Try changing the bus address to see if communications can be established at a new address. Address 768 (300 hex) is usually open.

Serial Communications

Is the proper port being used on the PC? If the Executive program is addressing the COM1 port, make sure that it is cabled out of the COM1 connector.
Does the baud rate specified in the Executive program match the baud rate setting of the E44-E47 jumpers on PMAC?
With a breakout box or oscilloscope, make sure there is action on the transmit lines from the PC as you type into the Executive program. If there is not, there is a problem on the PC end.
Probe the return communication line while giving PMAC a command that requires a response (e.g. <CONTROL-F>). If there is no action, change jumpers E9-E16 on PMAC to exchange the send and receive lines. If there is action, but the host program does not receive characters, RS-232 may be receiving circuitry that does not respond at all to PMAC RS-422 levels. If using another model of PC, try using it as a test (most models accept RS-422 levels quite well). If the computer will not accept the signals, a level-conversion device, such as Delta Tau's Accessory-26, may be needed.
Commutation Troubleshooting
If there was no movement, check to make sure that output voltages were received on DAC1 and DAC2. A value of 2000 should put 0.6V on the DAC lines. If voltage outputs were received from PMAC, but no movement, check the amplifier and motor setups. If voltage outputs were not received, check the analog supply to PMAC; make sure that the limits are held low or disabled; and make sure that the amplifier fault signal is not indicating to PMAC that it has faulted.
Servo Loop and Jogging Troubleshooting
If holding position well, but cannot move the motor, make sure that the hardware limits are held low. Check which limits I125 is addressed to (usually +/-LIM1), then make sure those points are held low (to AGND), and sourcing current (unscrew the wire from the terminal block and put the ammeter in series with this circuit to confirm this). If this is not right, refer to the Connecting PMAC to the System section previously, and the PMAC Opto-Isolation drawing to re-check the connections.
Troubleshooting 39
PMAC User Manual
If the motor dies after it is given a jog command, the fatal following error limit has been exceeded. If this has happened, it is either because a move that is more than the system can physically do has been requested (if so, reduce I122), or because it is badly tuned (if this is the case, increase proportional gain I130). To restore closed-loop control, issue the J command.
Homing Search Troubleshooting

No Movement at All

Check the following:
Are both limits held low to AGND and sourcing current out of the pins?
Is there a proper supply to A+15V, A-15V, and AGND?
Is the proportional gain (Ix30) greater than zero?
Can any output be measured at the DAC pin when an O command has been given?
Is the following error limit being tripped? Disable the fatal following error limit (Ix11) by setting it
to zero, and try to move again.

Movement, But Sluggish.

Check the following:
Is proportional gain (Ix30) too low? Try increasing it (as long as stability is kept).
Is the big step limit (Ix67) too low? Try increasing it to 8,000,000 (near the maximum) to eliminate
any effect.
Is the output limit (Ix69) too low? Try increasing it to 32,767 (the maximum) to make sure PMAC
can output adequate voltage.
Can an integrator help? Try increasing integral gain (Ix33) to 10,000 or more, and the integration
limit (Ix63) to 8,000,000.

Runaway Condition

Check the following:
Is there feedback? Check that position changes can be read in both directions.
Does the feedback polarity match output polarity? Recheck the polarity match as explained above.

Brief Movement, Then Stop

Check the following:
Is this following error limit being tripped? Disable fatal following error limit (Ix11) by setting it to
zero, then try to move again.
Motion Program Troubleshooting
If the program does not run at all, there are several possibilities:
Can the program be listed? In terminal mode, type LIST PROG 1 (or whichever program), and see
if it is there. If not, try to download it to the card again.
Is the program buffer closed? Type A just in case the program is running; type CLOSE to close any
open buffer; type B1 (or the program #) to point to the top of the program; and type R to try to run it again.
Can each motor in the coordinate system be jogged in both directions? If not, review that motor's
setup.
Have any motors been assigned to the coordinate system that are not really set up yet? Every motor
in the coordinate system must have its limits held low, even if there is no real motor attached.
40 Troubleshooting
PMAC User Manual
INPUT/OUTPUT: CONNECTING PMAC TO THE MACHINE
Capabilities and Features
PMAC has extensive input and output capabilities, analog and digital, special-purpose and general­purpose. The I/O has many features to ensure the integrity of the signals; as the different types of I/O are introduced, the steps taken to improve the integrity of each type of I/O is explained.
Quadrature Encoder Inputs (JMACH Port)
PMAC is equipped to take digital quadrature encoder signals at 0 to 5V levels as a standard feature. For each DSPGATE IC in a PMAC configuration, four encoders can be attached.

Single-Ended vs. Differential

PMAC has differential line receivers for each encoder channel, but can accept either single-ended (one signal line per channel) or differential (two signal lines, main and complementary, per channel). A jumper for each encoder (E18-E21 and E24-E27) permits customized configurations, as described below.
The differential line receivers can accept up to +/-12V between main and complementary inputs, and +/­12V between either input the GND reference voltage. Typically, 0 and +5V levels are used.
Single-Ended Encoders
With the jumper for an encoder set for single-ended, the differential input lines for that encoder are tied to
2.5V; the single signal line for each channel is then compared to this reference as it changes between 0 and 5V.
4
ANALOG
123
INPUTS
4
MUX
HOME 1-4
4
EQU 1-4
AENA 1-4
-LIMIT 1-4
+LIMIT 1-4
FAULT 1-4
LD
DAC 1
16 BIT
ANALOG
OUTPUTS.
RESOLU TION
LD
LD
DAC 3
LD
DAC 4
DAC 2
ADC
16 BIT
OPTO
ISOLATION
INPUT
FLAGS
FLAGS
SERIAL
OUTPUT
FLAG
CONTROL
SERVO PHASE
SAMPLE
ENCODER
SELECTABLE-FREQUENCY CLOCK INPUTS
ENCODER 1
ABC
ABCABCABC
SERIAL
DATA OUT
DAC SHIFT REGISTERS (4)
DATA IN
ADC SHIFT REGISTERS (4)
DSP-GATE
ENCODER 2
ENCODER 3
4
INPUTS
ENCODER
ACCESSORY BOARD
MUX
CLOCK
CONTROL
ANALOG
CONTROL
16-BIT
24-BIT
ENCODER
CONTROL
ENCODER 4
Figure 1 PMAC Motion Controller Custom Gate Array IC
ADDRESS BUS
DATA BUS
Input/Output: Connecting PMAC to the Machine 41
PMAC User Manual
Connect pin 1 to 2 to tie differential line to +2.5V
Connect pin 2 to 3 to tie differential line to +5V
(Reversible socketed SIP on PMAC2)
Tie to +2.5V when no connection
Tie to +2.5V for single-ended encoders
Don't care for differential line driver encoders
Tie to +5V for complementary open-
collector encoders (obsolete)
Tie to +5V to support external XOR loss of
encoder circuitry
Figure 2 PMAC Encoder Input Circuitry
When using single-ended TTL-level digital encoders, the differential line input should be left open, not grounded or tied high; this is required for the PMAC differential line receivers to work properly.

Differential Encoders

Differential encoder signals can enhance noise immunity by providing common-mode noise rejection. Modern design standards virtually mandate their use for industrial systems, especially in the presence of PWM power amplifiers, which generate a great deal of electromagnetic interference.
Open-Collector Differential
There are two types of differential encoder signals. The first has simple open-collector drivers (or equivalent) on both the main and complementary channels. For this type of encoder, the jumper must be set up for differential mode to provide pull-up resistors on both inputs.
Differential Line Drivers
The second type of differential encoder format (and the one that is strongly recommended) is the differential line driver on both signals. For this type of encoder, it does not matter what the jumper setting is; most will leave the jumper in the default setting.
Termination Resistors
When driving the encoder signals over a long cable (10 meters or more), to reduce the ringing on transitions, add termination resistors between the main and complementary lines. PMAC provides sockets for resistor packs for this purpose. The optimum value of the termination resistor is system dependent, but 330 ohms is a good starting point.

Analog Encoders

PMAC can take analog voltage-source encoder inputs into its differential line receivers if the drivers have enough capability to work against a 470 ohm pull-up resistor and the maximum differential voltage the line receiver sees is between 2 and 12V. For a single-ended analog signal, the complementary channel should be tied to GND to provide proper transitions as the voltage signal goes positive and negative. It is better, but not required, to jumper the input for single-ended.
For a differential analog encoder, the two signals for each channel are wired in just as for a digital differential encoder. It is better, but not required, to jumper the input for differential. In this case, the 12V input limit is a peak-to-peak measurement.
42 Input/Output: Connecting PMAC to the Machine
PMAC User Manual

Power Supply and Isolation

In the basic configuration of PMAC, the encoder circuitry is not isolated from the PMAC digital circuitry and the signals are referenced to the PMAC digital common level GND. Typically, the encoders in this case are powered from the PMAC +5V lines with a return on GND. The total encoder current draw must be considered in sizing the PMAC power supply.
It is also possible to use a separate supply for the encoders with non-isolated signals connected to PMAC. In this case, the return of the supply should be connected to the digital common GND on PMAC to give the signals a common reference. The +5V lines of separate supplies should never be tied together, as they will fight each other to control the exact voltage level.
Isolated Encoder Signals
In many systems, the encoder circuitry is optically isolated from the PMAC digital circuitry. This is common in systems with long distances from the encoder to the controller (> 10m or 30 ft) and/or systems with very high levels of electrical noise. Isolation can be achieved using the Acc-8D Opt 6 4­channel encoder isolator board. With an isolated encoder, a separate power supply is required for the encoders to maintain isolation, and the return on the supply must not be connected to the digital common GND, or the isolation will be defeated.
Simulated Encoder Signals
Special consideration must be given to systems that have a simulated encoder signal provided from a resolver-to-digital converter in a brushless motor amplifier. Usually in these systems, the encoder signals are referenced to the amplifier’s signal return, which in turn is connected to the PMAC analog common AGND. The best setup in these cases is to isolate the simulated encoder signal from the PMAC digital circuitry with the Acc-8D Opt 6 isolator board or similar module. This will keep full isolation between the PMAC digital circuitry and the amplifier.
If isolation of the simulated encoder signals is not feasible, the PMAC digital circuitry and the amplifier signal circuitry (including the PMAC analog circuitry) must be well tied together to provide a common reference voltage. Do this by putting jumpers on PMAC E-Points E85, E87, and E88, tying the digital and analog circuits on PMAC together, and therefore the analog signal circuits. Avoid having the simulated encoder cables providing the only connection between the circuits. This can result in lost signals from bad referencing, or even component damage from ground loops.

Wiring Techniques

There are several important techniques in the wiring of the encoders that are important for noise mitigation. First, the encoder cable should be kept physically separate from the motor power cable if possible. Second, both of these cables should be shielded, the motor cable to prevent noise from getting out, and the encoder cable to prevent noise from getting in. These shields should be grounded at the inward end only, that is, to the device that is itself tied to a ground.
Twisted Pairs
A third important noise mitigation technique is to twist the leads of the complementary pairs around each other. With these twisted pairs, what noise does get in tends to cancel itself out in opposite halves of the twist.

Encoder Signal Sampling

After the front-end processing through the differential line receivers, the encoder signals are sampled digitally at a rate determined by the SCLK (encoder sampling clock) frequency. SCLK is divided down from the master clock frequency by an amount determined by jumpers E34 to E38. The default setting is E34 ON, which gives SLCK half the frequency of the master clock, which on the standard board is about 10 MHz.
Input/Output: Connecting PMAC to the Machine 43
PMAC User Manual
E35 ON gives it one-fourth the frequency; E36 one-eighth; and E37 one-sixteenth. Setting E38 ON provides an external SCLK signal (on CHC4 and CHC4/ inputs). The SCLK frequency used sets the upper limit on the possible count rate; in actual use, the maximum count rate should be considered about 20% lower, allowing for imperfections in the input signals.

Digital Delay Filter

Each encoder has a digital delay filter consisting of three cascaded D-flip-flops on each line, with a best two-of-three voting scheme on the outputs of the flip-flops. The flip-flops are clocked by the SCLK signal. This filter does not pass through a state change that only lasts for one SCLK cycle; any change this narrow should be a noise spike. In doing this, the filter delays actual transitions by two SCLK.
2 of 3
Vot i ng
CH A
C B
DQ DQ DQ DQ
DQ DQ DQ DQ
2 of 3
Vot i ng
Figure 3 Encoder Digital Delay Filter
Frequency Tradeoffs
The lower the SCLK frequency, the wider the noise spike that can be rejected, but the lower the maximum count frequency. These aspects must be balanced in the system. In general, SCLK should be set to the lowest frequency that permits PMAC to keep up the maximum possible count frequency from the encoder.
Bypassing the Filter
This delay filter may be bypassed by setting the Encoder I-Variable 1 (I901, I906, etc.) to 1. Bypassing this filter will probably be done only by those with parallel sub-count interpolation for which the delay could cause transition errors. Refer to the Feedback Features section of this manual.

Error Detection

Count-Error Flag
If an illegal encoder transition (both channels changing on the same SCLK cycle) does get through (or around, if bypassed) the delay filter, and to the decoder, a count-error flag is set, noting a loss of position information. This flag is bit 18 of the encoder status/control word (X:$C000 for Encoder 1, X:$C004 for Encoder 2, etc.). Suggested M-variable definitions M118, M218, etc., can be used to access these bits.
Once-per-Rev Check
In addition, it is possible to use the third channel of the encoder to do a once-around position check using the PMAC position-capture feature to detect any loss of count. Refer to the Position-Capture description in the Synchronizing PMAC to External Events section of this manual, and program example PLCMOD.PMC for more details.
44 Input/Output: Connecting PMAC to the Machine
PMAC User Manual
Optically Isolated Dedicated Digital Input Flags (JMACH Port)
Each channel of PMAC has four dedicated digital inputs on the machine connector: +LIMn, -LIMn (overtravel limits), HMFLn (home flag), and FAULTn (amplifier fault). These inputs are typically assigned to a motor as a set for dedicated use as flags by addressing them with the motor I-variable Ix25. Those flags not used for the dedicated purposes may be used as general-purpose inputs with the assignment of an M-variable.

Flag Wiring

All of these flag inputs must be shorted to the zero-volt reference voltage for the circuit (usually AGND), allowing current to flow through the LEDs in the opto-isolator, in order to be considered in a zero state. The current flow to 0V just needs to be broken to put the flag in its 1 state; no external pull-up is required, although it will not hurt. For an electronic switch, an open-collector output is usually used. For a mechanical switch, an open/closed contact between the flag pin and 0V is usually used.

Overtravel Limit Inputs

When assigned for the dedicated uses, these signals provide important safety and accuracy functions. +LIMn and -LIMn are direction-sensitive overtravel limits that must be actively held low (sourcing current from the pins to ground) to permit motion in their direction.
The direction sense of +LIMn and -LIMn is the opposite of what many people would consider intuitive. That is, +LIMn should be placed at the negative end of travel, and -LIMn should be placed at the positive end of travel.

Home Flag Input

Typically, the HMFLn input is used for homing or other registration functions through use of the PMAC hardware position-capture feature. Encoder/flag I-variables 2 and 3 determine which signals and which edges cause a capture.

Amplifier Fault Input

Typically, the FAULTn input is used as a signal from the amplifier that something is wrong. Ix25 controls whether a high signal or a low signal means fault.
For more details on the actions taken on these flags, refer to the Making Your Application Safe and Synchronizing PMAC to External Events sections of this manual.

Flag Isolation

These inputs can be kept isolated from other circuits. If supplied from the analog supply voltage (A+15V) and tied to analog ground (AGND), they will be isolated from the PMAC digital circuitry. If supplied from a digital supply voltage (+12V) and tied to digital ground (GND), they will be isolated from the PMAC analog circuitry. If supplied from a separate supply (OPTO+V; 12 to 24V) and tied back to the supply’s own ground, they will be isolated from both the digital and analog circuitry. The setting of jumpers E89 and E90 controls which power the flag circuitry, and therefore, which circuits it is isolated from.
Dedicated Digital Output Flags (JMACH, JEQU Ports)
PMAC has two dedicated digital outputs for each channel in the hardware configuration: the Amplifier­Enable/Direction line (AENA/DIRn) and the Compare-Equals line (EQUn).

Amplifier-Enable/Direction Output

The AENA/DIRn output is an optically-isolated output tied to the same circuit as the dedicated digital inputs. It can be kept isolated from the PMAC digital computation circuitry, from the PMAC analog circuitry, or both.
Input/Output: Connecting PMAC to the Machine 45
PMAC User Manual

Amplifier Enable/Disable Use

These outputs are typically used as enable/disable lines for the amplifiers commanded by PMAC. This control function is very important for safety reasons to make sure the amplifier can be completely shut down when needed. (It is not a good idea to rely on a zero analog output voltage; offsets can easily build up so that a zero command does not cause a stop. Analog output offset will manifest itself as creep in a velocity-mode drive; on a lightly-loaded torque-mode drive, it can show up as high-speed runaway.)

Transition

When PMAC sees a fault signal from the amplifier, it will kill the motor automatically, taking the amplifier-enable signal to the disabled state. Many amplifiers, when they are disabled for any reason, will indicate a fault signal to the controller. PMAC permits an amplifier (changing the amplifier enable line from disabled to enabled) to be enabled even when the amplifier shows a fault. However, in the PMAC next error scan, which occurs in the background housekeeping task every few milliseconds, if the amplifier still shows a fault, PMAC will disable that axis again. Refer to the Synchronizing PMAC to External Events section of this manual.

Sinking Drivers

The default drivers for these outputs are open-collector (sinking) circuits, requiring external pull-up resistors. Typically, they can be connected directly to the cathode (negative end) of an opto-isolator input on an amplifier. The ULN2803A ICs used are rated to 100 mA and 24V; internal diode protection circuits in the IC limit the high voltage of the output to the analog positive supply voltage, usually +15V. To defeat this protection and allow the outputs to be pulled above 15V, pin 10 of the driver IC must be removed from the socket.

Sourcing Drivers

On newer hardware versions of PMAC, those with jumpers E101 and E102, a UDN2981A open-emitter (sourcing) driver can be substituted for the standard sinking driver. This is done by exchanging the IC in the socket and changing the placement of jumpers E101 and E102.

Polarity Control

Jumper E17 controls the polarity of these outputs. For PMAC PC, a jumper ON means low true enable (default); a jumper OFF means high true enable. PMAC PC has a single jumper E17 for all four or eight lines; PMAC Lite, -VME, and -STD have separate jumpers E17A to E17H for each channel. For PMAC Lite, -VME, and –STD, a jumper OFF means low true enable (default for PMAC Lite and -VME); a jumper ON means high-true enable (default for PMAC STD). The reason that the polarity is under hardware, not software control is that it is important to make sure the amplifiers are properly disabled even if the software fails.
Failsafe Polarity
With the default sinking drivers for the amplifier enable signals, using the low-true enable polarity (low voltage — conducting — is enable; high voltage — non-conducting — is disabled) provides better failsafe protection against loss of power supply. If either the +5V supply for the PMAC computational section, or the +15V analog supply is lost, the amplifier will be disabled automatically, because the output transistor will go into its non-conducting state. To use this failsafe protection without connecting a signal of this polarity directly to the amplifier, use intermediate circuitry to change the signal format. With the alternate sourcing drivers, the high-true enable polarity provides better failsafe protection.
46 Input/Output: Connecting PMAC to the Machine
PMAC User Manual

Direction Bit Use

An alternate use for these outputs is as the direction (sign) bits for drive systems expecting sign-and­magnitude commands. Some servo amplifiers expect this command format, and if the signal needs to be run through a voltage-to-frequency converter such as the Acc-8D Opt 2 to create a pulse train for a stepper drive, this format should be used. To use the output in this manner, bit 16 of Ix25 for the motor using this line must be set to 1. This disables its use as an amplifier-enable line. In addition, bit 16 of Ix02 for the motor must be set to 1. This makes the analog output an absolute value, and places the sign bit on this output.

General-Purpose Use

If no dedicated use is made of this output, it may be used as a general-purpose output by assigning an M­variable to the bit (M114, M214, etc., in the suggested M-variable definitions).

Compare-Equals Outputs

The compare-equals (EQU) outputs have a dedicated use of providing a signal edge when an encoder position reaches a pre-loaded value. This is very useful for scanning and measurement applications. Instructions for use of these outputs are covered in detail in the Synchronizing PMAC to External Events section of this manual.
PMAC PC
On the PMAC PC, there is not a framed connector for the EQU outputs. However, these signals may be brought out by placing a 26-pin IDC connector over the 13 E-point pairs E53 to E65, which include the eight EQU lines. These outputs are TTL-level with very low drive capability; they must be buffered externally before they can drive any real devices. Acc-27, normally used as an I/O buffer for the thumbwheel multiplexer port, can be used to drive several of these EQU lines. The 26-pin cable provided with the Acc-27 fits over the 13 jumper pairs E53-E65.
PMAC VME
On PMAC VME, these signals are brought out on connector J7 (JEQU), referenced to digital ground (GND). As shipped from the factory, they are open-collector (sinking) outputs, with a ULN2803A driver IC, rated to 24V and 100mA each. They may be changed to open-emitter (sourcing) drivers by replacing this chip in U28 with a UDN2981A driver IC and changing jumpers E93 and E94.
PMAC Lite
On PMAC Lite, these signals are brought out on connector J8 (JEQU), optically isolated from the digital circuitry, referenced either to analog ground (AGND) or an external flag supply ground. As shipped from the factory, they are open-collector (sinking) outputs, with a ULN2803A driver IC, rated to 24V and 100mA each. They may be changed to open-emitter (sourcing) drivers by replacing this chip in U54 with a UDN2981A driver IC and changing jumpers E101 and E102.
PMAC STD
On PMAC STD, these signals are brought out on connector J6 (JEQU) on each of the piggyback boards. They are open-collector (sinking) outputs with internal 1 k pull-up resistors, rated to 5V.
On PMAC STD1.5, these signals are brought out on connector J8 (JEQU), optically isolated from the digital circuitry, referenced either to analog ground (AGND) or an external flag supply ground. As shipped from the factory, they are open-collector (sinking) outputs, with a ULN2803A driver IC, rated to 24V and 100mA each. They may be changed to open-emitter (sourcing) drivers by replacing this chip in U54 with a UDN2981A driver IC and changing jumpers E101 and E102.
Input/Output: Connecting PMAC to the Machine 47
PMAC User Manual
Optically Isolated Analog Outputs (JMACH Port)
PMAC provides high-precision analog outputs on the JMACH machine connectors that are used to command servo amplifiers as a velocity command, a torque command, or phase current commands (in pairs). Each channel of PMAC provides complementary DAC and DAC/ outputs, operating from 16-bit digital-to-analog converters. Each output has a range of -10V to +10V, providing a resolution of 300µV/bit.

Connections

If the amplifier has a single-ended input, DACn should be used as the command line, and AGND as the return. If the amplifier has a differential input, DACn should be used as the command line and DACn/ as the return. The common of the amplifier input should still be tied to the PMAC AGND in this case.

Isolation

The analog command output circuitry is optically isolated from the digital logic circuitry on PMAC. Usually the analog circuitry will get its power from the amplifier (most amplifiers provide +/- 15V for this purpose). Use Jumpers E85, E87, E88, and E90 to jumper the power supply for the analog circuitry from the digital side of the board, but this defeats the optical isolation; it is not recommended for any high-power or high-noise environment, especially when PMAC is electrically connected to a host computer, either by backplane bus or by non-isolated serial cable.

Drive Capability

The analog outputs are intended to drive high-impedance inputs with no significant current draw. The 220 output resistors will keep the current draw lower than 50mA in all cases and prevent damage to the output circuitry, but any current draw above 10mA can result in noticeable signal distortion.

General-Purpose Use

Any analog output not used for dedicated servo purposes may be utilized as a general-purpose analog output. Usually, this is done by defining an M-variable to the digital-to-analog-converter register (suggested M-variable definitions M102, M202, etc.), then writing values to the M-variable.
General-Purpose Digital Inputs and Outputs (JOPTO Port)
The PMAC JOPTO connector (J5 on PMAC PC, Lite, and VME) provides eight general-purpose digital inputs and eight general-purpose digital outputs. Each input and each output has its own corresponding ground pin in the opposite row. The 34-pin connector was designed for easy interface to OPTO-22 or equivalent optically isolated I/O modules. Delta Tau's Accessory 21F is a six-foot cable for this purpose.
The PMAC STD has a different form of this connector from the other versions of PMAC. Its JOPT connector (J4 on the base board) has 24 I/O, individually selectable in software as inputs or outputs. The rest of this discussion does not pertain to the PMAC STD port, unless specifically mentioned. Refer to the PMAC STD Hardware Reference Manual for details on its JOPT port.

Software Access

These inputs and outputs are typically accessed in software through the use of M-variables. In the suggested set of M-variable definitions, variables M1 through M8 are used to access outputs 1 through 8, respectively, and M11 through M18 to access inputs 1 through 8, respectively. This port maps into the PMAC memory space at Y address $FFC2.

Standard Sinking Outputs

CAUTION:
Having Jumpers E1 and E2 set wrong can damage the IC.
48 Input/Output: Connecting PMAC to the Machine
PMAC User Manual
PMAC is shipped standard with a ULN2803A sinking (open-collector) output IC for the eight outputs. These outputs can sink up to 100mA, but must have a pull-up resistor to go high.
CAUTION:
Do not connect these outputs directly to the supply voltage, or damage to the PMAC will result from excessive current draw.
Provide a high-side voltage (+5 to +24V) into Pin 33 of the JOPTO connector and allow this to pull up the outputs by connecting pins 1 and 2 of Jumper E1. Jumper E2 must also connect pins 1 and 2 for a ULN2803A sinking output.

Option for Sourcing Outputs

CAUTION:
Having Jumpers E1 and E2 set wrong can damage the IC.
It is possible for these outputs to be sourcing drivers by substituting a UDN2981A IC for the ULN2803A. This IC (U3 on the PMAC PC, U26 on the PMAC Lite, U33 on the PMAC VME) is socketed, and so may be replaced easily. For this driver, use pull-down resistors. With a UDN2981A driver IC, Jumper E1 must connect pins 2 and 3, and Jumper E2 must connect pins 2 and 3.

Input Source/Sink Control

Jumper E7 controls the configuration of the eight inputs. If it connects pins 1 and 2 (the default setting), the inputs are biased to +5V for the OFF state, and they must be pulled low for the ON state. If E7 connects pins 2 and 3, the inputs are biased to ground for the OFF state, and must be pulled high for the ON state. In either case, a high voltage is interpreted as a 0 by the PMAC software, and a low voltage is interpreted as a 1.
Thumbwheel Multiplexer Port I/O (JTHW Port)

Multiplexed Uses

The Thumbwheel Multiplexer Port, or Multiplexer Port, on the JTHW (J3) connector has eight input lines and eight output lines. The output lines can be used to multiplex large numbers of inputs and outputs on the port, and Delta Tau provides accessory boards and software structures (special M-variable definitions) to capitalize on this feature. Up to 32 of the multiplexed I/O boards may be daisy-chained on the port, in any combination.
Port Accessories
The Acc-18 Thumbwheel Multiplexer board provides up to 16 BCD thumbwheel digits or 64 discrete TTL inputs per board. The TWD and TWB forms of M-variables are used for this board.
The Acc-34, -34A, and -34B Serial I/O Multiplexer boards provides 64 I/O point per board, optically isolated from PMAC. The TWS form of M-variables is used for these boards.
The Acc-8D Option 7 Resolver-to-Digital Converter board provides up to four resolver channels whose absolute positions can be read through the thumbwheel port. The TWR form of M-variables is used for this board.
The Acc-8D Option 9 Yaskawa encoders. The absolute position is read serially through the multiplexer port on power up.
Absolute Encoder Interface board can connect to up to four of these
Input/Output: Connecting PMAC to the Machine 49
PMAC User Manual

Non-Multiplexed Uses

If none of these accessory boards is used, the inputs and outputs on this port may be used as discrete, non­multiplexed I/O. They map into the PMAC processor space at Y address $FFC1. The suggested M­variable definitions for this use are M40 to M47 for the eight outputs and M50 to M57 for the eight inputs. The Acc-27 Optically Isolated I/O board buffers the I/O in this non-multiplexed form, with each point rated to 24V and 100mA.
Control-Panel Port I/O (JPAN Port)
The JPAN connector (J2 on PMAC PC, Lite, VME, and top board of PMAC STD) is a 26-pin connector with dedicated control inputs, dedicated indicator outputs, a quadrature encoder input, and an analog input. The control inputs are low true with internal pull-up resistors. They have predefined functions unless the control-panel-disable I-variable (I2) has been set to 1. If this is the case, they may be used as general-purpose inputs by assigning M-variables to their corresponding memory-map locations (bits of Y address $FFC0).

Discrete Inputs

Command Inputs
JOG-/, JOG+/, PREJ/ (return to pre-jog position), and HOME/ affect the motor selected by the FDPn/ lines (see below). STRT/ (run), STEP/, STOP/ (abort), and HOLD/ (feed hold) affect the coordinate system selected by the FDPn/ lines.
Selector Inputs
CAUTION:
Do not change the selector inputs while holding one of the jog inputs low. Releasing the jog input then will not stop the previously selected motor. This can lead to a dangerous situation.
The four low-true BCD-coded input lines FDP0/ (LSBit), FDP1/, FDP2/, and FDP3/ (MSBit) form a low­true BCD-coded nibble that selects the active motor and coordinate system (simultaneously). These are usually controlled from a single 4-bit motor/coordinate-system selector switch. The motor selected with these input lines will respond to the motor-specific inputs. It will also have its position following function turned on (Ix06 is set automatically to 1.); the motor just de-selected has its position following function turned off (Ix06 is set automatically to 0.).

Alternate Use

The discrete inputs can be used for parallel-data servo feedback or master position if I2 has been set to 1. The Acc-39 Handwheel Encoder Interface board provides 8-bit parallel counter data from a quadrature encoder to these inputs. Refer to the Acc-39 manual and the Parallel Position Feedback Conversion sections under Setting up a Motor in this manual for more details on processing this data.

Reset Input

Input INIT/ (reset) affects the entire card. It has the same effect as cycling power or a host $$$ command. It is hard-wired, so it retains its function even if I2 is set to 1.

Handwheel Inputs

The handwheel inputs HWCA and HWCB can be connected to the second encoder counter on PMAC with jumpers E22 and E23. If these jumpers are on, nothing else should be connected to the Encoder 2 inputs. The signal can be interpreted either as quadrature or as pulse (HWCA) and direction (HWCB), depending on the value of I905. I905 also controls the direction sense of this input. Make sure that the Encoder 2 jumper E26 is set for single ended signals, connecting pins 1 and 2.
50 Input/Output: Connecting PMAC to the Machine
PMAC User Manual

Analog Input

The Wiper analog input (0 to +10V on PMAC PC, -VME, and -STD; -10V to +10V on PMAC Lite, referenced to digital ground) provides an input to a voltage-to-frequency converter (V/F) with a gain of 25 kHz/Volt, providing a range of 0-250 kHz. The output of the V/F can be connected to the Encoder 4 counter using jumpers E72 and E73. If these jumpers are on, nothing else should be connected to the Encoder 4 inputs. Make sure that the Encoder 4 jumper E24 is set for single-ended signals, connecting pins 1 and 2.
Frequency Decode
When used in this fashion, Encoder 4 must be set up for pulse-and-direction decode by setting I915 to 0 or 4. Usually a value of 4 is used, because with CHB4 (direction) unconnected, a positive voltage causes the counter to count up.
Power Supply
For the V/F converter to work, PMAC must have +/-12V supply referenced to digital ground. If PMAC is in a bus configuration, this usually comes through the bus connector from the bus power supply. In a standalone configuration, still this supply must be brought through the bus connector (or the supply terminal block on the PMAC Lite), or it must be jumpered over from the analog side with E85, E87, and E88, defeating the optical isolation on the board.
PMAC Lite Special Considerations
Since the PMAC Lite’s Wiper input has bipolar capability, it has a few special considerations. If used in bipolar fashion, the offset potentiometer (R18) should be adjusted for minimum deadband in the zero crossing (monitor on CHA4 on the JMACH1 connector). If used in unipolar fashion, R18 should be adjusted for some deadband to assure that 0V in creates no frequency; also jumper E73 should be left OFF to make sure no glitches get into the sign bit of the counter.
On PMAC Lite, the pulse and direction signals may be output on the CHA4 and CHB4 pins, respectively, of the JMACH1 connector. These can be used to command a stepper-motor driver. The DAC4 output can be wired into the WIPER input, which provides both the feedback that the servo loop requires, and the command signals to the driver. This permits the PMAC Lite to drive one stepper motor without a special accessory board.
Software Processing
The encoder conversion table can then take the difference in the counter each servo cycle and scale it, providing a value proportional to frequency, and therefore to the input voltage. Usually this is used for feedrate override (time base control), but the resulting value can be used for any purpose. Refer to the Time-Base Control section in this manual.
Status Outputs
There are five dedicated low-true outputs on the JPAN connector, usually used to light LEDs. They are BRLD/ (buffer-request LED), IPLD/ (in-position LED), EROR/ (Error condition LED), F1LD/ (1st warning following error LED), and F2LD/ (which goes true when the watchdog timer trips). BRLD/, ERLD/, and F2LD/ are global status lines. IPLD/ and F1LD/ are coordinate-system specific status lines. If I2=0, they refer to the panel-selected coordinate system (by FDPn/). If I2=1, they refer to the host­selected coordinate system (&n).
If I2=0 but no coordinate system is selected (all FPDn/ inputs are floating or pulled high), these lines can be used as general purpose outputs, addressed as bits 20-23 of Y:$FFC2 (Y:$FFFD bits 0-3 on PMAC STD).
Input/Output: Connecting PMAC to the Machine 51
PMAC User Manual
Display Port Outputs (JDISP Port)
The JDISP connector (J1) allows connection of the Acc-12 or Acc-12A liquid crystal displays, or of the Acc-12C vacuum fluorescent display. Both text and variable values may be shown on these displays using the DISPLAY command, executing in either motion or PLC programs.
VAL UE
TO VOLTAGE
PROPORTIONAL
COUNT
INTERPOLATED
COUNT
INTEGER
0 TO 250 KHz
PULSE TRAIN
24
X:$729
"TIME
BASE"
CONVERSION
Y:$728=$400723
24
X:$723
1/T
ENCODER
CONVERSION
Y:$723=$00C00C
24
X:$C00C+
ENC4
CHA4
E72
I915=4
COUNTER
DECODER/
CHA4/
E73
(E24:1-2)
SOFTWARE
SOFTWARE
SOFTWARE-CONFIGURED
DIFFERENTIATION
INTERPOLATION
HARDWARE COUNTER
Y:$729=SCALING
V/F
(OPTIONAL
25 KHz/V
VOLTAGE
0 TO +10V
J2
25
+5V
+10V
USER
PROVIDED)
20
WIPER
~5Kohm
26
GND
HARDWARE
VOLTAGE-TO-FREQUENCY
CONVERTER
TO USE THIS VALUE FOR FEEDRATE OVERRIDE FOR A COORDINATE SYSTEM, SIMPLY SET
THE TIME BASE SOURCE ADDRESS I-VARIABLE (Ix93 FOR C.S.x) TO 1833 ($729)
SCALING IS SET BY THE VALUE IN Y:$729 (FOR THE DEFAULT CONVERSION TABLE).
THIS VALUE CAN BE DETERMINED INTERACTIVELY BY VARYING THE INPUT VOLTAGE
TO USE THIS VALUE FOR SOME OTHER PURPOSE, SIMPLY ASSIGN AN M-VARIABLE TO
AND NOTING THE EFFECT
THIS REGISTER (e.g. M60->X:$729,0,24,U)
Figure 4 Using the PMAC Control Panel Analog (Wiper) Input
52 Input/Output: Connecting PMAC to the Machine
PMAC User Manual
SETTING UP A MOTOR
What is a Motor?
A motor, to PMAC, is a unit that has feedback, output, flags, and potentially a master. A motor is set up by assigning it these attributes and activating it. This is done through the use of I (initialization) variables. Position information is typically pre-processed through a structure known as the Encoder Conversion Table, explained below.
Defining the Motor
The settings of a few I-variables define the motor for PMAC. That is, they tell it where to get its inputs, and where to put its outputs (which is as much as PMAC can really know). By making all of these locations set up by variable values, PMAC provides incredible flexibility in setting up a system.

Motor I-Variables

Each motor has an identical set of I-variables. The hundreds digit of the I-variable number corresponds to the number of the motor. To refer to a motor I-variable generically, we replace the hundreds digit with the letter x, where x represents the number of whichever motor we are dealing with at the time (for example Ix03 could represent I103, I203, I303, and so on, to I803).
The default values of the variables provide the settings that most will want to use, so they will not need to change these settings. However, if a different setup from the default is desired, it is a simple matter of changing a variable or two.
Activating the Motor
Variable Ix00 for Motor x controls whether PMAC does calculations for this motor or not. If using Motor x at all, set Ix00 to 1 (activated). If not using the motor at all, set Ix00 to 0 (de-activated), so PMAC does not waste processor time doing calculations for the non-existent motor. An activated motor can be either enabled or disabled; activation simply means that PMAC is paying attention to what happens on the motor.

Does PMAC Commutate this Motor?

Virtually all motors need to be commutated somehow — the only significant exception is the voice-coil motor. The important question here is whether PMAC does the commutation. If the commutation is done inside the motor (as in brush motors) or in the amplifier, PMAC does not need to do the commutation, and Ix01 must be set to 0. If this is the case, only one analog output is required for the motor, and it does not matter what the settings of the commutation I-variables (Ix70-Ix83) are.
If PMAC is to perform the commutation for the motor, Ix01 must be set to 1. In this case, two analog outputs are required for the motor, and Ix70-Ix83 must be set up to commutate the motor properly. Refer to the Setting Up PMAC Commutation section in this manual.

Address I-Variables

Each motor has several address I-variables. These pointer variables contain the address in the PMAC memory and I/O space of a register where PMAC will read or write data automatically. These variables include Ix02, Ix03, Ix04, Ix05, Ix10, Ix25, Ix81, and Ix83. Because PMAC has a 16-bit address bus, it takes 16 bits (four hexadecimal digits) to specify an address. However, the address I-variables are 24-bit values, and the upper eight bits can be used to specify alternate modes for using the designated register. If all of the upper bits are zero, the register is used in the default fashion. Refer to the individual I­variable descriptions in the PMAC and PMAC2 Software Reference Manual, for details on the alternate usage modes for each of these I-variables.
Setting Up a Motor 53
PMAC User Manual
To the beginner, the need to specify addresses for input and output may seem cumbersome. However, for basic applications, most can use the sensible default values (Motor n uses DACn, Encoder n, and Flags n), and the ability to assign inputs and outputs at will provides unprecedented flexibility in more sophisticated applications.

Hex vs. Decimal Reporting

If I9 is 0 or 1, PMAC will report address I-variable values as decimal numbers. If I9 is 2 (default) or 3, it will report these values as hexadecimal numbers. Usually, it is much easier to interpret these values as hexadecimal numbers, especially when alternate modes are used, because the address digits themselves can be seen. For example, setting I102 to $C003 (49155) specifies the use of DAC1 for Motor #1 command output in the normal bipolar mode.
Setting bit 16 to 1 tells PMAC to use the register in unipolar (magnitude and direction) mode. In hexadecimal form, PMAC would report this value back as $1C003, so the address is still obvious, but in decimal form, PMAC would report 114691, completely obscuring the address.

Selecting the Output(s)

Variable Ix02 determines in which register (or pair of registers, if PMAC-commutated) motor x places its command output every cycle. The value of Ix02 is the address of the register. Usually, this is a digital­to-analog-converter (DAC) register. The default value of Ix02 is the register address of DACx (e.g., Motor 1 uses DAC1 by default).
Pulse and Direction Output
PMAC can command drives that accept pulse-and-direction inputs — stepper drives and stepper­replacement servo drives. The analog output from PMAC is converted to a pulse train through a voltage­to-frequency converter on the Acc-8D Opt 2 board. The PMAC output must be set in sign-and-magnitude mode by setting bit 16 of Ix02 to 1. The pulse train can be fed back to PMAC for a simulated servo loop, or an actual encoder can be used.

Selecting the Position Loop Feedback

Variable Ix03 determines from which register Motor x gets its actual position information to close its position loop every servo cycle. The value of Ix03 is the address of the register. Usually, this register is the Encoder Conversion Table and contains processed information from a feedback device. With the default setup of the Encoder Conversion Table, the default value of Ix03 is the register address of processed data from Encoder x (e.g., Motor 3 uses Encoder 3 by default).

Selecting the Velocity Loop Feedback

Variable Ix04 determines from which register Motor x gets actual position information to close its velocity loop every servo cycle. The value of Ix04 is the address of the register. Usually, this register is in the Encoder Conversion Table and contains processed information from a feedback device. With the default setup of the Encoder Conversion Table, the default value of Ix04 is the register address of processed data from Encoder x (e.g. Motor 3 uses Encoder 3 by default).

Dual Feedback Systems

In most systems, this register is the same register that is used for closing the position loop, which means that Ix03 equals Ix04. However, the concept of dual feedback is becoming increasingly popular in motion systems today. In such a system, there are position sensors on both the motor and the load.
54 Setting Up a Motor
PMAC User Manual
A
LOW 16 BITS (4 HEX DIGITS) SPECIFY THE ADDRESS
WHEN HIGH 8 BITS ARE ZERO, ADDRESS IS USED IN NORMAL MODE
I9=2 OR 3: PMAC REPORTS VARIABLE VALUE IN HEX
FECP
+-
AP
HEX ($)
BINARY
MODES
0
1
000000000000000000011 111
DDRESS
C003
Figure 5 Address I-Variables
Ix02 DAC output address Ix03 POSITION loop feedback address Ix04 VELOCITY loop feedback address
Ix02
+
CV
PI
AV
VE
-
D
Ix04
DAC Locations
DACn
DACn+1
Y: $C002-$C03B
Encoder Table
ENCn
ENCn+1
AMP
LOAD
ENC MOT
LIN ENC
X: $0720-$0739
Ix03
Figure 6 PMAC Pulse and Direction Output
Accuracy vs. Stability
A sensor on the load (often a linear scale) provides a more accurate measure of position than a sensor on the motor, because its accuracy is not affected by imperfections in the motor-load coupling. However, it can also make the axis less stable, because these coupling imperfections (typically compliance and backlash) are now inside the loop. A sensor on the motor, while less accurate provides better stability because these imperfections are not inside the loop.
In many cases, it is possible to get both accuracy and stability by using sensors on both the motor and the load. In a PMAC system, simply use the load encoder to close the position loop (for accuracy), using Ix03 to point to this encoder; and use the motor encoder to close the velocity loop (for stability), using Ix04 to point to this encoder.
Setting Up a Motor 55
PMAC User Manual
Note:
When using dual feedback, the motor flags specified by Ix25 (see below) should have the same number as the position-loop encoder. Otherwise, the hardware position-capture function for homing will not work, and the less accurate software position-capture function must be used. For example, if the velocity-loop encoder is ENC1 (Ix04=$0720) and the position-loop encoder is ENC2 (Ix03=$0721), the motor flags must be Flags 2 (Ix25=$C004) in order to use the hardware position capture. If the flags are of a different number, the software position capture function must be specified for homing by setting bit 16 of Ix03 to 1 (e.g., Ix03=$10721).

Selecting the Master Position Source

Variable Ix05 determines from which register Motor x gets its master position information. The value of Ix05 is the address of the register. Usually, this is a register in the Encoder Conversion Table that contains processed information from a position sensor. With the default setup of the Encoder Conversion Table, the default value of Ix05 is the register address of processed data from Encoder 2 (i.e., all motors use Encoder 2 as a master). This setting permits a single master encoder to be brought in on the control­panel port (J2), and have any motor follow it if that motor’s following function is enabled.
The master position is the source of data for the PMAC position following function (often called electronic gearing). This topic is covered in detail in the Synchronizing PMAC to External Events section of this manual.

Selecting the Flag Register

Variable Ix25 determines which register Motor x uses for its flag inputs (limits, home flag, amplifier fault, and index channel) and output (amplifier-enable/direction). The value of Ix25 is the address of the register. Usually, this is a control/status register in the DSPGATE IC. The default value of Ix25 is the register address of the control/status register for Encoder x (e.g. Motor 4 uses +LIM4, -LIM4, HMFL4, FAULT4, CHC4, and AENA4/DIR4). In order to use the accurate hardware position capture function for homing, the number of the flag set must match the number of the position-loop encoder specified by Ix03.

Selecting the Power-Up Mode

Variable Ix80 determines whether the motor will be enabled or disabled at the end of the power-up/reset cycle. If Ix80 is 1, the motor will be enabled automatically at the end of the power-up/reset cycle, in a closed-loop, zero velocity state, with the commanded position set equal to the actual position at the time. If a phasing search is required for a PMAC-commutated motor, it will be done automatically. If Ix80 is 0, the motor will be left disabled (killed). A command will be required to enable the motor: for a PMAC­commutated motor, the $ command must be used; for a motor not commutated by PMAC, either the $ or
J/ command may be used, or the A command for all the motors in a coordinate system, or the <CTRL­A> command for all PMAC motors.
Types of Position Sensors
PMAC is designed to take incremental encoder feedback without any accessories. With the appropriate accessories, it can also take resolver, absolute encoder, analog, or magnetostrictive linear displacement transducer feedback. These features are explained in further detail below.

Quadrature Encoder Feedback

PMAC can take quadrature encoder signals as position feedback with software programmable decode selection of x1, x2, or x4 decode (pulse and direction decode is also possible). Encoder I- variable 0 (I900, I905, etc.) determines the decode method and direction sense for each encoder. The 24-bit hardware counter is software-extended to over 36 bits (64 billion counts). A software parameter (Ix27) allows position rollover at a user-specified value: this is especially useful for rotary axes. Any unused encoder counter in a DSPGATE IC may be utilized as a hardware timer (refer to I900 description).
56 Setting Up a Motor
PMAC User Manual
1/T Sub-count Interpolation
There are two optional methods on PMAC for achieving sub-count resolution with incremental feedback. The first is called 1/T decoding. Each encoder channel has two timer registers associated with it. The first register holds the time between the last two encoder transitions. Velocity is estimated as being inversely proportional to this time — a very accurate estimation, particularly at low speeds.
The second timer holds the time since the last transition. Fractional distance traveled since the last transition is estimated as the value of the second timer divided by the value of the first timer (see figure 7-
3). This interpolation provides added smoothness to low speed moves, but it does not provide accurate interpolation at rest. 1/T decoding requires the $00 conversion format (see below).
Parallel Sub-count Interpolation
The second method of interpolation allows PMAC to read up to five bits of parallel fractional information to supplement the integer quadrature count. Usually this information is derived from analog sine/cosine quadrature signals of encoders or interferometers through analog-to-digital converter circuitry. This circuitry, which creates digital quadrature and the parallel fractional bits, must be external to PMAC, either on Delta Tau’s Acc-8D Option 8, Analog Encoder Interpolator board, or on user-provided circuitry. PMAC provides simultaneous latching of the quadrature counter and the parallel inputs to ensure synchronicity of the data.
This interpolation method, unlike the 1/T method, provides accurate interpolation at rest as well as during movement. If the A/D conversion circuitry does not provide accurate interpolation at high speeds, it is possible to change on the fly between 1/T and parallel interpolation.
This type of sub-count extension may be done only on odd-numbered encoders. The five bits are the five inputs associated with the next higher-numbered encoder: FAULT (MSBit), +LIM, -LIM, HMFL, and CHC (LSBit). Parallel sub-count extension requires the $80 conversion format (see below).
Servo
Interrupts
A
B
T
T
1
2
Velocity Estimation : V =
Position Estimation : P = Counter +/-
Figure 7 PMAC 1/T Extension
T
T
1
2
K
n
T
1
T
n
2
T
1
Setting Up a Motor 57
PMAC User Manual

Hardware Changes

To implement this type of feedback properly, several settings in hardware and software must be changed from the default. First, the socketed opto-isolators for the flag bits being used as interpolated bits must be removed and replaced with hard-wired shunts so the signals are not delayed. This will tie the flag circuitry to the digital circuitry. In this case, it is desirable to supply the remaining true flags from the digital +12V circuitry (by moving the E90 jumper) and to tie the low ends to digital ground (GND); this will retain the isolation between digital and analog circuitry.

Software Changes

In software, it is important to disable the digital delay filters on the encoder inputs of both the main encoder, and the encoder matching the flag bits (even though that encoder is not actually used for this function). This is done by setting Encoder I-Variable 1 (I901, I906, I911, etc.) to 1 for both of these encoders.

Parallel Position Feedback

PMAC can take parallel position feedback (e.g., from an absolute encoder, laser interferometer, or an already converted analog signal) through its I/O expansion board (Accessory 14D/V). Each Acc-14D/V board has 48 bits of input, so it may be connected to two parallel feedback devices of up to 24 bits each, or one of over 24 bits. Up to six Acc-14D boards may be connected to a single PMAC. The parallel feedback devices must provide straight binary data, not gray code. The PMAC internal registers will extend the count automatically if the parallel device rolls over (unless the PMAC register is set up to roll over as well).
58 Setting Up a Motor
PMAC User Manual
Parallel position feedback requires one of the conversion formats $20, $30, $60, or $70 (see below).
DATA BUS
C CHANNEL
DSP-GATE
USE THESE INPUTS ON
PMAC'S "EVEN" CHANNEL
FOR "ODD" CHANNEL'S
INTERPOLATED POSITION
ENCODER BITS.
HOME FLAG
HF
-LIM
+LIM
FAULT "MSB"
"C" "LSB"
DATA LATCH
24 BIT
ENCODER COUNTER
B
A
"SCLK"
SELECT CLOCK FREQUENCY
OR SOURCE AS DESIRED
"E" POINT SELECTORS
E38
E37
E36
E35
E34
AND
A/B QUAD
INTERPOLATOR
SYNCHRONIZER
DIVIDER
20 MHz
EXT.
10 MHz MAX.
32
A
increments
A/B QUAD
CONVERT TO
PMAC
B
90 DEGREES
INTERPOLATE INTO 32 INCREMENTS
WHEN USING BIT INTERPOLATION FOR ENCODE R.
NOTE: A 4 AXIS PMAC CAN HANDLE ONLY 2 AXIS OF CONTROL
90
5 BITS
A
LASER
EDGE OF CLOCK
ALL OUTPUTS TO BE
LATCHED ON RISING
B
OR
ENCODER
INTERPOLATED
INTERFEROMETER
Figure 8 Interpolated Encoder Feedback
Setting Up a Motor 59
PMAC User Manual

Parallel Absolute Feedback

When using an absolute encoder as the feedback device, the data is presented to PMAC in parallel form. All lines must be presented together; no high-word low-word select schemes are permitted. With the absolute nature of the device, the power-on/reset position is not automatically zero. For this type of device, PMAC can use the Ix10 parameter to read the absolute power-on/reset position up to a width of 48 bits. If Ix10 is set to 0, the absolute power-on/reset position read function is disabled, and the power­on/reset position is set to zero, regardless of the setting of the sensor, and subsequent position readings are incrementally referenced to this zero position. For more information, refer to the Absolute Power-Up Position section in this manual and to the Ix10 description in the Software Reference manual.
Sensor Rollover
If the overall travel for the axis is more than the range of the absolute device, PMAC will automatically extend the position in software to handle rollover. In this case, however, the device should be considered a parallel incremental device (see next section). A device can be considered absolute for commutation purposes, so no power-on phasing search is required (set Ix81=0 if PMAC is doing the commutation), but still incremental for overall machine positioning functions. In most systems, single-turn resolvers and absolute encoders have this functionality. Refer to the Phasing Referenced to an Absolute Sensor in Setting Up PMAC Commutation section in this manual for more information on this type of setup.
It is important with this type of feedback device to perform a PMATCH (position-match) function before the first programmed move after power-up/reset. Usually this is done automatically by having I14 equal to 1. If this is not done, PMAC will calculate the first move for the motor assuming a starting point of zero, instead of the true position, leading to unexpected performance on the first move.
Parallel Incremental Feedback
A device such as a laser interferometer often provides parallel feedback data, but the device is fundamentally incremental, so it does not know where it is on power-on/reset. The PMAC setup to accept this type of feedback is the same as for an absolute parallel device, but recognize that a homing procedure is necessary. For this type of device, leave Ix10 equal to zero, so that PMAC does not perform an absolute power-on/reset position read.
However, since the position information is not absolute, and since PMAC has the ability to extend position range in software, it is not necessary to bring all the lines of a device to PMAC. This can save money on interfacing costs. All that is needed is enough lines (starting from the LSB) so that half the range of those lines will not be covered in a single servo cycle. For instance, a typical interferometer interface has 32 bits of parallel data. Even with a servo cycle of 1 msec, which is slow for PMAC, wiring
only the low 16 lines to PMAC is sufficient as long as the maximum speed is less than 32,768 (215) counts/msec, or 32,768,000 counts/sec.
Software Capture on Homing
The motor using this device for position feedback must be programmed to do a software position capture on a homing search move, instead of the hardware position capture performed with incremental encoders. This is done by setting bit 16 of variable Ix03 for the motor to 1 (if Ix03 were $0720, it would become $10720). The delay in software capture can be a few milliseconds; the speed of the homing search move may need to be limited for high homing accuracy.

Linear Displacement Transducer Feedback

PMAC can accept feedback from a linear displacement transducer (LDT) through its Acc-29 interface board. (The best-known brand name for this type of device is Temposonics from MTS Corp.) This type of device operates much like sonar, and what is being measured is the time before the echo is returned. Acc-29 uses the timer registers of its on-board DSPGATE ICs to record this information, therefore, the larger the time, the longer the distance.
60 Setting Up a Motor
PMAC User Manual
To PMAC itself, this type of feedback looks like an absolute encoder. The source of the data is the appropriate timer register, not the Acc-14D I/O register. The $20 or $30 conversion format would be used, and the data would be found in the Encoder 9 through Encoder 16 timers that measure the time between the last two pulses (Y:$C020, Y:$C024, ... Y:$C03C). See below under Parallel Position Feedback Entries for instructions on the software setup for this type of feedback.
For this type of device, PMAC can use the Ix10 parameter to read the absolute power-on/reset position up to a width of 24 bits. If Ix10 is set to 0, the absolute power-on/reset position read function is disabled, and the power-on/reset position is set to zero, regardless of the setting of the sensor, and subsequent position readings are incrementally referenced to this zero position. For more information, refer to the Absolute Power-Up Position section in this manual, the Ix10 description in the Software Reference manual, and the Acc-29 MLDT Interface manual.
It is important with this type of feedback device to perform a PMATCH (position-match) function before the first programmed move after power-up/reset. Usually this is done automatically by having I14 equal to 1. If this is not done, PMAC will calculate the first move for the motor assuming a starting point of zero, instead of the true position, leading to unexpected performance on the first move.

Analog Position Feedback

If analog feedback is desired from a potentiometer or an LVDT, PMAC can accept high-band width analog feedback through one of its analog-to-digital converter boards (Acc-23 or Acc-28). Any modulated analog position signal must be demodulated before it is presented to the PMAC system so that a fixed position is represented by a DC voltage. PMAC does not support the software extension of analog position feedback through its accessory cards, so no rollover should be permitted. Analog feedback through Acc-23 or Acc-28 requires conversion format $10 (see below).
If the analog data is converted to digital form external to PMAC or its accessory boards, then it will be fed into PMAC as a parallel data word, and PMAC will treat it like an absolute encoder (see above).
For this type of device, PMAC can use the Ix10 parameter to read the absolute power-on/reset position up to a width of 16 bits. If Ix10 is set to 0, the absolute power-on/reset position read function is disabled, and the power-on/reset position is set to zero, regardless of the setting of the sensor, and subsequent position readings are incrementally referenced to this zero position. For more information, refer to the Absolute Power-Up Position section in this manual, the Ix10 description in the Software Reference manual, and the Acc-28 or Acc-36 A/D Converter manual.
With the V1.15 firmware, it is also possible to use the A/D converters on a single Acc-36 for servo-loop feedback. I60 and I61 are used to specify the address and number of Acc-36 ADC registers to be copied into RAM automatically during phasing interrupts. The servo loop feedback functions read the data from these RAM registers, and should treat the data as 12-bit parallel position feedback (see above section).
For this type of device, PMAC can use the Ix10 parameter to read the absolute power-on/reset position up to a width of 12 bits. If Ix10 is set to 0, the absolute power-on/reset position read function is disabled, and the power-on/reset position is set to zero, regardless of the setting of the sensor, and subsequent position readings are incrementally referenced to this zero position.
It is important with this type of feedback device to perform a PMATCH (position-match) function before the first programmed move after power-up/reset. Usually this is done automatically by having I14 equal to 1. If this is not done, PMAC will calculate the first move for the motor assuming a starting point of zero, instead of the true position, leading to unexpected performance on the first move.
Setting Up a Motor 61
PMAC User Manual

Resolver Feedback

PMAC can accept resolver feedback through its Acc-8D Option 7 resolver-to-digital converter board. This board, which can be purchased in two-channel and four-channel configurations, processes the resolver data two ways: first into an absolute word (within one revolution of the resolver), and second, into a quadrature signal. Both have 4096 counts per electrical cycle of the resolver. An electrical cycle is a pole-pair, so a 4-pole resolver has two electrical cycles per mechanical revolution, or 8192 counts.
The reading of the absolute word is too slow to perform every servo cycle, so in typical use, this is only done at power-up/reset, if at all. The ongoing position is received from the quadrature encoder counter to which the converted quadrature signal has been connected. To the PMAC software, this then looks exactly like a real quadrature encoder.
For this type of device, PMAC can use the Ix10, I9x, and I8x parameters to read the absolute power­on/reset position of a single resolver, or of a system of 2 or 3-geared resolvers. If Ix10 is set to 0, the absolute power-on/reset position read function is disabled, and the power-on/reset position is set to zero, regardless of the setting of the sensor, and subsequent position readings are incrementally referenced to this zero position. If the absolute position of a single-turn resolver will be used only to prevent the need for a power-on phasing search, Ix81 is used to specify the absolute power-on phase position read. For more information, refer to the Absolute Power-Up Position section in this manual, the Ix10 description in the Software Reference manual and the Acc-8D Opt 7 R/D Converter manual.
Absolute Power-Up Position
In some applications, it is not permissible or desirable to do a homing search move after power-up or reset. In these applications, an absolute position sensor can be used so that the true position is known immediately on power-up/reset and there is no need to move to a known home position. The typical sensors used for this purpose are absolute encoders and resolvers. PMAC can support absolute power-on position reading from both of these sensors.

Absolute Position Range

To get absolute power-on position sufficient that no homing search move is required, the position sensor must be absolute over the entire range of travel of the axis. If the travel covers multiple revolutions of the motor and the sensor is absolute over only a single turn of the motor, a homing search will still be required. Although such a sensor can be used for power-on phasing of a brushless motor, for these purposes, the sensor should be treated as an incremental sensor. See Phasing Referenced to Absolute Sensor in the Commutation section of this manual, and the descriptions of Ix75 and Ix81 for information on power-on phasing.
If power-on absolute position of a system is desired without any rollover of the position, the rollover point(s) of the absolute sensor must be outside the range of travel. If treating the absolute position information as an unsigned quantity, the rollover points are the zero positions of the sensor. If treating the absolute position information as a signed quantity, the rollover points are half way in between the zero positions.
Each Motor x on PMAC has the variables Ix10, I9x, and I8x to support the absolute power-up position read. Ix10 specifies the register address in PMAC of the absolute sensor, and the method for reading it. I9x and I8x are used to specify second and third resolvers if a geared resolver system is used to determine power-on position.
62 Setting Up a Motor
PMAC User Manual

Parallel-Data Position

Ix10 can specify two types of feedback. If the absolute position data is presented to PMAC as a parallel word, usually through an Acc-14 I/O board, then the address specified in the low 16 bits of Ix10 is the address of the 'Y' PMAC register that holds this data (e.g., $FFD1). The high eight bits of Ix10 specify the number of bits to use at this register (and potentially the next higher register as well). The most significant bit specifies whether the quantity is to be treated as a signed or unsigned value and the second most significant bit (bit 22) specifies whether the data comes from an X-register or a Y-register.
Valid values for the number of bits in this mode are 8 to 48 ($08 to $30). If the most significant bit (value $80) is set to 1, giving a range for the high eight bits of $88 to $B0, the number read from the sensor is
treated a signed quantity, with a range of -(2 MSBit of Ix10 is zero, the sensor value is treated as an unsigned quantity, with a range of 0 to 2N-1.
Virtually all parallel I/O sources map into Y-registers in PMAC, so usually bit 22 (X/Y specification) is set to 0 to specify a Y data source.
Example:
For a 22-bit absolute encoder on Port B of the first Acc-14 (Y:$FFD1) to be read as an unsigned quantity, Ix10 would be set to $16FFD1 (16 hex is 22 decimal); to be read as a signed quantity, Ix10 would be set to $96FFD1. For a 32-bit absolute sensor with the low 24 bits at Port A of the first Acc-14 (Y:$FFD0) and the high eight bits at Port B (Y:$FFD1) to be read as an unsigned quantity, Ix10 would be set to $20FFD0 (20 hex is 32 decimal); to be read as a signed quantity, Ix10 would be set to $A0FFD0.
N-1
) to +2
N-1
-1, where N is the number of bits. If the

Note:

A sensor with parallel data output is not necessarily an absolute sensor. Laser interferometers often present their position data in parallel form, but they are incremental sensors and a motor using one for position feedback still must be homed. Ix10 should be left at 0 (no absolute power-on read) for any incremental sensors.

Resolver Position

The other type of power-on position data that can be specified with Ix10 is serial data from an Acc-8D Option 7 resolver-to-digital (R/D) converter board brought in through the thumbwheel multiplexer port. In this format, the low 16 bits of Ix10 specify the multiplexed address on this port, a value from 0 to 256 decimal matching the address set on the board with DIP switches. (Multiplexer addresses are even numbers ranging from 0 to 254; a value of 256 ($0100) should be used to specify multiplexer address 0, because PMAC interprets a value of 0 to mean no absolute power-on position read).
The high eight bits of Ix10 contain a value from 0 to 7 specifying the location of the particular R/D converter at that multiplexer address — there are potentially eight at each multiplexer address. In addition, the most significant bit (value $80) specifies whether the position is to be treated as a signed or unsigned quantity. If the MSBit is set to 0, the value read from the resolver is treated as an unsigned quantity, with a range of 0 to 4095; if the MSBit is set to 1, the value is treated as a signed quantity, with a range of -2048 to 2047.
For example, to use an R/D at location 3 of multiplexer address 2, treating the value as an unsigned quantity, Ix10 would be set to $030002; treating the value as a signed quantity, Ix10 would be set to $830002. To use an R/D at location 0 of multiplexer address 0, treating the value as an unsigned quantity, Ix10 would be set to $000100; treating the value as a signed quantity, Ix10 would be set to $800100.
Setting Up a Motor 63
PMAC User Manual
Geared Resolvers
Typically, a single resolver on the back of the motor is not sufficient to determine power-on position. If true power-on position information is required, a set of geared resolvers is used, each one geared down to a slower speed, and therefore a coarser resolution, than the resolver before it was in the chain. The first resolver, usually on the back of the motor and rotating with the motor, turns the fastest and has the highest resolution. It is called the fine resolver or the first resolver. The last resolver in the gear chain turns the slowest and has the lowest resolution. It should never turn more than one revolution — one electrical cycle, really — and it is called the coarse resolver.
Theoretically, any number of geared resolvers can be used to establish power-on position. In practice, most systems use two or three resolvers. In a two-resolver system, these are called the fine and coarse resolvers. In a three-resolver system, they are called the fine, medium, and coarse resolvers. Since PMAC can interface to both two- and three-resolver systems, the terminology first resolver or primary resolver will be used for the fine resolver connected directly to the motor shaft. The resolver geared down from the first resolver — coarse in a two-resolver system, medium in a three-resolver system — will be called the second or secondary resolver. The next resolver will be called the third resolver.
If a set of geared resolvers is to be used to determine power-on position with PMAC, variables I9x, and possibly I8x must be changed from their default values of zero as well. The second resolver must be connected to the R/D converter at the next higher location at the same multiplexer address than the primary resolver. I9x represents the gear ratio between the primary and secondary resolvers. It must be an integer number. If the second resolver were geared down from the primary resolver by a 16:1 ratio, I9x would be set to 16. A value of 0 for I9x tells PMAC that there is no secondary resolver.
If there is a third resolver geared down from the second resolver, I8x is used to specify the gear ratio between the second and third resolvers. The third resolver must be connected to the R/D converter at the next higher location at the same multiplexer address than the second resolver. It must be an integer number. If the ratio between the two were 36:1, I8x would be set to 36. A value of 0 for I8x tells PMAC that there is no third resolver.
Even in a geared-resolver system, the most significant bit of Ix10 determines whether the combined quantity will be treated as a signed or unsigned value. If it is to be treated as unsigned, the zero position should be set up past the negative end of travel, so power-up position cannot be to the negative side of zero. If it is to be treated as signed, the zero position should be in the normal range of travel; setting it in the middle of travel maximizes the usable range of the axis.
On any motor using a resolver or resolvers for position feedback, all position information used in the servo loop after the initial power-on read comes through the quadrature signals generated by the R/D converter for the primary resolver, counted in one of the PMAC encoder counters. The software setup to support this (Ix03, Ix04, conversion table) is the same as for a real quadrature encoder. There is no need to use the quadrature signals generated from the second or third resolvers for the motor.

Axis Offset

What if the absolute sensor’s zero position is not where the axis’ zero position for programming purposes should be? This is a very common occurrence, both because it is difficult to line up the sensor exactly, and because the zero position of the sensor typically must be outside the range of travel if the position information is treated as an unsigned value.
The difference between sensor (motor) zero and axis zero can be set by the axis offset parameter of the axis definition statement for the axis. This parameter, with units of counts, should contain the axis position when the sensor position is zero. It is independent of the axis scale factor (counts per engineering unit) in the same axis definition statement.
64 Setting Up a Motor
PMAC User Manual
For instance, to assign Motor #1 to the X-axis with 10,000 counts per unit, if the axis zero position should be at the point where the absolute sensor reads 50,247 counts, then the axis position would be -50,247 counts when the sensor reads zero, so the axis definition statement would be: #1->10000X-50247.

Encoder Offset

If using resolvers for absolute power-on position information, subsequent position information comes through the encoder counters, which are set to zero on power-on. For most purposes, this is transparent to the user, but to use encoder registers directly, usually for position capture and compare functions, then know the difference between the encoder-counter zero position, and the motor (resolver) zero position.
This value is kept in the Motor Encoder Position Offset Register [Y:$0815 (Motor 1), Y:$08D5 (Motor
2), etc.]. For an example of the use of this register, see the Storing the Home Position under Basic Motor Moves section of this manual.
Encoder Conversion Table
The PMAC Executive Program for PC compatible computers has a special editing screen for the conversion table that makes viewing it and changing it very easy. The detailed instructions here show how to view and change the table even without the help of the executive program screens.
PMAC uses a multiple-step process to work with its feedback and master position information, and with external time-base sources, to provide maximum power and flexibility. For most PMACs with quadrature encoders, this process can be virtually transparent, with no need to worry about the details. However, some basic understanding is needed of this conversion process to make the changes necessary to use other types of feedback, to optimize the system, or to perform special functions.
The first step in the position and time-base conversion process is the hardware encoder counters with associated timers, A/D registers, or accessory cards for parallel input. These work continually without direct software intervention (although they can be configured through software). Beyond this point, the process is software-controlled. At the start of each servo cycle, a servo interrupt signal is sent out to latch all of the registers.
At this point, PMAC uses a software structure called the Encoder Conversion Table to process the information in the latched registers. This table tells PMAC what registers to process, and how to process them; it also holds the intermediate processed data.
Servo Address
To S e r v o Algorithms
Data
I-Variables
Address
Ix03: Position Loop Feedback Address Ix04: Velocity Loop Feedback Address Ix05: Master Position Address Ix93: Time Base Source Address
Encoder Conversion
Table
Conversion Instructions:
Process & Address
Processed
Feedback Data
RAM
Figure 9 Encoder Conversion Table Process
Address
Data
& Timers, Latches, ADC's
PMAC Hardware
Registers
Raw
Feedback
Data
Encoder Counters
Feedback
Data Signals
Setting Up a Motor 65
PMAC User Manual
Conversion Table Structure
The Encoder Conversion Table has two columns, one in the X memory space of the processor, and one in the Y memory space. The X-column holds the converted data, while the Y-column holds the addresses of the source registers, and the conversion methods used on the data in each of those source registers. Basically, set up the table by writing to the Y-column, and PMAC uses the Y-column data to fill up the X-column each servo cycle.
Figure 10 Configure Encoder Conversion Table Editing Screen
Conversion Methods
The chart below lists the possible conversion formats. To do a conversion, the 8-bit format is matched with a 16-bit address to fill the 24-bit Y-word in the conversion table. If there is more than one row for a given conversion type, the other Y-words are further setup parameters for the conversion. The conversion result is placed in the last (highest address) X-word, and the other X-words hold intermediate data.
Adding Entries
For many conversion table entries – those with a second digit of x or y in the above table – setting bit 16 of the setup word to 1 means that the result of the conversion is not just from the specified source. Instead, it is the sum of this entry and the entry above in the table. This permits the servo feedback to use the sum of two sensors. (If the polarity of the sensors or their counters is opposite, this provides the difference of the sensors. This can be useful for Doppler-type sensors, where the reference wave and the shifted-frequency wave are fed into different counters, one counting up, the other counting down; summing the two counters provides position.)
Example Setup Words:
WY:$720,$00C000 ;/T entry for encoder channel 1 WY:$721,$01C004 ;/T entry for encoder channel 2 summed with channel 1 WY:$722,$680721, $FFFFFF ;Intermediary entry for sum of encoder
;channel 1 and 2 WY:$724,00C008 ;/T entry for encoder channel 3 summed with ;Intermediary entry
66 Setting Up a Motor
PMAC User Manual
Each type of conversion is discussed below.
If the conversion table has two or more summing entries in a row, only the first entry will perform summing. The other entries will only process their source data with no summing. This means that it is not possible to directly sum three or more sources. To sum three or more sources, an intermediary non-summing entry must be used between the second and third source entries. This is accomplished by reading the output of the second entry (the first summed entry) with an entry using the $68 format. This entry can then be summed into a third source entry using the standard technique.
PMAC Encoder Conversion Table
X-Memory (Results) Y-Memory (Set-up)
1. Single Line Entry
Bits Bits Bits Bits
5-23 0-4 16-23 0-15
Result:Integer Fraction Method Source Address
2. Multi-Line Entry
Bits
Bits
5-23 0-4 16-23 0-15
(Intermediate Result)
Result:Integer Fraction
Possible Conversion Formulas
Y-Word
Bits 16-23
$0x 1/T extension of incremental encoder 1 $1x A/D register — no rollover 1 $2y Parallel position from Y data word no filtering — with rollover 2 $3y Parallel position from Y data word with filtering — with rollover 3 $4x Time base conversion scaled digital differentiation 2 $50 Integrated analog 2 $6y Parallel position from X data word no filtering — with rollover 2 $7y Parallel position from X data word with filtering — with rollover 3 $8x Incremental encoder with parallel sub-count extension 1 $90 Triggered time base (frozen) 2 $A0 Triggered time base (running) 2 $B0 Triggered time base (armed) 2 $Cx Incremental encoder without extension 1 $D0 Exponential Filter 1 $Ex (Reserved for future use) 1 $Fx High-resolution sinusoidal encoder 2
x=0 for normal conversion, no summing
x=1 for conversion that sums this entry with one above it y=0 for normal conversion, no summing y=1 for conversion that sums this entry with one above it y=8 for an unshifted conversion, no summing y=9 for an unshifted conversion that sums this entry with one above it

Note:

Bits Bits
Method Source Address
(Conversion Factors)
• • •
Conversion Type No. of
Rows
Setting Up a Motor 67
PMAC User Manual

Incremental Encoder Entries

Incremental encoders are converted with one of the conversion formats $0x, $8x, or $Cx. The low sixteen bits of the setup word specify the address of the source on the X data bus. For incremental encoders, the source address must be one of the DSPGATE encoder counters, selected from the following list:
ENC1: $C000 ENC9: $C020 ENC2: $C004 ENC10: $C024 ENC3: $C008 ENC11: $C028 ENC4: $C00C ENC12: $C02C ENC5: $C010 ENC13: $C030 ENC6: $C014 ENC14: $C034 ENC7: $C018 ENC15: $C038 ENC8: $C01C ENC16: $C03C
Use the addresses from this list even though the actual encoder counter register has an address two higher.
Incremental Encoder Conversion
X-Word:
Converted Position Data
Bits 0-4: Fractional Bits Bits 0-15: Word address of source data Bits 5-23: Integer Bits Bits 16-23: Conversion format
$00 = 1/T interpolation $80 = parallel-bit interpolation $C0
Source and Processing of Data
Y-word:
= no interpolation
The source counter already reflects the method of decoding the incoming quadrature or pulse-and­direction waveform — whether there are one, two, or four counts per cycle. The decode method is determined by Encoder I-variable 0 (I900, I905, etc.) for that encoder. One bit in the counter is a count, whether it represents a full, half, or quarter wave cycle.

1/T Interpolation

Most people will use the 1/T-extension conversion method ($0x), which uses timers associated with each counter to estimate fractional resolution (see previous illustration). A typical setup word for this would be $00C008, which provides 1/T-extension conversion of the encoder 3 counter.

Parallel-Bit Interpolation

If the set up uses the parallel sub-count interpolation for incremental feedback, use the $8x conversion format. In this case, the source address must be one of the odd-numbered encoders. A typical setup word in this case would be $80C010, which provides parallel extension of the encoder 5 counter using encoder 6’s flags.

No Interpolation

For conversion without any sub-count interpolation, the $Cx conversion format should be used. A typical setup word in this case would be $C0C00C, which provides a non-interpolated conversion of the encoder 4 counter.

Acc-28 Analog-to-Digital Conversion Register Entries

The $1x conversion format picks up data from the top 16 bits of a 24-bit word. It is intended for use with the A/D converter registers in the DSPGATEs, which are fed by Accessory 23 (obsolete) or Accessory
28. (When using the Acc-36 A/D converter board, treat the data as 12-bit parallel-format data.) The source address specifies a word in the Y memory space, and should be one of the following:
68 Setting Up a Motor
PMAC User Manual
ADC1: $C006 ADC9: $C026
ADC2: $C007 ADC10: $C027 ADC3: $C00E ADC11: $C02E ADC4: $C00F ADC12: $C02F
ADC5: $C016 ADC13: $C036
ADC6: $C017 ADC14: $C037 ADC7: $C01E ADC15: $C03E ADC8: $C01F ADC16: $C03F
A typical setup word for an A/D register would be $10C006, which provides the conversion of the ADC1 register. With A/D conversion, there is no software extension performed, so rollover should not be permitted.
The result is placed in the X-register of the entry, scaled so that there are 19 bits of integer (the highest three bits are simply sign-extended), and five bits of fraction (the fraction is always zero).
Integrated Analog
It is possible to use the conversion table to integrate an analog input or equivalent. This is done with conversion format $50, instead of the $10 used for normal (un-integrated) analog conversion. The address of the A/D source register is specified just as for the $10 format. An entry to integrate the input of ADC1 would be $50C006.
Bias Term
The integrated analog format requires a second entry to specify the bias of the A/D. This is a signed quantity, with units of 1/256 of the LSBit of the 16-bit A/D converter. For example, if there were an offset in 16-bit ADC of five LSBits, this term would be set to 1280. If no bias is desired, a zero value should be entered here. This term permits reasonable integration, even with an analog offset.
Result Format
The integrated result is placed in the X-register of the second line of the entry, with 19 bits of integer and five bits of fraction (the fraction is always zero). Because the input data has 16 bits (this high 16 bits of a 24-bit word), at the maximum range of the input, there is only a 3-bit (8-times) extension of the input into this integrated register, with the integration performed every servo cycle. Therefore, whatever task uses this information must look at the integrated register at least once every eight servo cycles to handle potential rollover situations. This is no problem for the automatic servo-loop uses of the information (master or feedback), but it could be a problem in a background task.
The integrated result is set to zero automatically on power-up/reset, and the integration function starts immediately afterward. Any value may be written to the result register at any time (usually through an M-variable); make sure that nothing using the register at the time could be adversely affected by changing the value of this register.
Integrated Analog Feedback
X-Words Y-Words
1. Intermediate data 1. Source and process: Bits 0-15: Y-Address of source data Bits 16-23: = $50
2. Converted data:
Bits 0-4: Fractional Bits Bits 5-23: Integer Bits
2. Bias Term: 1/256 bit of 16-bit ADC
Uses of Integrated Analog
There are several possible uses of this format. First, an analog velocity sensor such as a tachometer could be used to provide position-like information to the PMAC servo loop (remember that the velocity loop expects position information). For example, consider an axis that has a motor with a tachometer, a linear encoder on the load for accuracy, and a current-loop amplifier for high responsiveness. It is difficult to
Setting Up a Motor 69
PMAC User Manual
get stability using just the linear scale for both position and velocity loop because there is no direct information about what the motor is doing. The tachometer can be connected to an A/D converter on an Acc-28 (e.g. ADC1).
Then this conversion table entry can integrate the A/D value into what is effectively position information for the servo loop to use. The source and process word would be $50C006; the bias term would be set empirically to hold the integrated value constant when the motor is still. Ix04 for the motor would point to the second line of the entry to use the integrated value.
Second, this makes it possible to do cascaded loops inside PMAC. The outer loop, which could be a force or tension loop acting around a normal position loop, would put out a command value that is a velocity correction to the inner position loop. The position loop can take a correction as position information from its master position register. This conversion table entry makes it possible to convert the velocity output of the outer loop to the position input of the inner loop. The outer loop would direct its command output to an unused internal memory register (e.g. Y:$07F0) by setting Ix02 to that register (Ix02=$07F0). The integrated analog entry in the conversion table uses this register as its source ($5007F0). Probably no bias is needed. Ix05 for the inner loop points to the second line of the entry, where the integrated value is, giving the position loop its correction.
Unsigned Analog
If bit 19 of the analog conversion setup word is set to 1 ($18xxxx for normal analog, $58xxxx for integrated analog), then PMAC treats the A/D number in the high 16 bits of the source word as an unsigned number with a range of 0 to 65,535 instead of a signed number with a range of -32,768 to 32,767. The unsigned conversion is required for use of the newer Acc-28B. The usual signed conversion (bit 19 = 0) is required for use of the older Acc-28 and Acc-28A.

Parallel Position Feedback Conversion

If providing position information to PMAC as a parallel data word — as from an absolute encoder or processed from a laser interferometer — use one of the conversion formats $2x, $3x, $6x, or $7x. Formats $2x and $3x get data from the specified source in Y-memory space; $6x and $7x get it from X-memory space. Usually this data is brought in on an Accessory-14 board, which is in the Y-memory space, so the $6x and $7x formats are rarely used.
If the x value in the conversion format is 0 or 1 (format word bit 19 = 0), the resulting data is shifted left five bits so that the least significant bit of the source data appears as one count to the servo algorithms, which expect five bits of fraction. If the x value is 8 or 9 (format word bit 19 = 1), the resulting data is not shifted and the LSB appears as 1/32 count to the servo algorithms (see the Unshifted Conversion section in this manual). If x is 1 or 9 (format word bit 16 = 1), the resulting data is summed with the result of the previous table entry. If x is 0 or 8 (format word bit 16 = 0), no summing is performed.
Acc-14 Source Registers
When using Acc-14 to bring in the data, the following source addresses would be used:
First Acc-14 Port A (J7): $FFD0 First Acc-14 Port B (J15): $FFD1 Second Acc-14 Port A (J7): $FFD8 Second Acc-14 Port B (J15): $FFD9 Third Acc-14 Port A (J7): $FFE0 Third Acc-14 Port B (J15): $FFE1 Fourth Acc-14 Port A (J7): $FFE8 Fourth Acc-14 Port B (J15): $FFE9 Fifth Acc-14 Port A (J7): $FFF0 Fifth Acc-14 Port B (J15): $FFF1 Sixth Acc-14 Port A (J7): $FFF8
70 Setting Up a Motor
PMAC User Manual
Sixth Acc-14 Port B (J15): $FFF9
A typical setup word for this type of feedback is $20FFD0, which provides for non-filtered conversion of the parallel data word fed into Port A of the first Acc-14 connected to PMAC.
Bit-Enable Mask Word
Parallel-feedback conversion requires a double (for non-filtered) or triple (for filtered) entry in the conversion table. The second entry – filtered or non-filtered – specifies the size of the feedback word used. The entry is a 24-bit word in which each bit actually used for the parallel feedback is a one; the unused bits above are zeros (parallel feedback is typically connected starting at bit 0 of the data word).
For a 12-bit absolute encoder, this entry would be $000FFF; for 14 bits, it would be $003FFF. For the standard shifted conversion, the maximum effective mask word is $07FFFF, unmasking the low 19 bits; any data in the high five bits is shifted out of the word. For the unshifted conversion, up to 24 bits of real data can be used with a mask word of $FFFFFF. The mask word allows PMAC to detect rollover in the source data, so it can extend the count properly in software.
Filter Word
If the conversion format is $3x or $7x, the parallel data word is filtered. The filter simply sets a maximum amount the data word is permitted to change in a single servo cycle. If PMAC sees a change larger than this in the source data word, the converted data only changes by the maximum amount. There is no permanent loss of position information if the filter kicks in.
Purpose of Filtering
This filtering permits protection against spurious changes on high-order data lines, while not delaying legitimate changes at all. This maximum amount is the third setup entry for the encoder in the Y-column of the conversion table. It should be set slightly greater than the maximum actual velocity expected on the sensor, expressed in counts (bits) per servo cycle.
Converted Data
The converted data from the parallel word is put in the X data word matching the last (second or third) setup word for the entry. This is the address that should be used by the motor I-variable that picks up position (Ix03, Ix04, or Ix05). For instance, if the first setup entry (address Y:$0720) in the conversion table were $30FFD0 (filtered parallel data), the size entry would be in Y:$0721, and the maximum change entry would be in Y:$0722. The converted data would be placed in X:$0722. If this were the position feedback for motor #1, Ix03 would be set to $0722 (1826 decimal). For incremental parallel feedback, bit 16 of Ix03 should be set to 1 for proper homing search moves.
Unshifted Conversion
If bit 19 of the source and process word for a parallel data conversion is set to 1, the converted data contains no fractional bits. Entries of this form would have the conversion formats (bits 16-23 of this word) $28, $38, $68, or $78, as opposed to the standard entries $20, $30, $60, and $70, which provide five fractional bits in the converted data.
Setting Up a Motor 71
PMAC User Manual
Unfiltered Parallel Feedback
X-Words Y-words
1. Intermediate data: Sign-extended most significant word
2. Converted data: Bits 0-4: Fractional Bits Bits 5-23: Integer Bits
1. Source and process Bits 0-15: Address of source data Y-word if $20 conversion X-word if $60 conversion Bits 16-23: = $20 for Y-word source = $60 for X-word source
2. Bit-enable mask Bit=1 to use corresponding bit from source word Bit=0 not to use corresponding bit from source word
Filtered Parallel Data Conversion
X-Words Y-words
1. Intermediate data: Raw data reading
2. Intermediate data: Sign-extended most-significant word
3. Converted data: Bits 0-4: Fractional Bits Bits 5-23: Integer Bits
1. Source and process Bits 0-15: Address of source data Y-word if $30 conversion X-word if $70 conversion Bits 16-23: = $30 for Y-word source = $70 for X-word source
2. Bit-enable mask Bit=1 to use corresponding bit from source word Bit=0 not to use corresponding bit from source word
3. Filter value: Maximum permitted change in counts/servo cycle
Uses
This unshifted format is intended for high-speed, very high-resolution applications, typically with parallel laser-interferometer feedback. With the normal shifted format, the PMAC internal velocity registers saturate when the counts/sec * Ix08 exceed 256M (268,435,456). With the unshifted format, this limit is 32 times higher: 8G (8,589,934,592).
Using this unshifted format, be aware that PMAC will treat on LSBit of the feedback device as 1/32 of a count, not as a full count. For example, if there is a sensor on motor 1 (X-axis) with 2.5 nanometer resolution, to program the axis in millimeters, treat one count as 80 nm (2.5*32) and make the axis definition #1->12500X (1,000,000 / 80).
The conversion table entry for this would consist of a source and process word $38FFC2 (unshifted parallel conversion of Y:$FFC2), a mask word $00FF00 (to use only the middle eight bits of the 24-bit word), and a filter word value of something like $000020 (maximum speed 32 counts per servo cycle). Ix05 for any motor x to be slaved to this handwheel would be set to the address of the third line of this entry in the table. For a 1:1 following ratio and a default Ix08 value of 96, Ix07 would be set to 12 instead of the usual 96, to reflect that fact that each count from this accessory appears eight times bigger than normal.
72 Setting Up a Motor
PMAC User Manual
Shift-Right Parallel Conversion
If both bit 19 and bit 18 of the source and process word for a parallel data conversion are set to 1, the raw data at the source address is shifted right three bits before being placed in the result word. Entries of this form would have the conversion formats (bits 16-23 of this word) $2C, $3C, $6C, or $7C. This conversion format is intended for data that is found in the high 16 bits of the 24-bit word (LSB is bit 8), as for feedback from a MACRO input register.
Another use of this format is with the Acc-39 Handwheel Decoder. This board contains an HCTL-2000 quadrature decoder IC that converts the quadrature signal from a handwheel to an 8-bit parallel word that is brought in on the JPAN control panel port. On the PMAC PC, -Lite, and -VME, this byte appears on bits 8-15 of register Y:$FFC0. A normal parallel conversion would put the 1’s bit of the handwheel counter at bit 13, effectively making it 256 times greater than if it were at the normal bit-5 location. This shift-right conversion puts the 1's bit at bit 5, as for normal encoders.
When using this shift-right format, the bits enabled mask word should reflect the locations of the bits used after the shift. For example, if all 16 high bits are used (bits 8 to 23), then the bits enabled mask word should be $1FFFC0, to mark the use of bits 5 to 20 after the shift. With the Acc-39, which uses bits 8-15, the mask word should be $001FC0, to mark the use of bits 5 to 12 after the shift.

Time-Base Conversion Entries

A time-base conversion is basically a scaled digital differentiation. When the source data is a counter, the result is a frequency value. Every servo cycle the table calculates the difference between the values of the source register for this cycle for the last cycle, and multiplies the difference by the scale factor.
The most common use for the resulting value is for time-base (feedrate override) control, which makes the speed of PMAC execution proportional to an external frequency (usually the speed of a master device. Refer to the Synchronizing PMAC to External Events section of this manual for details on how this is used.
Time-Base Conversion
X-Words Y-words
1. Last cycle's source data: Bits 0-4: Fractional Bits Bits 5-23: Integer Bits
2. Actual time-base value: product of scale
factor and difference between last two source values
1. Source and process Bits 0-15: X Address of source data (usually a converted position register). Bits 16-23: = $40 for time base conversion
2. Time-base scale factor (supplied by user)
For example, the default conversion table creates a time-base value from the data in the Encoder 4 counter. It is desirable in this time-base conversion to have the source data with sub-count interpolation — this significantly smoothes out the process by reducing the quantization error created by digital differentiation. To do this, the source register should be from the conversion table itself, not from the encoder counter.
In the default conversion table, the converted data from Encoder 4 is found in X:$0723 (1827 decimal). Therefore, the first setup (Y) word for the time-base conversion entry is $400723 — the $40 specifies time-base conversion, and the $0723 specifies the source address.
Scale Factor
The second setup (Y) word is the scaling factor — the value that multiplies the difference between the current source data and the last source data. Setting its value usually requires some computation; this subject is covered in the Time-Base Control section of Coordination Features of this manual.
Setting Up a Motor 73
PMAC User Manual
Converted Data
The last source data word is stored in the first X word of the entry in the table, and the net result is stored in the second X word. The value of the net result is 2 * Scale_factor * (New_source - Old_source). To use this value to control the time-base of a coordinate system, enter this address as the value of Ix93 (Time-Base Source Address) for the coordinate system.
DEC
1824
1827
1832
1833
HEX
$720
$723
$728
$729
X - Register
Interpolated Cts(n)
Interpolated Cts(n-1)
{Time Base}
Result
$00
{1/T}
$40
{Scale factor}
Y - Register
C00C
{Enc 4 counter}
0723
{Int. Enc. 4}
I193 = 1833
Result = 2*S.F * [Interp Cts (n) - Interp Cts (n-1)]
17
= 2 (2 = I10 * (IF/RTIF)
/RTIF) (25 * IF * I10/223)
Figure 11 Conversion Table Example for Time-Base Entry

Triggered Time-Base Conversion Entries

For those applications where it is necessary to synchronize exactly to the position of the master encoder, the conversion table provides the capability to freeze the time-base while calculating the first moves of the synchronized sequence. Then have the time base start up referenced exactly to the master position that occurred when the starting trigger occurred (usually the index channel of the master encoder). This provides a complete position lock of the slave to the master; there is no need for subsequent adjustment to make sure that they are phased in, as would be the case for normal (untriggered) time-base control.
Entry Format
Unlike the normal (untriggered) time-base conversion, the source address must be that of the encoder registers in the DSP-GATE with the raw (unprocessed) data. The triggered time-base conversion does the 1/T interpolation itself. The valid addresses for triggered time-base entries are the same as those for the Incremental Encoder Entries: $C000 for Encoder 1, $C004 for Encoder 2, and so on, to $C03C for Encoder 16.
Triggered Time-Base Conversion
X-Words
1. Last cycle's source data: Bits 0-4: Fractional bits Bits 5-23: Integer Bits
3. Actual time-base value: When running, the product of scale factor and difference between last two source values.
1. Source and process: Bits 0-15: Address of source (always a set of DSPGATE encoder registers) Bits 16-23: $90 (frozen; for preparation) $B0 (armed; waiting for trigger) $A0 (running; post-trigger)
2. Time-base scale factor: supplied by user; equal to 131,072 / real-time-input-frequency in cts/msec.
Y-Words
74 Setting Up a Motor
PMAC User Manual
Setting the Trigger State
The process bits — bits 16 to 23 of the first Y-word in the conversion table entry — of a single triggered time-base entry will take on three values during the normal course of use. This is done with an 8-bit M­variable. First, with the slave axes dwelling at their starting position, these process bits should be set to $90 in the sequence of motion program calculations for the first move. This forces the time-base value to zero, putting the coordinate system in feed-hold mode.
Next, another program, usually a PLC program, changes the bits from $90 to $B0. This arms the time­base, so that it is waiting for the position-capture trigger on the source encoder, as defined by Encoder/Flag I-variable 2 for that encoder. When the capture occurs, the time base starts up, with the captured-position register used as the initial value for the time-base difference equations. When this happens, PMAC automatically changes the process bits from $B0 to $A0. For untriggered use of this format, set the process bits to $A0.
Example
For example, if adding a triggered time-base entry working from Encoder 8 to the end of the standard conversion table, with a real-time input frequency of 64 cts/msec. These entries would reside in registers $072A(1834) and $072B (1835). Initially we would write to Y:$072A a value of $A0C01C (running time-base from Encoder 8 registers), and to Y:$072B a value of $800 (131,072 / 64 = 2048 = $800). We define an M-variable to the process bits with the command M199->Y:$072A,16,8.
With the slave axes dwelling at the start-up position, freeze the time base with the motion program command M199=$90. If Ix93 is not already pointing to X register $072B, do this at this time. The motion program commands immediately following this calculate the move, but with a zero time-base value, the move execution is stuck at the starting point. Meanwhile, a PLC program is looking for M199 to be equal to $90, at which time it changes it to $B0, arming for the trigger. Since a PLC program cannot interrupt motion program calculations for a move, this will not be done until after the calculations are completed. This change can be done with three program lines in a PLC program:
IF (M199=$90) M199=$B0 ENDIF
Once the trigger is armed by the PLC program, when the capture trigger occurs, PMAC starts the time base and changes the process bits to $A0 automatically.

Exponential-Filter Entries

It is possible to use the conversion table to create an exponential filter on a word of input data. This is particularly useful for position following (electronic gearing), especially when the slave is geared up from the master; i.e., the slave moves more than one count for each count of the master, where it can significantly smooth the motion of the following axis.
The equation of the exponential filter executed every servo cycle n is:
Out(n) = Out(n-1) + (K/223)*[In(n)-Out(n-1)]
If [Out(n) - Out(n-1)] > Max_change, Out(n) = Out(n-1) + Max_change
If [Out(n) - Out(n-1)] < -Max_change, Out(n) = Out(n-1) - Max_change
In, Out, and K are all signed 24-bit numbers (range -8,388,608 to 8,388,607). The difference [In(n)­Out(n-1)] is truncated to 24 bits to handle rollover properly.
The time constant of the filter, in servo cycles, is 2 constant. No shifting action is performed. Any operations such as 1/T interpolation should have been done on the data already, so typically the source register for this filter is the result register of the previous operation.
Setting Up a Motor 75
23
/K. The lower the value of K, the longer the time
PMAC User Manual
The output value of the exponential filter is placed in the X register of the third line of the conversion table entry. An operation that uses this value should address this third register; for example Ix05 for position following, or the source address for a time-base conversion-table entry (to keep position lock in time base, this filter must be executed before the time-base differentiation, not afterward).
Entry Format
Exponential Conversion
X-Words Y-Words
1. Intermediate data 1. Source and process: Bits 0-15: X-address of source (usually a converted position register)
Bits 16-23: = $D0
2. Intermediate data 2. Maximum permitted change in output value; expressed in
LSBs per servo cycle
3. Filtered result: unshifted from source
register data
Example:
Starting with the default encoder conversion table which occupies registers $0720 to $0729, to add a new entry to the table that filters the handwheel encoder that is wired into Encoder 5 on PMAC, the filter must have a time constant of eight servo cycles, and the maximum velocity of the output is to be 16 counts per servo cycle.
In the default table, the 1/T interpolation result for Encoder 5 is placed in register X:$0724. This is the source address for the exponential filter. Since the time constant of eight servo cycles is equal to 8,388,608 divided by filter gain K, then K is equal to 1,048,576. The units (LSBs) of the source register are 1/32 count, so the maximum change value is 32*16, or 512 LSBs per servo cycle.
These values can be entered into the interactive menu of the PMAC Executive program (V3.0 or newer), or they can be entered with a direct memory-write command:
WY:$072A,$D00724,512,1048576
Y:$072A is the starting location of the entry in PMAC memory; $D0 specifies the exponential filter; 512 (or $200) specifies the maximum output change rate; 1048576 (or $100000) specifies the filter gain. If the filtered value were to be used as a master encoder, Ix05 would be set to $072C.
3. Exponential filter gain K where filter equation is:
Out(n) = Out(n-1) + (K/2
23
)*[In(n)-Out(n-1)]

Setting up the Encoder Conversion Table

The encoder conversion table starts at address $720 (1824 decimal) in the PMAC memory. It can continue through address $73F (1855 decimal). The active part of the table is ended by the first Y word that is all zeros. The encoder table as shipped from the factory converts the eight incremental encoder registers on the base PMAC board in locations $720 through $727 (1824 to 1831). Locations $728 and $729 create time base information from the converted Encoder 4 register ($723). Y:$72A is zero, ending the active part of the table.
Default Encoder Conversion Table
Address Y-Word Meaning
$720 (1824) $00C000 1/T conversion of Encoder 1 $721 (1825) $00C004 1/T conversion of Encoder 2 $722 (1826) $00C008 1/T conversion of Encoder 3 $723 (1827) $00C00C 1/T conversion of Encoder 4 $724 (1828) $00C010 1/T conversion of Encoder 5 $725 (1829) $00C014 1/T conversion of Encoder 6 $726 (1830) $00C018 1/T conversion of Encoder 7 $727 (1831) $00C01C 1/T conversion of Encoder 8 $728 (1832) $400723 Time-base from converted Enc. 4 $729 (1833) $000295 Time-base scale factor for above
$72A (1834) $000000 Signifies end-of-table
76 Setting Up a Motor
PMAC User Manual
This table can be used unchanged by the great majority of PMAC users. Note that the default motor feedback-position-address and master-position-address I-variables (I103-I105, I203-205, etc.) point to locations in this table and assume the default setup of the table.
However, there are several reasons to change the table:
1. If the application uses an Acc-24 axis expansion board, it will need to convert Encoders 9-16, so entries for these must be added to the table.
2. If using an external time-base frequency source, the scaling factor and maybe the source should be changed.
3. If using 1/T interpolation on the position feedback.
4. If requiring fast control on just a few axes, reduce the table to save computation time, because each conversion does take a finite amount of time.
Example
When using two axes of fast laser-interferometer quadrature feedback (into Encoders 1 and 3) with parallel sub-count interpolation, and no handwheels or external time base, set up a table as follows for minimum conversion time:
Minimum Conversion Time Table
Address Y-Word Meaning
$720 (1824) $80C000 || sub-count conversion of Enc. 1 $721 (1825) $80C008 || sub-count conversion of Enc. 3 $722 (1826) $000000 Signifies end-of table
Example
To convert two 16-bit absolute encoders from the first Acc-14 filtered not to allow more than eight bits change per servo cycle, four incremental encoders (ENC1-4) with 1/T interpolation, four A/D converters (ADC1-4), and two linear displacement transducers (ENC9-10 timers) without filtering.
The conversion table setup would be:
Two 16-Bit Absolute Encoders Conversion Table
Address Y-Word Meaning
$720 (1824) $00C000 1/T conversion of Encoder 1 $721 (1825) $00C004 1/T conversion of Encoder 2 $722 (1826) $00C008 1/T conversion of Encoder 3 $723 (1827) $00C00C 1/T conversion of Encoder 4 $724 (1828) $10C006 Conversion of ADC1 $725 (1829) $10C007 Conversion of ADC2 $726 (1830) $10C00E Conversion of ADC3 $727 (1831) $10C00F Conversion of ADC4 $728 (1832) $30FFD0 Filtered Parallel from 1st Acc-14
$729 (1833) $00FFFF Use the low 16 bits of word $72A (1834) $000100 Max change 256 counts/cycle $72B (1835) $30FFD1 Filtered Parallel from 1st Acc-14 $72C (1836) $00FFFF Use the low 16 bits of word $72D (1837) $000100 Max change 256 counts/cycle $72E (1838) $20C020 Parallel from ENC 9 timer
$72F (1839) $07FFFF Use low 19 bits (max allowed)
$730 (1840) $20C024 Parallel from ENC 10 timer
$731 (1841) $07FFFF Use low 19 bits (max allowed)
$732 (1842) $000000 Signifies end-of-table
Setting Up a Motor 77
PMAC User Manual
To use something other than the conversion table editor screen in the PMAC Executive program, view the current set-up of the conversion table with a single Read-Hex (RH) command. For instance, if the table were set up as in the example immediately above, the command RHY:$720,24 (report in hex 24 Y­words starting at $720) would yield the following response:
00C000 00C004 00C008 00C00C 10C006 10C007 10C00E 10C00F 30FFD0 00FFFF 000100 30FFD1 00FFFF 000100 20C020 07FFFF 20C024 07FFFF 000000 000000 000000 000000 000000 000000
To use something other than the conversion table editor screen in the PMAC Executive program, change the entries in the table with one or more Write (W) commands. For example, to change the third and fourth entries above to straight conversion of the same registers, command WY:$722, $C0C008, $C0C00C. While the set-up values may be specified in decimal, it is easier to specify them in hexadecimal (except possibly for scale factors).
The set-up of the Encoder Conversion Table can be stored in EAROM with the SAVE command. The most recently saved set-up is copied from EAROM into RAM (active memory) on power-up or reset, so SAVE changes to the table to keep them.
Further Position Processing
Once the position feedback signals have been processed by the Encoder Conversion Table (which happens at the beginning of each servo cycle), the data is ready for use by the servo loop.

Software Position Extension

For each activated motor, PMAC takes the position information in the 24-bit register pointed to by Ix03 and extends it in software to a 48-bit register that holds the actual motor position. In the process of extension, it multiplies the value by the Ix08 position scale factor. Since the register in the conversion table is in units of 1/32 of a count, the actual motor position register is in units of 1/(Ix08*32) of a count.
These extended motor position registers are set to zero on power-up/reset (unless there is an absolute position sensor), and again at the end of a homing search move. The encoder position registers are only set to zero on power-up/reset. Therefore, after a motor is homed, there is an offset between motor zero position and encoder zero position.
Only worry about this offset if using the encoder registers directly (e.g., position capture and compare) or to relate these values to motor position. Find and store the offset, which is the value in the position capture register when the home trigger is found.
Program HOMOFFST.PMC in the Examples section shows how to do this. They may also have to handle rollover of the encoder registers if they will be traveling more than +/-8 million counts. The modulo (%) operator is useful for this. For more details, refer to the Synchronizing PMAC to External Events section of this manual.
78 Setting Up a Motor
PMAC User Manual
r
Input
Signal
Quadra ture,
Parallel, Analog,
etc.
Capture Positi on (Mx03)
Compare Positi on (Mx03)
Phase Position (Mx01)
Decoder/ Counter
Done Always
Power-up/Reset
Encoder Position
Integer
Count
24 bits
Set to Zero on
Encoder
Conversion
(e.g. 1/T)
32
Done Always
Power-up/Reset
Encoder Position
Interpolated
Count
(1/32 ct)
24 bits
Activated Motor
Set to Zero on
"P", (Mx62)
Position
Extension
Ix08
Done for
Moto
Position
Act. Pos.
Cmd., Target Pos.
Extended
Count
(1/(Ix08 32)ct)
(fixed point)
48 bits
Set to Zero on
Power-up/Reset
and Home
(Mx61),(Mx63)
(PMATCH)
Axis
Scaling
Axis Coeffici ents
Done for
Defined Axis
Axis
Position
Move End Pos.
(Mx65)
User Units
(floating point)
48 bits
Can be Offset
(Axis offset, PSET,
{axis}= )
COMMAND
ACTUAL POSITION
POSITION
Figure 12 PMAC Position Processing

Axis Position Scaling

Motor position is always kept in terms of counts. When a motor is assigned to an axis through an Axis Definition statement, the scale factor in the statement determines what the units of the axis are (usually inches, millimeters, degrees, etc.). Programmed moves are given for an axis, and PMAC converts this to motor moves, using the scale factors from the Axis Definition statements. It is important to realize that this conversion is for commanded positions only, and that the conversion normally goes only one-way: from axis to motor. PMAC never computes actual axis positions.

Leadscrew Compensation

PMAC is capable of performing what is commonly called leadscrew compensation. This technique, which also goes by other names, allows for a table of corrections to be entered into PMAC as a function of motor position. PMAC can store up to eight of these compensation tables.
Each motor can have one table that belongs to it. Unless otherwise specified, the table uses position information from this motor (source data) to determine the location in the table, and also adds its correction to this motor (target data). However, the source motor, or both the source and the target motors, may be specified to be motors other than the motor to which the table belongs. (If both motors are different, the concept of the table belonging to a motor is useful only for PMAC’s bookkeeping purposes.)
The compensation is performed inside the servo loop (every servo cycle) to obtain the maximum speed and accuracy. PMAC takes the position of the source motor and finds the matching position in the table. Typically this is between two entries in the table, so PMAC linearly interpolates between these two entries to obtain the correction for the current servo cycle. It then adds this correction to the position of the target motor. The entries of corrections in the table must be integer values, with units of 1/16 count (so an entry of 48 represents three counts) of the target motor.
Multiple Tables Per Motor
A motor may provide the source data for up to eight compensation tables; it may also be the target of up to eight motors.
Setting Up a Motor 79
PMAC User Manual
Table Range
The compensation is defined directly for a range of source motor positions starting at zero counts (the most recent home or power-up/reset position) and going in the positive direction. The size of this range is declared as the last argument of the DEFINE COMP command. This argument has units of counts of the source motor. The spacing between entries is the total range divided by the number of entries (which is the first argument of the DEFINE COMP command). The first entry in the table defines the correction at one spacing from the zero position of the source motor, the second entry at two spacings, and so on.
Rollover
Outside of this range, the uncorrected position is rolled over to within this range — essentially a modulo (remainder) operation — before the compensation is done. This permits compensation of rotary axes over several revolutions, and simple compensation for encoder eccentricity. Of course, if the table is made big enough to cover the entire source motor travel, the rollover feature will never be used.
If the motor has a travel range to the negative side of zero, and compensation is desired here, these entries should be made as if they were past the positive end of the motor range. For instance, if the motor travel were +/- 50,000 counts and a table entry was to be made every 500 counts (so 200 entries total), the table would be set up with a DEFINE COMP 200,100000 command.
The first 100 entries would cover the 500 to +50,000 count range, and the last 100 entries would cover the
-50,000 to 0 count range. (Usually the table is referenced so there is a zero correction at the source motor zero position, so the last entry in the table should be 0.) Essentially, the -50,000 to 0 range would be mapped into the +50,000 to +100,000 range.
Example:
If the following table were entered:
#1 DEFINE COMP 8,4000 ; Table of 8 entries over 4000 cts belonging to motor 1;
; Uses motor 1 for source & target because no other ; motor specified
-160 ; Correction at 4000/8 (500) cts is -160/16 = -10 cts 80 ; Correction at 1000 counts is 5 counts 120 ; Correction at 1500 counts is 7.5 counts 96 ; Correction at 2000 counts is 6 counts 20 ; Correction at 2500 counts is 1.25 counts
-56 ; Correction at 3000 counts is -4.5 counts
-12 ; Correction at 3500 counts is -0.75 cts 0 ; Correction at 4000 (and 0) cts is zero
and the axis definition were #1->1000X, a commanded move to X1.3 would give an uncorrected motor position of 1300 counts. The applied correction would be linearly interpolated from the table:
10001300
()
*55.7Correction +=+
=
500
counts5.65
At X8.4, PMAC would calculate an uncorrected motor position of 8400 counts; roll this over to within the table range: 8400 mod 4000 = 400 counts; and the correction from the table would be:
0400
()
=
*010Correction =+
500
counts80
Enabling and Disabling
All leadscrew compensation tables are enabled when I51 is set to 1. When I51 is set to 0, all are disabled.
80 Setting Up a Motor
Loading...