^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.
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.
REVISION HISTORY REV. 1 DESCRIPTION CORRECTION TO PID EQUATION, P. 108 DATE 06/28/07 CHG APPVD CP S.
PMAC User Manual Table of Contents INTRODUCTION .......................................................................................................................................................1 Flexibility..............................................................................................................................................................1 Configuration for a Task...................................................................................................................
PMAC User Manual Power-Up Mode..................................................................................................................................................18 Homing Search Move .........................................................................................................................................18 Setting up a Coordinate System ..............................................................................................................................
PMAC User Manual Control-Character Commands ...........................................................................................................................34 Resetting PMAC .....................................................................................................................................................35 PMAC Reset Actions...........................................................................................................................................
PMAC User Manual Input Source/Sink Control ..................................................................................................................................49 Thumbwheel Multiplexer Port I/O (JTHW Port) ....................................................................................................49 Multiplexed Uses ................................................................................................................................................49 Non-Multiplexed Uses ....
PMAC User Manual Axis Position Scaling ..........................................................................................................................................79 Leadscrew Compensation ...................................................................................................................................79 Backlash Compensation......................................................................................................................................
PMAC User Manual Interface to Other Firmware.............................................................................................................................112 Restrictions .......................................................................................................................................................113 Alternative Uses for User-Written Servo ..........................................................................................................
PMAC User Manual Multiple-Motor Axes.........................................................................................................................................137 Phantom Axes ...................................................................................................................................................138 Axis Definition Statements ...................................................................................................................................
PMAC User Manual I-Variable Default Value Assignment ...............................................................................................................158 Synchronous M-Variable Value Assignment.....................................................................................................158 Syntax................................................................................................................................................................160 Execution ....................
PMAC User Manual Defining the Plane of Compensation ................................................................................................................184 Defining the Magnitude of Compensation ........................................................................................................184 Turning on Compensation ................................................................................................................................185 Turning off Compensation ................
PMAC User Manual Calculation of Subsequent Moves.....................................................................................................................214 Implications of Calculating Ahead ...................................................................................................................216 SYNCHRONIZING PMAC TO EXTERNAL EVENTS .....................................................................................219 Features to Help Synchronize Motion............................
PMAC User Manual Compiled PLC Programs.......................................................................................................................................237 Execution of Compiled PLCs............................................................................................................................238 Preparing Compiled PLCs................................................................................................................................
PMAC User Manual Example ............................................................................................................................................................266 Dual-Ported RAM Communications .....................................................................................................................267 Uses of DPRAM................................................................................................................................................
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 .........................................................................................................................
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......
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 highperformance 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.
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.
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.
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.
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.
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.
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.
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).
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.
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).
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.
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.
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: I900I904 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.
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).
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.
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 (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 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.
PMAC User Manual Type J 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- should cause the motor to turn in the negative direction, and J should stop it again. J= should cause the motor to jog to the last pre-jog position and stop there automatically.
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. This will address coordinate system 1. (Confirm which coordinate system is addressed by typing & and PMAC will return the number of the currently addressed coordinate system.
PMAC User Manual When finished entering the program, type CLOSE 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 F2.36 X5.346 Y0 X5.346 Y5.346 X0 Y5.346 X0 Y0 ; ; ; ; ; erase old program 2.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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 Acc3L 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.
PMAC User Manual SW1-1 SW1-2 OFF ON OFF ON OFF ON OFF ON OFF ON OFF ON OFF ON OFF ON OFF OFF ON ON OFF OFF ON ON OFF OFF ON ON OFF OFF ON ON Switch Address Control For PMAC STD SW1-3 SW1-4 Card Address OFF OFF OFF OFF ON ON ON ON OFF OFF OFF OFF ON ON ON ON OFF OFF OFF OFF OFF OFF OFF OFF ON ON ON ON ON ON ON ON @0 @1 @2 @3 @4 @5 @6 @7 @8 @9 @A @B @C @D @E @F Default @0 Multi-Card Mode Variable When talking to multiple cards over a single daisy-chained connector, variable I1 should be set to 2 or 3
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.
PMAC User Manual (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 characters can erase all the alphanumeric characters sent since the latest carriage return character. If this includes addressing characters, these are erased as well. Full duplex communication (echoing of characters) is not permitted in daisy-chained serial mode.
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 before re-initializing), or a fast servo time with too many motors activated.
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.
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.
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.
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.
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 generalpurpose. 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.
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.
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.
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.
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.
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.
PMAC User Manual Direction Bit Use An alternate use for these outputs is as the direction (sign) bits for drive systems expecting sign-andmagnitude 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.
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.
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.
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, nonmultiplexed I/O. They map into the PMAC processor space at Y address $FFC1. The suggested Mvariable 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.
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.
52 ~5Kohm (OPTIONAL USER PROVIDED) +10V 26 20 25 KHz/V V/F CHA4 I915=4 ENC4 DECODER/ COUNTER X:$C00C+ 24 INTEGER COUNT SOFTWARE-CONFIGURED HARDWARE COUNTER CHA4/ (E24:1-2) E73 E72 PULSE TRAIN 0 TO 250 KHz HARDWARE VOLTAGE-TO-FREQUENCY CONVERTER VOLTAGE 25 0 TO +10V J2 SOFTWARE INTERPOLATION 24 X:$723 Y:$723=$00C00C 1/T ENCODER CONVERSION SCALING IS SET BY THE VALUE IN Y:$729 (FOR THE DEFAULT CONVERSION TABLE).
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.
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.
PMAC User Manual 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 MODES ADDRESS 0 1 C 0 0 3 HEX ($) BINARY 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 Figure 5 Address I-Variables Ix02 DAC output address Ix03 POSITION loop feedback address Ix04 VELOCITY loop feedback address Ix02 CP FE + - PI CV + VE - AP D DAC Locations DACn DACn+1 AMP Y: $C002-$C03B LOAD ENC AV Ix04
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.
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.
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.
Setting Up a Motor B CONVERT TO A/B QUAD A 32 increments B LASER INTERFEROMETER OR INTERPOLATED ENCODER A 90 PMAC 20 MHz EXT. A/B QUAD 10 MHz MAX.
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.
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.
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.
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).
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.
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.
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.
PMAC User Manual Each type of conversion is discussed below. Note: 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.
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.
PMAC User Manual ADC1: ADC2: ADC3: ADC4: ADC5: ADC6: ADC7: ADC8: $C006 $C007 $C00E $C00F $C016 $C017 $C01E $C01F ADC9: $C026 ADC10: $C027 ADC11: $C02E ADC12: $C02F ADC13: $C036 ADC14: $C037 ADC15: $C03E 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.
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.
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.
PMAC User Manual Unfiltered Parallel Feedback X-Words Y-words 1. Intermediate data: Sign-extended most significant word 1. 2. Converted data: Bits 0-4: Fractional Bits Bits 5-23: Integer Bits 2.
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.
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.
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 Mvariable. 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.
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 2.
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.
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.
PMAC User Manual Input Signal Quadrature, Parallel, Analog, etc. Encoder Position Encoder Position Capture Position (Mx03) Compare Position (Mx03) Phase Position (Mx01) Decoder/ Counter 24 bits Act. Pos. Cmd., Target Pos. "P", (Mx62) (Mx61),(Mx63) Position Extension 32 Set to Zero on Power-up/Reset (floating point) (PMATCH) Encoder 24 bits Conversion (e.g. 1/T) 48 bits Ix08 Done Always User Units (1/(Ix08 32)ct) (fixed point) (1/32 ct) Done Always Move End Pos.
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).
PMAC User Manual Uses of Cross-Axis Compensation The ability to have separate source and target motors for a table has several uses. The first is the traditional compensation for imperfect geometry, as in a bowed leadscrew. For instance, on an XY table, if the X-axis leadscrew is bowed, the Y-axis position should receive a correction as a function of X-axis position.
PMAC User Manual L1 S1=L1/N S2=L2/M C1=CORRECTION S1 (0) C1 C2 CN-1 CN CN+1 CN+2 CN+3 C2N C2N+1 C2N+2 C2N+3 C2N+4 C3N+1 C3N+2 +SOURCE 1 POSITION S2 L2 ROWS SHOULD MATCH COLUMNS SHOULD MATCH CMN+N CMN+M+1 CMN+M+2 CMN+M+N-1 CMN+M+N +SOURCE 2 POSITION Figure 14 Two Dimensional Compensation Table (C⋅+ )V)n Ix 35 (C⋅IE Ix 33 An ( ⋅Ix 31 0 ⋅n ⋅(A 32 − ⋅= ⋅ + + − 1 2) 128 Backlash Compensation PMAC can perform sophisticated backlash compensation for all motors.
PMAC User Manual Backlash Tables A backlash compensation table created with the DEFINE BLCOMP command can be used to create backlash distances that vary with the position of the motor. Most often, this is used in conjunction with a leadscrew compensation table to create the effect of a bi-directional leadscrew compensation table. The value of backlash distance for a given motor position derived from the backlash table is added onto the Ix86 constant backlash parameter.
PMAC User Manual The compensation table definition to create these corrections would be: DEFINE COMP 8,4000 -160 80 120 96 40 -56 -8 0 Notice that the first entry is for the correction at 500 counts, and the added last entry is 0, for the correction at 4000 counts and 0 counts. There is a 5-count backlash at motor position 0, so Ix86 should be set to 5*16, or 80. The backlash table should contain the differences between negative-going load position and positivegoing load position, minus Ix86: Motor Pos.
PMAC User Manual 83 -97 60 -43 129 0 ;Correction ;Correction ;Correction ;Correction ;Correction ;Correction at at at at at at 750 counts is 83 DAC bits 1000 counts is -97 DAC bits 1250 counts is 60 DAC bits 1500 counts is -43 DAC bits 1750 counts is 129 DAC bit 2000 counts (and 0) is 0 DAC bits the correction applied at 600 counts would be: Correction = −50 + Setting Up a Motor 600 − 500 750 − 500 (83 − [− 50 ]) = 3 85
PMAC User Manual 86 Setting Up a Motor
PMAC User Manual SETTING UP PMAC COMMUTATION Introduction This section explains how to set up the commutation scheme if PMAC is performing the commutation for a motor. If not using PMAC to perform the commutation on any of the motors, skip this section. Simply make sure that Ix01 is set to zero for all of the activated motors, so PMAC will not try to commutate them. If using PMAC to commutate a motor, tell PMAC how to perform the commutation.
PMAC User Manual TWO OUTPUTS BECOME TWO AXIS ONE AXIS NO COMMUTATION D.C. +/- 10V. TWO AXIS VELOCITY OR TORQUE COMM. 16 BIT RESOLUTION CONTROL PANEL DISPLAYS WITH COMMUTATION SINUSOIDAL, +/-10V. THREE OR FOUR PHASE 6KHz MAX. FREQ. VEL. & TORQUE COMM. 16 BIT RESOLUTION +10 V. HOST COMPUTER BUS OUT 1 RS422 D.C. [2 OF 8(16)] AVAILABLE OUTPUTS -10 V. +10 V. PMAC 16 THUMBWHEELS 120 OUT 2 D.C. 3 PH. OUT 3 -10 V. 8 (16) POSITION AND HANDWHEEL ENCODER OUT 8 90 OUT 9 4 PH.
PMAC User Manual Permanent Magnet Brushless Motor Commutation When commutating a permanent magnet brushless motor (often called a DC brushless motor, sometimes called an AC synchronous motor), very little beyond the basic commutation cycle parameters noted above must be specified. Getting the Polarity Right For proper commutation, it is required that the feedback polarity, as determined by the encoder wiring and the Encoder Decode I-variable (I900, I905, etc.
PMAC User Manual If a non-absolute sensor is used for commutation, PMAC must perform a search move for the proper phasing reference every time it powers up (with an absolute sensor, this only needs to be done once in the development of the system). There are several ways to do this phasing search. PMAC has two automatic methods executed by firmware; other methods or enhancements of these methods can be executed with PLC programs.
PMAC User Manual o In the stepper-motor phasing search, PMAC first forces current to put the motor at the +/-60 point in the o phasing cycle and waits for the settling time. Then it forces current to put the motor at the 0 point in the phasing cycle and again waits for the settling time. It checks to see that there has been at least 1/16 cycle o (22.5 ) movement between the two steps.
PMAC User Manual OPEN PLC 1 CLEAR CMD”#2O0” P229=I229 P279=I279 IF (I272<128) I229=-I273 I279=I273 ELSE ; Ix72>128 I229=I273 I279=-I273 ENDIF M70=I274*256 WHILE (M70>0) ENDWHILE I229=P229 M70=I274*256 WHILE (M70>0) ENDWHILE M271=0 I279=P279 CMD “#2J/” DISABLE PLC 1 CLOSE ; Force zero-magnitude open-loop ; Save real Phase A bias ; Save real Phase B bias ; Force negative bias into A ; Force positive bias into B ; ; ; ; ; Force positive bias into A Force negative bias into B This should force to 60 deg Start
PMAC User Manual For example: M171->TWR:0,2 M171->Y:$FFD0,0,16,U ;Resolver at multiplexer address 0, location 2 at that ; address on an Acc-8D Opt 7 board ;16-bit parallel absolute sensor at first Acc-14 Port A Next, manually run the stepper motor phasing search, using on-line commands. The point of this sequence is to force the motor into the zero-point of the phasing cycle. At this point, read the absolute sensor using the M-variable we have defined. Use Motor 1 for the example.
PMAC User Manual Saving Values Once confirmed that the proper phasing can be reached with the $ command, save the parameters into permanent memory with the SAVE command and do a full card reset with the $$$ command. If Ix80 was saved as 1, the motor should be enabled and in closed-loop position control immediately after the reset, although if the servo loop has not been tuned, it may not be very stiff. Regardless good response should be received from open-loop commands.
PMAC User Manual Hall Diagram This diagram shows the hall-effect waveforms with zero offset, defined such that the V-signal transition when the U-signal is low (defined as the zero point in the hall-effect cycle) represents the zero point in the PMAC commutation cycle. If the hall-effect sensors do not have this orientation, bits 16 to 21 of Ix81 can be used to specify the offset between The PMAC zero point and the hall effect zero point.
PMAC User Manual Switched Reluctance Motor Commutation To the PMAC commutation algorithm, a switched (variable) reluctance motor can look the same as a permanent magnet DC brushless motor. The difference is in the amplifier. Because the phases of an SR motor are driven uni-directionally, the power stage can be simpler. However, the analog pre-driver circuitry must convert the bidirectional nature of the PMAC outputs.
PMAC User Manual Slip Freq( cycles / update ) = Slip Freq( Hz ) PhaseUpdate Rate( updates / sec) The phase update rate for PMAC is determined by the master clock frequency and by jumpers E29-E33 and E98. The default rate is 9.04 kHz, or 9040 updates/sec.
PMAC User Manual Determination of the proper magnetization current is best done with a simple experimental technique. The technique relies on the linear relationship between motor speed and back EMF, in which the magnetization current provides the constant of proportionality (KE, the velocity, or back-EMF constant, is directly proportional to the magnetization current). Consider the no-load speed of the motor — equivalent to the line frequency, since there is zero slip at zero load.
PMAC User Manual • Plot the velocity-vs.-time graph on the screen. Calculate an acceleration value from the slope of the curve as it leaves zero velocity. • Decrease the Ix78 slip gain by 10% and repeat steps 3 and 4. If the acceleration from zero velocity is greater than the first plot, continue decreasing slip gain. If the acceleration is less than the first plot, increase Ix78 from the initial value by 10% and repeat steps 3 and 4.
PMAC User Manual Setting the I-Variables Setting up a motor for microstepping is simply a matter of setting motor I-variables according to the following list. Since there is no feedback, there is no tuning necessary. Ix01: Set to 1 to enable PMAC commutation. Ix02: Set bits 0 to 15 to the lower address of the pair of output DACs you wish to use ($C002 for DAC1 and DAC2, $C00A for DAC3 & DAC4). Set bit 16 to 1 to tell PMAC it is microstepping this motor. For example: I102=$1C002.
PMAC User Manual Using the Motor Once the motor is set up, use it just as any other PMAC motor. In fact, because it is working off internal feedback, this motor can be programmed and tested without any physical motor attached! User-Written Commutation Algorithm For the sophisticated user with unusual and/or difficult commutation needs, PMAC provides the hooks for custom user-written commutation (phasing) algorithms.
PMAC User Manual 102 Setting Up PMAC Commutation
PMAC User Manual CLOSING THE SERVO LOOP The Purpose of the Servo Loop PMAC automatically closes a digital servo loop for all activated motors. The purpose of the servo loop is to command an output in such a way to try to make the actual position for the motor match the commanded position. How well it does this depends on the tuning of the servo loop filter – the setting of its parameters – and the dynamics of the physical system under control.
PMAC User Manual Amplifier Types PMAC can interface to a variety of different types of amplifiers. The type of amplifier used for a particular motor has important ramifications for the tuning of the servo loop. Each of the common types is explained below. Velocity-Mode Amplifiers Many amplifiers accept a velocity command from the controller and a velocity feedback signal from a motor sensor – usually from a tachometer or synthesized from a resolver.
PMAC User Manual Torque-mode amplifiers are popular for several reasons. Since they do not need a tachometer or analog velocity-loop electronics, they can be simpler and less expensive. Because the current loop gains are dependent only on motor properties, and not on the load, they can be tuned by the manufacturer for the particular motor that is being used. No retuning is required by the machine builder when the motor is connected to the load.
PMAC User Manual Finally, it provides a safer failure mode on loss of feedback. When a servo algorithm loses feedback, it puts out a large torque command, which can cause runaway. However, when a commutation algorithm loses its feedback, it will lock in like a stepper motor (for a synchronous motor) or at least fail to generate significant torque (for an asynchronous – induction – motor).
PMAC User Manual K (1-z -1 ) vff -1 -2 K (1-2z +z ) aff Reference Position Big Step/ Deadband Filter + - Notch Filter + + K -1 1+n z +n 2z 1 p -1 1+d z +d z - + 1 -2 -2 2 Notch Coefficients n 1 : Ix36 IM Ki n 2 : Ix37 K d 1-z -1 d 1 : Ix38 d 2 : Ix39 Kp : Proportional Gain (Ix30) K : Derivative Gain (Ix31) d K : Velocity Feedforward Gain (Ix32) vff K : Integral Gain (Ix33) i IM : Integration Mode (Ix34) K : Acceleration Feedforward Gain (Ix35) Secondary Position ("Velocity") Fe
PMAC User Manual Actual PID Algorithm The actual equation used in the PID algorithm to compute the commanded output for motor x is as follows: DACout ( n ) = 2 −19 Ix32 ⋅ CV ( n) + Ix35 ⋅ CA( n) 128 ⋅ Ix30 Ix 08 ⋅ {FE ( n) + + Ix33 ⋅ IE ( n) Ix31 ⋅ Ix09 ⋅ AV ( n ) }− 23 128 2 where: • DACout(n) is the 16-bit output command (-32768 to +32767) in servo cycle n. It is converted to a 10V to +10V output. DACout(n) is limited by Ix69.
PMAC User Manual Automatic Notch Specification With the PMAC Executive Program, set up a notch filter (this can be done without the need to understand how a notch filter works). The easiest way is to enter the frequency of the mechanical resonance that to control. The Executive Program will compute automatically the desired characteristics of the band-reject and band-pass filters, calculate their coefficients, and download them to PMAC.
PMAC User Manual For example, suppose a 55 Hz resonance has been identified in the mechanical coupling. To compensate for this, put a lightly damped band-reject filter (damping ratio 0.2) at 50 Hz natural frequency, and a heavily damped band-pass filter (damping ratio 0.8) at 80 Hz natural frequency to limit the highfrequency gain of the filter. The servo update time is the default of 442 microseconds. Ts = 442 µ sec* 10 −6 sec = 0.000442 sec µ sec ω nz = 2π * 50 Hz = 314.
PMAC User Manual Lead-Lag The notch filter can be used as a lead-lag filter if the roots are real rather than imaginary. A lead-lag filter is similar in performance to a PID filter; it is useful when filter settings are determined analytically rather than experimentally. When a basic lead-lag servo filter is desired, all servo gains Ix31 to Ix35 should be set to zero; Ix30 is used as the generalized gain term.
PMAC User Manual What is needed to write the Filter The user-written filter will be written on host computer using a cross-assembler. Motorola provides 56000 cross-assembler programs for IBM-PC and compatibles (SSP56000CLASa), Macintosh II (SSP56000CLASb), Sun-3 workstations (SSP56000CLASc), and DEC VAX computers (SSP56000CLASd). Almost all will work on the IBM PC, because the file will have to be converted to DOS format anyway.
PMAC User Manual • • • • • On entry, the X register contains a 48-bit integer representing actual position (APOS) in units of 1/(Ix08*32) counts On entry, the A accumulator contains a 48-bit integer representing desired velocity (DVEL) in units of 1/(Ix08*32) counts/servo cycle. On entry, the Y1 register contains the value of Ix08.On entry, the R1 register contains the address of the servo status register for the motor whose loop is to be closed ($003D for Motor 1, $0079 for Motor 2, etc.).
PMAC User Manual ; ; ; ; ; ; ; ; ; OLD_UF_A COEF_A SAMP_A period factor and its counter should be initialized in L:SAMP_A. Notice the sampling period counter always should be less than the sampling period factor. The content of the sampling period factor cell represents an integer multiple of the hardware selected PMAC servo sampling period. In this way the sampling frequency may be reduced from the the PMAC default value.
PMAC User Manual int argc; char *argv[]; { m = 0; x = 0; if (argc > 1) { infile = fopen(strcat(strcpy(buf,argv[1]),".lod"),"r"); if (infile != NULL) { outfile = fopen(strcat(strcpy(buf,argv[1]),".
PMAC User Manual 116 Closing the Servo Loop
PMAC User Manual MAKING THE APPLICATION SAFE Responsibility for the Safety of a Control System Delta Tau Data Systems has provided many safety features on the PMAC controller, and invested many resources to make PMAC a safe product. However, the ultimate responsibility for the safety of a control system using PMAC must lie with the system designer, utilizing the safety features on PMAC and in other parts of the system.
PMAC User Manual Software Overtravel Limits PMAC also has positive and negative software limits for each motor to complement or replace the hardware limits. The user-set values (Ix13 and Ix14 parameters for motor #x) for these limits cannot be saved in EAROM on battery-backed boards; they are held in battery-backed RAM. The behavior on hitting these limits is the same as for hardware limits. A value of zero in these parameters disables the limit.
PMAC User Manual PMAC only performs the integrated following error check if the Ix63 integration limit parameter is less than zero. When this is the case, the magnitude of Ix11 is used for the normal unintegrated following error check, but in addition, the value of the PID integrator is compared against the Ix63 integration limit magnitude.
PMAC User Manual Ix17 is particularly useful to prevent unreasonable moves early in system development, when it is easy to make large mistakes in scaling. In some systems, it can be used during the actual application to make sure that accelerations always happen in the minimum time. In these applications, the TA and TS acceleration times are set very small so that the Ix17 limit is always used.
PMAC User Manual where: a. I (quadrature current) is the commanded torque-producing output of the PID filter in units of a 16-bit DAC; q b. Id c. ∆t (direct current) is the magnetization current command as set by Ix77. This is usually zero except when PMAC is doing vector control of induction motors. is the time since the last sample in servo cycles 2 If Sum exceeds Ix58, an I T fault will occur. When commanded current levels are below Ix57, Sum will decrease, but it will never go below zero.
PMAC User Manual Watchdog Timer PMAC has an on-board dead-man (or watchdog) timer. This subsystem provides a fail-safe shutdown to guard against software malfunction. To keep it from tripping the hardware circuit for the watchdog timer requires that two basic conditions be met. First, it must see a DC voltage greater than 4.75V. If the supply voltage is below this value, the circuit's relay will trip and the card will shut down. This prevents corruption of registers due to insufficient voltage.
PMAC User Manual Program Checksums PMAC continually computes the checksum of its internal program (firmware) as a background task. Each time it has computed the checksum, it compares this value to a reference register in memory (X:$07B1) that has been manually entered with the correct value. PMACs shipped from the factory are preloaded with the correct reference value for that firmware version at the factory.
PMAC User Manual 124 Making Your Application Safe
PMAC User Manual BASIC MOTOR MOVES Commanding Some Basic Moves for the Motor Once the motor is defined and basically working, command some basic moves for the motor. Jogging commands allows the motor to make simple moves, independent of other motors, without writing a motion program. Use these moves for development, diagnostics, and debugging, but also use them in the actual application. Another type of simple motor move is the homing search move.
PMAC User Manual Indefinite Jog Commands J+ commands an indefinite positive jog for the addressed motor; J- commands an indefinite negative jog; J/ commands an end to the jog, leaving the motor in position control after the deceleration. It is possible for the J/ command to leave the commanded position at a fractional count, which can cause dithering between the adjacent integer count values.
PMAC User Manual • Ix03 bit 16 specifies whether the hardware-captured counter value is used as the trigger position — suitable for incremental encoder signals, real or simulated — or the software-read position is used instead — suitable for other types of feedback (0=hardware, 1=software). The software-read position must be used if the following error status is used for the trigger.
PMAC User Manual Homing Search Move Control Homing Acceleration The acceleration for homing search moves is controlled by the same parameters (Ix19, Ix20, and Ix21) as for jogging moves. These are described in the previous section. Homing Speed Homing speed and direction are specified by Ix23. If Ix23 is greater than zero, the homing search move will be positive. If it is less than zero, the move will be negative. The magnitude of Ix23 controls the speed of the move (in counts/msec).
PMAC User Manual Trigger Signals and Edges Once the set of flags for the motor have been specified with Ix25, use Encoder/Flag I-variable 2 (I902, I907, etc.) to tell PMAC whether to use a flag, the index channel, or both, as the capture trigger, and which edge of the flag and/or the index channel to use. Next, use Encoder/Flag I-variable 3 (I903, I908, etc.) to specify which of the four flags (HMFLn, +LIMn, -LIMn, FAULTn) is to use for the capture.
PMAC User Manual Although the homing switch does not need to be placed accurately in this type of application, it is important that its triggering edge remain safely between the same two index channel pulses. Also, the homing switch pulse must be wide enough to always contain at least one index channel pulse. Action on Trigger In the homing search move, as soon as the PMAC firmware recognizes that the hardware trigger has occurred, it takes several actions.
PMAC User Manual Buffered Program Command The homing search move can also be commanded from within a motion program with the HOMEn command, where n is the motor number. This command specifies a motor; unlike other motion program commands that specify an axis move. In a motion program, the PMAC automatic program sequencing routines monitor for the end of the move. When the move is successfully completed, program execution continues with the next command.
PMAC User Manual Note: If the following error is received when giving the HOMEZ command, the reported actual position after the HOMEZ command will not be exactly zero; it will be equal to the negative of the following error. Homing into a Limit Switch It is possible to use a limit switch as a home switch. However, first disable the limit function of the limit switch to have the move finish normally; if this is not done, the limit function will abort the homing search move.
PMAC User Manual ;************** PLC program to execute routine ********************* OPEN PLC 10 CLEAR I125=$2C000 ; Disable +/-LIM as limits CMD"#1HM" ; Home #1 into limit and offset out of it WHILE (M145=1) ; Waits for Home Search to start ENDWHILE WHILE (M133=0) ; Waits for Home motion to complete ENDWHILE I125=$C000 ; Re-enable +/-LIM as limits DIS PLC10 ; Disables PLC once Home is found CLOSE ; End of PLC Multi-Step Homing Procedures A homing procedure may be required that cannot be executed with a s
PMAC User Manual I907=11 I908=0 CMD"#2HM" WHILE (M245=1) ENDWHILE WHILE (M233=0) ENDWHILE DIS PLC11 CLOSE ; ; ; ; Capture on flag low and index channel high Use HMFL2 (home flag) as trigger flag Do actual homing move Waits for Home Search to start ; Waits for Home motion to complete ; Disables PLC once Home is found ; End of PLC Already Into Home? A similar situation occurs when it is not known on power-up whether or not it is positioned already into the home trigger.
PMAC User Manual I326=0 I912=3 I913=0 CMD"#3HM" WHILE (M345=1) ; ; ; ; No home offset Capture on rising flag and rising index Use HMFL3 as flag Do actual homing move ; Waits for Home Search to start ENDWHILE WHILE (M333=0) ENDWHILE DIS PLC12 CLOSE ; Waits for Home motion to complete ; Disables PLC once Home is found ; End of program Storing the Home Position PMAC stores the encoder position that was captured during the latest homing search move for the motor automatically.
PMAC User Manual Open-Loop Moves Open-loop moves, as their name implies, do not do closed-loop position control. They open up the servo loop and just put commands of the specified magnitude on the outputs. Typically, these are used for diagnostic purposes, but they can also be used in the actual applications. These moves are executed using the motor-specific O{constant} on-line command, where {constant} represents the magnitude of the output as a percentage of Ix69, the maximum output parameter.
PMAC User Manual SETTING UP A COORDINATE SYSTEM Coordinating Multiple Motions Once the motors have been set up and tuned and they are doing controlled jogging and homing search moves, assemble one or more coordinate systems so that motion programs can be run. PMAC has several methods of coordinating multiple motions, whether they are all under the PMAC direct control or not. Depending on needs, one of the coordination strategies below can be implemented.
PMAC User Manual Coordinating parallel gantry motors in this fashion is in general superior to using a master/slave technique (which can be done on PMAC with the position following feature described in the Synchronizing PMAC to External Events section of this manual.
PMAC User Manual Axis Types An axis can have several attributes, as specified below. Note that for most axis functions, it does not matter what type of axis is used, or what letter is given it. However, for some features, only particular axis names may be used. Cartesian Axis A Cartesian axis is one that may be put into a grouping of two or three axes so that movement along an axis is a linear combination of motion on two or three motors.
PMAC User Manual The PMATCH function effectively inverts the equations contained in the Axis Definition statements for the coordinate system, using motor commanded positions, and solves for axis commanded positions. If more than one motor is assigned to the same axis (e.g. #1->10000X, #2->10000X), the commanded position of the lower-numbered motor is used in the PMATCH calculations.
PMAC User Manual What Is Coordinate System Time-Base? Each coordinate system has its own time base that helps control the speed of interpolated moves in that coordinate system. The PMAC interpolation routines increment an elapsed-time register every servo cycle. While the true time for the servo cycle is set in hardware for the card (by jumpers E98, E29-E33, and E3-E6) and does not change, the value of time added to the elapsed-time register each servo cycle is just a number in a memory register.
PMAC User Manual 142 Setting Up a Coordinate System
PMAC User Manual COMPUTATIONAL FEATURES Advanced Computational Features PMAC has advanced computational features that permit off-loading of many operations from a host, or even stand-alone operation in ways that were not previously possible. Many arithmetic, logical, and transcendental operations can be performed on variables and constants in user programs on board the card.
PMAC User Manual • Motion Program Move Planning: .Motion program move planning consists of working through the lines of a motion program until the next move or dwell command is encountered, and computing the equations of motion for this next part of the move sequence. Every time PMAC starts executing a new move, it sets an internal flag indicating it is time to plan the next move in the program. This planning occurs at the next RTI.
PMAC User Manual Second is to adjust the jobs at a priority level to give them less emphasis. Large PLC programs can be split into a few shorter PLC programs. This increases the frequency of housekeeping and communications by giving more breaks in PLC scans. Motion program WHILE(condition)WAIT statements could be done as follows: WHILE(condition) DWELL20 ENDWHILE This will give more time to other RTI jobs such as Move Planning and PLC/PLCC0.
PMAC User Manual * CT #1 #2 #3 #4 PLC 0 Servo CT #1 #2 #3 #4 #1 #2 Background PLC 1 (cont.) Servo CT PLC 1... RTI HK PLC 2... Background #3 #4 PLC 2 (cont.) Servo HK Comm PLC 3... Background * CT #1 #2 #3 #4 PLC 0 Servo CT #1 #2 #3 #4 Move Planning (cont) PLC 3 (cont) ... RTI Background Servo CT #1 #2 Move Planning ... RTI #3 #4 PLC 3 (cont) Servo HK PLC 1 ... Background * CT #1 #2 #3 #4 PLC 0 Servo CT #1 #2 PLC 1 (cont) ...
PMAC User Manual Addresses PMAC uses the Motorola DSP56001 as its processor. The 56001 has dual 16-bit address spaces (of 24bit data) for memory and I/O. (The I/O in PMAC is memory-mapped; it does not have a separate I/O space as the PC does.) When specifying an address in PMAC, one must state which half of memory (X or Y) – or both halves (L) for a long 48-bit word – followed by an optional colon, followed by the numerical address itself.
PMAC User Manual Value Assignment Values assigned to an I-variable may be either a constant or an expression. The commands to do this are on-line (immediate) if no buffer is open when sent, or buffered program commands if a buffer is open. Examples: I120 = 45 I120 = (I120+P25*3) Limited Range For I-variables with limited range, an attempt to assign an out-of-range value does not cause an error. The value is rolled over automatically to within the range by modulo arithmetic (truncation).
PMAC User Manual 23 X-Memory 16 15 8 7 0 23 Y-Memory 16 15 87 0 $0000 Internal DSP $00FF $0100 Memory Fixed-Use Calculation Registers $17FF $1800 External Static RAM (Battery Backed) User Buffer Storage Space $BBFF $BC00 User-Written Servo Storage $BFFF $C000 M-Variable Definitions DSP-Gate Registers $C03F $D000 Dual-Ported RAM $DFFF $E000 VME Setup Registers Mailbox Registers VME bus registers $F000 I/O Registers $FFFF Figure 25 PMAC Memory Mapping P-Variables P-variables are gene
PMAC User Manual Array Writing Writing to a set of P-variables as an array must be done with indirect addressing techniques. To set this up, first define an M-variable to point to P0 (e.g. M0->L:$1000). Next, define a second M-variable to point to the lowest twelve bits of the first M-variable’s definition word which is in Y-register $BC00 (e.g. M10->Y:$BC00,0,12 defines M10 to the low 12 bits of the definition word for M0).
PMAC User Manual Coordinate System 3's Q0 is the same thing as the Q256 of &1; Coordinate System 4's Q0 is the same thing as Q256 of &2, and as Q768 of &1. Q0 of &5 is equivalent to Q128 of &1; Q0 of &6 is equivalent to Q128 of &2, and to Q640 of &1; Q0 of &7 is equivalent to Q128 of &3, and to Q384 of &1; Q0 of &8 is equivalent to Q128 of &4, and to Q896 of &1. See the table below for clarification.
PMAC User Manual Array Capabilities Array Reading It is possible to use a set of Q-variables as an array. To do this when reading from the variables, simply replace the constant specifying the variable number with an expression in parentheses — use the ({expression}) syntax instead of the Q{constant} syntax. PMAC simply treats this syntax as a type of function call, like SIN({expression}). Example: To move in sequence to the positions specified by Q51 to Q100, use a program segment like the following.
PMAC User Manual Special-Use Q-Variables Several Q-variables have special uses that need to be watched. The ATAN2 (two-argument arctangent) function uses Q0 as its second argument (the cosine argument) automatically. The READ command places the values it reads following letters A through Z in Q101 to Q126, respectively, and a mask word denoting which variables have been read in Q100. The S (spindle) statement in a motion program places the value following it into Q127.
PMAC User Manual See the instructions for each type of M-variable definition in the On-Line Commands section of this manual. Many suggested M-variable definitions are given in SETUP.PMC in the Examples section of the manual. It is a good idea to prepare a single file with all of the M-variable definitions and to put at the top of this file the command M0..1023->*. This will remove all existing definitions, and help to prevent mysterious problems caused by stray M-variable definitions.
PMAC User Manual Logical Operators PMAC has three logical operators that do bit-by-bit operations: & (bit-by-bit AND), | (bit-by-bit OR), and ^ (bit-by-bit EXCLUSIVE OR). If floating-point numbers are used, the operation works on the fractional as well as the integer bits. & has the same precedence as * and /; | and ^ have the same precedence as + and -. Use of parentheses can override this default precedence.
PMAC User Manual ASIN inverse sine (arc-sine) function with its range reduced to +/-90 degrees. ASIN ({expression}) Syntax -1.0 — 1.0 Domain Domain units none -Pi/2 — Pi/2 radians (-90 — 90 degrees) Range radians/degrees Range units Possible errors Illegal Domain Function ACOS inverse cosine (arc-cosine) function with its range reduced to 0 — 180 degrees. ACOS ({expression}) Syntax -1.0 — 1.
PMAC User Manual LN Function Syntax Domain Domain units Range Range units Possible errors natural logarithm function (log base e). LN ({expression}) all positive reals none all reals none illegal domain EXP Note: x ln (y) To implement the yx function, use e instead. A sample PMAC expression P2 would be EXP (P2*LN (P1)) to implement the function P1 . Function Syntax Domain Domain units Range Range units Possible errors exponentiation function (ex).
PMAC User Manual Function Syntax Domain Domain units Range Range units Possible errors truncation function INT ({expression}) all reals free integers free none Expressions A PMAC expression is a mathematical construct consisting of constants, variables, and functions, connected by operators. Expressions can be used to assign a value to a variable, to determine a motion program parameter, or as part of a condition.
PMAC User Manual Why Needed When assigning values to variables is part of the calculation, the variables will get their new values ahead of their place in the program when looking at actual move execution. For P and Q-variables, this is generally not a problem, because they exist only to aid further motion calculations.
PMAC User Manual Syntax There are four forms of synchronous M-variable assignment statements: M{constant}=={expression} M{constant}&={expression} M{constant}|={expression} M{constant}^={expression} ; ; ; ; Straight equals assignment AND-equals assignment OR-equals assignment XOR-equals assignment In all of these forms, the expression on the right side of the statement is evaluated when the line is encountered in the program, ahead of the execution of the move.
PMAC User Manual Function Expression Value 1- to 20-bit MVariable * or 24-bit MVariable 32- or 48-bit MVariable == == == &= &= &= |= |= |= ^= ^= ^= All 1's All 0's Others All 1's All 0's Others All 1's All 0's Others All 1's All 0's Others 2 2 3 0 (no-op) 2 2 2 0 (no-op) 2 2 0 (no-op) 2 2 2 2 0 (no-op) 2 2 2 0 (no-op) 2 2 0 (no-op) 2 3 3 3 illegal illegal illegal illegal illegal illegal illegal illegal illegal Comparators A comparator evaluates the relationship between two values (constants or ex
PMAC User Manual Compound Conditions A compound condition is a series of simple conditions connected by the logical operators AND and OR. The compound condition is evaluated from the values of the simple conditions by the rules of Boolean algebra. In the PMAC, AND has execution precedence over OR (that is, ORs operate on blocks of ANDed simple conditions). PMAC will stop evaluating compound AND conditions after one false simple condition has been found.
PMAC User Manual Example: In a PLC program, to turn on an output for a fixed number of milliseconds: M1=1 M90=125*8388608/I10 WHILE (M90>0) ENDWHILE M1=0 ; Turn on Machine Output 1 ; Set timer (M90) to 125 msec, in servo cycles ; Wait for counter to count down to zero ; Turn off Machine Output 1 Computational Considerations When PMAC is doing calculations in a PLC program, motion program, or on-line, it uses its 48-bit floating point format for the intermediate form of the calculation.
PMAC User Manual 164 Computational Features
PMAC User Manual WRITING PROGRAMS FOR PMAC Writing a Motion Program PMAC can hold up to 256 motion programs at one time. Any coordinate system can run any of these programs at any time, even if another coordinate system is already executing the same program. PMAC can run as many motion programs simultaneously as there are coordinate systems defined on the card (up to eight). A motion program can call any other motion program as a subprogram, with or without arguments.
PMAC User Manual Motion Program Trajectories Among the PMAC outstanding characteristics are the power and flexibility of its trajectory generation algorithms. These algorithms allow a variety of difficult maneuvers to be performed, and permit the choice of tradeoffs between ease of use and degree of control. It is important to remember that these trajectories are series of commanded positions only. It is up to the servo loops for each axis to try to make the actual positions match the commanded positions.
PMAC User Manual Note: If PMAC is operating in move segmentation mode (I13>0), which is required for circular interpolation, this Ix17 acceleration limit is not observed. Do not set both the TA and TS (Ix87 and Ix88.) times to zero, even if planning to rely on the acceleration limit. This would cause a divide-by-zero error, yielding possible erratic performance.
PMAC User Manual SPECIFY t A AND t S C C E L AND ACCELERATION LIMIT ACCELERATION Parabolic Sinusoidal For Comparison tL = 0 t ACCEL = 2tS 2a 2 a tL = tS 3 2 tS = 0 t ACCEL = 2tS a 0 4 1 TIME VELOCITY Parabolic (sinusoidal) 4 for comparison t L = tACCEL - 2tS tL t S t S MAX.
PMAC User Manual Note: Feedrate is a magnitude and should therefore always be a positive number. A negative Feedrate will cause the motion to be opposite of what is defined as positive in the Coordinate System definition. Short Moves If a feedrate-specified move segment is so short in distance that it cannot reach its target velocity, it will spend its entire time in acceleration (yielding a triangular rather than trapezoidal profile).
PMAC User Manual Small acceleration time V TA TM or ∆ P/F TA time V TA TM or ∆ P/F TA TM or ∆P/F TA time V TA TM or ∆ P/F TA TM or ∆ P/F TA time V TA TA TM or ∆ P/F TA TM or ∆ P/F TA TM or ∆ P/F time Figure 28 Linear Mode Trajectories (Sheet 1 of 4) 170 Writing Programs for PMAC
PMAC User Manual Acceleration time matches move time V TM or ∆P/F time V TM or ∆P/F TA TM or ∆P/F TA time TA V TM or ∆P/F TA TM or ∆P/F TA time TA V TM or ∆P/F TA TM or ∆P/F time TA TA TA Figure 29 Linear Mode Trajectories (Sheet 2 of 4) Writing Programs for PMAC 171
PMAC User Manual Large (velocity limiting) acceleration time V TM or ∆P/F TA TA time V TM or ∆P/F TM or ∆P/F TA TA time TA V TM or ∆P/F TA TM or ∆P/F TA time TA Figure 30 Linear Mode Trajectories (Sheet 3 of 4) 172 Writing Programs for PMAC
PMAC User Manual Changing acceleration times V TM or ∆P/F TA1 TM or ∆P/F TA2 time TA2 V TM or ∆P/F TA1 TM or ∆P/F TA2 time TA2 V TA1 TA2 actual TA2 specified TA2 specified time V TM1 TA1 TM2 TA2 TA2 time Figure 31 Linear Mode Trajectories (Sheet 4 of 4) Writing Programs for PMAC 173
PMAC User Manual Feedrate Axes If a multi-axis move is specified by feedrate (and not time), there is further flexibility by specifying which axes control the vector feedrate, using the FRAX command (on-line or buffered), and velocity is apportioned among these axes so that their vector combination (root of sum of squares) is the specified velocity. PMAC calculates the move time as the vector distance of the feedrate axes divided by the programmed feedrate.
PMAC User Manual The acceleration parameters TA and TS can change between each move. If the final deceleration to a stop should use a different TA or TS from the previous blending acceleration time in a sequence, declare the new TA or TS after the final move command in the sequence, but before the DWELL or other feature that stops the continuous sequence. Rapid-Mode Moves Rapid mode moves are essentially jog moves for each motor assigned to an axis specified in the move.
PMAC User Manual • If input flags are to create the trigger, Ix25 specifies the flag register. • If input flags are to create the trigger, Encoder/Flag I-variables 2 and 3 for this set of flags specify which edges of which signals will cause the trigger.
PMAC User Manual Standard Planes To specify the circles in the XY plane, simply command NORMAL K-1 (equivalent to G17 in machinetool code). Similarly, for circles in the ZX plane, command NORMAL J-1 (G18 equivalent); for circles in the YZ plane, command NORMAL I-1 (G19 equivalent).
PMAC User Manual Radius Size Specification If the radius method of locating the arc center is used, the radius is the number after the letter R in the move command. This value always represents the distance from the move starting point. With radius specification, it is also necessary to specify whether the arc to the move endpoint is the long route (>=180 degrees) or the short route (<=180 degrees).
PMAC User Manual Feedrate Axes Any axes used in the circular interpolation are automatically feedrate axes for circular moves, even if they were not so specified in a FRAX command. Other axes may or may not be feedrate axes. Any nonfeedrate axes commanded to move in the same move command will be linearly interpolated so as to finish in the same time. This permits easy helical interpolation. See the Feedrate Axes section in this manual.
PMAC User Manual PMAC Calculations From the specified parameters for the move piece, and the beginning position and velocity (from the end of the previous piece), PMAC computes the only third-order position trajectory path to meet the constraints. This results in linearly changing acceleration, a parabolic velocity profile, and a cubic position profile for the piece.
PMAC User Manual E= Rθ 4 V 4T 4 = 384 384 R 3 where V is the vector velocity, T is the segment time, R is the local radius of curvature, and θ is the subtended angle. Splined Moves PMAC can perform two types of cubic splines (cubic in terms of the position vs time equations) to blend together a series of points on an axis. Its SPLINE1 mode is a uniform non-rational cubic B-spline and its SPLINE2 mode is a non-uniform non-rational cubic B-spline.
PMAC User Manual V V TA (added) TA TA (added) TA (added) time TA TA TA (added) time Two Programmed Segments One Programmed Segment V V TA (added) TA TA TA TA (added) time TA (added) TA Three Programmed Segments TA TA TA TA (added) time Four Programmed Segments Figure 36 Cubic Spline Trajectories VEL A0 (calculated) P0 ,V 0 (from before) dA = constant(calculated) dt P1 (specified) V1 (specified) A1 (calculated) PVT200 ... X9000:150 ...
PMAC User Manual PMAC also computes the velocity for each axis at each way point along the spline by taking the velocity halfway between the average velocities of the segments on either side of the way point: V(n) = [X(n + 1) - X(n)] + [X(n) - X(n - 1)] X(n + 1) - X(n - 1) = 2 * TA 2 * TA Having computed exact positions and velocities at segment boundaries, PMAC calculates the unique cubic position equation (parabolic velocity profile) that meets these constraints, and uses this equation for interpolatio
PMAC User Manual Cutter Radius Compensation PMAC provides the capability for performing cutter (tool) radius compensation on the moves it performs. This compensation can be performed among the X, Y, and Z axes, which should be physically perpendicular to each other. The compensation offsets the described path of motion perpendicular to the path automatically by a programmed amount, compensating for the size of the tool.
PMAC User Manual Turning on Compensation The compensation is turned on by buffered motion program command CC1 (offset left) or CC2 (offset right). These are equivalent to the RS-274 G-Codes G41 and G42, respectively. If implementing GCode subroutines in PMAC motion program 1000, simply incorporate in PROG 1000: N41000 CC1 RETURN N42000 CC2 RETURN Turning off Compensation The compensation is turned off by buffered motion program command CC0, which is equivalent to the RS-274 G- Code G40.
PMAC User Manual Outside Corner Introduction If the lead-in move and the first fully compensated move form an outside corner, the lead-in move moves first to a point one cutter radius away from the intersection of the lead-in move and the first fully compensated move, with the line from the programmed point to this compensated endpoint being perpendicular to the path of the lead-in move at the intersection.
PMAC User Manual Inside Corner Cutter Compensation Line Programmed Path r r Line Tool Center Path Line Programmed Path r Line Arc r Arc Line Line Line to Line r r Arc Arc Tool Center Path Line to Arc Line Programmed Path Tool Center Path Line Programmed Path r Arc Arc r Arc Arc Tool Center Path Arc to Line Arc to Arc Figure 40 Inside Corner Cutter Compensation Treatment of Outside Corners For outside corners, PMAC will either blend the incoming and outgoing moves directly together, or
PMAC User Manual Outside Corner Cutter Compensation, Sharp Angle ( cos ∆Θ < Isx99) Line Arc Line r Arc Arc Line Programmed Path r Tool Center Path Line Line Programmed Path r r Arc Tool Center Path Line Line to Line Line Line to Arc Arc Line Arc r r Programmed Path Arc r Arc Programmed Path r Arc Arc Tool Center Path Arc Arc Tool Center Path Arc to Line Arc to Arc Figure 41 Outside Corner Cutter Compensation Sharp Angle Shallow outside Corner However, if the cosine of the chan
PMAC User Manual The added arc prevents the compensated corner from extending too far out on the outside of a sharp corner. However, as an added move, it has the minimum time of the acceleration time, which can cause a slowdown on a very shallow angle. While the default value for I89 of 0.9998 (cos1o) causes an arc to be added on any change in angle greater than 1o, many users will set I89 to 0.707 (cos45o) or 0.0 (cos90o) so arcs are only added on sharp corners. When coming to a full stop (e.g.
PMAC User Manual Failure When Compensation Extends Full Circle Tool Center Path 1 1 r Programmed Path r 2 r 3 Short Arc Executed Compensated Circle “Skipped” 2 Programmed Full Circle Figure 44 Failure When Compensation Extends Full Circle Speed of Compensated Moves Tool center speed for the compensated path remains the same as that programmed by the F parameter.
PMAC User Manual Cutter Compensation Change of Direction CC1 Arc Line Line Arc Line CC2 Line Programmed Path CC2 Line Programmed Path Tool Center Path CC1 Tool Center Path Line Line to Line Line to Arc Arc CC1 CC2 Programmed Path Arc Arc Programmed Path Line CC2 Tool Center Path Line Arc Arc Arc Tool Center Path CC1 Arc to Line Arc to Arc Figure 45 Cutter Compensation Change of Direction However, if there is no intersection between the two compensated move paths, the change is introd
PMAC User Manual Note that few controllers can make their lead-out move a CIRCLE-mode move. This capability permits releasing contact with the cutting surface very gently, important for fine finishing cuts. Inside Corner If the last fully compensated move and the lead-out move form an inside corner, the lead-out move starts directly from this point to the programmed endpoint. When the lead-out move is a LINEAR-mode move, the compensated tool path will be at a diagonal to the programmed move path.
PMAC User Manual Removing Compensation – Outside Corner Line Line Programmed Path Tool Center Path Line CC0 Line r Arc r Arc Line to Line Line to Arc Arc Line Programmed Path Tool Center Path Line Line r Tool Center Path r Line Programmed Path CC0 Arc CC0 Spiral r r Arc Arc Tool Center Path Arc Programmed Path CC0 Arc Spiral r r Arc Arc to Line Arc to Arc Figure 48 Removing Compensation – Outside Corner Note that this behavior is different from changing the magnitude of the compensation
PMAC User Manual Failures in Cutter Compensation Overcut Programmed Path Line r r Tool Center Point at Failure r Line Line Tool Center Path Tool Center Point at Failure (No Overcut) Line Line Tool Center Path Arc r r Programmed Path Line Line Line Failure to See Through Inside Corner Tool Center Path Line Arc r Line Line Line r Programmed Path Failure to See Through Outside Corner Line Line Programmed Path Arc r r Tool Center Path Line Stopping Point (Not Executed) Overcut Inside
PMAC User Manual Unlike many controllers, PMAC can execute non-motion program blocks with single-step commands with cutter compensation active. However, be aware that the execution of these blocks may appear out of sequence, because the motion from the previous programmed move block will not yet have been executed. Synchronous M-variable assignments in this mode are still buffered and not executed until the actual start of motion execution of the next programmed move.
PMAC User Manual Absolute Displacement The ADIS{constant} (absolute displacement) command sets up the displacement portion of the selected matrix by making the three displacement values (D1, D2, & D3) equal to the three Q-variables starting with the one specified with {constant}. For instance, ADIS 25 would make the Xdisplacement equal to Q25, the Y-displacement equal to Q26, and the Z-displacement equal to Q27.
PMAC User Manual Rotation Example To rotate the coordinate system 15 degrees about the origin in the XY plane.
PMAC User Manual Entering a Motion Program The motion program statements are entered one program buffer at a time into PMAC. For each program buffer, the first step is to open the buffer for entry with the OPEN PROG n command (where n is the buffer number – with a range of 1 to 32,767). Next, if there is anything currently in the buffer that should not be kept, it should be emptied with the CLEAR command. Existing lines cannot be edited or new lines cannot be inserted between existing lines.
PMAC User Manual If the LEARN command specifies which axes are to be learned (e.g. LEARN(A,B,C) ), only those axis commands will be added to the program. If the LEARN command does not specify any axes, commands for all nine axis names are added to the motion program. The LEARN function can only add axis move commands to the program. Any other parts of the motion program, including math, logic, move modes, and move times, must be sent to the open motion program buffer directly.
PMAC User Manual Sequential Moves If the program is in LINEAR, CIRCLE, PVT, or SPLINE mode, and there is more than one move command line in a program without a DWELL or DELAY in between (there can be other statements in between), the moves will blend together without stopping. The exact form of the blending will depend on the move mode in force (see the Program Trajectory section of this manual). However, if Ix92 for the coordinate system (Move Blend Disable), this blending capability is disabled.
PMAC User Manual DWELL(P5) P1=P1+1 ENDWHILE The variables P2, P3, P4, and P5 could be set by the host with on-line commands (e.g. P2=2000) by a PLC program because of inputs and/or calculations, or even by another motion program. With calculations inside the motion program, we can get even more sophisticated. General mathematical expressions can be built in a PMAC motion program using constants, variables, functions and operators (see Computational Features).
PMAC User Manual If the logic of the subroutine needs to know whether a certain argument has been passed to it or not, it should use the bit-by-bit AND operator (&) between Q100 and the value of the bit in question. The value of bit 0 is 1, of bit 1 is 2, of bit 2 is 4, and so on (bit value is 2N-1, for the Nth letter of the alphabet). For instance, to see if a D-argument has been passed, the condition would be: IF (Q100 & 8 > 0) ... 3 D is the fourth letter, so the bit value is 2 = 8.
PMAC User Manual Pointing to the Program Pointing to the program is done with the B{constant} command, where the {constant} represents the number of the motion program buffer. Use the B command to change motion programs, and after any motion program buffer has been opened. Do not use it if repeatedly running the same motion program without modification.
PMAC User Manual G, M, T, and D-Codes When PMAC encounters the letter G with a value in a motion program, it treats the command as a CALL to motion program 10n0, where n is the hundreds’ digit of the value. The value without the hundreds’ digit (modulo 100 in mathematical terms) controls the line label within program 10n0 to which operation will jump — this value is multiplied by 1000 to specify the number of the line label. When a return statement is encountered, it will jump back to the calling program.
PMAC User Manual G03 — 2D Counterclockwise Arc Mode Typically, this code is implemented in PMAC through use of the CIRCLE2 command. The simplest implementation of this is N02000 CIRCLE2 RET. If feedrate override is desired, and it could have been disabled in RAPID mode, the subroutine should set the time-base source address variable to the register containing the external information (e.g. I193=1833). G04 — Dwell Command This code requires the use of the READ command.
PMAC User Manual G91 — Incremental Move Mode Typically, this code is implemented in PMAC through use of the INC command. The INC command without a list of axes puts all axes in the coordinate system in incremental move mode. The typical implementation would be G91000 INC RET. If the G-Code dialect has G90 and G91 also affecting the mode of circle-move center vectors (non-standard), an INC (R) command should be added to this routine.
PMAC User Manual The subroutine implementing G95 must therefore cause the program to get its time base from the spindle encoder and get the constants of proportionality correct. (Actually, some or all of these constants may be set up ahead of time.) This external time base function is performed through a PMAC software feature known as the Encoder Conversion Table, which is documented in detail in the Feedback Features section of the manual.
PMAC User Manual G97 — Constant Surface Speed Disable This code cancels spindle constant surface speed mode and puts the spindle into a constant angular velocity mode. In this mode, the spindle speed is independent of tool radial position. With the spindle axis in a separate coordinate system, the subroutine executing this code simply sets a variable and a flag for that program to see. Usually, a G97 code will carry with it a spindle speed S code in RPM.
PMAC User Manual If the spindle were to be controlled in open-loop fashion in CSS mode, it would be best to have a PLC program modifying the output command (Mx25 or Ix29) as a function of tool radial position. The structure of the PLC program would be like that of the closed-loop motion program example SPINDLE.PMC, except no actual move command would be needed; once the math was processed, the value would simply be assigned to the appropriate variable.
PMAC User Manual This assumes, of course, that motor #4 on PMAC is the spindle motor and that the counting-up direction is clockwise. Spindle speed will have been determined already in other routines by setting I422 (motor #4 jog speed). If PMAC were controlling the spindle with an open loop voltage, these routines would put a voltage on an otherwise-unused analog output by writing to a DAC register.
PMAC User Manual M30 — End of Program with Rewind See M02 description. M30 will be essentially equivalent to M02 in most systems but will return to the beginning of the program. Default Conditions Typically, a machine running G-code style programs requires many default values and modes beyond what PMAC sets automatically during its power-up/reset cycle.
PMAC User Manual Preparing to Run To prepare to run a rotary program in a coordinate system, use the B0 command (go to Beginning of program zero — the rotary program) when addressing that coordinate system. This must be done when no buffers are open, or it will be interpreted as a B-axis command. Once prepared this way, the program is started with the R command. This command can be either given with the buffer open or closed.
PMAC User Manual I16 Restarts Interrupts Variable I16 controls where BREQ gets set again as the executing program in the rotary buffer catches up to the last loaded lines. If after execution of a line, there are less than I16 lines ahead in the rotary buffer, BREQ is set high. This can be used to signal the host that more program lines need to be sent.
PMAC User Manual Starting Calculations Upon the command to start the program, PMAC will calculate program statements down to and including the first or second move statement, depending on the mode of the move and the setting of I13. This can include multiple modal statements, calculation statements, and logical control statements. Actually the programmed moves will not start executing until I11 milliseconds have passed, even if the calculations were finished earlier.
PMAC User Manual When No Calculation Ahead There are several conditions in a motion program that break the blending and stop the calculation ahead. In these cases, PMAC waits until that operation is finished before it starts calculations on the next move or two moves. During any of these breaks, PMAC will use the I11 calculation time to delay the start of the next move. DWELL Commands A DWELL command in a motion program breaks the blending of moves, so PMAC will not calculate through a DWELL.
PMAC User Manual The first 360 pieces will be blended (splined) together on the fly as PMAC cycles through the inner loop. But when PMAC increments P2 to 360, it hits the first ENDWHILE and jumps back to the inner WHILE condition, which is now false, so it jumps down, increments P1, hits the second ENDWHILE, and jumps back to the outer WHILE condition, all without encountering a move command. At this point, PMAC invokes the double-jump-back rule and lets the last programmed move come to a stop.
PMAC User Manual It is possible to move these non-motion actions to a point one or two moves later in the program to get the actions to occur when they are desired. However, this makes the program extremely difficult to read as far as the proper sequence of operations. Synchronous M-Variable Assignment The synchronous M-variable assignment statement is designed to get around this problem. This type of statement uses a double equals sign (==) instead of a single equals sign.
PMAC User Manual 218 Writing Programs for PMAC
PMAC User Manual SYNCHRONIZING PMAC TO EXTERNAL EVENTS Features to Help Synchronize Motion PMAC has several powerful features to help in synchronizing the motion under PMAC control to external events. These include position following, commonly known as electronic gearing; time-base control, commonly known as electronic cams; position capture, which is very useful for registration applications; and position compare, which can be used for precision scanning and measurement applications.
PMAC User Manual Changing Ratios on the Fly To vary the following ratio in the middle of an application, change Ix07 alone. Ix08 is involved in the scaling of servo feedback calculations, and so should not be changed in the middle of an application. There can be tradeoffs between the resolution of on-the-fly changes and the servo performance of the system. The higher the Ix08 scale factor, the finer the resolution of the changes can be.
PMAC User Manual Real-Time Input Frequency The PMAC method for doing this leaves the language expressing position as a function of time, but makes time proportional to the distance covered by the master. This is done by defining a real-time input frequency (RTIF) from the master's position sensor, in units of counts per millisecond. For example, an RTIF of 32 cts/msec is defined.
PMAC User Manual How It Works Time-base control works by lying to the commanded position update equations that occur every servo cycle about the amount of elapsed time since the last servo cycle. (Variable I10 contains the actual amount of time.) Note: The actual time between servo cycles does not change, nor do the dynamics of the servo loops.
PMAC User Manual Step 3: Time Base Calculation A separate entry in the encoder conversion table takes the interpolated position information from the above step, subtracts out the interpolated position information from the previous servo cycle, and multiplies this difference by a scale factor to produce the time base value for the servo cycle.
PMAC User Manual Step 5: Writing the Program When writing the program that is to be under external time-base control, simply write it as if the input signal were always at the real-time frequency. When run, the program will execute at a rate proportional to the input frequency. There is full floating-point resolution on the move times and feedrates specified. Remember that DWELL commands always execute in real time, regardless of the input frequency.
PMAC User Manual Since the math works out more easily if this number is a power of two, declare the real-timecount rate to be 128 counts/msec. Then calculate the scale factor as 131,072 / 128 = 1024. Enter the scale factor by commanding WY:$729,1024 (note that the value can be entered as a decimal number by omitting the dollar sign). Step 4: Using the Time-Base Calculation Since working in Coordinate System 1, assign I193 to $729 (1833 decimal) to point to this time base value.
PMAC User Manual Instructions for the Triggered Time-Base Using the triggered time-base feature involves proper setup of I-variable values, M-variable definitions, and conversion table entries (these can be done ahead of time), writing motion programs, and writing PLC programs. Each of these is covered in this section, first with a general explanation, then with a specific example.
PMAC User Manual The master encoder has 4096 lines per revolution, and typically rotates at about 600 rpm. After being given the command to run, the X-axis must wait for the index pulse of the master and for 45 degrees past it. For the next 36 degrees of the master, it must accelerate up to speed, then run at speed for 144 degrees of the master, and finally decelerate over 36 degrees of the master. This move must cover one full revolution of the A-axis.
PMAC User Manual Synchronizing PMAC to Other PMACs When multiple PMACs are used together, inter-card synchronization is maintained by passing the servo clock signal from the first card to the others. With careful writing of programs, this permits complete coordination of axes on different cards. PMAC provides the capability for putting multiple cards together in a single application.
PMAC User Manual If no serial communication is being used, but the serial data lines are connected along with the clock signals, it may be desirable to deactivate the serial port to prevent noise on the lines from creating input command characters to PMAC. On PMAC PC, PMAC Lite, and PMAC VME, this is done by making jumpers E44-E47 all ON; on PMAC STD, by making DIP switches SW1-5 to SW1-8 all OFF.
PMAC User Manual • • • • • Disable all PLC programs using if @@ has been issued as in the simple case or use which is the global run command. To run a PLC 0, set I8 back to its original value (usually 2).
PMAC User Manual Fortunately, this is simply the position captured during the homing move, which PMAC stores for future use in registers Y:$0815 (#1), Y:$08D5 (#2), etc. Note: The position-capture feature gets encoder position, rather than motor or axis position. Position-Compare Functions The position-compare feature is essentially the opposite of the position-capture function.
PMAC User Manual Compare Control Bits There are three control bits to set up the format of the equals signals. The flag-latch control bit (M111 in our example) controls whether the compare-equal signal is transparent (true only when the positions are actually equal) or latched (true until actively reset). The signal is transparent if this control bit is zero, and latched if the control bit is one. To clear a latched flag, take the control bit to zero, then back to one.
PMAC User Manual WRITING A PLC PROGRAM PLC Programs In addition to the motion programs, which operate sequentially and synchronously in time (any move command takes a specified amount to execute before succeeding program lines are executed) PMAC has 64 PLC programs that operate asynchronously and with rapid repetition (32 compiled PLC programs as well as 32 uncompiled PLC programs). They are called PLC programs because they perform many of the same functions as hardware programmable logic controllers.
PMAC User Manual Opening the Buffer For each PLC program, the next step is to open the buffer for entry with the OPEN PLC n statement, where n is the buffer number. Next, if there is anything currently in the buffer that should not be kept, it should be emptied with the CLEAR statement (PLC buffers may not be edited on the PMAC itself; they must be cleared and re-entered). If the buffer is not cleared, new statements will be added onto the end of the buffer.
PMAC User Manual PLC Program Structure The important thing to remember in writing a PLC program is that each PLC program is effectively in an infinite loop; it will execute over and over again until told to stop. (These are called PLC because of the similarity in how they operate to hardware Programmable Logic Controllers, the repeated scanning through a sequence of operations and potential operations.
PMAC User Manual Any SEND, COMMAND, or DISPLAY action statement should be done only on an edge-triggered condition, because the PLC can cycle faster than these operations can process their information, and the communications channels can get overwhelmed if these statements get executed on consecutive scans through the PLC. More examples of how to program using these statements can be found in later sections.
PMAC User Manual Precise Timing Since PLCs 1 to 31 are the lowest computation priority on PMAC, the cycle time cannot be determined precisely. To hold up an action for a fairly precise amount of time, use a WHILE loop, but instead of incrementing a variable, use an on-board timer. PMAC has four 24-bit timers to write to, and count down once per servo cycle. These timers are at registers X:$0700, Y:$0700, X:$0701, and Y:$0701.
PMAC User Manual Execution of Compiled PLCs Of the 32 compiled PLC programs (PLCC 0 to PLCC 31) only PLCC 0 operates in the foreground, triggered by the real-time interrupt (RTI). PLCCs 1 to 31 operate as background tasks. At each real-time interrupt, PMAC checks to see whether several user tasks need to be done. The realtime interrupt occurs every (I8+1) servo cycles.
PMAC User Manual Executing Integer Arithmetic The compiled PLCs have the capability to perform arithmetic and logical operations in 24-bit signed integer form. By contrast, all arithmetic and logical operations in uncompiled PLC programs are performed in 48-bit floating-point form, even if acting on integer variables. The short integer math operations execute at least 10 times faster than the floating-point operations.
PMAC User Manual A small routine in a compiled PLC to make Machine Output 1 follow Machine Input 1 would be: IF (L11=1) L1=1 ELSE L1=0 ENDIF It is acceptable to access a register in one program statement with an L-variable, and then access the same register, even the same part of the register, in another program statement with an integer M-variable or Ivariable.
PMAC User Manual Valid Operators All of the mathematical operators (+, -, *, /, %) and bit-by-bit boolean operators (&, |, ^) that can be used in floating-point operations in uncompiled PMAC programs can also be used in integer operations in compiled PLCs. The priorities of these operations are the same as for the floating-point operations.
PMAC User Manual Examples of illegal integer statements: L10=P10 P10=L10 L11=L11+P11 L13=16777216/L12 L253=L14*ATAN(L16) Conditional Statements In a conditional statement, any simple condition ({expression} {comparator} 23 23 {expression}) that contains only L-variables and integer constants in the range -2 to 2 -1 will be evaluated using the faster integer arithmetic.
PMAC User Manual A read operation from a less-than-24-bit (1- to 20-bit) signed L-variable takes from six to eight DSP instruction cycles and from five to seven program memory locations. A read operation from a less-than24-bit (1- to 20-bit) unsigned L-variable takes from 7 to 9 DSP instruction cycles and from six to eight program memory locations. A write operation to a less-than-24-bit (1- to 20-bit) signed or unsigned L-variable takes 12 to 14 instruction cycles and 10 to 12 program memory locations.
PMAC User Manual If the compiler can compile the entire file successfully, it will create an output file containing the PMAC machine code in form that can be directly downloaded to PMAC. This file has the same name as the input file, but with a .56K extension. The following message displays on the screen: *** *** *** *** PMAC PLC Compiler V1.2 04/28/94 *** PLC compile complete, no errors *** Downloadable PLCC code in file MYPLCC.
PMAC User Manual To use a different uncompiled PLC of the same number as a compiled PLC, include it in the input file to the compiler after the text for the compiled PLC. The compiler will pass it through to the output and it will be reloaded each time. Otherwise, do a separate download of this PLC after each compile/download cycle. All other commands are passed through the compiler to the output file unchanged.
PMAC User Manual Note: It is never advisable to have PLC 0 or PLCC 0 running on power-up. Therefore, do not save an I5 value of 1 or 3. Instead, save I5 as 2; then in PLC 1 reset PLC, use a command sequence like: DISABLE PLCC 0 DISABLE PLC 0 I5=3 The PLC 0 and/or PLCC 0 can then be enabled as needed.
PMAC User Manual WRITING A HOST COMMUNICATIONS PROGRAM Communicating From a Host Computer If communicating from a host computer to PMAC in the actual application, write a host communications program. The PMAC Executive program that was used in development is not intended as a host program for an actual application; it was designed simply as a development tool. At a fundamental level, the host communications routines that are written send and receive strings of ASCII-coded characters to and from PMAC.
PMAC User Manual Base Address The first thing to know is the base address of the COM port in the computer’s I/O space. In an IBM-PC, the COM1 port base address is at 3F8 hex (1016 decimal), and the COM2 port is at 2F8 hex (760 decimal). Baud Rate Set up the baud rate counter in the host computer to match the PMAC baud rate, which is determined by the master clock and jumpers E40-E43. The baud rate counter must be given a value equal to 115,200 divided by the baud rate (e.g.
PMAC User Manual Host Port Bus (PC/STDbus) Communications Host Port Structure The host port interface of PMAC, used for communications over the PC (ISA) and STD busses, occupies 11 consecutive addresses of a 16-address region in the I/O space of the host computer (it is not memory mapped). On the host side, these registers are accessed with byte-write and byte-read commands, such as outportb, inportb, outp, and inp.
PMAC User Manual where speed is 1 or 2 for a PC-XT, 3 or 4 for a 286-based computer, 5 to 6 for a 386-based computer, and 7 to 9 for a 486-based computer.
PMAC User Manual PMAC PC/PMAC Lite Input Signal Matching PIC Input PMAC Signal IR0 IR1 IR2 IR3 IR4 IR5 IPOS BREQ EROR F1ER HREQ EQU1 (thru E65) EQU5 (thru E64)* AXEXP1 (thru E63) MI1 (thru E62) EQU2 (thru E61) EQU6 (thru E60)* AXEXP0 (thru E59) MI2 (thru E58) EQU3 (thru E57) EQU7 (thru E56)* EQU4 (thru E55) EQU8 (thru E54)* IR6 IR7 The following table shows which signals match to each input on the PMAC STD: Input PMAC STD Input Signal Matching Signal Input Signal IR0 IR1 IR2 IR3 RESET RESET/ HREQ IP
PMAC User Manual MI1 and MI2 are PMAC Machine Inputs 1 and 2, which usually come from the system under control. (Software): This line in the PMAC STD can be toggled from a PMAC program after assigning an Mvariable to bit 7 of Y-register $FFED (e.g. M10-> Y:$FFED,7,1). Setting this M-variable to 1 triggers the interrupt; setting it to 0 clears it.
PMAC User Manual AXEXP1 E64 EQU5 EQU1 HREQ (Read-Ready/Write-Ready) IR3 Warning F1ER Following Error E65 MI2 E58 AXEXP0 E59 EQU6 E60 EQU2 E61 EQU8 E54 EQU4 E55 EQU7 E56 EQU3 E57 IR4 IR5 ( IR2 IR6 PMAC 8259 PIC IR7 Fatal EROR Following Error ( IR1 BREQ IR0 IPOS ( MI1 E63 ( E62 (Buffer-Request) (In-Position) INT PMAC PC 470 ohm E76E77E78E79 E80 IRQ15 IRQ14 IRQ12 IRQ11 PC-AT only ALL PCs E81E82E83E84E86 IRQ3 IRQ4 IRQ5 IRQ7 IRQ2 IRQ10 PC-AT 8259 PIC PC 8259 PIC
PMAC User Manual EROR IR5 IR4 BREQ IR3 FE1 SOFTWARE IR6 IR7 PMAC 8259 PIC IPOS IR2 HOST REQUEST IR1 BOARD EXITING RESET IE PUSHED BUTTON IR0 BOARD ENTERING RESET IE WATCHDOG TIMEOUT INT W3 W2 W1 PMAC STD32 INTRQ2* INTRQ1* INTRQ* PC 8259 PIC 80x86 CPU Figure 55 PMAC STD Interrupt Structure In PMACINT.
PMAC User Manual The EQUn lines can be used to signal the host that the actual position of an axis has reached a certain point so that the appropriate action can be taken. Alternately, these are the best way to have a PMAC motion or PLC program interrupt the host during the program flow. Setting Up Proper setup of the interrupt structure, both in hardware and software, is essential to a properly working interrupt scheme.
PMAC User Manual Vectoring In vectoring, usually the first step is to save the old vector so it can be restored on exiting the program. This is essential if borrowing an interrupt line. In TurboC, this can be done using the getvect function, as in: oldvect = getvect(0x0d) This statement stores the existing interrupt vector for interrupt number 0d(hex) — IRQ5 — in the (long) variable oldvect. The next step is to enter an interrupt vector.
PMAC User Manual The resulting new mask word is written back to I/O port address 21(hex) with: outportb (0x21, ch) Finally, re-enable the PC interrupts (TurboC command: enable();). This completes the setup procedure. Using the Interrupts To react to an interrupt in actual use, write an interrupt service routine. TurboC has a special type of routine that makes this relatively easy. In naming the routine, specify that it is an interrupt routine.
PMAC User Manual This is done through software programming. In order to do this, an IBM-PC compatible computer running the PMAC Executive Software is needed, (or some suitable terminal software) talking to PMAC through the RS232/422 port (using, of course, an RS232/422 cable connected from the computer’s COM port to the PMAC J4 connector on the front bezel).
PMAC User Manual Address Modifier Do Not Care Bits This register (X:$0784) simply states which bits of the address modifier are don't care bits. In other words, this tells which bits of the AM are ignored. The factory default of $04 tells PMAC to ignore bit 2 (value of 4) of the AM, so for example, it will recognize both $39 and $3D as valid 24-bit AMs. There should be no reason to change this from the default.
PMAC User Manual Bits A19-A14 of DPRAM base address must be specified by the host computer every time the system is powered up or reset. The host computer does this by writing a byte to the mailbox IC at the mailbox base address + $121. The low six bits of this byte represent bits A19-A14 of the DPRAM base address.
PMAC User Manual A simple write command followed by a save command to PMAC will put these values into their appropriate registers and make them permanent: WX$0783,$39,$4,$0,$7F,$A0,$02,$A1,$0,$60,$10 SAVE Remember that these values must be saved and then the card reset (with the $$$ command, the INIT/ input line pulled low, or power cycled) before these new values will take effect. If using the PMAC Executive Program, set up these registers using the Configure|VME Communications menu.
PMAC User Manual Binary Hex 1 1 1 1 3 1 1 F Therefore, we write $3F from the VME host computer (master) into VMEbus location $7FA121 after PMAC is powered up or reset. At this point, the starting address of DPRAM is fully specified. However, check two more register locations in the PMAC memory to make sure they have appropriate values.
PMAC User Manual Note: Almost all PMAC VME users purchase the Option 2 DPRAM and use the ASCII communications feature of the DPRAM rather than the ASCII mailbox communications described in this section. The ASCII DPRAM communications is easier and faster. Refer to PMAC Option 2, Dual-Ported RAM User manual for details. Sending Commands to PMAC VME through Mailbox Registers When sending commands to PMAC, write to these mailbox registers.
PMAC User Manual First write an ASCII 1 to location $7FA005, then a J to $7FA007, then a + to $7FA009, then a carriage return (ASCII code 13) to $7FA010, and finally a # to $7FA001. Example: The above example works for a command line of 15 characters or less (including the that was added to terminate the line). However, if the command line contains more than 15 characters (Remember there are only 15 mailbox registers that can be written to, send the first 15 characters (do not send a yet.
PMAC User Manual The key to reading data from PMAC through the mailbox registers is that writing to mailbox register #1 permits PMAC to place its data in the mailbox registers when it has something to say. This can be done ahead of time; effectively pre-enabling the PMAC response. This is the strategy used in all of the following examples. If not pre-enabling, write to mailbox register #1 only when immediately expecting a response, which is usually after acknowledging the $A0 interrupt (see examples).
PMAC User Manual In this example, PMAC will have six characters waiting to be read: 19.2. (Assume that Ivariable I3 is set to 2.) The data will be in the registers as follows: Address Mailbox # Character $7FA001 0 1 $7FA003 1 9 $7FA005 2 . $7FA007 3 2 $7FA009 4 Start reading the characters at $7FA001, mailbox register 0. There is a in mailbox register 4, so stop reading, and write a $00 into mailbox register 1 to tell PMAC it is fine to send more.
PMAC User Manual Now we read again the mailbox registers, looking for , , or . The fifth character we read in mailbox #4 ($7FA009) happens to contain a , so we stop reading and write $00 into mailbox register #1. Because PMAC still has to send the final character, it interrupts us again with vector $A1 and we see in the mailbox registers: Address Mailbox # Character $7FA001 0 $7FA003 ... ...
PMAC User Manual DP: (for 32-bit fixed point), and F: (32-bit floating point). For sending data back to the host, the PMAC data gathering function can also be used, directed to the dual-ported RAM rather than the regular RAM (I45 controls). See the PMAC DPRAM User manual (Option 2 manual) for details. Using Multiple PMAC VME Cards on the VME bus Install multiple PMAC VME cards on the VME bus. Up to 16 PMAC VME cards may be controlled by a single host computer.
PMAC User Manual Power up or reset PMAC Write to base + $121 (if using DPRAM) Write $00 into maibox reg #1 Send a line to PMAC? NO YES Send command line to PMAC (up to 16 characters) Has an interrupt ocurred? NO YES YES All characters sent? Read $A1 interrupt vector and acknowledge interrupt NO Wait for interrupt Read $A0 interrupt vector and acknowledge interrupt Read mailbox regs until: 1) encountered 2) encountered 3) encountered 4) All 16 regs have been read Write $00 in
PMAC User Manual It is possible to keep all of the PMACs in a rack completely synchronized by sharing clock signals over extra lines on the serial port. To do this, simply daisy chain a cable between all the PMAC VME J4 connectors in the rack. If this method is used, one PMAC VME must have jumpers E40 through E43 configured so it becomes card 0 (since card 0 outputs the synchronizing clock). All the other PMACs must have E40 - E43 set for higher card numbers (card 1, 2, etc.
PMAC User Manual Communications Checksum PMAC is capable of performing checksum calculations on communications lines sent between it and the host computer. This mode is enabled when I4=1, and disabled when I4=0. It will operate for serial, PC bus, STD bus, or VME bus communications. PMAC computes the checksum of the individual bytes (characters) in a communications line sent in either direction between it and the host. It simply adds together the ASCII value of each character into an accumulating sum.
PMAC User Manual Example With I3=3 and I4=1, and assuming P100=35, Q10=0, Q11=1, and Q12=2: Host sends: PMAC sends: Host sends: PMAC sends: Host sends: PMAC sends: J+ <117dec> (117=74[J] + 43[+]) P100 35<127dec> (127=10+51+53+13) (225=80+49+48+48) <225dec> Q10..
PMAC User Manual Real-Time Data Gathering through Dual-Ported RAM Using the dual-ported RAM, it is possible to perform the PMAC data gathering function and upload the gathered data to the host computer in real time. (The standard data gathering function — used by the PMAC Executive Program to produce plots — performs the data gathering in real time, storing to open regular RAM in PMAC, then uploads to the host afterwards.
PMAC User Manual To reassemble a long fixed-point word in the host, take the less significant 32-bit word, and mask out the sign extension (top eight bits). In C, this operation could be done with a bit-by- bit AND: (LSW & 16777215). Treat this result as an unsigned integer. Next, take the more significant word and multiply it by 16,777,216. Finally, add the two intermediate results together. To reassemble a long floating-point value in the host, first split the 64-bit value into its pieces.