^1 USER MANUAL ^2 Turbo PMAC ^3 Programmable Multi Axis Controller ^4 3Ax-602264-TUxx ^5 September 12, 2008 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 © 2008 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 Revision 1 Description P. 261 – CORRECTED EX. SETUP PROGRAM Date 09-12-08 CHG CP Approved M.
Turbo PMAC User Manual Table of Contents USING THIS MANUAL .............................................................................................................................................1 What is in this Manual ..............................................................................................................................................1 Other Manuals to Use..........................................................................................................................
Turbo PMAC User Manual Setting System Clock Frequencies ..........................................................................................................................24 Setting Turbo PMAC Phase and Servo Clock Frequencies ................................................................................25 Setting Turbo PMAC2 Phase and Servo Clock Frequencies ..............................................................................26 Setting I10 Servo Update Time Parameter ....................
Turbo PMAC User Manual Conversion Table Processing Setup – Turbo PMAC Interface...........................................................................58 Conversion Table Processing Setup – MACRO Station Interface ......................................................................59 Scaling the Feedback Units ................................................................................................................................59 Setting up Resolvers............................................
Turbo PMAC User Manual Current Loop in Turbo PMAC or Not.................................................................................................................91 Setting Up for Direct PWM Control .......................................................................................................................91 Introduction ........................................................................................................................................................
Turbo PMAC User Manual Inner Loop General Setup.................................................................................................................................164 Outer Loop General Setup ................................................................................................................................164 Joining the Loops..............................................................................................................................................
Turbo PMAC User Manual Direction Control..............................................................................................................................................199 Inversion Control..............................................................................................................................................200 Alternate Uses...................................................................................................................................................
Turbo PMAC User Manual Servo Update ....................................................................................................................................................235 Real-Time Interrupt Tasks ................................................................................................................................236 VME Mailbox Processing .................................................................................................................................
Turbo PMAC User Manual Coordinate System Time-Base..............................................................................................................................268 WRITING AND EXECUTING MOTION PROGRAMS....................................................................................271 Sequenced Motion Program Execution .................................................................................................................271 Flow Control ..........................................
Turbo PMAC User Manual Changes in Compensation ................................................................................................................................300 Failures in Cutter Compensation......................................................................................................................302 Block Buffering for Cutter Compensation.........................................................................................................
Turbo PMAC User Manual Requirements for Hardware Capture ...............................................................................................................357 Setting the Trigger Condition ...........................................................................................................................357 Automatic Move-Until-Trigger Functions ........................................................................................................358 Manual Use of the Capture Feature ..
Turbo PMAC User Manual Host Address Setup ...............................................................................................................................................398 ISA Bus Setup....................................................................................................................................................398 VME Bus Setup ................................................................................................................................................
Turbo PMAC User Manual xii Table of Contents
Turbo PMAC User Manual USING THIS MANUAL This is the User Manual for the Turbo PMAC family of motion and machine controllers from Delta Tau Data Systems, Inc. The Turbo PMAC family combines power, flexibility, and ease of use in a wide variety of configurations to provide optimal solutions for machine builders.
Turbo PMAC User Manual Actually, the Pewin32 Pro package is a suite of software programs, including step-by-step tutorial setup programs, tuning programs (interactive and auto-tuning), and plotting programs. The Pewin32 Pro suite automates or simplifies many of the setup steps that are explained in detail for low-level setup in this manual. Utilize the Pro Suite tools for automated setup wherever possible.
Turbo PMAC User Manual TURBO PMAC FAMILY The Turbo PMAC family of controllers is the newest generation of motion and machine controllers from Delta Tau Data Systems. It is available in a wide variety of configurations, permitting the user to optimize the controller hardware and software to particular application needs. This section provides a brief overview of the Turbo PMAC structure; all items mentioned here are covered in more detail elsewhere in the User Manual or in related reference manuals.
Turbo PMAC User Manual What Turbo PMAC Does Turbo PMAC can handle all of the tasks required for machine control, constantly switching back and forth between the different tasks thousands of times per second. The major tasks involved in machine control are summarized here. Executing Motion Programs The most obvious task of Turbo PMAC is executing sequences of motions given to it in a motion program.
Turbo PMAC User Manual Task Priorities These tasks are ordered in a priority scheme that has been 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. See Computational Features for more details. Key Hardware Components A Turbo PMAC controller is a combination of a computer processor section and specialized interface circuitry for motion, I/O, and communications.
Turbo PMAC User Manual • Option 5Cx (the x specifies the external memory size – see below) provides an 80 MHz DSP56303 with 8k 24-bit words of internal memory. This is the default processor. • Option 5Dx provides a 100 MHz DSP56309 with 34k 24-bit words of internal memory. • Option 5Ex provides a 160 MHz DSP56311 with 128k 24-bit words of internal memory. These options require firmware revision V1.939 or newer.
Turbo PMAC User Manual Status variable I4908 contains the address of the next register past last word of unreserved data memory. If no UBUFFER has been defined, this is the address one greater than the last word of data memory. With the standard memory configuration, no UBUFFER is defined on re-initialization. With the extended memory configuration, a UBUFFER of 65,536 words – from X/Y:$030000 - $03FFFF – is defined automatically on re-initialization.
Turbo PMAC User Manual Machine Interface ICs The Turbo PMAC CPU communicates to the physical machine through several types of special ICs that have memory-mapped registers for easy processor access, and application-specific circuitry for the machine interface. The most common of these are the Servo ICs, the MACRO ICs, and the I/O ICs, application-specific ICs (ASICs) designed by Delta Tau and manufactured in gate array technology to create a full feature set in a cost-effective manner.
Turbo PMAC User Manual HOME 1+LIMIT 14-LIMIT 1FAULT 14 4 PMAC CUSTOM AENA 1-4 EQU 1-4 SELECTABLE-FREQUENCY CLOCK INPUTS ENCODER SAMPLE LD DAC 1 SERVO PHASE LD DAC 2 INPUT FLAGS 4 ENCODER INPUTS ENCODER 1 A B C ENCODER 2 A B C DAC 3 DAC SHIFT REGISTERS (4) SERIAL DATA OUT ENCODER 3 LD DAC 4 OPTO ISOLATION DSP-GATE SERIAL DATA IN 1 ADC 16 BIT MUX 2 3 4 ANALOG INPUTS 4 ENCODER 4 ANALOG CONTROL CLOCK MUX CONTROL ENCODER CONTROL 24-BIT DATA BUS 16 BIT RESOLUTION OUTPUT FLAGS
Turbo PMAC User Manual The DSPGATE1 IC also has on-board software-configurable clock generation circuitry. It can generate the servo and phase clocks for the entire Turbo PMAC system (only one IC will do this; the others will accept these as inputs). It also generates the clock signals that drive its own circuitry: DAC, ADC, PWM and PFM (pulse-frequency-modulation).
Turbo PMAC User Manual Turbo PMAC variable I4902 reports how many MACRO ICs are present, and at which addresses. I4903 reports which type each MACRO IC is, a DSPGATE2 or a MACROGATE (see below). Variables I20 – I23 specify the addresses of the four MACRO ICs that are automatically configured with I-variables.
Turbo PMAC User Manual IOGATE I/O IC The IOGATE IC is used to access general-purpose digital I/O on most of the UMAC I/O boards. It provides 48 I/O points, addressed as 6 bytes in consecutive registers. Different boards use different buffers and drivers around the IOGATE to provide the specific I/O features desired. While on the IOGATE itself, each I/O point is individually selectable as to direction, on most of the I/O boards, each point’s direction is fixed by the external circuitry for that point.
Turbo PMAC User Manual Key Software Components In any application, the Turbo PMAC will have software components provided both by Delta Tau and by the user. The Delta Tau software components are known as the firmware (software embedded in the hardware). These are not application-specific. The user software components – primarily motion programs and PLC programs – are application-specific.
Turbo PMAC User Manual Axes Generally, motions in a Turbo PMAC system are commanded through the use of axes. An axis in Turbo PMAC consists of the software structures for programmed moves. Axes are specified by letter (A, B, C, U, V, W, X, Y, and Z), and their attributes are specified in terms of user-specified units (e.g. millimeters, inches, degrees, seconds, minutes). Axes are assigned to motors through axis definition statements or kinematic subroutines.
Turbo PMAC User Manual Turbo PMAC Configurations Turbo PMAC controllers can come in a variety of different physical configurations. Fundamentally, these break into three different types: board-level, rack-mounted, and boxed. Each of these types is described below. Board-Level Designs There are multiple board-level implementations of the Turbo PMAC.
Turbo PMAC User Manual • • • Fieldbus interface: DeviceNet and Profibus, master or slave Backplanes for 4 to 18 boards plus power supply AC-input (85 – 240VAC) and DC-input (24VDC) power supplies Compact UMAC Turbo The Compact UMAC Turbo (formerly called UMAC-CPCI Turbo) is a rack-mounted Turbo PMAC system in which the 3U-format boards are connected across a backplane board that has the physical format of a Compact PCI (CPCI) bus (110-pin high-density connectors), but is not electrically or software compa
Turbo PMAC User Manual TURBO PMAC/PMAC2 SYSTEM CONFIGURATION AND AUTO-CONFIGURATION Turbo PMAC, and especially Turbo PMAC2, boards have extensive capabilities for automatically identifying and self-configuring their systems. This is particularly important for UMAC Turbo systems, with their wide variety of configurations. These capabilities provide ease of use and flexibility in getting started with a particular configuration.
Turbo PMAC User Manual System clock frequencies such as the phase and servo clocks, plus the clock frequencies driving hardware circuits, are generated directly from the clock-crystal frequency through a Servo IC or a MACRO IC and are not dependent on the CPU operating frequency. These clock frequencies are covered in the following sections.
Turbo PMAC User Manual Typical Clock-Source ICs On a board-level Turbo PMAC2 controller that is not an Ultralite MACRO-only controller, usually the system clock source is Servo IC 0, the first on-board Servo IC. This means that I7007 is set to 0, so that I7000, I7001, and I7002 control the system clock frequencies. Other clock-direction I-variables should be set to 3. The same is true for 3U Turbo Stack controllers.
Turbo PMAC User Manual UMAC Systems In UMAC systems (including Compact UMAC), the phase and servo clocks are shared across the UBUS backplane board among the different 3U-format cards inserted into that backplane. Each card has buffer ICs for these signals as they interface to the backplane. On cards that are potential sources of the phase and servo clock signals, such as the Acc-24E/C axis boards or the Acc-5E MACRO board, these buffers can be configured as either inputs or outputs.
Turbo PMAC User Manual 1. 2. 3. 4. … 11. 12. … 19. 20. 21. 22.
Turbo PMAC User Manual Do not try to set the clock-direction I-variables directly. In other Turbo PMAC2 systems, change the clock-direction I-variables themselves in a single command (e.g. I6807=0 I7007=3). It is best to change I19 to the number of the I-variable that just set to 0 (I19=6807 in this example), but this is not necessary. Store these new values to non-volatile flash memory with the SAVE command. They will then be used automatically on every subsequent powerup/reset.
Turbo PMAC User Manual • • MACRO nodes 32 – 47 (can be changed dynamically) MACRO Type 1 auxiliary communications if I84=2 MACRO IC 3, specified by I23, has several functions that require automatic firmware support: I-variables I6950 – I6999 (values automatically assigned only at power-up/reset) MACRO nodes 48 – 63 (can be changed dynamically) MACRO Type 1 auxiliary communications if I84=3 • • • On re-initialization, Turbo PMAC2 searches for the MACRO ICs with the lowest base addresses.
Turbo PMAC User Manual I4903 is also a collection of 16 independent bits, each reporting the type of MACRO IC at one of the 16 possible locations. A bit value of 1 indicates a DSPGATE2 IC; a bit value of 0 indicates a MACROGATE IC (or no IC present if the corresponding bit of I4900 is 0). While it is possible for up to 16 MACRO ICs to be installed in a Turbo PMAC system, only four of these can be supported at any time by automatic firmware functions. I20 – I23 contain the base addresses of these four ICs.
Turbo PMAC User Manual • • Output to PWM circuits Communication over MACRO ring The software tasks that are driven by the phase and servo clock signals include: • Digital current loop closure (phase clock) • Motor phase commutation (phase clock) • Demuxing of muxed A/D converters (phase clock) • Encoder conversion table pre-processing (servo clock) • Trajectory interpolation (servo clock) • Position/velocity loop closure (servo clock and Ixx60) • PLC 0 and PLCC 0 execution (servo clock and I8) • Checking f
Turbo PMAC User Manual E29 – E33 Phase Clock Frequency Control The jumper set E29 – E33 determines the phase clock frequency, controlling its division from the DCLK signal set by E98. Only one jumper in this set may be installed at any time. The maximum possible phase clock frequency is 1/68 of the DCLK frequency – 36.14 kHz for the 2.46 MHz DCLK, or 18.07 kHz for the 1.23 MHz DCLK. This is the frequency selected by E33.
Turbo PMAC User Manual PMAC2 Gate Array IC Clock Control 20 MHz 120 MHz x6 Phase Locked Loop PWM Up/Down Counter 16 PWM COUNT 16 SIGN DIR Max Phase PWM Max Count PWM Dead Time/ PFM Pulse Width 24 Data 8 6 Address DT / PW 40 MHz 1 3 Encoder Sample n = 0 - 7 Clock Control PFM n=0-7 Clock Control DAC n=0-7 Clock Control n=0-7 ADC Clock Control Int/Ext Phase Int/Ext Servo n = 0 - 15 Phase Clock Control n = 0 - 15 Servo Clock Control 1 2n SLCK 1 2n PFMCLK DACCLK 1 2n 1 2n 1 2n ADCCLK PHASE
Turbo PMAC User Manual At the default value of 3 (divide by 4) and the default phase clock frequency of 9.04 kHz, this sets a servo clock frequency of 2.26 kHz (442 µsec period). The following diagram shows the relationship between the PWM counter, whose frequency is set by the I7m00/I6800 Max Count parameter, the resulting MaxPhase clock signal, and the Phase and Servo clock signals that are derived from MaxPhase.
Turbo PMAC User Manual MACRO Ring Frequency Control Variables The MACRO ring update frequency is the phase clock frequency of the ring master controller. If there is more than one Turbo PMAC2 controller on the ring, only one of them can be the ring master controller (others are masters, but not ring masters). Of course, if there is only one Turbo PMAC2 controller on the ring, it will be the ring master controller.
Turbo PMAC User Manual I6890/I6940/I6990: MACRO IC 1/2/3 Master Configuration A Turbo PMAC2 Ultralite may have additional MACRO ICs if Options 1U1, 1U2, and/or 1U3 are ordered. A UMAC Turbo system may have additional MACRO ICs if Option 1 on an Acc-5E is ordered, or if multiple Acc-5E boards are ordered. These additional ICs should be set to be masters but not ring controllers by setting I6890, I6940, and I6990, respectively to $10. This sets bit 4 of the variable to 1, making the IC a master on the ring.
Turbo PMAC User Manual The table shown in an above section and in the Hardware Reference Manual for the 3U MACRO Station’s SW1 switch setting provides a starting point for the Turbo PMAC2’s I6841/I6891/I6941/I6991 value. Additional bits of these I-variables may be set to 1 if I/O nodes are enabled or if more than one 3U MACRO station is commanded from a single MACRO IC.
Turbo PMAC User Manual I78 must be set greater than 0 if any auxiliary communications is desired with a MACRO Station. This reserves Node 15 for the Type 1 Auxiliary Communications. A value of 32 is suggested. If I78 is set greater than 0, bit 15 of I70, I72, I74, and I76 must be set to 0, so Node 15 is not used for flag transfers also.
Turbo PMAC User Manual Starting in Turbo firmware version 1.936, the base addresses of the up to 4 MACRO ICs must be specified in I20 – I23, for MACRO IC 0 – 3 respectively. Before this, the base addresses were fixed at $078400, $079400, $07A400, and $07B400, respectively. Only UMAC Turbo systems can support any other configuration, and only rarely will another configuration be used. The following table gives the addresses of the MACRO ring registers for Turbo PMAC2 controllers.
Turbo PMAC User Manual Register Addresses for MACRO IC 2 with I22=$07A400 (default) Node # Turbo PMAC2 Reg. 0 Addresses: Reg. 1 MACRO IC 2 Reg. 2 Reg.
Turbo PMAC User Manual Resetting and Re-Initializing Turbo PMAC It is important to understand how a Turbo PMAC system can be reset or re-initialized and what actions are performed in each case. Methods of Resetting There are fundamentally three ways a Turbo PMAC system can be reset: 1. Cycling power to the digital circuits 2. Hardware reset 3.
Turbo PMAC User Manual 2. The last-saved user configuration – variable values and definitions, user programs, tables, and buffers – are loaded from the flash memory into active memory and registers. During this loading, the checksums of the saved data are evaluated. If the checksum for the saved I-variables does not match the data, all I-variables in active memory are returned to their factory default values.
Turbo PMAC User Manual Updating the firmware will cause Turbo PMAC to revert to default I-variables. Make sure the configuration is backed up before the new firmware is downloaded. If writing a custom application to perform this function, detect that the Turbo PMAC is in bootstrap mode by sending the ? query command. In this mode, it will respond with the string BOOTSTRAP PROM instead of a hexadecimal status word.
Turbo PMAC User Manual 38 Turbo PMAC System Configuration and Auto Configuration
Turbo PMAC User Manual TALKING TO TURBO PMAC This section covers the basic aspects of communicating with Turbo PMAC from a host computer. At this level, we are assuming that there is a program for the host computer that processes these communications. The PMAC Executive Program (Pewin32 Pro) is the most common of these programs. If there will be a host computer in the final application, write custom communications routines for the host computer as part of the front-end software for the application.
Turbo PMAC User Manual The values of I54 and the baud rates they produce are: I54 Baud Rate I54 Baud Rate I54 Baud Rate I54 Baud Rate 0 1 2 3 600 900 1200 1800 4 5 6 7 2400 3600 4800 7200 8 9 10 11 9600 14,400 19,200 28,800 12 13 14 15 38,400 57,600 76,800 115,200 The baud rates produced by odd-number settings of I54 are only exact if the CPU frequency is an exact multiple of 30 MHz (technically, of 29.4912 MHz).
Turbo PMAC User Manual Auxiliary Port Parser Disable It is possible to turn off the automatic command parser on the auxiliary serial port by setting I43 to 1. With I43 set to the default value of 0, Turbo PMAC will try to interpret any characters coming in the auxiliary serial port as part of Turbo PMAC commands. However, with I43 set to 1, these characters are just placed in the rotary command queue at X:$1C00 – X:$1CFF, where a user’s application program can interpret them.
Turbo PMAC User Manual Serial Controller Addressing A controller is addressed with the @n command, where n is a hex digit from 0 to F. When the @n command is sent over the serial cable, the controller whose value of I0 is equal to n becomes the addressed controller; all others become unaddressed. Only the addressed controller will respond to commands and acknowledge them, driving its output data and handshake lines (which are tri-stated on the unaddressed controllers to prevent signal contention).
Turbo PMAC User Manual The following table shows how the jumpers (Turbo PMAC boards) or DIP switches (Turbo PMAC2) set the base address on the ISA or PC/104 port. A PMAC jumper that is OFF or a PMAC2 DIP-switch that is OPEN adds the associated bit value to the base address; a jumper that is ON or a DIP-switch that is CLOSED adds nothing to the base address value.
Turbo PMAC User Manual * Don’t care, not used ** System dependent setting Delta Tau’s software packages for the PC, such as the Executive and Setup programs, and the PComm32 communications library, do not support VME bus communications, because there is no standard VME communications method under the Microsoft Windows operating systems, even for PC-compatible VMEbus computers.
Turbo PMAC User Manual • • • DPRAM Coordinate System and Global Background Data Reporting: I49 and I50 DPRAM Background Variable Buffers: I55 DPRAM Binary Rotary Buffer Foreground Transfer: I45 It is possible to have multiple DPRAM ICs in some Turbo PMAC systems, especially in UMAC systems. However, only one of these ICs can be used at any given time with any of the automatic data structures.
Turbo PMAC User Manual setting of I3. For these commands, the command acknowledgement character – or – is sent after the data response, serving as an end-of-transmission character. For computer parsing of the response, it is nice to have the serve as a unique EOT character. Data Integrity Variable I4 determines some of the data integrity checks Turbo PMAC performs on the communications, the most important of which is a line-by-line checksum.
Turbo PMAC User Manual Port-Specific Commands To maintain truly independent communications among the multiple communications ports, it is necessary for certain commands that affect subsequent commands to only affect commands on the same port. For this reason, addressing commands – #n for motors and &n for coordinate systems – as well as buffer OPEN and CLOSE commands, affect only subsequent commands on the same port.
Turbo PMAC User Manual Buffered (Program) Commands As their name implies, buffered commands are not acted on immediately, but held for later execution. Sending a buffered program command to Turbo PMAC merely cause the command to be loaded into the open program buffer; the command will not actually be executed until that program is run.
Turbo PMAC User Manual SETTING UP FEEDBACK AND MASTER POSITION SENSORS Turbo PMAC systems can interface to a wide variety of position sensors for both feedback and master use, either on the main control boards or through a variety of accessory boards. This section summarizes the basic hardware and software setup issues; more details can be found in the appropriate hardware reference manuals and the Turbo PMAC Software Reference Manual.
Turbo PMAC User Manual Note: When using single-ended TTL-level digital encoders, the complementary line input should be left open, not grounded or tied high; this is required for PMAC's differential line receivers to work properly. It is possible to pull the complementary line as well to 5V. On most Turbo PMAC boards, this is done by changing the setting of a 3-point jumper for the encoder channel.
Turbo PMAC User Manual Power Supply and Isolation In the basic configuration of a Turbo PMAC, the encoder circuitry is not isolated from Turbo PMAC’s digital circuitry and the signals are referenced to Turbo PMAC’s digital common level GND. Typically, the encoders in this case are powered from PMAC’s +5V lines with a return on GND. The total encoder current draw must be considered in sizing the Turbo PMAC power supply.
Turbo PMAC User Manual Encoder Sampling Clock Frequency: E34 – E38, I7m03, I6803, MI903, MI907 After the front-end processing through the differential line receivers, the quadrature encoder inputs are sampled by digital logic in the Turbo PMAC Servo IC or MACRO IC at a rate determined by the frequency of the SCLK encoder sample clock” which is user settable.
Turbo PMAC User Manual Turbo PMAC Servo IC SCLK Frequency Control On a Turbo PMAC board, or an Acc-24x with PMAC-style Servo ICs (Acc-24P or 24V), the SCLK frequency is set by the configuration of jumpers E34 – E38. Only one of these jumpers may be on in any given configuration. This SCLK frequency is common to all Servo ICs and channels on the board. Turbo PMAC2 Servo IC SCLK Frequency Control On a Turbo PMAC2 board, or an accessory board with PMAC2-style Servo ICs or MACRO ICs (e.g.
Turbo PMAC User Manual Conversion Table Processing Setup – MACRO Station Interface If the quadrature encoder is connected to a remote MACRO Station, the conversion table processing (usually 1/T extension) is done in the MACRO Station, and the resulting enhanced position information is passed back to the Turbo PMAC, where it is processed by the Turbo PMAC’s encoder conversion table as unshifted parallel data (usually method digit $2, mode switch bit = 1), because it already has fractional count information,
Turbo PMAC User Manual Hardware Setup If just used for power-up commutation position feedback, typically the hall sensors are wired into the U, V, and W supplemental flags for a PMAC2-style interface channel. These are single-ended 5V digital inputs on all existing hardware implementations. They are not optically isolated inputs; if isolation is desired from the sensor, this must be done externally.
Turbo PMAC User Manual For the 3-phase hall sensors, the decode must be set to times-6 decode, which derives six counts per signal cycle, one for each signal edge. This requires a variable value of 11 or 15. The difference between these two values is the direction sense – which direction of motion causes the counter to count up.
Turbo PMAC User Manual Setting up Sinusoidal Encoders Turbo PMAC systems can accept signals from sinusoidal (sine/cosine) encoders and generate position data of very high resolution. This is done through special accessory boards and dedicated firmware algorithms. Presently there are two classes of interpolators: low-resolution ones producing 128 or 256 states per line, and high-resolution ones producing 4096 states per line.
Turbo PMAC User Manual In addition, the direction sense of the whole-count data must match that of the fractional-count data. For the low-resolution interpolators, this requires that the decode variable be set to 7. If this value does not produce the direction sense needed, change the wiring of the encoder into the accessory (exchange sine and cosine signals, or the plus and minus lines of one channel).
Turbo PMAC User Manual For details of setting up the encoder conversion table to process sinusoidal encoders, consult the section Setting up the Encoder Conversion Table section in this manual and the specification for variables I8000 – I8191 in the Software Reference Manual.
Turbo PMAC User Manual High-Resolution (x4096) Interpolators For the high-resolution interpolators, the interpolation algorithm produces data with the LSB representing 1/4096 of an encoder line. Since the Turbo PMAC motor software considers this data to be in units of 1/32 of a count, this means that the software considers there to be 128 counts per encoder line. Other motor and axis position, velocity, and acceleration values are based on this definition of a count which we will call a software count.
Turbo PMAC User Manual Conversion Table Processing Setup – Turbo PMAC Interface Usually, digital quadrature signals, even if synthesized, are processed in the conversion table with the 1/T extension method (method digit $0), which uses timers associated with the counter to compute fractional count information that enhances smoothness of motion. The source address specified is that of the base address of the channel (e.g.
Turbo PMAC User Manual Motor offset variable Ixx26 contains the difference between the absolute resolver position and the resulting motor position (if any). Scaling the Feedback Units The Acc-8D Option 7 R/D converter is a 12-bit converter. It reports 4096 separate states per electrical cycle of the resolver (per mechanical revolution for a typical 2-pole resolver, per half revolution for a 4pole resolver).
Turbo PMAC User Manual The rising edge of the return pulse in the DPM format is the equivalent of the rising edge of the start pulse in the RPM format. The falling edge of the return pulse in the DPM format is the equivalent to the rising edge of the stop pulse in the RPM format. Because Turbo PMAC is expecting a rising signal edge to latch the timer, in this signal format the return signals should be inverted so that the ‘+’ output of the MLDT is wired into Turbo PMAC’s ‘-’ input, and vice versa.
Turbo PMAC User Manual PFM Pulse Output Addresses (Y-registers) IC# - Chan# 0-1 0-2 0-3 0-4 1-1 1-2 1-3 1-4 Mxx07->Y: $078004 $07800C $078014 $07801C $078104 $07810C $078114 $07811C IC# - Chan# 2-1 2-2 2-3 2-4 3-1 3-2 3-3 3-4 Mxx07->Y: $078204 $07820C $078214 $07821C $078304 $07830C $078314 $07831C IC# - Chan# 4-1 4-2 4-3 4-4 5-1 5-2 5-3 5-4 Mxx07->Y: $079204 $07920C $079214 $07921C $079304 $07930C $079314 $07931C IC# - Chan# 6-1 6-2 6-3 6-4 7-1 7
Turbo PMAC User Manual or: MI 926 = 16 ,777 ,216 * OutputFreq( kHz ) PFMCLK _ Freq( kHz ) To produce a pulse output frequency of 1.667 kHz with the default PFMCLK frequency of 9.83 MHz, we calculate: MI 926 = 16 ,777 ,216 * 1.667 9 ,830 = 2 ,982 Note: The servo update time for the motor using the MLDT should be at least as high as the output time set here (the servo frequency should be as low as or lower than the output frequency).
Turbo PMAC User Manual Conversion Table Processing Setup – Turbo PMAC Interface The timer registers are processed in the conversion table as parallel feedback representing the position, just as an absolute encoder would be. The filtered parallel read (method digit $3) should be used to reject errors due to extra or missing echo pulses. Consult the Setting up the Encoder Conversion Table section in this manual and the specification for variables I8000 – I8191 in the Software Reference Manual.
Turbo PMAC User Manual 1 length µ sec length * Re turnSpeed = increment TimerFreq increment µ sec Re solution increments 41.3 117.96 increment 0.35 µ sec increment mm 1 1 inches inches increments µ sec ≅ * ≅ 0.00094 1060 117.96 increment 9.0 µ sec increment inch Axis User Units ≅ 1 µ sec * 1 mm ≅ 0.024 mm Typically the axis assigned to the motor using the MLDT for feedback will be given engineering units of millimeters or inches.
Turbo PMAC User Manual Conversion Table Processing Setup – Turbo PMAC Interface 16-bit data from an Acc-28x converter connected to a Turbo PMAC is processed for servo feedback using an Acc-28 A/D entry (method digit $1) in the Turbo PMAC’s conversion table. Fundamentally, this just copies the data from a Y-register to an X-register (where the servo loop can access it) and shifts the data so that the LSB out of the converter will be treated by the servo as a count.
Turbo PMAC User Manual Setting Up for Power-On Absolute Position Absolute Power-On Position Address and Format: Ixx10, Ixx95, MI11x Generally, position data that comes to a Turbo PMAC system as an analog voltage is absolute in nature, so no homing search move is required if it is used for position feedback. Turbo PMAC variables Ixx10 (Motor xx Power-On Servo Position Address) and Ixx95 (Motor xx Power-On Position Format) can be used to establish this absolute position.
Turbo PMAC User Manual 70 Setting Up Feedback and Master Position Sensors
Turbo PMAC User Manual BASIC MOTOR SETUP Turbo PMAC has many modes for controlling motors. A major part of the initial setup of a Turbo PMAC is the hardware and software configuration to specify a specific mode of operation.
Turbo PMAC User Manual Beginning Motor Setup No Use PMAC to commutate and/or close current loop? Yes Single Output Setup Basic Commutation Setup Use PMAC to close current loop? Analog Output? No Yes Pulse and Direction Setup Analog Output Setup No Yes Sine-Wave Output Setup Direct PWM Output Setup Current Loop Setup/Tuning Synchronous Motor? No Yes Slip and Magnetization Current Setup Phase Referencing Position/Velocity Servo Loop Setup Turbo PMAC Motor Setup Flowchart Initial Setup P
Turbo PMAC User Manual Motor Address Setup Parameters Each Turbo PMAC motor has several address I-variables that tell the motor what registers to use for its inputs and outputs. Each of these variables contains the Turbo PMAC address of the register for the particular function. This provides a mapping between the motor calculation registers and the different types of servo I/O registers (encoders, D/A converters, flags, etc.) used for the physical interface.
Turbo PMAC User Manual Command Output Address: Ixx02 Ixx02 instructs Turbo PMAC where to place its output command values for Motor xx by specifying the address of the register (or the first register if multiple outputs are used). The default values of Ixx02 use the output registers for the machine interface channel usually assigned to the motor, or command registers (starting with Register 0) for the MACRO node usually assigned to the motor.
Turbo PMAC User Manual The following table shows the possible addresses for these variables when the flags are accessed through PMAC2-style Servo ICs.
Turbo PMAC User Manual Absolute Power-Up Position Address and Format: Ixx10 and Ixx95 If you have a position sensor for the motor that is absolute over the entire range of travel for the motor, you can use motor variables Ixx10 and Ixx95 to tell Turbo PMAC where to read this absolute position data, and how to interpret the format, respectively. This does not have to be the same register or even the same sensor that is selected for ongoing position feedback with Ixx03.
Turbo PMAC User Manual Is Turbo PMAC Commutating or Closing the Current Loop for This Motor? All motors of significant travel require commutation (reversal of current) in the motor phases in order to generate consistent torque/force as the motor moves. The only question is where and how this commutation is done. In a brush DC motor the commutation is performed mechanically inside the motor. With brushless motors, the commutation is often performed electronically inside the drive.
Turbo PMAC User Manual DAC Clock Frequency Control: I7m03, MI903, MI907, MI993 An I-variable specifies the frequency of the DACCLK signal that controls the rate at which data is clocked into the serial DACs on all channels of the Servo IC. This variable is I7m03 for a Turbo PMAC’s Servo IC m. If the IC is part of a MACRO Station, the variable is MI903, MI907, or MI993. The default DACCLK frequency of 4.92 MHz is appropriate for all DACs used by Delta Tau.
Turbo PMAC User Manual PMAC2-Style Servo IC Command Output Addresses (Y-registers) IC# - Chan# Ixx02 IC# - Chan# Ixx02 IC# - Chan# Ixx02 IC# - Chan# Ixx02 IC# - Chan# Ixx02 0-1 0-2 0-3 0-4 1-1 1-2 1-3 1-4 $078002 $07800A $078012 $07801A $078102 $07810A $078112 $07811A 2-1 2-2 2-3 2-4 3-1 3-2 3-3 3-4 $078202 $07820A $078212 $07821A $078302 $07830A $078312 $07831A 4-1 4-2 4-3 4-4 5-1 5-2 5-3 5-4 $079202 $07920A $079212 $07921A $079302 $07930A $079312 $07931
Turbo PMAC User Manual PMAC2 Pulse and Direction Stepper System PMAC2 Drive and Motor Over/Under flow Pulse Master Position Stepper Drive Accumulator + Trajectory + Generation PID - Adder Direction PFM Circuit Decoder/ Counter E Note: The analog output of a PMAC-style Servo IC, used in sign-and-magnitude mode (Ixx96=1), and passed through a voltage-to-frequency converter, can be used for the same type of operation.
Turbo PMAC User Manual Turbo PMAC Parameter Setup Hardware Setup for PMAC2-Style ICs PFM Clock Frequency: I7m03, I6803, MI903, MI907, MI993 An I-variable controls the frequency of addition of the command value into the accumulator by setting the frequency of a clock signal called PFMCLK. One addition is performed during each PFMCLK cycle, so the addition frequency is equal to the PFMCLK frequency. The pulse frequency for a given command value is directly proportional to this addition frequency.
Turbo PMAC User Manual PFM Pulse Width: I7m04, I6804, MI904, MI908 I7m04 controls the pulse width for the axis-interface channels on Turbo PMAC PMAC2-style Servo IC m; I6804 does so for supplementary channels on the handwheel port. MI904, MI908, and MI994 set this for channels on a MACRO Station. The pulse width is specified in PFMCLK cycles; the range is 1 to 255 cycles. The minimum gap between pulses is equal to the pulse width, so the minimum pulse cycle period is twice the pulse width set here.
Turbo PMAC User Manual Command Output Address: Ixx02 Ixx02 tells Turbo PMAC where to write the output command value for Motor xx. To use the PFM, the output must be written to the C command register for the axis interface circuit of the proper number. (The default is to the A command register.
Turbo PMAC User Manual Encoder Conversion Table Entries, No Interpolation IC# - Chan# 0-1 0-2 0-3 0-4 1-1 1-2 1-3 1-4 I8xxx $C78000 $C78008 $C78010 $C78018 $C78100 $C78108 $C78110 $C78118 IC# - Chan# 2-1 2-2 2-3 2-4 3-1 3-2 3-3 3-4 I8xxx $C78200 $C78208 $C78210 $C78218 $C78300 $C78308 $C78310 $C78318 IC# - Chan# 4-1 4-2 4-3 4-4 5-1 5-2 5-3 5-4 I8xxx $C79200 $C79208 $C79210 $C79218 $C79300 $C79308 $C79310 $C79318 IC# - Chan# 6-1 6-2 6-3 6-4 7-1 7-2
Turbo PMAC User Manual Proportional Gain: Ixx30 The proportional gain term Ixx30 is set according to the equation: Ixx30 = 660 ,000 Ixx08 * PFMCLK ( MHz ) For example, with PFMCLK at the default of 9.83 MHz, and Ixx08 at the default of 96, Ixx30 = 660,000 / (96 * 9.83) = 700. Derivative Gain: Ixx31 The derivative gain term Ixx31 is set to zero, because the loop behaves like a velocity-loop servo drive, and there is no need to have the Turbo PMAC add damping.
Turbo PMAC User Manual Executing the Open-Loop Test First, use the “O” (open-loop output) command to verify the operation of the frequency generator. This command simply places a value proportional to the magnitude of the command into the output register. This should generate a constant frequency output from the pulse generator that shows up as a constantly changing position and a steady non-zero (for non-zero commands) velocity in the reporting window.
Turbo PMAC User Manual If not getting the proper frequency range, double check the setting of I7m03 that sets the PFMCLK frequency. Also check the value of Ixx69 that determines the maximum frequency (O100 frequency) at this PFMCLK frequency. Executing the Closed-Loop Test Next, close the loop with a J/ command. The reported position should hold steady, and the reported velocity should be zero. Set up yotheur jogging I-variables Ixx19 to Ixx22 to get the speeds and accelerations needed.
Turbo PMAC User Manual 88 Basic Motor Setup
Turbo PMAC User Manual SETTING UP TURBO PMAC-BASED COMMUTATION AND/OR CURRENT LOOP This section provides detailed instructions for the step-by-step manual setup of motor phase commutation and/or digital current-loop closure within the Turbo PMAC. Few users will do these steps manually; most will use the automated procedures of the Turbo Setup program on the PC, even for the setup of the first unit.
Turbo PMAC User Manual Commutation Feedback Address: Ixx83 Ixx83 specifies the address of the register used for the commutation position feedback. The default values of Ixx83 use the encoder register for the machine interface channel usually assigned to the motor. Ixx83 seldom needs to be changed from the default value for PWM applications. When using on-board encoder counter, these are X-registers, so Ixx01 must be set to 1, not 3, to use these.
Turbo PMAC User Manual Current Loop in Turbo PMAC or Not Turbo PMAC can perform commutation for a motor with or without closing the current loop for the motor phases. If the current loops are closed in the Turbo PMAC, the outputs from Turbo PMAC are phase voltage commands, usually represented as pulse-width-modulated (PWM) digital outputs. This technique is called direct PWM control.
Turbo PMAC User Manual Turbo PMAC permits digital closure of the motor current loops, mathematically creating phase voltage commands from numerical registers representing commanded and actual current values. These numerical phase voltage commands are converted to PWM format through digital comparison to an up/down counter that creates a digital saw tooth waveform. The analog current measurements must be converted to digital form with ADCs before the loop can be closed.
Turbo PMAC User Manual A current vector in the stator that is parallel to the rotor field induces current in the rotor that changes the magnetic field strength of the rotor (when the stator and rotor field are rotating relative to each other). This component of the stator current is known as direct current. For an induction motor, this is required to create a rotor magnetic field.
Turbo PMAC User Manual Turbo PMAC has a PI (proportional-integral) digital current loop. There is only one set of gains, which serves for both the direct current loop and the quadrature current loop. Tuning is best done on the direct current loop, because this will generate no torque, and therefore no movement. The current-loop autotuner in the PMAC Executive program uses the direct current loop to tune.
Turbo PMAC User Manual Parameters to Set up Global and Multi-Channel Hardware Signals PWM Frequency Control: I7m00, MI900, MI906 If you are driving the axes directly (not over the MACRO ring), set Turbo PMAC I-variable I7m00 to define the PWM frequency for the 4 channels on PMAC2-style Servo IC m according to the equation: I 7 m00 = int 117 ,964.
Turbo PMAC User Manual PWM Deadtime Control: I7m04, MI904, MI908 I7m04 determines the PWM deadtime between top and bottom signals for the machine interface channels on Servo IC m. I7m04 has a range of 0 to 255, and the deadtime is 0.135 µsec times the I-variable value. The deadtime should not be set smaller than the recommended minimum for the drive, or excessive drive heating could occur. Too large a deadtime value can cause unresponsive performance.
Turbo PMAC User Manual PWM Local Command Output Addresses (Y-registers) IC# - Chan# 0-1 0-2 0-3 0-4 1-1 1-2 1-3 1-4 Ixx02 $078002 $07800A $078012 $07801A $078102 $07810A $078112 $07811A IC# - Chan# 2-1 2-2 2-3 2-4 3-1 3-2 3-3 3-4 Ixx02 $078202 $07820A $078212 $07821A $078302 $07830A $078312 $07831A IC# - Chan# 4-1 4-2 4-3 4-4 5-1 5-2 5-3 5-4 Ixx02 $079202 $07920A $079212 $07921A $079302 $07930A $079312 $07931A IC# - Chan# 6-1 6-2 6-3 6-4 7-1 7-2
Turbo PMAC User Manual Servo ICs 2 – 9 are on Acc-24x2 or Acc-51E boards. Channels 1 – 4 on odd-numbered Servo ICs are Channels 5 – 8 on dual-Servo-IC boards. When performing direct PWM control over the MACRO ring, Ixx82 points to the second of a set of two MACRO input registers for the MACRO IC and the node used.
Turbo PMAC User Manual The amplifier manual should specify the level of current that provides full-range feedback from the ADCs.
Turbo PMAC User Manual If the phase current sensors and ADCs in the amplifier are set up so that a positive PWM voltage command for a phase yields a negative current measurement value, Ixx72 must be set to a value less than 1024: 683 for a 3-phase motor, or 512 for a DC brush motor. If these are set up so that a positive PWM voltage command yields a positive current measurement value, Ixx72 must be set to a value greater than 1024: 1365 for a 3-phase motor, or 1536 for a DC brush motor.
Turbo PMAC User Manual • Ixx82 should contain the address of ADC B register for the feedback channel used (just as for brushless motors) when the ADC A register is used for the rotor (armature) current feedback. The B register itself should always contain a zero or near-zero value. • Ixx81 > 0: Any non-zero setting here makes Turbo PMAC do a “phasing read” instead of a search move for the motor.
Turbo PMAC User Manual Purpose The purpose of this set of tests is to confirm the basic operation of the hardware circuits on PMAC, in the drive, and in the motor and to check the proper interrelationships.
Turbo PMAC User Manual If the positive direction of motion is known, check this here. If the direction is incorrect, invert it by changing I7mn0, usually from 7 to 3, or from 3 to 7. If it is not known yet which direction sense is needed, change it later, but make another change at that time to maintain the proper commutation polarity match, usually by exchanging two of the motor phase leads at the drive.
Turbo PMAC User Manual Synchronous Motor Stepper Action With a synchronous motor, this command should cause the motor to lock into a position, at least weakly, like a stepper motor. This action may be received temporarily on an induction motor, due to temporary eddy currents created in the rotor. However, an induction motor will not keep a holding torque indefinitely at the new location. Current Loop Polarity Check Observe the signs of the ADC register values in M105 and M106.
Turbo PMAC User Manual • For synchronous motors (and probably for induction motors), the physical change in rotor position between the initial Step 1 and the return to Step 1 (mark the rotor if necessary) should be equal to 1 pole pair: • On a 2-pole motor, it should be one full mechanical revolution. • On a 4-pole motor, it should be one-half mechanical revolution. • On a 6-pole motor, it should be one-third mechanical revolution. • On an 8-pole motor, it should be one-fourth mechanical revolution.
Turbo PMAC User Manual Example The table of results for a sample run of this test is: Step 1 2 3 4 5 6 1 M102 (A) +500 +500 0 -500 -500 0 +500 M104 (B) 0 -500 -500 0 +500 +500 0 M107 (C) -500 0 +500 +500 0 -500 -500 Cycle Position 0oe +60oe +120oe +180oe -120oe -60oe 0oe Physical Position 4:00 3:00 2:00 1:00 12:00 11:00 10:00 M101 (counts) 8820 9184 9501 9845 10218 10532 10869 M105 (A) <0 <0 ≈0 >0 >0 M106 (B) ≈0 >0 >0 ≈0 <0 ≈0 <0 <0 ≈0 From this test, we can conclude: • PWM operation is fundamen
Turbo PMAC User Manual Establishing Basic Current Loop Operation Once the proper operation of the Turbo PMAC PWM output circuits, the Turbo PMAC ADC input circuits, and all of the drive and motor circuitry between them have been established, close the current loop. The Turbo Setup program has both auto-tuning and interactive tuning procedures for the digital current loop. Most people will use one or both of these procedures to tune the current loop.
Turbo PMAC User Manual However, if the command from the position/velocity servo loop is noisy, as can be the case with a lowresolution position sensor, this filtering effect can be desirable, and Ixx76 can provide better performance than Ixx62. Analytic Calculation of Current-Loop Gains With some basic knowledge of motor and amplifier parameters, it is possible to calculate the current-loop gains directly.
Turbo PMAC User Manual The proportional gain term is expressed as the sum of two I-variables. Ixx62 is the “forward-path” proportional gain term, directly responding to changes in the command values; Ixx76 is the “back-path” proportional gain term, directly responding only to the actual current values. When high position feedback resolution is used in the position/velocity loop, the quantization noise in the current command is low, and it is better to use Ixx62.
Turbo PMAC User Manual In the Detailed Plot section of data gathering, specify data gathering at intervals of one servo cycle. Select for gathering the commanded and actual direct current registers every servo cycle for the motor under test. The addresses for these registers are found in the following table.
Turbo PMAC User Manual When used through a PMAC-style Servo IC, this requires the single DACs on two consecutive channels. The higher (even) numbered DAC channel is the A DAC; the lower (odd) numbered DAC channel is the B DAC. DAC Output Signals The A and B DAC outputs should be connected to the phase command inputs on the sine-wave input amplifier. If the inputs on the amplifier are single-ended, use the DAC+ output only, and leave the complementary DAC- outputs floating; do not ground them.
Turbo PMAC User Manual Only the DAC_CLK signal is directly used with the sine-wave output, to control the frequency of the serial data stream to the DACs. The default DAC clock frequency of 4.9152 MHz is suitable for the DACs on all Delta Tau hardware. Refer to the I7m03 description for detailed information on setting these variables. The encoder SCLK frequency should be at least 20% greater than the maximum count (edge) rate that is possible for the encoder on any axis.
Turbo PMAC User Manual Sine-Wave Mode Command Output Addresses – PMAC-style Servo ICs (Y-registers) IC# - Chan# 0 – 1&2 0 – 3&4 1 – 1&2 1 – 3&4 Ixx02 $078002 $07800A $078102 $07810A IC# - Chan# 2 - 1&2 2 - 3&4 3 - 1&2 3 - 3&4 Ixx02 $078202 $07820A $078302 $07830A IC# - Chan# 4 - 1&2 4 - 3&4 5 - 1&2 5 - 3&4 Ixx02 $079202 $07920A $079302 $07930A IC# - Chan# 6 - 1&2 6 - 3&4 7 - 1&2 7 - 3&4 Ixx02 $07A202 $07A20A $07A302 $07A30A IC# - Chan# 8 - 1&2 8 - 3&4 9 - 1&2 9 -
Turbo PMAC User Manual Commutation Phase Angle: Ixx72 Ixx72 sets the angle from Phase A to Phase B as a fraction of the commutation cycle. Turbo PMAC splits the commutation cycle (360oe) into 2048 parts. For a 3-phase motor, the angle from A to B is either 1/3 of a cycle (Ixx72=683) or 2/3 of a cycle (Ixx72=1365). For a 2-phase or 4-phase motor, the angle from A to B is either 1/4 of a cycle (Ixx72=512) or 3/4 of a cycle (Ixx72=1536).
Turbo PMAC User Manual Evaluating the Polarity Match Determine the proper setting of Ixx72 by looking at the direction of motion between the two steps. If the position changed in the negative direction, set Ixx72 less than 1024 – to 683 for a 3-phase motor, or 512 for a 2- or 4-phase motor. If the position changed in the positive direction, set Ixx72 greater than 1024 – to 1365 for a 3-phase motor, or 1536 for a 2- or 4-phase motor.
Turbo PMAC User Manual Establishing a Phase Reference Purpose When commutating a synchronous multi-phase motor such as a permanent-magnet brushless motor, the commutation algorithm must know the absolute position of the rotor. With an absolute sensor such as a resolver, the phase referencing must be done just once, on assembly of the system. With an incremental sensor such as an incremental optical encoder, the phase referencing must be done every time the system is powered up.
Turbo PMAC User Manual This register normally varies from -Ixx71/2 to +Ixx71/2, although if monitoring it, sometimes it will jump by Ixx71 units and be temporarily outside this range. This is normal behavior. Access to this register is useful in many ways for establishing a phase reference. Define the suggested M-variable for the Motor 1 phase position register: M171->X:$00B4,0,24,S ; Motor 1 phase position (counts*Ixx70) Add this M-variable to the Watch window.
Turbo PMAC User Manual Note: Generally, this test is not appropriate for linear motors, because of the relatively uncontrolled movement it produces. It should only be done on unloaded rotary motors. On linear motors, a fine phasing test can be done by adjusting the phase position register so that no movement occurs when a large value of Ixx77 (e.g. 16,000) is given with an O0 command. The test should start with small values, and movement quickly stopped with a K command.
Turbo PMAC User Manual Make sure the motor is completely at rest. Now multiply the sensor position value read by I170, and subtract this from the phase position read by M171. (If the motor is moved manually so that M171=0, the product can be negated). Enter this value into I175 using a statement such as: I175=M171-(M175*I170) Finally, set up I181 to read the absolute sensor on subsequent Turbo PMAC resets and store these values with the SAVE command. Perform another phase reference on this motor.
Turbo PMAC User Manual Preparation Define M-variables to the hall-effect or equivalent inputs. Suggested definitions for Channel 1 on a PMAC2-style Servo IC are: M124->X:$078000,20 M125->X:$078000,21 M126->X:$078000,22 M127->X:$078000,23 M128->X:$078000,20,4 ; ; ; ; ; Channel Channel Channel Channel Channel 1 1 1 1 1 W flag V flag U flag T flag (not usually hall) TUVW as a 4-bit value Make these definitions and add these variables to the Watch window.
Turbo PMAC User Manual Using the Test Results To execute a power-on phasing using the hall-effect sensors, you can use new modes of the Ixx81 poweron phase position parameter, or write a simple PLC program that executes once on power-up/reset. Setting bit 23 of Ixx81 to 1 specifies a hall-effect power-on phase reference. In this case, the address portion of Ixx81 specifies a Turbo PMAC X-address, usually that of the flag register used for the motor, the same address as in Ixx25.
Turbo PMAC User Manual The description of Ixx81 in the Software Reference Manual shows the common values of offsets used, for all the cases where the zero point in the hall-effect cycle is at a 0o, 60o, 120o, 180o, -120o, or -60o point – where manufacturers generally align the sensors. Note: Ixx81 in Turbo is used for address only (i.e. same as Ixx25). Ixx91 in Turbo is used for bits 16-21, 22 and 23. Note that Ixx75 is not used for the phase position offset in this method.
Turbo PMAC User Manual M171=I171/12 P170=1 ENDIF IF (M128&7=0 OR M128&7=7) P170=0 ENDIF IF (P170=1) M148=0 CMD"#1J/" ELSE CMD"#1K" ENDIF DISABLE PLC 1 CLOSE ; Set phase angle to 30 deg ; Phasing OK flag ; Invalid states ; Phasing not OK ; Phasing OK? ; Clear phasing error bit ; Enable motor ; Not OK; disable motor ; So program will not repeat Notes on this program: • The reason for the &7 (bit-by-bit AND with 7 [0111]) operation is to remove the effect of the T-flag input, which is the most significant bi
Turbo PMAC User Manual The two-guess phasing search is quick and requires little movement. It works well provided that external loads such as gravity and friction are low. However, if there are significant external loads, it may not prove to be a reliable phasing-search method (and unreliable phasing search methods can be dangerous); if this is the case, another method such as the stepper-motor method described below should be used. The two-guess method is selected by setting Ixx80 to 0 or 1.
Turbo PMAC User Manual Most custom algorithms are variations on the stepper-motor phasing search method. They use the phasecurrent offset values Ixx29 and Ixx79 with an O0 command to force current into particular phases so the motor will lock at a certain physical position in its phasing cycle. The following table shows the positions in the phasing cycle created by different combinations of Ixx29 and Ixx79 for 3-phase motors. Usually the magnitudes of the non-zero values are 2000 to 3000: Ixx29 Ixx79 (A).
Turbo PMAC User Manual I279=P279 IF (ABS(P271)>I271/12) M248=0 CMD"#2J/" ELSE CMD"#2K" SEND"PHASING FAILED" DISABLE PLC 1 CLOSE ; ; ; ; ; ; Restore real bias to B Greater than 1/12 cycle? Clear phasing error bit Close servo loop Not enough movement Bad phasing, kill ; Keep from executing again WARNING: Make sure an algorithm of this type can be executed reliably. Do not attempt this algorithm if the position sensor or drive is unpowered or faulted.
Turbo PMAC User Manual Finishing Setting up Turbo PMAC Commutation (Direct PWM or Sine Wave), Asynchronous (Induction) Motors Turbo PMAC commutation of an AC induction motor requires the setup of two I-variables that can be left at 0 for permanent-magnet brushless motors. One variable is the Ixx77 magnetization-current parameter (which is usually left at 0 for permanent-magnet motors, but can be changed for them).
Turbo PMAC User Manual Example: A 4-pole induction motor has a rated speed of 1740 rpm at a 60 Hz electrical frequency. It is being controlled from a UMAC Turbo with default clock source and frequency. The electrical frequency is: rad cyc rad = 377.0 * 2π sec sec cyc ω e = 60 The mechanical pole frequency is: rad rad poles 1 cyc rad rev 1 min * 4 = 364.
Turbo PMAC User Manual The higher the value of Ixx77 (before saturation), the more torque is produced per unit of quadrature current commanded from the servo loop, but the higher the back-EMF generator voltage produced per unit of motor velocity, so the lower the maximum velocity can be achieved from a given supply voltage.
Turbo 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. Commutation Enable: Ixx01 Set Ixx01 to 3 to enable Turbo PMAC commutation, reading a Y-register for commutation position feedback. (See the Ixx83 section below.) Command Output Address: Ixx02 Set Ixx02 to the lower address of the pair of output DACs being used (e.g.
Turbo PMAC User Manual Sine-Wave Mode Command Output Addresses – MACRO ICs (Y-registers), Type 1 Protocol IC# - Node# 0-0 0-1 0-4 0-5 0-8 0-9 0 - 12 0 - 13 Ixx02 $078420 $078424 $078428 $07842C $078430 $078434 $078438 $07843C IC# - Node# 1-0 1-1 1-4 1-5 1-8 1-9 1 - 12 1 - 13 Ixx02 $079420 $079424 $079428 $07942C $079430 $079434 $079438 $07943C IC# - Node# 2-0 2-1 2-4 2-5 2-8 2-9 2 - 12 2 - 13 Ixx02 $07A420 $07A424 $07A428 $07A42C $07A430 $07A434 $07A438
Turbo PMAC User Manual • • • • Set the Ixx32 velocity feedforward term to 2048. Set the Ixx33 integral gain term to 0. Set the Ixx35 acceleration feedforward term to 2048. Set this command output limit to 32,767. Commutation Cycle Size: Ixx70 & Ixx71 Set Ixx70 to 1 and Ixx71 to 2048 to provide 2048 counts (microsteps) per electrical cycle (512 microsteps/step). Commutation Phase Angle: Ixx72 Set the Ixx72 commutation phase-angle parameter to 512 or 1536 for the usual 2-phase microstepping motor.
Turbo PMAC User Manual User-Written Phase Algorithms Turbo PMAC supports the installation and automatic execution of user-written phase algorithms. These can be used if the standard commutation/current-loop algorithms are not suitable to get the required performance; alternately, they can be used for non-servo purposes, with the algorithm guaranteed to execute at the phase update rate. This can be very valuable for fast updates of I/O.
Turbo PMAC User Manual The last line of the user-written phase must be RTS (ReTurn from Subroutine). Available Registers The following data registers may be used by the user-written phase: • Internal DSP registers R0, N0, R1, N1, R5, and N5 may be used, and do not need to be restored when done. • Internal DSP registers M0, M1, M4, M5, R4, and N4 may be used, but must be restored to previous values when done.
Turbo PMAC User Manual SETTING UP THE ENCODER CONVERSION TABLE Turbo PMAC uses a two-step process to work with its feedback and master position information for the servo algorithm, to provide maximum power and flexibility. (Note that the commutation algorithms generally use raw feedback registers unprocessed by the conversion table.) For most Turbo PMAC users with quadrature encoder feedback, this process can be virtually transparent, with no need to worry about the details.
Turbo PMAC User Manual Conversion Table Execution The conversion table executes automatically at the beginning of each servo cycle, immediately after the servo interrupt. The entire active part of the table executes before any servo loops execute that cycle. Each entry in the table is executed every servo interrupt, even if the result is used less often (as when a motor’s own servo cycle is extended with Ixx60) or not at all. The table is executed in order from top to bottom each cycle.
Turbo PMAC User Manual Executive Program Setup Menu Generally, the setup of the encoder conversion table I-variables can be done interactively through the configuration menu in the PMAC Executive Program. The following section explains how the setup can be done directly and “manually.” Entry First Setup I-Variable The first setup I-variable for an entry has three parts: the conversion method, a mode-switch bit, and the address of the source data.
Turbo PMAC User Manual $A 2 $B 2 $C 1 $D 3 $E 1 $F - $F/$0 3 $F/$2 2 $F/$3 3 Triggered Time Base, running Triggered Time Base, armed Incremental Encoder, no or HW 1/T extension Exponential filter of parallel data Sum or difference of entries (Extended entry – type determined by 1st digit of 2nd line) High-Resolution Interpolator 0 = PMAC IC 1 = PMAC2 IC 0 = PMAC IC 1 = PMAC2 IC 0 = No extension 1 = Hardware 1/T None Byte-wide parallel Yword data, no filtering Byte-wide parallel Yword da
Turbo PMAC User Manual Final Result Format In general, the 24-bit final result is structured as 19 bits of integer (bits 5 – 23) and five bits of fraction (bits 0 – 4). The integer value represents whole number of least significant bits (LSBs) of a counter (counts), a latched register or an analog-to-digital converter. In other words, the LSB of the main source register is placed in bit 5 of the result register, a 5-bit shift.
Turbo PMAC User Manual Line I-variable Address Line I-variable Address 1 2 3 4 5 6 7 8 I8000 I8001 I8002 I8003 I8004 I8005 I8006 I8007 $3501 $3502 $3503 $3504 $3505 $3506 $3507 $3508 9 10 11 12 13 14 15 16 I8008 I8009 I8010 I8011 I8012 I8013 I8014 I8015 $3509 $350A $350B $350C $350D $350E $350F $3510 For example, to use the result in the eighth line of the table for position-loop feedback for Motor 4, either of the following commands could be used: I403=$3508 I403=@I8007 Even if the address is
Turbo PMAC User Manual PMAC 1/T Extension Servo Interrupts A B T 1 T T 2 1 T 2 Velocity Estimation : V = K n T1 Position Estimation : Pn = Counter +/- T2 T1 Note: For PMAC2-style Servo ICs of Revision D or newer (introduced 2002), ICchannel variable I7mn9 must be set to the default value of 0 so the two timers can be read. (Backward compatibility is maintained.
Turbo PMAC User Manual Examples: I8008=$C78200 I8009=$C78208 ; No extension of Servo IC 2 Channel 1 ; No extension of Servo IC 2 Channel 2 (PMAC2 IC) Analog Sine/Cosine Encoders Turbo PMAC supports two methods of conversion for interpolating analog sine/cosine encoders: one lowresolution (128 or 256 states per line) and one high-resolution (4096 states per line). The source addresses are always the base addresses of encoder channels in the Servo ICs.
Turbo PMAC User Manual Examples: I8000=$F78200 I8001=$078202 I8002=$004000 ; Hi-res interpolation of Servo IC 2 Channel 1 (PMAC1 IC) ; Read ADCs from Servo IC 2 Channel 1 ; Bias term of 4 LSBs of 12-bit ADCs I8000=$FF8300 I8001=$078305 I8002=$000000 ; Hi-res interpolation of Servo IC 3 Channel 1 (PMAC2 IC) ; Read ADCs from Servo IC 3 Channel 1 ; Zero bias term Acc-28 Analog-to-Digital Converters The conversion table can process the data from the 16-bit A/D converters of Acc-28 boards or their equivalen
Turbo PMAC User Manual • $2: The 48 possible bits are from the Y-register at the specified address and the Y-register at the next higher address. The conversion table performs no filtering. • $3: The 48 possible bits are from the Y-register at the specified address and the Y-register at the next higher address. The conversion table can perform filtering of the source data. • $6: The 48 possible bits are from the Y-register at the specified address and the X-register at the same address.
Turbo PMAC User Manual Examples: These first three 3-line entries process 3 16-bit inputs on a 48-bit Acc-14D/V card I8000=$378A00 I8001=$010000 I8002=256 I8003=$378A00 I8004=$010010 I8005=256 I8006=$378A01 I8007=$010008 I8008=256 ; Filtered parallel Y-data from first Acc-14D/V ; Use 16 bits starting at bit 0 ; Max change of 256 LSBs per servo cycle ; Filtered parallel Y-data from first Acc-14D/V ; LSB from bit 16, use 16 bits (high 8 bits from next address) ; Max change of 256 LSBs per servo cycle ; Filt
Turbo PMAC User Manual This can be used, for example, to average the readings of two sensors on opposite sides of a rotary table to take out the eccentricity, or to calculate the skew on a gantry by taking the difference of sensors on the two sides. This entry can use as source data only results in the conversion table. It is strongly encouraged to use results from earlier in the table; using results from later in the table means results from the previous servo cycle are used.
Turbo PMAC User Manual Untriggered vs. Triggered Time Base A time-base entry can be untriggered or triggered. Untriggered time base entries are simpler, but do not have a means for starting the time-base tracking of the master encoder precisely at a specific position of the master. The triggered time base entries use the hardware-capture feature of the Turbo PMAC Servo ICs to precisely latch the master position that is the starting point for the programmed motion sequence that is slaved to the master.
Turbo PMAC User Manual Next, a PLC program will change the method digit to $B to arm the time base. Finally, the conversion table will change the method digit to $A itself when it sees the capture trigger, as explained above. Examples: Untriggered time base I8003=$079218 I8004=$403504 I8005=640 I5193=@I8005 ; 1/T conversion of Servo IC 2 Channel 4 encoder ; Untriggered time base from result of I8003 ; TBSF=131072/204.8 (RTIF=204.8 cts/msec) ; Use I8005’s result as time base for C.S.
Turbo PMAC User Manual SETTING UP THE SERVO LOOP Turbo PMAC can close a digital servo loop automatically for each activated motor. The purpose of the servo loop is to command an output in such a way so as 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.
Turbo PMAC User Manual Changing the servo update rate changes the percentage of processor time devoted to the servo tasks, which can have important implications for lower-priority tasks, such as motion-program and PLCprogram calculations. Refer to the Computational Features section for details on how to evaluate these changes. If the servo update time is changed with the jumpers, change global parameter I10 to match the change so that commanded trajectories are executed at the right speed.
Turbo PMAC User Manual 1. It can be used as regular feedback to the Turbo PMAC, just as on a servo motor. In this method, the key issue is the resolution and phasing of the encoder edges relative to the steps or microsteps produced by the drive – some deadband may have to be created with Ixx64 and Ixx65 to prevent hunting at rest. 2. The encoder can just be used for position confirmation at the end of moves.
Turbo PMAC User Manual Direct-PWM Power-Block Amplifiers A direct-PWM power-block amplifier accepts phase voltage commands encoded as the actual pulsewidth-modulated on-off commands for the power transistors. This type of amplifier expects the controller to calculate the commutation and current loop, using the torque/force command from the position/velocity-loop servo as the current-magnitude command into the commutation and current loop. The amplifier performs no control functions in this style.
Turbo PMAC User Manual Ixx31 Derivative Gain Term The derivative gain term set by Ixx31 provides a damping effect by providing a contribution to the control effort proportional to the actual velocity acting against that velocity. In this respect it acts much like a dashpot or the shock absorber of a vehicle’s suspension. The higher the derivative gain term, the heavier the damping action. Some form of derivative action – effectively a velocity loop – is required for a stable position loop.
Turbo PMAC User Manual Ixx35 Acceleration Feedforward Term The acceleration feedforward term Ixx35 adds an amount to the control effort that is directly proportional to the commanded acceleration, to overcome potential position errors that would be proportional to acceleration. These errors come from the fundamental tendency of inertia to resist acceleration. Without acceleration feedforward, there would be a component of the following error proportional to acceleration.
Turbo PMAC User Manual Filter Structure For those familiar with control theory (not necessary to use the filter!), the form of Turbo PMAC’s notch filter system is: N ( z ) 1 + N 1 z −1 + N 2 z −2 1 + Ixx36 z −1 + Ixx37 z −2 = = D( z ) 1 + D1 z −1 + D2 z −2 1 + Ixx38 z −1 + Ixx39 z −2 The I-variables Ixx36, Ixx37, Ixx38, and Ixx39 each have a range of -2.0 to +2.0; they are 24-bit values, with one sign bit, one integer bit, and 22 fractional bits.
Turbo PMAC User Manual Then compute the filter coefficients: Ixx36 = − (2ζ z ω nz Ts + 2 ) αz Ixx37 = Ixx38 = ( 1 αz − 2ζ p ω np Ts + 2 ) αp Ixx39 = 1 αp Finally, modify the proportional-gain term to compensate for the DC-gain change that the filter creates: 2 ω np αz Ixx30 new = Ixx30old 2 α ω nz p For example, suppose we have identified a 55 Hz resonance in our mechanical coupling. To compensate for this, we decide to put a lightly damped band-reject filter (damping ratio 0.
Turbo PMAC User Manual Ixx30 new = Ixx30old 2 ω np αz 502.7 2 1.0748 = 500 ,000 = 979 ,169 2 314.2 2 1.4049 ω nz α p Use to Create a Low-Pass Filter It is also possible to use this filter component as a low-pass filter if reducing roughness of operation is more important than high system bandwidth. Typically, the low-pass filter is used if a low-resolution position sensor is used.
Turbo PMAC User Manual Second-Order Filter: To calculate a second-order low-pass filter, we consider the continuous transfer function for a generalized second-order filter: ω n2 F (s ) = s 2 + 2ζω n + ω n2 where ωn is the cutoff frequency of the filter in radians per second, and ς is the damping ratio – a value of 0.707 produces a Butterworth filter here.
Turbo PMAC User Manual Ixx30new = Ixx30old * (K pv + K iv ) The zero and pole terms use the first-order notch filter parameters Ixx36 and Ixx38, respectively. The second-order parameters Ixx37 and Ixx39 are set to zero if the filter is used only as an integrator. Ixx36 = − K pv K pv + K iv Ixx38 = −1 Use to Create a Lead-Lag Filter This filter can be used simply as a lead-lag filter if the roots are real rather than imaginary. A lead-lag filter is very similar in performance to a PID filter.
Turbo PMAC User Manual Ixx63: Integration Limit Ixx63 is a saturation limit for the integrator, which limits the magnitude of the integrator output. If set to a negative value, it trips the servo loop with a fatal following error if the integrator saturates. Setting Ixx63 to 0 clears the integrator and thus its output. (Setting integral gain term Ixx33 to 0 only stops further input to the integrator.
Turbo PMAC User Manual Ixx67: Following Error Limit Ixx67 is a saturation limit on the magnitude of the following error input to the P and I terms of the filter. It does not limit the true following error, or the error value compared to the Ixx11 and Ixx12 following error limit parameters. Setting Ixx67 to 0 disables the PI control terms, while leaving the D derivative term (i.e. the velocity loop) and the feedforward terms active. This setting is useful if only velocity control is truly desired.
Turbo PMAC User Manual PMAC: Extended Servo Algorithm Block Diagram 1 - z -1 Ix68 KS (k 0 + ⋅ ⋅ ⋅ + k 3z -3 ) h 0 + h1 (1 - z -1) 1 + 4 (L1z −1 + ⋅ ⋅ ⋅ + L3z -3 ) r(z) + 32 ⋅ Ix08 s0 TS (t 0 + ⋅ ⋅ ⋅ + t 3z -4 ) + - - 1 + 1 + 8 (r1z −1 + ⋅ ⋅ ⋅ + r4 z - 4 ) + + 1 + d1z −1d 2 z - 2 + Ix69 + + u(z) 15 2 DAC -1 s1 (1 - z ) 32 ⋅ Ix08 θ1(z) Encoder #1 Encoder #2 Feedback Loop #1 + f0 GS (g 0 + g1 (1 - z -1 )) + - - f1 (1 - z -1 ) 32 ⋅ Ix08 θ2(z) Encoder #1 Encoder #2 Feedba
Turbo PMAC User Manual Terms whose names consist of two letters, with the second letter an S, multiply the results of an entire block. These terms are treated as integers with a range of +/-8,388,608. The PID terms Ixx30 – Ixx39, Ixx63 – Ixx65, and Ixx67 are not used. Ixx68 is used as the “friction feedforward” term for the ESA, just as it is for the PID. Ixx69 is used for the ESA, but in a slightly different manner from the PID.
Turbo PMAC User Manual Selecting Turbo PMAC Motors to Use Any two Turbo PMAC motors can be used for the inner and outer loops. If no integration is required in passing the information from outer loop to inner loop (see below), using a lower-numbered motor for the outer loop will avoid adding a servo-cycle delay. This has the possibility of delivering higher performance in closing the outer loop.
Turbo PMAC User Manual Joining the Loops After the inner loop is working properly, and have done the basic setup of the outer loop, join the loops together. To Integrate Outer Loop Command or Not Sometimes the output from the outer loop will be numerically integrated before being used as a position input to the inner loop. If it is integrated, the outer loop’s command itself will effectively be a velocity value; if it is not integrated, the value will be a position value.
Turbo PMAC User Manual Ixx06 for the inner loop’s motor also controls how the outer loop’s corrections interact with commanded positions for the inner loop. When Ixx06 bit 1 (the following mode control bit) is set to 0, the inner loop’s commanded positions are relative to a fixed origin, and these commanded moves effectively cancel out whatever corrections have come in through the master position port.
Turbo PMAC User Manual Setup Example In this example, Motors 1, 2, and 3 are the X, Y, and Z-axes, respectively, in Coordinate System 1 of a Cartesian stage. Each uses quadrature feedback with 0.1-micron resolution, and is programmed in millimeters. Motor 4 is used to control the gap height of the vertical tool over the surface. It uses a capacitive gap sensor through an Acc-28 16-bit A/D converter, with the LSB of the ADC measuring 0.25 microns.
Turbo PMAC User Manual Special Instructions for Extended Single-Loop Setup When using cascaded servo loops for extended filtering of a single control quantity, several details of the setup will be different. The outer loop will be set up first, using the real feedback device, and writing directly to the registers that command the amplifier, commutating if necessary. This servo loop should be tuned as well as possible by itself. When ready to engage the inner loop as well, do the following: 1.
Turbo PMAC User Manual User-Written Servo Algorithms Turbo PMAC supports the installation and automatic execution of user-written servo algorithms. These can be used if the standard PID and ESA filters are not suitable to get the required servo performance. Alternately, they can be used for non-servo purposes, with the algorithm guaranteed to execute at the servo update rate. This can be valuable for fast updates of I/O. There are two methods for creating these user-written servo algorithms.
Turbo PMAC User Manual Computational Features The Open Servo provides powerful computational features to permit easy writing of sophisticated and flexible algorithms. Access to Turbo PMAC Variables Open Servo algorithms can utilize all of Turbo PMAC’s I, P, Q, and M-variables, reading and writing to them as appropriate. As in other user programs, it uses floating-point arithmetic to process these variable values, even those that are stored as fixed-point values (see Floating-Point vs.
Turbo PMAC User Manual Floating-Point vs. Fixed-Point Mathematics Each statement in the Open Servo can be executed using either floating-point or integer (fixed-point) mathematics. In a floating-point statement, all variables used are processed through an intermediate working format that is 48-bit floating-point, regardless of the storage format of the variable. Floatingpoint statements can utilize any of Turbo PMAC’s I, P, Q, or M-variables, and the compiler’s long Fvariable pointers.
Turbo PMAC User Manual Register Arrays: Register arrays work with the compiler’s short L-variables and long F-variables. These arrays must be declared to the compiler before the start of the actual Open Servo algorithm. In use, the number of the array index is placed inside square brackets, and specifies the address offset from the declared beginning of the array.
Turbo PMAC User Manual • • • • • • • • • ASIN (trigonometric arc sine ACOS (trigonometric arc cosine) ATAN (trigonometric arc tangent) ATAN2 (special 2-argument, 4-quadrant arc tangent)* ABS (absolute value) INT (greatest integer within) EXP (exponentiation) LN (natural logarithm) SQRT (square root) The trigonometric functions use degrees if Turbo PMAC variable I15 is set to the default value of 0; they use radians if I15 is set to 1.
Turbo PMAC User Manual COPYREG Command: The COPYREG command copies five key registers for the executing motor into five consecutive P-variables, where they can easily be used for calculations. The user does not have to know the addresses of these registers. In doing this copying, Turbo PMAC automatically converts the data to 48-bit floating-point format.
Turbo PMAC User Manual RETURN(FTOI(P345)) L10=FTOI(P92/65536) RETURN(L10) The RETURN command will typically be the last line of an Open Servo algorithm. Putting it earlier in the algorithm will not cause the command data to be used any sooner by the Turbo PMAC. If the Open Servo program is used for a task other than servo-loop closure, there is no need to use the RETURN command.
Turbo PMAC User Manual Processor Utilization Servo algorithms are one of the most important tasks executed by the Turbo PMAC’s processor, but far from the only one. While Turbo PMAC’s DSP processor is very efficient, it is still possible to overload the processor, particularly with floating-point algorithms executing in compiled code from the Open Servo. These do not run nearly as efficiently as the standard servo algorithms, which have been written in assembly language and use fixed-point mathematics.
Turbo PMAC User Manual For large amounts of extra data memory, it is recommended to use the User Buffer set up with the on-line DEFINE UBUFFER command. The User Buffer occupies a number of registers at the high end of X/Y data memory. With an Option 5x0 standard memory configuration, the end of data memory is at X/Y:$0107FF; if DEFINE UBUFFER 2048 is declared, all data memory from $010000 through $0107FF is reserved for the user’s own purposes.
Turbo PMAC User Manual In order to start the algorithm correctly, it reads the servo cycle counter and compares it to the counter the last time the last time this algorithm was executed. If the algorithm was not executed the previous cycle, it zeros out the “history” values for the algorithm. It also does a saturation check on the commanded output. This algorithm assumes a standard memory option (5x0) whose data memory ends at X/Y:$0107FF and a UBUFFER defined of at least 2048 words.
Turbo PMAC User Manual Example 3: PMAC’s PID Filter The following example mimics the action of Turbo PMAC’s basic PID loop (without the notch, deadband compensation, position-error limiting, or friction feedforward terms), but with floating-point calculations. It uses the PID’s own I-variables, accessed as L-variables for speed, then converted to floating-point values. This program is a user written servo that replicates the PMAC PID loop.
Turbo PMAC User Manual ; FE, APOS, & DPOS in 1 / [Ix08* 32] counts ; AVEL in 1 / [Ix09*32] counts/servo period ; DVEL in 1 / [Ix08*32] counts/servo period; ; if( Ix34 = 1 && Des_Vel0 = 1 OR Ix34 = 0) ; then integrate IPOS = IPOS + FE * Ix33 && Limit to Ix63 If (STATUS&$12000 = $12000 Or STATUS&$10000 = 0) ; Test Ix34 mode IPOS = FLIMIT(ITOF(Ix33)*FE*K23+IPOS, ITOF(Ix63)*ITOF(Ix08)*2) ; Scale Ix63 to include Ix08 EndIf DACOUT = FLIMIT(ITOF(Ix30)*K16 * ( FE + K128 *(ITOF(Ix32) * DVEL + ITOF(Ix35) * (DVEL - PD
Turbo PMAC User Manual Assembled User-Written Servo Algorithms Highly efficient user-written servo algorithms may be written in the assembly language for the DSP56300 family of processors used in the Turbo PMAC. This requires the use of a cross-assembler from Motorola, obtainable at no cost from their website. It also requires a linking program from Delta Tau, called CODET.EXE and running under Microsoft Windows operating systems, available at no cost from the Delta Tau website.
Turbo PMAC User Manual Available Registers The following data registers may be used by the user-written servo: • Internal DSP registers R4, N4, R5, and N5 may be used, and do not need to be restored when done. • Internal DSP registers M0, M4, and M5 may be used, but must be restored to previous values when done. • Motor intermediate value registers X:$000x93/13 through X:$000x9A/1A may be used to hold values from cycle to cycle.
Turbo PMAC User Manual MOTOR COMPENSATION TABLES AND CONSTANTS Turbo PMAC has the capability to perform sophisticated table-based corrections for both position and torque on its motors. These permit compensating for imperfections in the system that cannot be measured with the sensors used in the actual application (although reference sensors that can measure the imperfections must be used to characterize the errors).
Turbo PMAC User Manual PMAC Compensation Tables Standard leadscrew compensation e.g. ∆x = f(x) y y y Get linear encoder accuracy (almost!) with rotary encoder Characterize system with linear sensor Enter errors in PMAC ∆x E ∆x ∆x ∆x ∆x M DEFINE COMP 200, #1, #1, 100000 Table Length Source Motor Table Span in Counts Target Motor Uses of Cross-Axis Compensation The ability to have separate source and target motors for a table has several uses.
Turbo PMAC User Manual PMAC Compensation Tables 2D (Planar) compensation tables e.g. ∆z = f(x,y) DEFINE COMP 15.20, #1, #2, #3, 20000, 15000 Table # of rows Table # of columns Row motor Column motor Column motor span in counts Row motor span in counts Target motor Note: 3D compensation may be achieved in Turbo PMAC through the use of the kinematic subroutines, which can be used to compute the corrections algorithmically.
Turbo 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).
Turbo PMAC User Manual Entering 1D Tables If the position compensation table to be entered has both the source and target motors equivalent to the addressed (assigned) motor, and the table uses the actual position of this motor to calculate the corrections, then there is no need to specify the motors in the DEFINE COMP command.
Turbo PMAC User Manual Motor 1 is the first source motor (the row motor), using its desired position; each row represents a row span of counts of positions of Motor 1, and each column represents a constant raw position of Motor 1. Motor 2 is the second source motor (the column motor), using its desired position; each column represents a column span of counts of Motor 2, and each row represents a constant raw position of Motor 2. Motor 3 is the target motor; the corrections are applied to Motor 3.
Turbo PMAC User Manual Active Calculation of Corrections The position compensation is performed inside the servo loop (every servo cycle) to obtain the maximum speed and accuracy. Turbo PMAC takes the position of the source motor and finds the matching position in the table. Typically this is between two entries in a 1D table, or four entries in a 2D table, so Turbo PMAC linearly interpolates (weighted average) between these entries to obtain the correction for the current servo cycle.
Turbo PMAC User Manual Backlash Compensation Turbo PMAC can perform sophisticated backlash compensation for all motors. If the position feedback utilizes a sensor on the motor and there is physical backlash in the coupling to the load (as in a typical gear train), the physical position of the load for a given sensor-reported position will differ depending on the direction of motion. Unless this is compensated for, significant position errors can result in the application.
Turbo PMAC User Manual Entering the Table The backlash compensation tables are entered and operated much like the position leadscrew compensation tables. However, there are no cross-axis or multi-axis backlash compensation tables. The table belonging to a motor provides a backlash correction to that motor as a function of that motor’s position. Backlash compensation tables must be defined in order from those belonging to highernumbered motors to those belonging to lower-numbered motors.
Turbo PMAC User Manual Backlash Table Example Imagine the calibration of an axis assigned to Motor 3 had been performed against an accurate linear measurement device on the load, working in both directions, and the following readings of the linear reference device for set positions of the motor encoder (expressed in units of the motor encoder): 0 500 0* 510 5 516 * Reference point; zero by definition Motor Pos. (cts) Load Pos.+ (cts) Load Pos.- (cts) 1000 995 998.5 1500 1492.
Turbo PMAC User Manual Torque Compensation Tables Turbo PMAC provides the capability to create a table of corrections as a function of motor position to the output of the servo loop. Typically, this feature will be used with the servo loop in torque mode (whether or not Turbo PMAC is also performing motor commutation), so this function is called torque compensation table.
Turbo PMAC User Manual then the correction applied to a 16-bit DAC at 600 counts would be: Correction = −50 + 600 − 500 (83 − [− 50 ]) = 3bits 750 − 500 How to Calculate Table Entry Values Torque compensation tables are most commonly used to correct for torque ripple in motors due to “cogging torque” effects.
Turbo PMAC User Manual TURBO PMAC GENERAL PURPOSE I/O USE Turbo PMAC controllers have substantial input/output capabilities that are not directly related to servo operation. I/O points are both digital and analog, both input and output. Board-level Turbo PMAC controllers have some on-board general-purpose I/O, and more can be added with accessory boards. With the modular UMAC systems, I/O boards can be added according to the needs of the particular application.
Turbo PMAC User Manual Turbo PMAC Multiplexed I/O (JTHW) Port The Multiplexer port on the JTHW (J3) connector of a Turbo PMAC has eight input lines and eight output lines. The output lines can be used to multiplex large numbers of inputs and outputs on the port, and Delta Tau provides accessory boards and software structures (special M-variable definitions TWB, TWD, TWR, and TWS) to capitalize on this feature. Up to 32 of the multiplexed I/O boards may be daisy-chained on the port, in any combination.
Turbo PMAC User Manual Turbo PMAC2 General-Purpose I/O (JIO) Port The JIO port on a Turbo PMAC2 (on Acc-5E for a UMAC Turbo) has 32 discrete digital I/O lines for general-purpose use. The lines are configurable by byte for input or output (on the DSPGATE2 I/O IC, the lines are individually configurable for input or output, but the buffer ICs are only byte-configurable), and individually configurable for inverting or non-inverting format.
Turbo PMAC User Manual In addition, the bi-directional buffer IC for each byte has a direction control line accessible as a software control bit. These control lines and bits must match the ASIC direction bits. The buffer direction control bits are at PMAC address Y:$070800, with bits 0 to 3 controlling the four bytes of the JIO port. A bit value of 0 specifies input; 1 specifies output.
Turbo PMAC User Manual Multiplexer Port Accessories Delta Tau provides several accessories that can connect to the JTHW multiplexer port, with automatic firmware support for accessing the I/O on these boards. These accessories provide a direct flat-cable connection to the JTHW port, and the port is configured automatically at power-up/reset to work with any of these boards. These accessories include: • Acc-8D Opt. 7 Resolver-to-Digital Converter Board • Acc-8D Opt.
Turbo PMAC User Manual These M-variables should take values of 0 or 255 ($FF) only; 0 sets the byte to input, 255 sets the byte to output. In addition, the bi-directional buffer IC for each byte has a direction control line accessible as a software control bit. These control lines and bits must match the ASIC direction bits. In the ISA and PCI-bus versions of the Turbo PMAC, the buffer direction control bits are at Turbo PMAC address Y:$070800, with bits 4 and 5 controlling the two bytes of the JTHW port.
Turbo PMAC User Manual The analog-to-digital converters on Turbo PMAC require +5V and -12V supplies. These supplies are not isolated from digital +5V circuitry on PMAC. If the Turbo PMAC2 is plugged into the bus (ISA, PCI, or VME), these supplies are taken from the bus power supply. In a standalone application, these supplies must be brought in on terminal block TB1. The -12V and matching +12V supply voltages are available on the J1 connector to supply the analog circuitry providing the signals.
Turbo PMAC User Manual In operation, Turbo PMAC reads one ADC pair each phase cycle and copies it into the appropriate memory registers. Therefore, it reads each ADC pair every I5060 phase cycles. If these values are used as feedback for a servo loop, the loop should not be closed more often than the ADC is read. UMAC Digital I/O Boards The UMAC has an extensive family of digital I/O boards.
Turbo PMAC User Manual Boards With Switch-Set Addresses For the Acc-14E, 65E, 66E, and 67E boards, the base address of the board is determined by the settings of DIP switches SW1-1 through SW1-4. When these boards are used with a UMAC Turbo CPU, SW1-5 and SW1-6 must always be ON. These boards always appear in the low byte (bits 0 – 7) of the 24-bit word.
Turbo PMAC User Manual The following table explains how these bits select registers: Bit 7 Bit 6 Combined Value 0 0 0 0 1 1 1 0 2 1 1 3 * With bits 0 to 5 set to 0 Byte Value* {Base + 0} to {Base + 5} Register Selected {Base + 6} Register Selected $00 $40 $80 $C0 Data Register Setup Register 1 Setup Register 2 Setup Register 3 Data Register Setup Register n. a. In a typical application, non-zero combined values of Bits 6 and 7 are only used for initial configuration of the IC.
Turbo PMAC User Manual Setup Register 3: Latch Control Setup Register 3 at each address {Base + 0} through {Base + 5}, which is selected by writing a 1 to Bit 6 of the Control Word at {Base + 7} and a 1 to Bit 7, is the latch control register for the Data Register at the same address. Each bit of Setup Register 3 controls whether latched or unlatched data is read from the matching bit of the Data Register at the same address.
Turbo PMAC User Manual 206 Turbo PMAC General Purpose I/O Use
Turbo PMAC User Manual MAKING AN APPLICATION SAFE Delta Tau Data Systems has provided many safety features on the Turbo PMAC controller, and invested many resources to make Turbo PMAC a safe product. However, the ultimate responsibility for the safety of a control system using Turbo PMAC must lie with the system designer, utilizing the safety features on Turbo PMAC and in other parts of the system. Following Error Limits Turbo PMAC has three following error limits for each motor.
Turbo PMAC User Manual Integrated Following Error Protection In addition to the normal following error protection provided by the Ixx11 variable for each motor, Turbo PMAC can shut down the motor if the time-integrated value of the following error exceeds a preset value. This integrated error feature can protect against those cases in which the magnitude of the measured following error never gets very large – for example, a loss of feedback followed by a very short commanded move.
Turbo PMAC User Manual Variable Ixx25 for the motor must contain the address of the flag register for the channel into which these limit switches are wired. Bit 17 of Ixx24 must be set to the default value of 0 to use these limit inputs. If this bit is set to 1, Turbo PMAC will not monitor these limit inputs. This bit can be set permanently to 1 if the motor does not have limit switches; it can be set to 1 temporarily for operations such as homing into a limit.
Turbo PMAC User Manual For a LINEAR or CIRCLE-mode move executed with the special lookahead buffer active and exceeding a desired position limit, the move will come to a stop along the programmed path exactly at the limit, decelerating as controlled by the Ixx17 maximum-acceleration parameters for the motors in the coordinate system. This is the equivalent of the \ quick-stop command. In this case, it is possible to resume motion along the path after changing the offending limit parameter.
Turbo PMAC User Manual Acceleration Limits Turbo PMAC has two programmable acceleration limits for each motor, one for jogging, homing, and RAPID-mode moves (Ixx19), and one for LINEAR and CIRCLE-mode programmed moves (Ixx17). Both parameters are in units of counts per (millisecond-squared). PVT and SPLINE-mode moves do not observe either of these limits.
Turbo PMAC User Manual 2 Two I-variables control the functioning of the I T protection for each motor. Ixx57 is the continuous current limit magnitude. It has the same units as the Ixx69 instantaneous output limit, bits of a 16-bit DAC (even if some other output device is used). Both have a maximum magnitude of 32,767, which is the size of Turbo PMAC’s maximum possible output. If Ixx57 is a positive value, I2T protection will be used; if Ixx57 is a negative number, |I|T protection will be used.
Turbo PMAC User Manual [ ] Sum = Sum + 1 2 + 0 2 − 0.5 2 ∆t = Sum + 0.75 ∆t Sum will increase at a rate of 0.75 per servo cycle. At the default servo cycle update rate of 2.25 kHz, Sum will increase at a rate of 2250*0.75=1688 per second. If you want the motor to trip after 3 seconds of this condition, you should set Ixx58 to 1688*3 = 5064. When an integrated-current fault occurs on a motor, Turbo PMAC reacts just as for an amplifier fault error.
Turbo PMAC User Manual The following table shows the resistor pack for each channel for Turbo PMACs and accessories with this feature. To enable the encoder-loss feature, pin 1 of the resistor pack (marked by a dot on the package) should be placed at the opposite end of the socket from pin 1 of the socket (marked by a white-ink square on the circuit board).
Turbo PMAC User Manual ; Logic to clear fault status IF (Mtr1OpenLoop=0 AND Enc1LossIn=OK AND Mtr1EncLossStatus=0) Mtr1EncLossStatus=0 ENDIF CLOSE Refer to the individual hardware reference manuals for more details of the implementation of this function. User-Written Safety Algorithms You can write your own safety-checking algorithms easily in a PLC program.
Turbo PMAC User Manual • • 5V power-supply disturbances Loose connections 2. If there is an immediate watchdog timer trip in Step 1, power up with the re-initialization jumper ON. If it does not trip now, there is a problem in the servo/phase task loading for the frequency, or an immediate software problem on the board. Check for the following: • Phase and servo clock frequencies vs. the number of motors used by Turbo PMAC. These frequencies may need to be reduced.
Turbo PMAC User Manual The following table summarizes the different commands that can be used to stop motion and their attributes: Command Scope Begin Immed? Stop on Path? Stop at Prog Pt? Decel Rate J/ Motor Yes –- No A Q / C.S. Global C.S. Global C.S. Yes Yes No No No No No Yes Yes Yes No No Yes Yes Yes Ixx1921 Ixx15 Ixx15 TA, TS TA, TS TA, TS H \ C.S. Global C.S.
Turbo PMAC User Manual Communications Data Integrity Turbo PMAC provides a variety of techniques for ensuring valid transmission of data, including serial parity checking, framing error checking, serial full-duplex communications, and bidirectional checksum computation on both serial and bus communications. For more details on how these techniques work, refer to the Writing Host Communications Programs section of this manual.
Turbo PMAC User Manual EXECUTING INDIVIDUAL MOTOR MOVES Once the motor is defined and basically working with reasonable gains, command some basic moves for the motor. Jogging commands make simple moves for the motor, independent of other motors, without writing a motion program. Use these moves for development, diagnostics, and debugging, but they may also be used in an actual application. Another type of simple motor move is the homing search move.
Turbo PMAC User Manual MOTOR x MOTION VARIABLES Ix20 ACCELERATION TIME (JOG, HOME) (Units: msec); integer Ix21 S-CURVE TIME (JOG, HOME) (Units: msec); integer V Ix20 > 2 * Ix21 Ix21 Ix21 Ix21 Ix20 V Ix21 T Ix20 Ix20 < 2 * Ix21 Ix21 Ix21 Ix21 2*Ix21 T Ix21 2*Ix21 V Ix21=0 Ix20 T Ix20 Jog Move Trajectory Move Timer Active = 0 (if command was J+ or J- Jog Stop given (J/) Move Timer Active = 1 Vel Move Timer Active = 1 Desired Velocity Zero = 0 In Position = 0 Max Accel = Ix19 Max A
Turbo PMAC User Manual Jog Commands The commands to jog a motor are on-line (immediate) commands that are motor-specific; they act on the currently addressed motor. Note: A jog command to a motor will be rejected if the motor is in a coordinate system that is currently executing a motion program, even if the motion program is not commanding that motor to move. PMAC will report ERR001 if I6 is set to 1 or 3.
Turbo PMAC User Manual Triggered Motor Moves Triggered moves in Turbo PMAC are double moves, with a pre-trigger portion and a post-trigger portion. Upon the trigger event, Turbo PMAC will break into the pre-trigger move and calculate a post-trigger move ending at a pre-specified distance from the trigger point. Types of Triggered Moves There are three types of triggered motor moves: 1. Homing search moves (on-line or motion-program) 2. On-line jog-until-trigger moves 3.
Turbo PMAC User Manual Merits of Dual Trigger In homing-search moves, it is common practice to use a combination of a homing switch and the index channel as the home trigger condition. The index channel of an encoder, while precise and repeatable, is not unique in most applications, because the motor can travel more than one revolution. The homing switch, while unique, is typically not extremely precise or repeatable.
Turbo PMAC User Manual Hardware Capture with Acc-51 Interpolators To utilize the hardware-capture feature on triggered moves using sinusoidal encoder feedback through an Acc-51 high-resolution interpolator, several additional firmware features (introduced in firmware revision V1.940) must be activated. Because the capture flags must be of the same Servo IC and channel as the position loop feedback, Ixx25 must be set to the address of the channel on the interpolator board.
Turbo PMAC User Manual Homing Acceleration The acceleration for homing search moves is controlled by the same parameters – Ixx19 (maximum acceleration), Ixx20 (acceleration time), and Ixx21 (S-curve time) – as for jogging moves. These are described in the above section on jogging moves. Homing Speed Ixx23 specifies the speed and direction of the homing-search move. If Ixx23 is greater than zero, the pretrigger homing-search move will be in positive direction.
Turbo PMAC User Manual Homing Search Move Trajectory Vel Trigger Occurs Home Complete=1 Home Search in Progress=0 Home Complete=0 Home Search In Progress=1 Net distance from trigger position = Ix26 Ix23 Time Ix21 Ix21 Ix21 Ix20 Note: Rate of acceleration limited by Ix19 - can override Ix20 and Ix21 Desired Velocity Zero=1 In Position=1 (when FE in range) Ix21 Ix20 Ix21 Ix21 Ix20 Home Command The homing search move can be executed either through an on-line command (which can be given from a PLC
Turbo PMAC User Manual Multiple homing moves can be started together by specifying a list or range of motor numbers with the command (e.g. HOME1,3 or HOME2..6). Further program execution will wait for all of these motors to finish their homing moves. Separate homing commands, even on the same line (e.g. HOME1 HOME2) will be executed in sequence, with the first finishing before the second starts. It is not possible to execute partially overlapping homing moves from a single motion program.
Turbo PMAC User Manual Note: If there is a following error when the HOMEZ command is given, 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 for the move to finish normally; if this is not done, the limit function will abort the homing search move.
Turbo PMAC User Manual ;*********** PLC program to execute routine ********************* OPEN PLC 10 CLEAR I124=$20000 CMD"#1HM" WHILE (M145=1) ENDWHILE WHILE (M133=0) ENDWHILE I124=$0 DIS PLC10 CLOSE ; Disable +/-LIM as limits ; Home #1 into limit and offset out of it ; Waits for Home Search to start ; Waits for Home motion to complete ; Re-enable +/-LIM as limits ; Disables PLC once Home is found ; End of PLC Multi-Step Homing Procedures You may require a homing procedure that cannot be executed with a
Turbo PMAC User Manual ENDWHILE I223=-10 I224=$0 I7222=11 I7223=0 CMD"#2HM" WHILE (M245=1) ENDWHILE WHILE (M233=0) ENDWHILE DIS PLC11 CLOSE ; Home speed 10 cts/msec negative direction ; Re-enable hardware limits ; Capture on flag low and index channel high ; Use HOME2 (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 pow
Turbo PMAC User Manual ENDWHILE WHILE (M333=0) ENDWHILE ENDIF I323=-10 I326=0 I7232=3 I7233=0 CMD"#3HM" WHILE (M345=1) ENDWHILE WHILE (M333=0) ENDWHILE DIS PLC12 CLOSE ;Waits for home motion to complete ; Home speed 10 cts/msec negative direction ; No home offset ; Capture on rising flag and rising index ; Use Home3 as 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 program Storing the Home Position Turbo PMAC aut
Turbo PMAC User Manual The “jog-until-trigger” function for a motor is specified by adding a ^{constant} specifier to the end of a regular “definite” jog command for the motor, where this {constant} is the distance to be traveled relative to the trigger position before stopping, in encoder counts. It cannot be used with the J+ and Jindefinite jog commands. This makes the jog command for a jog-until trigger something like J=10000^100 , J=*^-50 or J:50000^0.
Turbo PMAC User Manual For more information on these moves, look under RAPID-mode moves in the Writing and Executing Motion Programs section and in the description of {axis}{data}^{data} motion-program statements in the Software Reference 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.
Turbo PMAC User Manual 234 Executing Individual Motor Moves
Turbo PMAC User Manual TURBO PMAC COMPUTATIONAL FEATURES Turbo 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.
Turbo PMAC User Manual The servo clock frequency is determined by: • Jumpers E98, E29 – E33, and E3 – E6 on a Turbo PMAC • I7m00, I7m01, and I7m02 (for clock-source Servo IC m as set by I19) on a (non-Ultralite) Turbo PMAC2 • I6800, I6801, and I6802 on a Turbo PMAC2 Ultralite The default update frequency is 2.25 kHz (440 µsec cycle). At the default, the servo update of each motor takes approximately 1% of Turbo PMAC’s computational power.
Turbo PMAC User Manual Compiled PLC Programs 1 – 31 Compiled PLC programs (PLCC programs) 1-31 are executed in background. Each background cycle, Turbo PMAC will execute one scan (to the end or to an ENDWHILE statement) of all active compiled background PLC programs, starting from lowest numbered to highest, uninterrupted by any other background task (although it can be interrupted by higher priority tasks). At power-on/reset, PLCC programs run after the first PLC program runs.
Turbo PMAC User Manual Priority Level Optimization Usually, Turbo PMAC will have enough speed and calculation power to perform all of the tasks asked of it. Some applications will put a large demand on a certain priority level, and to make Turbo PMAC run more efficiently some priority level optimization should be done. When Turbo PMAC begins to run out of time, problems such as sluggish communications, slow PLC/PLCC scan rates, run-time errors, and even tripping the watchdog timer, can occur.
Turbo PMAC User Manual Servo Interrupt Tasks Another timer register can be used to evaluate the computation load of the servo-interrupt tasks such as the conversion table, interpolation, position/velocity-loop closure, and data gathering. This register, located at Y:$000037, holds the number of timer increments elapsed from the beginning to the end of the servo-interrupt tasks for the last interrupt.
Turbo PMAC User Manual P72=(M72-P69*M71)/(M70*P70) ; Servo task duty cycle P68=INT((M71+M72+M73)/M70) ; # of times phase interrupted RTI P67=INT((M71+M72+M73)/(M70*P70)) ; # of times servo interrupted RTI P73=(M73-P68*M71-P67*(M72-P69*M71))/(M70*P70*(I8+1)) ; RTI task duty cycle P74=P71+P72+P73 ; Latest total foreground duty cycle P75=(P75*(P76-1)+P74)/P76 ; Averaged total foreground duty cycle CLOSE Background Cycle Time There are two timer registers important to evaluate the time required to execute a ba
Turbo PMAC User Manual The internal format of 48-bit floating-point registers is shown in the following table: X-word: Bit: Part: Val: Bit: Part: Val: 23 Mant -20 11 Mant +2-12 22 Mant +2-1 10 Mant +2-13 21 Mant +2-2 9 Mant +2-14 20 Mant +2-3 8 Mant +2-15 19 Mant +2-4 7 Mant +2-16 18 Mant +2-5 6 Mant +2-17 17 Mant +2-6 5 Mant +2-18 16 Mant +2-7 4 Mant +2-19 15 Mant +2-8 3 Mant +2-20 14 Mant +2-9 2 Mant +2-21 13 Mant +2-10 1 Mant +2-22 12 Mant +2-11 0 Mant +2-23 22 Mant +2-25 10 Exp +210 21 Ma
Turbo PMAC User Manual Addresses Turbo PMAC uses a Motorola DSP563xx as its processor. The DSP563xx has dual 24-bit address spaces (of which 19 bits are used by the Turbo PMAC) for memory and I/O. (Note that the I/O in Turbo PMAC is memory-mapped; it does not have a separate I/O space as your PC does.) When specifying an address in Turbo PMAC, you 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.
Turbo 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+5 I(P1*100+20)=10 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 automatically rolled over to within the range by modulo arithmetic (truncation).
Turbo PMAC User Manual If a command consisting simply of a constant value is sent to Turbo PMAC, Turbo PMAC assigns that value to variable P0 (unless a special table buffer such as a compensation table or stimulus table has been defined but not yet filled – in that case the constant value will be entered into the table. For example, if the command 342 is sent to Turbo PMAC, it will interpret it as P0=342.) This capability is intended to facilitate simple operator terminal interfaces.
Turbo PMAC User Manual When accessing a Q-variable from a motion program statement (including kinematic subroutines), the Qvariable belonging to the coordinate system running the program is being used. If a different coordinate system runs the same motion program, it will use different Q-variables. When accessing a Q-variable from a PLC program statement, the Q-variable for the coordinate system that has been addressed by that PLC program with the ADDRESS command is being used.
Turbo PMAC User Manual L: DP: F: TWD: TWB: TWS: TWR: *: 48 bits floating-point across both X- and Y-memory 32 bits fixed-point (low 16 bits of X and Y) (for use in dual-ported RAM) 32 bits floating-point (low 16 bits of X and Y) (for use in dual-ported RAM) Multiplexed BCD decoding from Thumbwheel port Multiplexed binary decoding from Thumbwheel port Multiplexed serial I/O decoding from Thumbwheel port Multiplexed serial resolver decoding from Thumbwheel port No address definition; uses part of the definit
Turbo PMAC User Manual the M-variables are instantaneous servo variables, there is no guarantee that M16 or M17 will have the same value in both places in the expression or that the values for M16 and M17 will come from the same servo cycle. The first problem can be overcome by setting P1=M16 and P2=M17 right above this, but there is no general solution to the second problem.
Turbo PMAC User Manual Logical Operators Turbo 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 these default precedence levels.
Turbo PMAC User Manual Variable Value Assignment Statement This type of statement calculates and assigns a value to a variable. When a value assignment statement is sent to Turbo PMAC, if a program buffer is open, the statement is added to the buffer. If not, it is executed immediately. The standard assignment syntax is: {variable name}={expression} where {variable name} specifies which variable is to be used, and {expression} represents the value to be assigned to the variable.
Turbo PMAC User Manual Note: With synchronous assignment, the actual assignment is performed where the blending to the new move begins, which is generally ahead of the programmed point. In LINEAR and CIRCLE mode moves, this blending occurs V*TA/2 distance ahead of the specified intermediate point, where V is the commanded velocity of the axis, and TA is the acceleration (blending) time. Also, note that the assignment is synchronous with the commanded position, not necessarily the actual position.
Turbo PMAC User Manual Synchronous Assignment of Other Variables Only M-variables can be used in these synchronous assignments, but M-variables can be assigned to the registers of any other variables (I, P, or Q), so these synchronous assignments can be used effectively on other variable types as well. Refer to the detailed memory map for addresses of other variables.
Turbo PMAC User Manual Note: <= and >= are not valid Turbo PMAC comparators. The comparators !> and !<, respectively, should be used in their place. Conditions A condition can be used to control program flow in motion or PLC programs. It is evaluated as either true or false. It can be used in an IF branching statement or WHILE looping statement. Turbo PMAC supports both simple and compound conditions. Note: A condition in a command line – IF or WHILE – must be surrounded by parentheses.
Turbo PMAC User Manual In Turbo PMAC rotary program buffers single-line condition actions are the only types of conditional statements permitted. Multiple-line conditions are not permitted because it cannot be guaranteed that the line that must be jumped to will be in the rotary buffer at that time. Multiple-Line Conditions In Turbo PMAC PLC programs (but not in motion programs) compound conditions over several program lines are allowed.
Turbo PMAC User Manual PMAC Program Mathematical Calculations For All Motion and PLC Programs Except Fixed-Point Compiled PLC Lines 1 1 Intermediate Working Form: 48-Bit Floating Point 4 4 (PMAC Handles all type conversions automatically) 8 X 12 S G N 16 1 2 1 4 1 8 20 8 Y ...
Turbo PMAC User Manual SETTING UP A COORDINATE SYSTEM Once you have set up your motors, gotten them well tuned, and are doing controlled jogging and homing search moves, you will want to assemble one or more coordinate systems from the motors so that you can run motion programs. Turbo PMAC has several methods of coordinating multiple motions, whether they are all under Turbo PMAC’s direct control or not.
Turbo PMAC User Manual Multiple-Motor Axes More than one motor may be assigned to the same axis in a coordinate system. This is common in gantry systems, where motors on opposite ends of the cross-piece are always trying to do the same movement. By assigning multiple motors to the same axis, a single programmed axis move in a program causes identical commanded moves in multiple motors. This is commonly done with two motors, but up to eight motors have been used in this manner with Turbo PMAC.
Turbo 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 Axes 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.
Turbo PMAC User Manual Rotary Axes A rotary axis is one that permits rollover, but cannot be assigned to combinations of motors. A rotary axis must be named A, B, or C. The rollover is technically a motor function, specified by Ixx27 for Motor xx, but it can only operate when the motor is assigned to a rotary axis. Rollover permits the motor to take the shortest path around the rotary range, or the specified direction to the destination, when an absolute axis move is specified in a program.
Turbo PMAC User Manual The PMATCH function assumes that the position referencing – either a homing search move or an absolute position-sensor read – has been done for each motor in the coordinate system. Each motor has a home complete status bit that is set true if either has been done, and to check for this, do it at the application level.
Turbo PMAC User Manual Note: Formal robotic analysis makes a distinction between joint position, and the actuator positions required for that joint position. Usually, while the two positions are the same, there are cases, such as when two motors drive a joint differentially, where there is an important difference.
Turbo PMAC User Manual Reserved Variables If kinematic calculations are used in a system, the global variables P1 – P32 and the coordinate-system variables Q1 – Q10 should not be used for any other purposes, because Turbo PMAC will write to these variables automatically in executing the kinematic routines. (Q10 is used to distinguish between inversekinematic calculations that involve velocity calculations and those that do not, as explained below.
Turbo PMAC User Manual The forward-kinematic program must calculate the axis positions for all of the axes in the coordinate system, whether or not all of the motor positions are calculated in the inverse-kinematic program (see below). For instance, if this arm had a vertical axis at the tip with a normal axis definition statement in C.S.
Turbo PMAC User Manual Creating the Inverse-Kinematic Program The on-line OPEN INVERSE command opens the inverse-kinematic buffer for the addressed coordinate system for entry. The on-line CLEAR command erases any existing contents of that buffer. Subsequently, any math or logic program command sent to Turbo PMAC that is legal for a PLC program (this does not include ADDRESS, DISPLAY, CMDx, or SENDx) will be entered into the open buffer. The on-line CLOSE command stops entry into the buffer.
Turbo PMAC User Manual To implement these equations in a Turbo PMAC inverse-kinematic program for Coordinate System 1 that converts the X and Y tip coordinates in millimeters to the shoulder angle in Motor 1 and the elbow angle in Motor 2, the following program could be used. System constants Q91, Q92, and Q93 are the same as for the above forward kinematic program.
Turbo PMAC User Manual Rotary Axis Rollover If a rotary inverse-kinematic axis in the system has the capability to “roll over,” the inverse-kinematic program must handle the rollover calculations explicitly. The automatic rollover capability of the A, B, and C axes with Ixx27 is not available for inverse-kinematic axes. The key to handling rollover properly is to take the difference between the new and the old values and make sure that this difference is in the +180o range.
Turbo PMAC User Manual Turbo PMAC will also set Q10 to 1 in this mode as a flag to the inverse-kinematic program that it should use these axis (tip) velocity values to compute motor (joint) velocity values. In this mode, after any execution of the inverse-kinematic program, Turbo PMAC will read the values in those variables P1xx (P101 – P132) for each Motor xx in the coordinate system defined as inversekinematic axes (#xx->I).
Turbo PMAC User Manual Coordinate System Transformations with Kinematics A coordinate system established with kinematic algorithms can still use the on-line {axis}= and buffered PSET translations of the axis programming origins, just as for a coordinate system with standard axis definition statements.
Turbo PMAC User Manual When the inverse-kinematic program is executed only at programmed end-points, as in RAPID mode, all interpolation occurs in joint space. In this case, the path of the tip from point to point is not well defined if the programmed end-points are far apart, and in general it will not be a straight line. When the inverse-kinematic program is executed at each intermediate segment boundary, the coarse interpolation (segmentation) is done in tip space, so the path is well defined.
Turbo PMAC User Manual Each coordinate system has a variable Isx93 that contains the address of the register that the coordinate system uses for its time base. With the default value of Isx93, the coordinate system gets its time base information from a register that is set by % commands from the host computer. A %100 command puts a value equal to I10 in this register; a %50 command puts a value equal to I10/2 in this register.
Turbo PMAC User Manual 270 Setting Up a Coordinate System
Turbo PMAC User Manual WRITING AND EXECUTING MOTION PROGRAMS Motion programs are Turbo PMAC’s chief mechanism for describing the desired motion with the associated math, logic, and I/O operations. They provide a simple, yet powerful and flexible means for describing the motion and operations synchronous to that motion. Turbo PMAC can hold up to 224 motion programs at one time.
Turbo PMAC User Manual Modal Commands Many of the statements in Turbo PMAC motion programs are modal in nature. These include move modes, which specify what type of trajectory a move command will generate; this category includes LINEAR, RAPID, CIRCLE, PVT, and SPLINE. Moves can be specified either incrementally (distance) or absolutely (location) – individually selectable by axis – with the INC and ABS commands. Move times (TA, TS, and TM) and/or speeds (F), are implemented in modal commands.
Turbo PMAC User Manual The units of the TM time are milliseconds; the units of the F velocity are the user length (or angle) units of the feedrate axes divided by the time units as defined by coordinate system variable Isx90 in milliseconds. If Isx90 is at the default value of 1000, the F units are length units per second; if Isx90 is set to 60,000, the F units are length units per minute. If no F or TM value is specified after power-up/reset, the value of Isx89 is used for the moves as a feedrate value.
Turbo PMAC User Manual This velocity limiting is active either if segmentation mode is not active (Isx13 = 0), in which case circular interpolation and cutter-radius compensation are not permitted, or if segmentation mode is active (Isx13 > 0) and the special lookahead buffer is active (Isx20 > 0, defined lookahead buffer). If the velocity limits are active, Turbo PMAC compares the motor velocity magnitudes requested by the motion program to the Ixx16 limit for each motor.
Turbo PMAC User Manual AUTOMATIC "S" CURVE ACCELERATION SPECIFY t ACCEL AND t S 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) for comparison t L = t ACCEL - 2tS t tL S t 4 S MAX.
Turbo PMAC User Manual This section covers the acceleration limiting algorithms of Mode 1 only. The acceleration limiting function of the special lookahead buffer (Mode 3) is discussed in a manual section devoted to that function, below. If the acceleration calculated from the motion exceeds the maximum programmed acceleration (set by 2 Ixx17 in counts/msec ) for any motor involved in the move, the acceleration for all motors in the move is decreased in proportion so that no motor exceeds this limit.
Turbo PMAC User Manual Maximum Move Time 23 The maximum time for one programmed move is 2 -1 (8,388,607) msec, approximately 2 hours and 20 minutes. This is the maximum value that Turbo PMAC will accept with a TM command. It is also the maximum value Turbo PMAC will compute for a feedrate-specified move when it divides the vector distance for the move by the feedrate.
Turbo PMAC User Manual Linear Mode Trajectories Small acceleration time V TA TM or ∆P/F TM or ∆P/F TM or ∆P/F TM or ∆P/F TA time V TA TA TM or ∆P/F TM or ∆P/F TA time V TA TA TA time V TA TA 278 TA TM or ∆P/F TA TM or ∆P/F time Writing and Executing Motion Programs
Turbo PMAC User Manual Linear Mode Trajectories Acceleration time matches move time V TM or ∆ P/F TM or ∆ P/F time V TA TM or ∆ P/F TA time TA V TM or ∆ P/F TA TM or ∆ P/F TA time TA V TM or TA ∆ P/F TM or ∆ P/F time TA TA Writing and Executing Motion Programs TA 279
Turbo PMAC User Manual Linear Mode Trajectories Large (velocity limiting) acceleration time V TM or ∆P/F TA time TA V TM or ∆P/F TM or ∆P/F TA TA time TA V TM or TA 280 ∆P/F TM or TA ∆P/F time TA Writing and Executing Motion Programs
Turbo PMAC User Manual Linear Mode Trajectories 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 Writing and Executing Motion Programs TM2 TA2 TA2 time 281
Turbo PMAC User Manual Circular Blended Moves Note: In order for Turbo PMAC to do circular moves, coordinate-system parameter Isx13 must be greater than zero. See below for details. Turbo PMAC allows circular interpolation on the X, Y, and Z-axes in a coordinate system. As with linear blended moves, TA and TS control the acceleration to and from a stop, and between moves. Circular blended moves can be either feedrate-specified (F) or time-specified (TM), just as with linear moves.
Turbo PMAC User Manual CIRCULAR INTERPOLATION +Z +Z CW CW +X NORMAL K-1 +Y +X NORMAL K1 +Z +Y +Z CW +X +Y +X CW +Y NORMAL J-1 NORMAL J1 +Z +Z CW +X CW +X +Y NORMAL I-1 +Y NORMAL I1 NORMAL VECTORS FOR CIRCULAR MOVES: THE PLANES AND CLOCK WISE ARCS THEY DEFINE Center Vector If the vector method of locating the arc center is used, the vector is specified by its I, J, and Kcomponents (I specifies the component parallel to the X axis, J to the Y axis, and K to the Z-axis).
Turbo PMAC User Manual ; Arc move; I=20-0=20; J=0-0=0 X20 Y20 I20 J0 LINEAR X40 Y20 CIRCLE1 X20 Y0 I0 J-20 ; Arc move; I=40-40=0; J=0-20=-20 PMAC END (25,30) Y NORMAL K-1 DefaultsABS (X,Y) INC (R) CIRCLE1 F10 X25Y30I20J5 Y CENTER (30,10) START (10,5) X Y I J I X X Y CIRCLE2 TM1000 X15Y10I-10 START CENTER (25,20) (15,20) END (15,10) Y X Y J Y CIRCLE1 F25 X30Y10I-10J10 or I-10J10 CENTER (20,20) I START,END (30,10) END (0,10) 2 CIRCLE2 TM2000 X0Y10R-10 2 1 X X 1 CIRCLE2 TM2000
Turbo PMAC User Manual No Center Specification If there is neither a vector specification nor a radius specification on a given move command line, the move will be linearly interpolated between start and end points, even if the program is in circular move mode. However, cutter compensation will not work properly if this is done. LINEAR move mode must be explicitly declared if cutter compensation is on.
Turbo PMAC User Manual Rapid-Mode Moves Rapid-mode moves provide for minimum-time point-to-point moves, subject to pre-defined motor constraints. These moves are essentially jog moves for each motor assigned to an axis specified in the move.
Turbo PMAC User Manual No Blending A rapid-mode move is never blended with another move at the programmed end-point; all motors will be commanded to at least a momentary stop before the next move is commanded to start. However, unlike in other modes, rapid-mode moves may be broken into at arbitrary points along the trajectory to change to a different destination. This can be implemented with the move-until-trigger and altered-destination functions described below.
Turbo PMAC User Manual All motors must come to a stop, either at the originally specified position, or at the post-trigger position, before Turbo PMAC will calculate any further in the motion program. This means that there is no blending of the post-trigger move into any subsequent moves. The captured value of the sensor position at the trigger is stored in a dedicated register if later access is needed. The units are in counts; for incremental encoders, they are relative to the power-up/reset position.
Turbo PMAC User Manual If a RAPID-mode move is in progress when the command is issued, Turbo PMAC will extend the current trajectory of each motor for Ixx92 milliseconds. At that point, it will break into the trajectory of each motor, compute a smooth blending for each motor to the RAPID-mode trajectory toward the new destination, and execute the modified trajectory.
Turbo PMAC User Manual Turbo PMAC computes intermediate “way-points” WPi for each axis for each point along the spline by taking a weighted average of the specified point Pi and the specified points on either side. For the uniform spline, this is done according to the equation: P + 4 Pi + Pi +1 WPi = i −1 6 Turbo PMAC also computes the velocity Vi for each axis at each way-point along the spline.
Turbo PMAC User Manual Cubic Spline Trajectories V V TA (added) TA TA (added) time TA (added) TA TA (added)time TA Two Programmed Segments One Programmed Segment V TA (added) TA TA TA TA (added) time Three Programmed Segments V TA (added) TA TA TA TA (added) time TA Four Programmed Segments SPLINED MOVES All segments same time If segment were done at constant velocity: etc. VEL Vc = No velocity or acceleration discontinuities at segment boundaries P TA etc.
Turbo PMAC User Manual PVT-Mode Moves For the user who desires more direct control over the trajectory profile, Turbo PMAC offers PositionVelocity-Time (PVT) mode moves. In these moves, you specify the axis states directly at the transitions between moves (unlike in blended moves). This requires more calculation by the host, but allows tighter control of the profile shape. For each piece of a move, you specify the end position or distance, the end velocity, and the piece time.
Turbo PMAC User Manual PVT Segme nt Shapes Vel V Vel V ∆P=1/2 Vt ∆P=1/3 Vt t Time Vel t Time t Time 2t Time Vel V V ∆P=2/3 Vt ∆P=Vt t Time Vel Vel V2 V V V/2 ∆P =1/6 Vt 1 ∆ P =5/6 Vt ∆P=1/2(V +V ) t 1 2 2 t Time t Use of PVT in Contouring PVT mode provides excellent contouring capability, because it takes the interpolated commanded path exactly through the programmed points. It creates a path known as a Hermite Spline.
Turbo PMAC User Manual Cutter Radius Compensation Turbo 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 automatically offsets the described path of motion perpendicular to the path by a programmed amount, compensating for the size of the tool.
Turbo PMAC User Manual This same command also specifies the plane for circular interpolation. NORMAL K-1 is the default. The compensation plane should not be changed while compensation is active. Other common settings are NORMAL J-1, which specifies the ZX-plane for compensation, and NORMAL I-1, which specifies the YZ-plane. These three settings of the normal vector correspond to RS-274 Gcodes G17, G18, and G19, respectively.
Turbo PMAC User Manual Introducing Compensation – Inside Corner Line Programmed Path r Line Arc Line Arc Line CC2 Programmed Path r Tool Center Path Line Tool Center Path Line CC2 Line to Line Line to Arc Line Programmed Path r Arc Tool Center Path Line Arc Arc Spiral Spiral Programmed Path r Arc Tool Center Path CC2 CC2 Arc to Line Arc to Arc Outside Corner Introduction If the lead-in move and the first fully compensated move form an outside corner, the lead-in move first moves
Turbo PMAC User Manual Note that the behavior for lead-in moves is different from changing the compensation radius from zero to a non-zero value while compensation is active. An arc move is always added at the corner, regardless of the setting of Isx99. This ensures that the lead-in move never cuts into the first fully compensated move.
Turbo PMAC User Manual Sharp Outside Corner If the cosine of the change in directed angle is less than Isx99, which means the corner is sharper than the specified angle, then an arc move will be added around the outside of the corner.
Turbo PMAC User Manual When coming to a full stop (e.g. Step, Quit, /, or DWELL) at an outside corner with an added arc, Turbo PMAC will include the added arc move before stopping. When coming to a full stop at an outside corner without an added arc, Turbo PMAC will stop at the compensated, but unblended, corner point.
Turbo PMAC User Manual Failure When Compensation Extends Full Circle Tool Center Path 1 1 r Programmed Path r 2 r Short Arc Executed Compensated Circle “Skipped” 3 2 Programmed Full Circle Speed of Compensated Moves Tool center speed for the compensated path remains the same as that programmed by the F parameter. On an arc move, this means that the tool edge speed (the part of the tool in contact with the part) will be different from that programmed by the fraction Rtool/Rarc.
Turbo PMAC User Manual However, if there is no intersection between the two compensated move paths, the change is introduced linearly over the next move.
Turbo PMAC User Manual Outside Corner If the last fully compensated move and the lead-out move form an outside corner, the last fully compensated move ends at a point one cutter radius away from the intersection of the last fully compensated move and the lead-out move, with the line from the programmed point to this compensated point being perpendicular to the path of the fully compensated move at the intersection.
Turbo PMAC User Manual • Program logic causes a break in blending moves (e.g. looping twice through a WHILE loop).
Turbo PMAC User Manual With this buffer defined for the coordinate system, if Turbo PMAC encounters one or more moves perpendicular to the plane of compensation while compensation is active, these moves will be stored in the CCBUF temporarily while the next move in the plane is found, so the intersections can be computed correctly.
Turbo PMAC User Manual Three-Dimensional Cutter Radius Compensation Turbo PMAC provides the capability for performing three-dimensional (3D) 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 (even if the motors assigned to the axes are not).
Turbo PMAC User Manual Until a surface-normal vector is declared explicitly with 3D compensation active, no actual compensation will occur. A tool-orientation vector must also be declared for compensation to work on anything other than a ball-nose cutter. Turning Off 3D Compensation 3D cutter compensation is turned off by the buffered motion program command CC0, just as for 2D compensation. Compensation will be removed over the next LINEAR or CIRCLE mode move after compensation has been turned off.
Turbo PMAC User Manual How 3D Compensation is Performed In operation, Turbo PMAC starts from the uncompensated X, Y, and Z-axis positions for each end-point programmed while 3D compensation is active. Then two offsets are applied to the X, Y, and Z-axis positions. The first offset is taken along the surface-normal vector, of a magnitude equal to the tip radius.
Turbo PMAC User Manual Because of the nature of the lookahead calculations – trajectory calculations are done well in advance of the actual move execution, and moves are kept within machine limits by the automatic adjustment of move speeds and times – they are not appropriate for some applications. Any application requiring quick reaction to external conditions should not use lookahead.
Turbo PMAC User Manual The next diagram shows how the lookahead function can create a deceleration into a tight corner automatically, permitting the corner to be taken slowly to keep it within acceleration constraints, and then to accelerate back up to the programmed speed coming out of the corner. This permits the user to command high speeds, and to have Turbo PMAC slow down the path only where needed.
Turbo PMAC User Manual 10. If the application involves high block rates, set the Isx87 default acceleration time to the minimum block time in msec; the Isx88 default S-curve time to 0. 11. If the application does not involve high block rates, set the Isx87 default acceleration time and the Isx88 default S-curve time parameters to values that give the desired blending corner size and shape at the programmed speeds. 12.
Turbo PMAC User Manual In this mode, if the lookahead algorithm, while scanning ahead in the programmed trajectory, determines that any motor in the coordinate system would exceed one of its desired position limits, it will suspend the program and force a stop right at that limit. It will then work backwards through the buffered trajectory segments to bring the motors to a stop along the path at that point in the minimum time that does not violate any motor’s Ixx17 acceleration constraint.
Turbo PMAC User Manual If the algorithm, while looking ahead in the programmed trajectory, determines that any motor in the coordinate system is being asked to violate its acceleration limit, it will slow down the trajectory at that point just enough so that no limit is violated. It will then work backwards through the buffered trajectory segments to create a controlled deceleration along the path to this limited speed in the minimum time that does not violate any motor’s Ixx17 acceleration constraint.
Turbo PMAC User Manual 100 2 Error = mm 2 * 0.01 2 sec 2 sec 2 = 0.003mm = 3 µm 6 * 50 mm If the programmed path itself introduces path error, such as the chordal error of linear interpolation, this must be added to the error budget as well. In addition, if the servo-loop execution adds servo errors, these must also be included.
Turbo PMAC User Manual Lookahead Length Parameter Variable Isx20 for the coordinate system tells the algorithm how many segments ahead in the program to look. This value is a function of the number of segments that must always be correct in the lookahead buffer (SegmentsNeeded). The formula is: Isx 20 = 4 * SegmentsNeeded 3 Setting Isx20 to a value larger than needed does not increase the computational load (although it does increase the time of heaviest computational load while the buffer is filling).
Turbo PMAC User Manual This size of the buffer for these assignments must be at least as great as the largest number of assignments expected during the time for lookahead. There is no penalty for reserving more memory for these synchronous M-variable assignments than is needed, other than the loss of this memory for other uses. Note: The buffer reserved in this manner for synchronous M-variables under lookahead is distinct from the fixed-size buffer used for synchronous M-variables without lookahead.
Turbo PMAC User Manual First, the programmed acceleration time, which is the larger of TA or 2*TS, is the minimum move-block time. If PMAC initially computes a smaller move time, typically as (vector-distance divided by vectorfeedrate), it will increase the time to be equal to the acceleration time, slowing the move. This check occurs even before lookahead (which can only slow the move further), and it is an important protection against computational overload.
Turbo PMAC User Manual 5000 2 Error = mm 2 min 2 * * 0.002 2 sec 2 min 2 3600 sec 2 = 1.39 × 10 −6 mm = 1.39 nm 2 * 100 2 mm 2 Feedrate Override All lookahead calculations are performed assuming a feedrate override value of 100%. If the feedrate override value, from whatever source, changes from 100%, the velocity and acceleration calculations will be incorrect. True velocity values vary linearly with the override value; true acceleration values vary with the square of the override value.
Turbo PMAC User Manual The \ command is the best command to use to stop interactively within lookahead operation with the intention of resuming operation. Any synchronous M-variable assignments set to happen within the deceleration will execute. Motors may be jogged away from this stop point, if desired. Also, motion can be reversed along the path with the < command (see Reversal, below).
Turbo PMAC User Manual Abort The A abort command breaks into the executing trajectory immediately, and brings all motors in the coordinate system to a controlled stop, each at its own deceleration rate as set by Ixx15 for the motor. The stop is not necessarily at a programmed point (and probably will not be), and it is not necessarily even along the programmed path (and probably will not be).
Turbo PMAC User Manual • • • • • A DWELL point A RAPID, SPLINE, or PVT-mode move A homing-search move A point where the program was stopped with a /, Q, or S command. A point where blending was stopped for any other reason (e.g. Isx92=1, double jump-back) Remember that a DELAY command in a motion program does not disable blending, so it is possible to reverse execution through a DELAY point.
Turbo PMAC User Manual [X'] [R11 [Y'] = [R21 [Z'] [R31 R12 R22 R32 R13] [X] [D1] R23] [Y] + [D2] R33] [Z] [D3] The base X, Y, and Z coordinates are those defined by the axis definition statements. Those statements may or may not incorporate a matrix relationship between the axes and motors. If there is a matrix relationship in the definition statements, these matrix operators will act “on top” of that relationship.
Turbo PMAC User Manual Note: When using axis matrix transformation for scaling, do not use the R radius specification for circular interpolation because the radius will not scale with the axes. Use the IJK center vector specification instead.
Turbo PMAC User Manual Second Rotation Example To rotate the coordinate system 15 degrees in the XY plane, as in the first rotation example, but about an arbitrary point (P1, P2) instead of the origin. In this case the rotation matrix is the same as for a rotation about the origin, but a displacement vector is also required.
Turbo PMAC User Manual A CLOSE DELETE GATHER OPEN PROG n CLEAR {program statements} CLOSE After the program has been downloaded and the buffer CLOSEd, a coordinate system that is to execute this program must be pointed to the program with the B command. For example, B6 would point the addressed coordinate system’s program counter to the beginning of motion program 6. This can be confirmed with the PC (program counter) query command, which should return P6:0 if it is pointing to the top of program 6.
Turbo PMAC User Manual The F (feedrate) statement specifies a speed, the X statements command actual moves for the X-axis, and the DWELL statement commands a halt for the specified time. This program simply specifies a basic move and return. Defaults A program this simple relies on quite a few default settings and modes. This one uses the following defaults: LINEAR move mode, ABS (absolute) axis specification, with Isx87 and Isx88 specifying the TA and TS acceleration times, respectively.
Turbo PMAC User Manual Line Labels It is possible to put line labels in your motion program to mark particular sections of the program. The syntax for a line label is N{constant or O{constant}, where {constant} is an integer from 1 to 262,143. Note that these are line labels, not line numbers (even though they are specified by number). A line does not require a label; and the labels do not need to be in numerical order.
Turbo PMAC User Manual Passing Arguments to Subroutines These subprogram calls are made more powerful by use of the READ statement. The READ statement in the subprogram can go back up to the calling line and pick off values (associated with other letters) to be used as arguments in the subprogram. The value after an A would be placed in variable Q101 for the coordinate system executing the program, the value after a B would be placed in Q102, and so on (Z value goes in Q126).
Turbo PMAC User Manual Once PMAC has encountered a PRELUDE1 command in the program, it will execute the specified subprogram call each time it encounters a move command or other letter-number command in the motion program (including G, M, T, and D codes, but excluding N and O line labels). The move command or letter-number command must be at the beginning of a program line, or immediately following an N or O line label at the beginning of a program line.
Turbo PMAC User Manual Turbo PMAC will reject a run or step command for any of the following reasons: • A motor in the coordinate system has both overtravel limits tripped (ERR010) • A motor in the coordinate system is currently executing a move (ERR011) • A motor in the coordinate system is not in closed-loop control (ERR012) • A motor in the coordinate system in not activated {Ix00=0} (ERR013) • There are no motors assigned to the coordinate system (ERR014) • A fixed (non-rotary) motion program buffer is
Turbo PMAC User Manual CLEAR RAPID I5193=$2000 RETURN ; To erase old version when sending new ; First actual line of program G01 – Linear Interpolation Mode Typically, this code is implemented in PMAC through use of the LINEAR command. The simplest implementation of this is N01000 LINEAR RETURN. 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.
Turbo PMAC User Manual You may also want to set some variables in these routines to note what plane has been specified if you want to use this information for other routines (such as G68 rotation). Turbo PMAC’s circular interpolation and radius compensation routines do not need such a variable. G40, G41, G42 – Cutter Radius Compensation Cutter radius compensation can be turned on and off easily with the CC0, CC1, and CC2 PMAC commands, corresponding to G40, G41, and G42, respectively.
Turbo PMAC User Manual G94 – Inches (Millimeters) per Minute Mode This code sets up the program so that F-values (feedrate) are interpreted to mean length units (inches or mm) per minute. In PMAC, F-values are interpreted to mean a speed (length per time) where the length units are set by the axis definition statements, and the time units are set by the coordinate system variable Isx90. Since the units of Isx90 are milliseconds, this routine should set Isx90 to 60,000.
Turbo PMAC User Manual G96 – Constant Surface Speed Mode Enable This code sets up the programs so that the spindle is put in constant surface speed (CSS) mode. In this mode, the spindle angular velocity is varied in real time so that its surface speed past the tool tip remains constant. Essentially, this means that the angular velocity of the spindle is inversely proportional to the radial distance of the tool tip from the spindle center.
Turbo PMAC User Manual Open-Loop Spindle If using the open loop spindle, write directly to an otherwise unused DAC output register by using a Mvariable. For instance, the definition M425->Y:$C00A,8,16,S matches the variable M425 to the DAC4 output register. Any value given to this M-variable will cause a corresponding voltage on the DAC4 output line. In this method, a spindle-on command (see M03, M04) could be M425=P10 or M425=-P10, where P10 has been set previously by an S-code.
Turbo PMAC User Manual M02 – End of Program Since PMAC automatically recognizes the end of a program, and resets the program pointer back to the top of the program, the routine for this code could be empty (RETURN statement only). However, in many systems, a lot of variables and modes get set to default values here.
Turbo PMAC User Manual M07 – Low-Level (Mist) Coolant On M08 – High-Level (Flood) Coolant On M09 – Coolant Off The actual implementation of these M-codes will be very machine dependent, but it will typically be very simple. For instance, if the coolant on/off control were wired into Turbo PMAC’s Machine Output 7, and the coolant high/low control were wired into Turbo PMAC’s Machine Output 8, the routines could simply be: N07000 M7=1 M8=0 RETURN N08000 M7=1 M8=1 RETURN N09000 M7=0 RETURN ; Set Mach. Out.
Turbo PMAC User Manual Rotary Motion Program Buffers The rotary motion program buffers allow for the downloading of program lines during the execution of the program and for the overwriting of already executed program lines. This permits continuous execution of programs larger than PMAC’s memory space, and also real-time downloading of program lines. Defining a Rotary Buffer Each coordinate system can have a rotary program buffer.
Turbo PMAC User Manual Staying Ahead of Executing Line The key to the handling of a rotary program buffer is knowing how many lines ahead it is; that is, how many program lines have been loaded ahead of the program line that PMAC is executing. Typically it will load ahead until a certain number of lines ahead is reached, and then wait until the program catches up to within a smaller number of lines ahead.
Turbo PMAC User Manual How PMAC Executes a Motion Program It can be important to know how Turbo PMAC works its way through a motion program. A motion program differs fundamentally from a typical high-level computer program in that it has statements (moves, DWELLs, and DELAYs) that take time; there is an important difference between the calculation time and the execution time.
Turbo PMAC User Manual PMAC Motion Program Precalculation A. Two moves ahead LINEAR with I13=0 SPLINE1 Execute Calculate I11 2 3 B. One move ahead LINEAR with I13>0 CIRCLE, PVT Execute 4 4 5 6 2 3 4 3 4 5 time 1 "R" I11 Calculate 3 1 "R" 1 2 1 2 time C.
Turbo 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, Turbo PMAC waits until that operation is finished before it starts calculations on the next move or two moves. During any of these breaks, Turbo PMAC will use the I11 calculation time to delay the start of the next move.
Turbo PMAC User Manual The first 360 pieces will be blended (splined) together on the fly as Turbo 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.
Turbo PMAC User Manual 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. This is a flag to PMAC to hold off the actual execution of the statement until the beginning of the move immediately following it, so the actual action coincides with the actual motion.
Turbo PMAC User Manual 344 Writing and Executing Motion Programs
Turbo PMAC User Manual SYNCHRONIZING TURBO PMAC TO EXTERNAL EVENTS Turbo PMAC has several powerful features to help in synchronizing the motion under Turbo 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 useful for registration applications Position compare, which can be used for precision scanning and measurement applications.
Turbo PMAC User Manual PMAC Position Following Motor Commanded Position Master Position follows Ix07 ∆ CPn = Ix08 ∆ MPn Ix08 ∆ CPn = Ix07 ∆ MPn With 1/T: 32 Ix08 ∆ CPn= 32 Ix07 ∆ MPn ∆ MPn ∆ CPn Ix08 Ix07 Master Follower Mechanical Analogy Changing Ratios on the Fly To vary the following ratio in the middle of an application, change Ixx07 alone. Ixx08 is involved in the scaling of servo feedback calculations, and so should not be changed in the middle of an application.
Turbo PMAC User Manual Use for Cascaded Loops Offset-mode following can be very useful for the implementation of cascaded servo loops. The output of the outer loop is used as the master position for the inner position loop (and not sent directly to an actuator). In this mode of operation, typically, the inner loop is a standard position loop; the outer loop closes a loop on force or tool height, or some other process variable.
Turbo PMAC User Manual Constraints on Selection of RTIF If Turbo PMAC had infinite resolution and infinite dynamic range in its time base calculations, the choice of real-time input frequency would be entirely arbitrary –any frequency can be selected as the RTIF, and the motion program can be written for that RTIF. However, Turbo PMAC does its time-base calculations in integer arithmetic, which limits the resolution, and in 24-bit registers, which limits the dynamic range.
Turbo PMAC User Manual Step 2: Interpolation Once decoded and counted, the value from the signal is brought into the encoder conversion table once per servo cycle, exactly as a position feedback signal would be. Using the 1/T conversion method here is highly recommended; because this method gives a very good sub-count interpolation of the signal (using timers associated with the counter) that significantly enhances the smoothness of the time base information.
Turbo PMAC User Manual For instance, if the table started with eight 1/T entries (using I8000 – I8007), and the time-base entry followed using I8008 and I8009, the resulting time base value would be in the X-register accompanying I8009 (address X:$350A). To use this value as the time base for Coordinate System 1, issue the command I5193=$350A (specifying the address directly), or I5193=@I8009 (specifying the address through the location of the I-variable). Both commands yield the same result.
Turbo PMAC User Manual $078318 $0 $0 Referring to the detailed description of the I8000 variables in the Software Reference Manual, notice that this table processes all four encoder channels from Servo ICs 2 and 3 using 1/T extension, so the master encoder is processed. Step 3: Time-Base Calculation Now set up an entry in the table to convert the interpolated position to time base format.
Turbo PMAC User Manual Triggered Time Base The time-base techniques discussed so far keep the slave coordinate system locked perfectly to the master, but they do not provide a way of synchronizing to a particular point on the master. Thus, the slave cycle can be out of phase with the master cycle, and some special technique, usually involving position capture from a registration mark, must be used to bring the cycles in phase with each other.
Turbo PMAC User Manual These commands in the motion program are followed immediately by the calculations and commands for the first moves that are to be started on the trigger. With the time-base frozen, Turbo PMAC will perform all of the calculations, but not start actual execution of these moves. Variable I11 (calculation delay) should be set to 0, so Turbo PMAC will be ready to start the move as soon as the time base starts.
Turbo PMAC User Manual Motion program The motion program freezes the time base and calculates the first move. But actual execution of this move will not happen until the time base has been triggered. CLOSE OPEN PROG 12 CLEAR I5193=$350A DWELL0 M199=$9 LINEAR INC TA10 TS0 DELAY12.
Turbo PMAC User Manual Synchronizing Clock Signals over MACRO Ring If the multiple Turbo PMACs to be synchronized are Turbo PMAC2s on a common MACRO ring, the synchronization will be achieved automatically over the ring. In this case, each Turbo PMAC2 generates its own clock signals using MACRO IC 0 (so I6800, I6801, and I6802 control the frequency), but these signals are forced into full synchronization through use of the “sync packet” passed over the MACRO ring.
Turbo PMAC User Manual Synchronizing with External Time Base If synchronicity is desired in an application where axes on several cards are tied to an external frequency time base, the same frequency signal must be brought into encoder counters on all cards. If it is not also required to have complete synchronicity when on internal time base, there is no need to tie the Turbo PMAC clock signals together, because the external frequency will provide the common clock.
Turbo PMAC User Manual • • • • Set I8 to 0, which forces a real time interrupt every servo cycle. If not running a PLC 0, leave this at zero permanently. Begin your programs using R 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. Leaving I8 at 0 probably will cause PLC 0 to starve the background tasks for processor time, causing loss of communications or even a watchdog timer failure.
Turbo PMAC User Manual By having software setup for a hardware capture, Turbo PMAC gets the best of both worlds: the flexibility of software configuration, plus the immediacy and accuracy of hardware capture. It is possible to have one setup for homing and another for probing or registration, for example, both with the high accuracy of hardware capture, and the change requires no rewiring.
Turbo PMAC User Manual For PMAC2-style Servo ICs, the M-variable definitions for the position-capture flags are shown in the following table. With the standard assignment of channels to motors, the suggested M-variable for the flag for Motor xx is Mxx17.
Turbo PMAC User Manual For PMAC2-style Servo ICs, the M-variable definitions for the position-capture registers are shown in the following table: Servo IC # Channel 1 Channel 2 Channel 3 Channel 4 0 1 2 3 4 5 6 7 8 9 X:$078003,0,24,S X:$078103,0,24,S X:$078203,0,24,S X:$078303,0,24,S X:$079003,0,24,S X:$079103,0,24,S X:$07A203,0,24,S X:$07A303,0,24,S X:$07B203,0,24,S X:$07B303,0,24,S X:$07800B,0,24,S X:$07810B,0,24,S X:$07820B,0,24,S X:$07830B,0,24,S X:$07900B,0,24,S X:$07910B,0,24,S X:$07A20B,0,24,
Turbo PMAC User Manual Scaled properly, this value can be added to the whole-count capture register value, regardless of the direction of motion at the trigger.
Turbo PMAC User Manual Using the Position-Compare Feature on Turbo PMAC The Turbo PMAC has powerful position compare functions built into its Servo ICs, particularly with the PMAC2-style DSPGATE1 Servo ICs. The position-compare feature provides a fast and accurate digital output based on the actual position counter – when the hardware counter in the IC becomes equal to the compare register, the output toggles immediately. Often, this output is used to trigger a measurement device or to fire a laser.
Turbo PMAC User Manual 3. Compare output invert control bit: If this bit is set to 0, the off state is a low voltage out of the Servo IC, and the on state is a high voltage. (Depending on the output driver circuitry, the actual output from the card may be inverted from this.) If this bit is set to 1, the off state is a high voltage and the on state is a low voltage.
Turbo PMAC User Manual In addition, there is a memory-mapped status bit for the output that Turbo PMAC software can access with M-variables for its own use. If the Servo IC is on a Turbo PMAC, or directly connected to it, the registers and control/status bits are accessed with user-defined M-variables. If the Servo IC is on a MACRO Station, these registers and bits are accessed with pre-defined Station node-specific MI-variables for the MACRO node matched to this interface channel.
Turbo PMAC User Manual The single status bit is the compare output status, which reflects the state of the output at any instant. A 1 here indicates a high voltage out of the Servo IC; a 0 indicates a low voltage. Depending on the output driver used in a particular configuration, the voltage sense may be inverted out of the control card. There are no firmware functions for the automatic use of the position-compare circuitry.
Turbo PMAC User Manual B0 Starting Position A0 B1 A1 Auto-Increment Example: Starting from the above example, desiring the compare output on between 1000 (A0) and 1010 (B1) counts, but adding an auto-increment value of 2000 counts, with a starting position of about 100 counts, program code to start the sequence could be: M110=2000 M108=1000 M109=1010-M110 M112=0 M111=1 {Command to start the move} ; Auto-increment of 2000 encoder counts ; First front edge (A0) at 1000 counts ; First back edge (B1) at
Turbo PMAC User Manual Turbo PMAC’s high-resolution interpolation of sinusoidal encoders produces 4096 states per line, or 1024 states per hardware count (10 bits of fraction). However, Turbo PMAC’s servo software assumes there are only 5 bits of fractional count data in the positions it accesses. Therefore, a software count from an Acc-51 interpolator is 1/32 the size of a hardware count, yielding 128 software counts per line of the encoder.
Turbo PMAC User Manual The auto-increment function is still available in extended-count mode, but the auto-increment value is limited to integer numbers of counts. In operation in this mode, you write to both the standard (integer) compare register and the fractional compare register. In this mode, the integer value written to the compare register is offset by one count from the count value at which the compare output will toggle. The direction of this offset is dependent on the direction of motion.
Turbo PMAC User Manual The conversion from axis position to motor position involves a scale factor and an offset, with the following equation: MotorPosition = ScaleFactor * AxisPosition + Offset The scale factor is specified in the axis definition statement in counts per engineering unit. It should be constant for an application.
Turbo PMAC User Manual 370 Synchronizing Turbo PMAC to External Events
Turbo PMAC User Manual WRITING AND EXECUTING PLC PROGRAMS What are PLC Programs? Turbo PMAC has 64 PLC programs that operate asynchronously and with rapid repetition – 32 compiled PLC programs and 32 interpreted (uncompiled) PLC programs. They are called PLC programs because they perform many of the same functions as hardware programmable logic controllers. PLC programs have most of the same logical constructs as the motion programs, but no move-type statements.
Turbo 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 Turbo 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.
Turbo 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.
Turbo PMAC User Manual Notice that we had to make sure that P11 could follow M11 both up and down. We set P11 to 0 in a level-triggered mode. We could have done this edge-triggered as well, but it does not matter as far as the final outcome of the routine is concerned. It is about even in calculation time, and it saves program lines.
Turbo PMAC User Manual Note: M5187 is the Coordinate System In-Position bit as defined in the suggested Mvariable list. Precise Timing Since PLCs 1 to 31 are the lowest computation priority on Turbo PMAC, the cycle time cannot be precisely determined. To hold up an action for a fairly precise amount of time, a WHILE loop can be used, but instead of incrementing a variable, use an on-board timer.
Turbo PMAC User Manual A compiled PLC program is labeled PLCC n (PLC-Compiled #n) on Turbo PMAC. This distinguishes it from an interpreted PLC, which is simply labeled PLC n. There is no special relationship between the interpreted and compiled PLCs of the same number. 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.
Turbo PMAC User Manual For variables referencing fixed locations in Turbo PMAC’s memory and I/O space, the L-variables will simply replace M-variables, and the L-variable definition will be made exactly like the M-variable definitions. It is completely acceptable to retain the M-variable definition as well. You will probably want to retain the M-variable definitions for debugging purposes, because Turbo PMAC will not accept a query command for the value or definition of an L-variable.
Turbo PMAC User Manual It is possible to use L-variables for fast integer arithmetic while retaining the run-time flexibility of Mvariable definitions. (This does add the run-time definition-access computational penalty described above.) Instead of directly defining L-variables to registers for the compiler, reference a range of Lvariables to Turbo PMAC M-variable definitions with the LMOVERLAY {start},{end} compiler directive. This directive must precede the actual compiled PLC program.
Turbo PMAC User Manual Arrays Compiled PLC programs support two types of arrays: variable arrays and register arrays. Both provide useful capabilities. Variable Arrays Variable arrays work with the Turbo PMAC’s standard PMAC I, P, Q, and M-variables. The number of the array index is placed inside parentheses, and specifies the variable number for the specified type of variable.
Turbo PMAC User Manual Functions As with any Turbo PMAC user program, compiled PLCs can utilize the following mathematical functions.
Turbo PMAC User Manual If an Option 5x0 standard memory configuration is ordered, 48K words of program memory are available for the machine code of compiled PLCs (P:$050000 through P:$05BFFF). If an Option 5x3 extended memory configuration is ordered, 432K words of program memory are available for the machine code of compiled PLCs (P:$050000 through P:$0BBFFF).
Turbo PMAC User Manual Running Compiled PLCs The downloader automatically activates the compiled PLCs after downloading. If I5 is set to permit these programs to run, they will be executing immediately after download. Compiled PLC programs can be enabled and disabled individually or in groups with the ENABLE PLCC and DISABLE PLCC commands. These can be given as on-line commands, or as buffered commands within motion programs, uncompiled PLC programs, or compiled PLC programs.
Turbo PMAC User Manual WRITING A HOST COMMUNICATIONS PROGRAM If communicating from a host computer to Turbo PMAC in the actual application, a host communications program must be written. The PMAC Executive program used in development is not intended as a host program for an actual application; it was designed simply as a development tool. This section describes the actions to take if writing custom communications software, including low-level drivers.
Turbo PMAC User Manual Multi-Line Responses A command to Turbo PMAC, such as LIST PROG 1 (report contents of motion program 1), that calls for a multi-line text response, if valid will get multiple text-line responses each terminated by a , followed by a single character at the end. If it is invalid, Turbo PMAC will respond with a character instead.
Turbo PMAC User Manual Serial Port Communications When communicating to the Turbo PMAC through either its main or auxiliary serial ports, you typically use one of the COM ports in the host computer. In a standard, these are usually the built-in COM1 and COM2 RS-232 ports, but they can be on expansion ports as well. Most COM ports, even on other types of computers, use the same ICs, so they usually have the same registers on the host side.
Turbo PMAC User Manual i = 0; /* Reset counter */ outportb(combase + 4, 2); /* Set port for input */ while (i++
Turbo PMAC User Manual {Base + 2} holds the handshaking status bits; even though this is called the Interrupt Status Register, it can be used for polled communications with the host: The Write-Ready Bit (bit 1) is true when PMAC is ready to have the PC write it a character; and the Read-Ready Bit (bit 0) is true when PMAC is ready to have the PC read a character.
Turbo PMAC User Manual PCI Bus On the PCI bus, the operating system selects the interrupt line used by the controller automatically on the power-up/reset of the PC. Consult the operating system documentation for details of how the operating system determines which interrupt is selected. If using Delta Tau’s PCOMM32PRO library for Microsoft Windows operating systems, consult the documentation for PCOMM32PRO for instructions for handling interrupts in this environment.
Turbo PMAC User Manual EQUn (Position Compare for Channel n): The EQUn line contains the state of the position-compare output for Servo Channel n of the Turbo PMAC. This line can be toggled by the automatic action of the encoder counter’s compare circuitry, or by writing directly to control bits for this circuitry, which permits the use of this signal as a software-generated interrupt from Turbo PMAC programs.
Turbo PMAC User Manual Interrupt Controller Structure The PIC appears as four 8-bit registers in the I/O space of the PC. The actual address of these registers depends on the setting of the base address (Base) of the Turbo PMAC in the I/O space of the PC. For ISA-bus Turbo PMACs, this base address is set by jumpers (Turbo PMAC) or by DIP-switches (Turbo PMAC2) on the controller. For PCI-bus Turbo PMACs, this base address is set by the PC’s operating system during the PC’s initialization.
Turbo PMAC User Manual Initializing the Interrupt Controller To start, write to the Turbo PMAC PIC’s Initialization Command Words (ICWs) to set up the PIC properly. Although this IC is on Turbo PMAC, it is mapped into the PC’s port space as two registers at Turbo PMAC’s base address plus 8 and 9. To do this, perform the following steps: 1. Write a byte of 17(hex) to [PMAC base address + 8]. interrupts. 2. Write a byte of 08(hex) to [PMAC base address + 9]. 3.
Turbo PMAC User Manual Setting up VME Communications Communications through the mailbox registers and the DPRAM must be set up through the use of 10 Ivariables: I90 – I99. If use is desired at other than the default settings of these variables, another communications port (typically a serial port) must be used to make these settings before VME bus communications will be possible.
Turbo PMAC User Manual We will keep the same base address of Turbo PMAC from our previous example.
Turbo PMAC User Manual At this point, Turbo PMAC has taken these characters into its command queue, but has not done anything with them yet since no has been encountered yet. It asserts the selected interrupt level (default is 2) and provides the command a receipt interrupt vector (default is $A0), which must be acknowledged. Now send the next 11 characters (D through " followed by a): $7FA001 $7FA003 $7FA005 ... $7FA017 $7FA019 Address 0 1 2 ... 11 12 Mailbox # D " .
Turbo PMAC User Manual Example Let us now assume the following command has been sent to ask for the position of motor 1: #1P. Turbo PMAC, of course, will respond with data containing position information of motor 1. Let’s say that motor 1 is currently at position 19.2. We now wish to read the mailbox registers to obtain this information Turbo PMAC has waiting for us.
Turbo PMAC User Manual Remember, we get this second interrupt because Turbo PMAC has just now placed data in the mailbox registers, which is now ready to be read. We service this second interrupt and note that the accompanying interrupt vector is $A1, telling us to read the data in the mailbox registers. In this example, Turbo PMAC will have 22 characters to be read: 123456 789012 345678, with the first 16 of them in the mailbox registers. (We are assuming I-variable I3 is set to 2 again.
Turbo 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
Turbo PMAC User Manual • • • • ASCII Command and Response Buffers Data Gathering Buffer Background Variable Copying Buffers Binary Rotary Program Download Physical Configuration and Connection On the Turbo PMAC-PC, the dual-ported RAM option is a separate ½-slot board that connects to the Turbo PMAC’s CPU board with 2 short ribbon cables, and has its own ISA bus connector. On other board-level Turbo PMACs, the dual-ported RAM is an on-board option in which the DPRAM IC is installed directly on the PMAC.
Turbo PMAC User Manual I93 is an 8-bit value that specifies ISA bus address bits A23 – A16 for the DPRAM. Usually, it is specified as a 2-digit hexadecimal value, and these two digits are the same as the first two digits of the six-digit ISA hexadecimal address, $0D in the default case. I94 is an 8-bit value that controls the addressing of the DPRAM over the ISA bus. If only a 16k x 8 block is reserved for DPRAM, it also specifies ISA bus address bits A15 – A14.
Turbo PMAC User Manual I94 controls the VME address bus bits A15 – A08 for the mailbox registers. If bits A23 – A16 are the same for both the mailbox registers and the DPRAM, it is essential that I94 be set up so that there is no conflict between the 512 addresses required for the mailbox registers and the 16k registers required for the DPRAM. I95 controls which interrupt line is used when PMAC interrupts the host computer over the bus. Values of $01 to $07 select IRQ1 to IRQ7, respectively.
Turbo PMAC User Manual USB/Ethernet When USB or Ethernet communications is used with DPRAM, the host computer does not actually have direct access to the DPRAM IC on the Turbo-PMAC end of the wire link. However, the USB and Ethernet implementations support the creation of a virtual shared memory interface so higher level routines can work as if there were direct access.
Turbo PMAC User Manual DPRAM Automatic Functions Turbo PMAC provides many facilities for using the DPRAM to pass information back and forth between the host computer and the Turbo PMAC. Each of these functions has dedicated registers in the DPRAM. The following table shows each of these functions and the addresses used for it.
Turbo PMAC User Manual DPRAM Motor Data Reporting Buffer Turbo PMAC can provide key motor data to the DPRAM, where it can be accessed easily and quickly by the host computer. If this function is enabled, Turbo PMAC will copy key motor registers into fixed registers in the DPRAM. Foreground vs. Background: This copying function can be done either as a foreground (interrupt) task in Turbo PMAC, or as a background task.
Turbo PMAC User Manual Addresses of Data: For details as to the exact registers used for each of these values for each motor, consult the Turbo PMAC Memory Map in the Software Reference Manual. Foreground Handshaking: If foreground transfer is used (I48 = 1), Turbo PMAC will set Bit 15 of 0x006E (X:$06001B) to 0 while it is copying motor data into the DPRAM, and it will set this bit to 1 as soon as it is finished. The host computer should not try to read the data if this bit is 0.
Turbo PMAC User Manual • • • C.S. time remaining in move segment C.S. time remaining in accel/decel C.S. program execution address offset Addresses of Data: For details as to the exact registers used for each of these values for each motor, consult the Turbo PMAC Memory Map in the Software Reference Manual. Handshaking: Turbo PMAC will set Bit 15 of 0x067A (X:$06019E) to 0 while it is copying coordinatesystem and global data into the DPRAM, and it will set this bit to 1 as soon as it is finished.
Turbo PMAC User Manual 2. Write the control character to Bits 0 – 7 of 0x0E9E (X:$0603A7). 3. Each background cycle, Turbo PMAC will read this byte. If the byte contains a non-zero value, Turbo PMAC will take the appropriate action for the command, and set the byte back to 0. Reading a Response Line: To read an ASCII response line from the Turbo PMAC through the DPRAM: 1. Wait for the Host-Input Control Word at 0x0F40 (Y:$063D0) to become greater than 0, indicating that a response line is ready. 2.
Turbo PMAC User Manual Turbo PMAC will continue to assert this interrupt source until the host has cleared the Host-Interrupt Control Word. Because of this, the host may see the source still active when it gets an interrupt from another source. DPRAM Background Variable Read Buffer The Background Variable Data Read Buffer permits you to have up to 128 user-specified Turbo PMAC registers copied into DPRAM during the background cycle. This function is controlled by I55.
Turbo PMAC User Manual Enabling: To start operation of this buffer: 1. Write the starting location of the second part of the buffer into register 0x104A (X:$060412). This location is expressed as a Turbo PMAC address offset from the start of DPRAM’s variable-buffer space at $060450, and it must be between $0000 and $0BAF for the 8k x 16 DPRAM, or between $0000 and $3BAF for the 32k x 16 DPRAM. 2.
Turbo PMAC User Manual When the host wants to read a register, it should check to see that Bit 15 of the data type specifier (the Data Ready bit) has been set. If it has, the host can begin reading and processing the data from that register. When it is done, it should clear the Data Ready bit to let Turbo PMAC know that it can update that register the next cycle. Data Format: Each 24-bit (X or Y) register is sign-extended to 32 bits.
Turbo PMAC User Manual Enabling: To start operation of this buffer: 1. Write the starting location of the second part of the buffer into register 0x104E (X:$060413). This location is expressed as a Turbo PMAC address offset from the start of DPRAM’s variable-buffer space at $060450, and it must be between $0000 and $0BAF for the 8k x 16 DPRAM, or between $0000 and $3BAF for the 32k x 16 DPRAM. 2.
Turbo PMAC User Manual The binary rotary program transfer buffers in DPRAM are simply pass-through buffers to the internal rotary program buffers. When Turbo PMAC receives a binary-format motion program command in the DPRAM buffer from the host computer, it copies this data into the rotary buffer in internal memory. The end result is the same as if an ASCII program command had been sent to Turbo PMAC through any of the ports, but the transmission is quicker for several reasons: 1.
Turbo PMAC User Manual Using the Buffer: First, Turbo PMAC’s internal binary rotary program buffer must be established with the &n DEFINE ROT command. Next, the header information for the DPRAM transfer buffer must be set up. The starting address and size of the transfer buffer must be declared. The buffer should not overlap any other use of DPRAM. The size parameter must be an even number, with an absolute minimum of six PMAC addresses. The size should be declared large enough to not limit throughput.
Turbo PMAC User Manual Turbo PMAC Ethernet communications ports talk using the UDP or TCP protocol of the TCP/IP suite of protocols on port 1025. Therefore, the programmer should open either a datagram socket (UDP) or a stream socket (TCP) on port 1025 the PMACPORT. sock = socket(PF_INET,SOCK_DGRAM,0); // UDP Mode or sock = socket(PF_INET,SOCK_STREAM,0); // TCP Mode // Embedded Ethernet's IP address // The port that the embedded program is listening on. sin.
Turbo PMAC User Manual Every command that is sent to the Turbo PMAC through an Ethernet port begins using the ETHERNETCMD packet structure and is initiated with a PC send command. Every command then must issue a recv command to either receive an acknowledgement character back via the recv command or receive meaningful data.
Turbo PMAC User Manual EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_SENDLINE; EthCmd.wValue = 0; EthCmd.wIndex = 0; EthCmd.wLength = htons( (WORD)strlen(outstr)); strncpy((char *)&EthCmd.bData[0], outstr ,(WORD)strlen(outstr)); Example int CALLBACK PmacSockSendLine(char *outstr) { EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_SENDLINE; EthCmd.wValue = 0; EthCmd.wIndex = 0; EthCmd.wLength = htons( (WORD)strlen(outstr)); strncpy((char *)&EthCmd.
Turbo PMAC User Manual EthCmd.RequestType EthCmd.Request EthCmd.wValue EthCmd.wIndex EthCmd.wLength EthCmd.bData = = = = = - VR_UPLOAD; VR_PMAC_GETBUFFER; 0; 0; htons( (WORD)strlen(outstr)); Not Used Example int CALLBACK PmacSockGetBuffer(char *instr) { EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETBUFFER; EthCmd.wValue = 0; EthCmd.wIndex = 0; EthCmd.
Turbo PMAC User Manual EthCmd.wValue EthCmd.wIndex EthCmd.wLength = htons((WORD)offset); = htons((WORD)outch); = 0; To receive data from the host port set the packet as follows. After sending the packet the programmer will receive 1 byte, which is the value the Ethernet port read from the Turbo PMAC’s CPU host port. EthCmd.RequestType EthCmd.Request EthCmd.wValue EthCmd.wIndex EthCmd.
Turbo PMAC User Manual For example, the following multi-line string could be sent in a single packet: OPEN PLC 1 CLEAR<00>P1=P1+1 <00> CLOSE<00>, where <00> indicates a null byte. The maximum data length is 1024 bytes; anything bigger must be separated into multiple calls of VR_PMAC_WRITEBUFFER. Upon receiving this packet, the Turbo PMAC Ethernet interface sends back 4 bytes of data. Byte 3 indicates if there was an error downloading.
Turbo PMAC User Manual EthCmd.wIndex = 0; EthCmd.wLength = htons( (WORD)strlen(outstr)); strncpy((char *)&EthCmd.bData[0],outstr,(WORD)strlen(outstr)); send(sock,(char*)&EthCmd,ETHERNETCMDSIZE + strlen(outstr),0); recv(sock, szPmacData,1400,0); VR_PMAC_GETMEM This packet causes the Ethernet connection to read data from the DPRAM shared between the Turbo PMAC CPU and the Ethernet microcontroller. Up to 1400 bytes may be received in a single packet.
Turbo PMAC User Manual mask = ~mask; memcpy(EthCmd.bData,&mask,len); // Send command request send(sock,(char *)&EthCmd,ETHERNETCMDSIZE+len,0); recv(sock,(char *)&errcode,1,0); VR_PMAC_SETBITS This packet causes the Ethernet connection to perform a write to DPRAM shared between the Turbo PMAC CPU and the Ethernet microcontroller that sets bits in a 32-bit word to a new value. The wValue field contains the byte offset to retrieve the data from.
Turbo PMAC User Manual Setting bit 0 of I5000 to 1 enables the wrap-around. This mode is required for gathering to DPRAM and real-time upload; it can be useful in gathering to main memory when trying to catch an intermittent problem. When gathering in this mode, it is a good idea to gather the servo-cycle counter at X:$000000, so it is possible for the host-computer software to unwrap the data properly.
Turbo PMAC User Manual Real-Time Data Gathering Through the Dual-Ported RAM Using the dual-ported RAM, it is possible to perform Turbo PMAC’s 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 Turbo PMAC, then uploads to the host afterwards.
Turbo PMAC User Manual Data Format Data is stored in the buffer in 32-bit sign-extended form. That is, each short (24-bit) word gathered from Turbo PMAC is sign-extended and stored in 32-bits of DPRAM (LSByte first). The most significant byte is all ones or all zeros, matching bit 23. Each long (48-bit) word is treated as 2 24-bit words, with each short word sign-extended to 32 bits. The host computer must reassemble these words into a single value.
Turbo PMAC User Manual DUAL-PORTED RAM DATA GATHERING FORMATS 24 BITS PMAC WORD: DPRAM BYTE NO. (RELATIVE) 0 1 2 3 BIT # 23 S 16 15 Byte 2 87 Byte 1 0 Byte 0 Byte 0 Byte 1 S Byte 2 S = Sign bit S S S S S S S S (SIGN EXTENSION) 48 BITS PMAC Y: WORD PMAC X: WORD DPRAM BYTE NO.