BRX User Manual, 2nd Edition Chapter 12 Ch12
User Manual: Chapter 12 BRX Do-more Platform User Manual and Inserts
Open the PDF directly: View PDF .
Page Count: 125
Download | |
Open PDF In Browser | View PDF |
BRX Do-more! Onboard Motion Control and Highspeed I/O Chapter 12 In This Chapter... Overview................................................................................................................... 12-2 Unsuitable Applications............................................................................................ 12-3 BRX Wiring Examples: High-Speed Inputs ............................................................. 12-4 BRX Wiring Examples: High-Speed Outputs, continued......................................... 12-8 Available High-Speed Input and Output Features................................................. 12-11 1. Input Filters....................................................................................................... 12-12 2. Interrupt Setup.................................................................................................. 12-14 3. High-Speed I/O ................................................................................................ 12-23 BRX High-Speed Examples..................................................................................... 12-34 BRX High-speed Instructions ................................................................................ 12-56 AXCAM................................................................................................................. 12-57 AXCONFIG............................................................................................................ 12-63 AXFOLLOW........................................................................................................... 12-67 AXGEAR................................................................................................................ 12-71 AXHOME............................................................................................................... 12-75 AXJOG................................................................................................................... 12-82 AXPOSSCRV.......................................................................................................... 12-84 AXPOSTRAP........................................................................................................... 12-89 AXRSTFAULT......................................................................................................... 12-94 AXSETPROP........................................................................................................... 12-96 AXVEL................................................................................................................... 12-99 TDODECFG......................................................................................................... 12-102 TDOPLS............................................................................................................... 12-104 TDOPRESET......................................................................................................... 12-114 Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 Overview The purpose of this chapter is to help the user understand the capabilities and the flexibility of the BRX built-in motion control and high-speed input and output (HSIO). This section 2 will show the user the steps needed to setup the I/O for use with the High-Speed functions, provide various wiring examples, detailed programming examples and explain the available 3 high-speed instructions. All inputs and outputs can be selected for use in an HSIO application. However, the standard 4 I/O will work at a lower response time. This flexibility frees up the high-speed inputs and outputs. For example, in a BRX 18/18E MPU, when setting up a pulse train output (PTO) as Step/Direction control to a stepper motor, it is possible to select a high-speed output for 5 the STEP signal and a standard output for the Direction signal. By doing this, a high speed output is made available that can be used for another high speed output function, such as 6 PWM. The High-Speed inputs (as fast as 250kHz) can be used as High-Speed counters, as triggers for 7 Interrupt Service Routines (ISR), and as edge timers. The High-Speed counter values can be used as accurate position feedback and engineered values for rate and position. The Interrupt Service Routine (ISRs) can be used to run through logic based on events that are too fast for 8 standard input triggers and normal PLC logic scan. With the high-speed outputs (as fast as 250kHz), it is possible to perform homing moves, 9 trapezoid and s-curve moves, jog and velocity moves, and pulse width modulation (PWM). Also available are electronic camming and gearing instructions, providing additional ways to 10 handle follower type moves. The following table shows the BRX platform HSI specifications. 11 HSI Specifications 12 Item 10/10E 18/18E 36/36E 13 14 15 A B C D Input Type Sink/Source Total Inputs * 6 10 20** High-Speed Inputs 6 10 10 X0–X9 X0–X9 Location X0–X5 Frequency 0 to 250kHz Minimum Pulse width for HSI 0.5 μs Off to On Response < 2µs On to Off Response < 2µs * Refer to the specific wiring chapter for the discrete input specs of the specific model you are using. ** Standard inputs may be used with high-speed functions, but at lower response frequencies of approximately 120Hz. 12-2 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Overview, continued The following table shows the BRX platform HSO specifications. HSO Specifications Parameter 10/10E Output Type 18/18E 36/36E High-Speed Total Outputs * 4 8 16** High-Speed Outputs 2 4 8 Location Off to On Response On to Off Response Max Switching Frequency Y0–Y1 Y0–Y3 Y0–Y7 < 2µs < 2µs 1m cable; 250kHz 10m cable; 100kHz * Refer to the specific wiring chapter for the discrete output specs of the specific model you are using. ** Standard outputs may be used with high-speed functions, but at lower response frequencies of approximately 110Hz. Unsuitable Applications There are situations where HSIO is not an appropriate control choice: • Mechanical contacts used as counter or encoder inputs: Reliable readings are not possible using mechanical contacts. The bounce of mechanical contacts will cause the BRX MPU input to see more edges than intended. • Direct connection to TTL, line driver or differential encoders: A BRX MPU input cannot accept these low voltage inputs directly. (Consider using the FC-ISO-C signal conditioner to be able to input these signal types.) • Absolute encoders are not suitable for use with the high speed inputs of the BRX MPU. BRX User Manual, 2nd Edition 12-3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 BRX Wiring Examples: High-Speed Inputs Quadrature Encoder Input 2 Do-more! BRX Open-Collector Output BRX MPU Input (Sinking) Encoder Wiring Example 3 4 5 Sinking 6 Encoder 7 8 9 10 Do-more! BRX Push-Pull Totem Pole 11 BRX MPUExample Input (Sourcing) Encoder Wiring 12 13 14 Sourcing A Encoder 15 B A Z B C 9-30 VDC D 1C X0 X1 X2 X3 X4 A B Z 9-30 VDC 1C X0 X1 X2 X3 X4 12-4 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O BRX Wiring Examples: High-speed Inputs, continued NPN/PNP Input Example Do-more! BRX PNP/NPN Wiring Example 1C X0 X1 X2 X3 2C X4 X5 X6 X7 Sourcing Signal Signal Sinking BRX User Manual, 2nd Edition 12-5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D BRX Wiring Examples: High-speed Inputs, continued Do-more! BRX Quadrature Encoder Wiring Example Differential Line Driver Encoder Input BRX MPU Input Differential Line Driver Encoder A A B B Z Z FC-ISO-C +Ai nC X0 X1 X2 X3 X4 -Ai +Bi -Bi +Zi -Zi COM COM V+ 0V Ao ISOLATION BOUNDARY Ao Bo Bo Zo Zo 0V 0V FC-ISO-C FC-ISO-C Dipswitch Settings DIP Switch 1 Input DIP 1 2 Setup 1 1 3 4 5 6 7 1 0 0 0 0 8 0 12345678 DIP ON↓ DIP Switches DIP Switch 2 Output DIP 1 2 3 4 5 6 7 8 Setup 0 0 0 0 0 0 0 0 12345678 DIP ON↓ DIP Switches 12-6 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O BRX Wiring Examples: High-speed Outputs SureServo Driver WiringBRX Example Do-more! Servo Drive Wiring Example VDD PULL HI PULSE /PULSE SIGN /SIGN COM- VDD PULL HI PULSE /PULSE SIGN /SIGN COM- Sure Servo Drive wired to Sinking Outputs 1kΩ 1kΩ Sure Servo Drive wired to Sourcing Outputs 1C Y0 Y1 Y2 Y3 Note: VDD = 24VDC 1kΩ resistor is needed for servo to handle this voltage. 1C Y0 Y1 Y2 Y3 1kΩ resistors are not needed if a 5VDC source is used. NOTE: must consult SureServo documentation specific Note: Customer mustCustomer consult SureServo documentation for specific details on thefor servo drive. details on the servo drive. BRX User Manual, 2nd Edition 12-7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 BRX Wiring Examples: High-Speed Outputs, continued Stepper Drive Output Do-more! Do-more! BRX Stepper BRX Stepper Drive Output Drive Output Wiring Example Wiring Example 2 3 4 StepperStepper Drive Drive StepperStepper Drive Drive 5–36 VDC 5 SinkingSinking Sourcing Sourcing 5–36 VDC 6 7 8 BRX MPU Output 9 10 11 12 13 14 15 A B C D DIR DIR + STEP STEP + DIR DIR + STEP STEP + DIR DIR + STEP STEP + 1C Y0 Y1 Y2 1C Y3 Y0 1C Y1 Y0 Y2 Y1 Y3 Y2 Y0 Y1 Y2 Y3 1C Y3 12-8 BRX User Manual, 2nd Edition DIR DIR + STEP STEP + Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O BRX Wiring Examples: High-speed Outputs, continued BRX MPU to Stepper/Servo Drive Output Detailed output wiring example between a BRX MPU and the SureStep Stepping System Detailed Output Wiring Example between a BRX MPU components. and the SureStep Stepping System components Step Motor Power Supply STP-PWR-xxxx AC Power 120/240 VAC GND L2 L1 5 VDC xx VDC – + 0 VDC – + Step Motor Drive STP-DRV-xxxx EN– EN+ VDC+ VDC– Cable Color Code Term Wire Pin # A+ Red 1 A– White 2 B+ Green 3 B– Black 4 DIR+ STEP– A– STEP+ Y0 +5 VDC B– 12" Motor Pigtail with Connector Connector Step Motor STP-MTR(H)-xxxxx Y1 DIR– A+ B+ N/C N/C 4 3 2 1 Front View Extension Cable with Connector STP-EXT(H)-020 1C Y0 Y1 Y2 Y3 BRX MPU Sinking Sinking Output Wiring Diagram for a BRX MPU Using the SureStep Stepping System Components. BRX User Manual, 2nd Edition 12-9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O BRX Wiring Examples: High-speed Outputs, continued BRX MPU to Stepper/Servo Drive Output Detailed output wiring example between a BRX MPU and the SureStep Stepping System Detailed Output Wiring Example between a BRX MPU components. and the SureStep Stepping System components Step Motor Power Supply STP-PWR-xxxx AC Power 120/240 VAC GND L2 L1 – 5 VDC xx VDC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D + 0 VDC – + Step Motor Drive STP-DRV-xxxx EN– EN+ Cable Color Code Term Wire Pin # A+ Red 1 A– White 2 B+ Green 3 B– Black 4 DIR– VDC– DIR+ A+ STEP– A– STEP+ B+ Y1 Y0 +5 VDC B– 12" Motor Pigtail with Connector Connector Step Motor STP-MTR(H)-xxxxx VDC+ N/C N/C 4 3 2 1 Extension Cable with Connector STP-EXT(H)-020 Front View 1C Y0 Y1 Y2 Y3 BRX MPU Sourcing Sourcing Output Wiring Diagram for a BRX MPU Using SureStep Stepping System Components. 12-10 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Available High-Speed Input and Output Features The following High-Speed input and output features are available on the BRX Do-more! MPUs. Reference the specific numbered topic listed below for directions on configuring that particular feature. 1. Input Filters 2. Interrupt Setup a. Setup Input Interrupts b. Setup Timer Interrupts c. Setup Match Register Interrupts d. Interrupt Instructions 3. High-Speed I/O (Counters, Timers, Pulse outputs, PWM and Table driven outputs) a. Counters b. Timers – Interval Scaling c. Axis/Pulse Outputs d. PWM (Pulse Width Modulation) e. Table Driven Outputs – Preset Tables – Programmable Limit Switch (PLS) To access all of the High-Speed input and output setup, go to Do-more! Designer menu PLC>System Configuration: BRX User Manual, 2nd Edition 12-11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 1. Input Filters In the System Configuration window, select (a) the BRX Onboard I/O option under the Configuration Entries panel. The on-board discrete inputs on all of the BRX hardware platforms can be configured to use (b) input filtering. Filters are typically used on inputs that are operating in electrically noisy environments to remove “false positives”. This is accomplished by requiring the input signal remain above the input hardware threshold level longer than the filter time so the CPU will see that input as ON. Once ON, it must be OFF for more than the filter time before the CPU will see that input as OFF. ON Input Signal OFF Filter Time ON Input sent to the CPU OFF 12-12 BRX User Manual, 2nd Edition Filter Time Filter Time Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Clicking on (b) Filters... opens the Setup Discrete Input Response Times dialog box (below). Choose Preferred Filter Scale – Sets format for all of the Inputs values entered in the form. NOTE: Be sure to select the Filter Scale before entering values in fields. If you change the Preferred Filter Scale after entering values then any values that are not valid in that scale will be set to 0. The Filter Scale can be specified in the following formats: • A frequency in the range of 0–250000 Hz. • A time value in milliseconds in the range of 0–112, microseconds in the range of 0 - 111848, or nanoseconds in the range of 0–111848093. • The number of 13.33 nanosecond clocks in the range of 0–8388607. An input filter value of 0 will use the default filter value of 1 microsecond. Selecting one format to specify the filter value will automatically show the filter value in the other two formats. BRX User Manual, 2nd Edition 12-13 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 2. Interrupt Setup In the System Configuration window, select (a) the BRX Onboard I/O option under the Configuration Entries panel. Clicking on (b) Interrupts... opens the Setup Interrupt Triggers dialog box (below). A PLC normally reads inputs at the top of the scan and writes outputs at the bottom of the scan. The ladder logic is solved after the inputs are read and after the ladder is solved the outputs are written. Because the PLC can change the amount of work it does from scan to scan, the PLC scan time will also change accordingly, which will directly affect how frequently inputs will be read and outputs will be written. Interrupts are a method of triggering an action or code segment immediately after the qualifying condition(s) becomes true, regardless of variations in the PLC scan time. In the BRX PLC, this can be accomplished by using hardware (a) Input Events, (b) Timers or (c) Match Registers, (matching a register count). There are 12 Interrupt triggers available: 4 Input Interrupts, 4 Timer Interrupts and 4 Match Register Interrupts. Click on (d) Event 1... to bring up the Setup Input Event dialog box. 12-14 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 2a. Setup Input Interrupts: Input Interrupts can be used to respond to transitions of discrete inputs that occur during a PLC scan. Input Interrupts can be triggered in several different ways: • Any (a) of the on-board discrete inputs • Single Input (b, dropdown menu at right) (OR Rising Edge, OR Falling Edge or OR Either ) • Combinations of Inputs (c, dropdown menu at right) (AND High Level or AND Low Level) Next, choose to assign the input event to (d) an existing Interrupt Service Routine (ISR) or (e) create a new ISR. For this exercise we will click on (e, above) to create a new ISR (a, below) and enter a name for the ISR, (b) click the Create button. Dropdown Menu Interrupt Selections BRX User Manual, 2nd Edition 12-15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Input Interrupt Example 1 In the configuration below (a) of ISR_1, if (b) EITHER Input 0 or Input 1 goes from false to true, the Interrupt Service Routine ISR_1 will run. Input Interrupt Example 2 In the configuration below of (a) ISR_1, Input 0 must be true and when (b) Input 1 goes from false to true, the Interrupt Service Routine ISR_1 will run. 12-16 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 2b. Setup Timer Interrupts Timer Interrupts use a hardware timer to run an Interrupt Service Routine in situations where you need an action to occur at regular intervals that are not affected by variations in the PLC scan time. This can be situations that require actions to occur at exact repeating intervals (Recurrent), or actions that occur after a precise amount of delay time (One Shot). Timer Interrupts are fairly simple to setup. There are two modes: One Shot or Recurrent. The Timer Duration is in microseconds resolution. As with the Input Interrupt setup, an existing (a) ISR can be specified or a new one can be created from this dialog by clicking on (b) Create ISR button. One Shot – The ISR will run only once at the time period specified after putting the PLC into Run. In order for this Interrupt to run again, the PLC will need to transition from Stop/Program to Run or you can use the (c) INTCONFIG instruction in ladder logic to trigger it again. The INTCONFIG instruction is very useful and will be discussed in more detail later. Recurrent – the ISR will run continuously at the time period specified after putting the PLC in Run mode or it can be controlled (turned on or off ) by using the INTCONFIG instruction. NOTE: The Timer Interrupt will be triggered when the PLC goes from Stop/Program mode to Run mode. To stop this from taking place, you can use the ISRname.Inhibit bit to disable the ISR from triggering when the PLC first goes into Run mode. BRX User Manual, 2nd Edition 12-17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 2c. Setup Match Register The Match Register function allows you to compare one of the hardware based registers to a value. When that condition is met, the specified Interrupt Service Routine will run. As with the other Interrupt functions, you can pick from a previously created ISR or you can create one from this dialog (a). (b) ...when – specifies which of the High-Speed input or output locations to use in the comparison. Choose from the following: High-Speed Ctr / Tmr 1 Accumulator High-Speed Ctr / Tmr 2 Accumulator High-Speed Ctr / Tmr 3 Accumulator Pulse Output 1 Position Pulse Output 2 Position Pulse Output 3 Position (c) ...is – specifies the math operator to use when performing the comparison. Choose from the following: Equal To Not Equal To Greater Than Greater Than or Equal To Less Than Less Than or Equal To 12-18 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O (d) ...this value - specifies the 32-bit signed decimal constant value to compare to the register contents. This can be any constant value between -2147483648 and 2147483647. The specified ISR will run once when the operand condition is met. For example: In the case of Greater than, the ISR will run when the High-Speed Ctr/Tmr or Pulse Output position is above the set point. It will not run again until the value has gone below the set point and then back above it again. The same is true for Not Equal to - the ISR will run the very first time after going into Run Mode if the High-Speed Ctr/Tmr or Pulse Output position is not equal to the set point. It will not run again until the High-Speed Ctr/Tmr or Pulse Output position becomes equal to the set point and then moves off of that value. BRX User Manual, 2nd Edition 12-19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 2d. Interrupt instructions There are four Interrupt instructions: • INTCONFIG (Configure Interrupt) • INTDECONFIG (Deconfigure Interrupt) • INTSUSPEND (Suspend Interrupts) • INTRESUME (Resume Interrupts) NOTE: If you are doing ISRs, you should use one or more of the Immediate Output instructions: OUTI (Out Immediate) SETI (Set Immediate) RSTI (Reset Immediate). These will help get a faster response from a Y in the ISRs. A brief explanation of the use of these instructions will be given here. For full details on these instructions, refer to the help file. For each instruction, there is an Input Leg action selection: Power flow enabled or Edge triggered. A Power flow enabled will lock the instruction on. So if an INTCONFIG instruction was configured as Power flow enabled, the rung became true and an INTDECONFIG instruction was enabled, the Interrupts would still occur. Choosing Edge triggered will invoke the action once and other instructions may change the current behavior. NOTE: If an Interrupt Trigger was created using the Interrupt Triggers setup in System Configuration, be aware that these instructions DO NOT change that configuration. The Interrupt Trigger configuration will return each time the BRX CPU transitions from PROGRAM to RUN mode. INTCONFIG 12-20 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O The INTCONFIG instruction performs the same Interrupt setup located within the System Configuration. The instruction allows you to dynamically change the setup in applications where this may be required. One example is to calculate a Match Register value in Ladder Logic using the MATH instruction to D100, then use D100 in an INTCONFIG. If the INTDECONFIG instruction is used to disable Interrupts, this instruction is required to re-enable them. INTDECONFIG This instruction disables the Interrupt(s) selected. Individual Interrupts may be selected as well as choosing to disable all of them. To re-enable Interrupts, the PLC must transition from Program to Run or the INTCONFIG instruction must be used. To temporarily disable Interrupts, use the INTSUSPEND instruction. INTSUSPEND The INTSUSPEND instruction temporarily suspends the interrupts and does not allow the ISRs to run. To enable the interrupts to function again, use the INTRESUME instruction. When interrupts are suspended using the INTSUSPEND instruction and one or more triggers take place, only one iteration of the interrupt will be available to be triggered after it is no longer suspended. INTRESUME The INTRESUME instruction resumes the normal processing of suspended interrupts. When the INTRESUME instruction is enabled, if one or more than one trigger took place while suspended, only one will be triggered when it resumes. Clear any Pending interrupts: When enabled, it resets the trigger that took place while suspended. For example, if one or more triggers take place while suspended and the Clear any Pending Interrupts was not enabled, when interrupts are resumed, it will immediately execute the interrupt routine one time. If, however, the Clear any Pending Interrupts was enabled, any trigger that took place while suspended would be reset and when interrupts resume, it would start the normal processing of the interrupts. BRX User Manual, 2nd Edition 12-21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Interrupt Service Routines Only a brief explanation will be given of the Interrupt Service Routine. This topic is defined in the help file as well. When an Interrupt Service Routine (ISR) is created, a structure is created. The members of the structure are as follows: • .ExecutionTime – Time, in microseconds, it took to run the ISR the last time it ran. • .HasRun – Should be on if the ISR has run at least once since the last Program to Run transition. • .Inhibit – Enabling this bit will prevent the ISR from running. The actions do NOT get queued when this bit is enabled and the hardware interrupt becomes true for this ISR. • .Latency – Time in microseconds elapsed between when the hardware Interrupt occurred and when the ISR execution began. • .RunCounter – Indicates how many times the ISR has run since the past Program to Run transition. These structure members may be helpful in troubleshooting the process when using Interrupts. 12-22 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 3. High-Speed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D (a) Counters (b) Timers (c) Axis/Pulse Outputs (d) Pulse Width Modulation (PWM) Outputs (e) Table Driven Outputs BRX User Manual, 2nd Edition 12-23 Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 3a. Counters A structure is created when this function is used. The name of the structure is configurable in the Device Name field. For the description of this function we will use the default name HsCtrTmr1. (a) The BRX PLC allows for either 3 High-Speed Counters or 3 High-Speed Timers. Counters may be used in 5 different configurations with different options for the “Edge” to count: Up Counter (Rising Edge, Trailing Edge or Both): Uses a single input and increments the count in the $HsCtrTmr1.Acc register. Down Counter (Rising Edge, Trailing Edge or Both): Uses a single input and decrements the count in the $HsCtrTmr1.Acc register. Quad Counter (1X, 2X or 4X): Uses 2 inputs and counts in both positive and negative directions based upon which of the inputs is ‘leading’. Bidirectional Counter: Uses 2 inputs. The first input is the count input. The second input determines whether the count is incrementing (when input is low) or decrementing (when input is high). Up/Down Counter: Uses 2 inputs. The first input increments the count. The second input decrements the count. (b) Initial Reset Value: The $HsCtrTmr1.Acc register will be loaded with the value configured in this field when the Reset Input goes true. (c) Reset Input: When this condition is met, the $HsCtrTmr1.Acc register will be loaded with the value specified in the (b) Initial Reset Value field. The Input can be configured to indicate a true condition when the Rising Edge occurs, the Falling Edge, High Level or Low Level. (d) Enable Capture Input: When this condition is met AND when $HsCtrTmr1.EnableCapture is 12-24 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O true, the current value that is in the $HsCtrTmr1.Acc register will be loaded into the $HsCtrTmr1. CapturedValue register. When this occurs, the structure member, $HsCtrTmr1.CountCaptured will be true. To capture again, the $HsCtrTmr1.EnableCapture bit must be turned off and back on. This Input can be configured to indicate a true condition on Rising Edge or Falling Edge. (e) Inhibit Input: When this condition is met, the $HsCtrTmr1.Acc register will cease to increment or decrement. The Input can be configured to indicate a true condition on High Level or Low Level. Counter Scaling Position Configure the Min Raw, Max Raw, Min Scaled and Max Scaled values for a linear interpolated result. That result will be placed in the $HsCtrTmr1 structure member $HsCtrTmr1. ScaledValue . Rate The scaling feature allows you to convert the raw input pulse count to engineering units more appropriate to the process that the PLC is running. The scaled value will be placed in the structure member: $HsCtrTmr1.ScaledValue. NOTE: The raw value is used for Match Register functionality. However, the Preset Command table and PLS table can use the scaled value. Rate scaling is a measurement of distance over time. The following parameters are used in calculating the .ScaledValue: (a) Raw Counts / Unit: The raw count value that would comprise 1 scaled unit value. So for calculated RPMs of an encoder, this might be the Pulses Per Revolution of the encoder. (b) Unit Time Base: A time base for the scaled unit value. In the example of calculating RPMs, this value would be units per minute. (c) Scale Offset: Simply a value added to the resulting .ScaledValue. (d) Calc Interval: Specifies how often (in milliseconds) the rate calculation is performed. The higher the value, the lower the impact on performance to the system. The calculation should be performed no faster than the process requires. If the application generates very slow pulse signals, consider using the Interval Scaling, discussed later in this chapter. (e) Data Filter: Entering a value into this field will apply a time constant filter to a rolling average resulting in a ‘smoother’ value. BRX User Manual, 2nd Edition 12-25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 3b. Timers There are 2 types (a) of High-Speed Timers for the BRX PLC: Edge Timer (1 Input) and Dual Edge Timer (2 Inputs). Edge Timer: With the Edge Timer, measurements can be taken in 4 possible ways: • From rising edge of one pulse to the rising edge of the next pulse • From rising edge to falling edge of the same pulse • From falling edge of one pulse to the rising edge of the next pulse • From falling edge of one pulse to the falling edge of the next pulse Dual Edge Timer: With the Dual Edge Timer, measurements can be taken in 4 possible ways: • From the rising edge of input 1 to the rising edge of the subsequent pulse of Input 2 • From the rising edge of input 1 to the falling edge of the subsequent pulse of Input 2 • From the falling edge of input 1 to the rising edge of the subsequent pulse of Input 2 • From the falling edge of input 1 to the falling edge of the subsequent pulse of Input 2 When a High-Speed Timer is configured, a structure is created. To use the timer, the $HsCtrTmr1.EnableTimer bit must be enabled. The BRX PLC will then look for the first pulse. When the first pulse is read, the timer begins. The current time value (in microseconds) can be seen in the $HsCtrTmr1.Acc register. When the second pulse has been read, the time value is moved into the $HsCtrTmr1.LastTime register and the timer stops. To run again, disable the $HsCtrTmr1.EnableTimer bit and re-enable. There are 2 other bits to indicate the state that the timer is in. The $HsCtrTmr1.TimerStarted indicates that the timer is active. The $HsCtrTmr1.TimerComplete bit indicates that the timer has completed. Enable Free Run: When the (b) Enable Free Run checkbox is selected, the timer will continue on subsequent pulses and the $HsCtrTmr1.EnableTimer bit only needs to be enabled once and not re-enabled for subsequent timer measurements. NOTE: The timer will ‘free run’ and will not stop in between pulses. The BRX PLC is just grabbing snapshots of the configured pulse timing. Enable Timeout: The Enable Timeout (c) feature gives an indication that the first pulse has been received but the second has not been received within the time period specified (in microseconds). When the timeout occurs, it will not successfully complete the timer even though the second pulse may eventually arrive. The $HsCtrTmr1.EnableTimer bit must be disabled and re-enabled. 12-26 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Interval Scaling The Scaling Interval feature (right) allows you to convert the raw input pulse count to engineering units more appropriate to the process that the PLC is running. The scaled value will be placed in the structure member: $HsCtrTmr1.ScaledValue. NOTE: The raw value is used for Match Register functionality. However, the Preset Command table and PLS table can use the scaled value. Interval scaling measures the time between pulses to calculate the frequency. The result is a measurement of unit movement over time. The following parameters are used in calculating the .ScaledValue: Raw Counts / Unit: This is the raw count value that would comprise 1 scaled unit value. So for calculated RPMs of an encoder, this might be the Pulses Per Revolution of the encoder. Unit Time Base: This is the time base for the scaled unit value. In the example of calculating RPMs, this value would be units per minute. Scale Offset: This is simply a value added to the resulting .ScaledValue. Data Filter: Entering a value into this field will apply a time constant filter to a rolling average resulting in a ‘smoother’ value. BRX User Manual, 2nd Edition 12-27 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 3c. Axis/Pulse Outputs The Axis/Pulse Output Configuration window allows you to specify the type of pulse train (mode) to output as well as the physical output points to use for this Axis. The software will indicate and warn if there are conflicts specified for the output points selected in this or other axis configurations. There are four Pulse Output Modes: 1. Virtual (a): Axis can execute profiles for master/slave operations with other axes, or can trigger Table Driven Outputs or Match Register interrupts, but does not drive physical I/O. NOTE: A Virtual axis will not generate pulses to physical outputs of the PLC. Convenient for testing. 2. Step/Direction (b): The output specified for Function Output 1 will pulse at the speed and/or amount (Position) specified. The output specified for Function Output 2 will be low for a positive position value move or high for a negative position value move. 3. CW/CCW (c): The output specified for “Function Output 1” will pulse at the speed and/or amount (Position) specified when the Position value is positive. The output specified for Function Output 2 will pulse at the speed and/or amount (Position) specified when the Position value is negative. 4. Quadrature (d): In Quadrature mode, both outputs specified will pulse at the speed and/or amount (Position) specified in 4X fashion (both leading and trailing edges are considered a pulse). If the position value specified is a positive value, the output specified for Function Output 1 will lead. If the position value specified is a negative value, the output specified for Function Output 2 will lead. 12-28 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 3c. Axis/Pulse Outputs, continued When an Axis is created, a structure is available for use in control and monitoring. Each member takes the form of $Axisn.member, where “n” is the Axis number (0 to 3) and “member” is the element word or bit referenced. Each member and an explanation of that structure are listed below. .TargetVelocity (Signed DWord): When using an AXVEL instruction, this is the target Velocity (When using an AXPOSTRAP or AXPOSSCRV instruction, the velocity configured in the AXCONFIG instruction is the velocity that is used). .TargetPosition (Signed DWord, Read Only): This is the target position that has been configured successfully by an AXPOSTRAP or AXPOSSCRV instruction. .CurrentVelocity (Signed DWord, Read Only): This is velocity that the axis is currently running at. .CurrentPosition (Signed DWord, Read Only): This is the pulse count where the Axis is currently located. .FollowingError (Signed DWord, Read Only): When an Axis is configured to use encoder feedback as the Axis position, the FollowingError is the difference between the output pulse count (TargetPosition) and the encoder input value (Current Position). This value is always reported in pulse counts, not in encoder count values. .MstSlvCoordError (Signed DWord, Read Only): This error is the difference between the position of the Master Axis and the projected location of the Slave Axis when using the AXGEAR, AXFOLLOW and AXCAM instruction. .Suspend (Bit): Enabling the Suspend bit will halt the axis motion where it is at (honoring the accel and decel parameters). Disabling the bit will resume the axis motion. .MasterEnable (Bit): This must be enabled for an axis instruction to function. It gets enabled automatically after the AXCONFIG has completed successfully. .Configured (Bit, Read Only): This bit is true when the axis has been successfully configured by the AXCONFIG instruction. .Active (Bit, Read Only): This bit is true when the axis is in motion (pulses are being generated). .AtVelocity (Bit, Read Only): This bit is true when the axis is generating the pulses at the frequency specified by an AXPOSTRAP or AXPOSSCRV , an AXVEL or other axis instructions (TargetVelocity = CurrentVelocity). .AtPosition (Bit, Read Only): This bit is true when the position specified by an AXPOSTRAP or AXPOSSCRV has been achieved (TargetPosition = CurrentPosition). .ScriptBusy (Bit, Read Only): Reserved .Fault (Bit, Read Only): Will be SET when either Fault Limit for an Axis is ON, or when the Axis’ MasterEnable has been manually turned OFF. A Reset Axis Limit Fault (AXRSTFAULT) or an Axis Configuration (AXCONFIG) instruction must be executed to clear the Fault in the Axis before the Axis will operate again. 3d. PWM (Pulse Width Modulation) The PWM function has no associated instructions. In the “PWM Output Configuration”, BRX User Manual, 2nd Edition 12-29 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O specify the output to control. Once this function has been configured, a structure is created. The function is used by manipulating the members of that structure. The structure members are defined below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D .EnableOutput (Bit): Set this bit ON to generate output pulses, set the bit OFF to stop generating output pulses. .PeriodScale (Bit): This specifies the time base for the output pulses. OFF = Microseconds (μs), ON = Milliseconds (mS). .Period (Unsigned Word): Specifies the amount of time (in microseconds or milliseconds) for one complete pulse. This can be any positive constant value from 0–65535. NOTE: Remember, this value is NOT a frequency specified in Hz, this is the duration (milliseconds or microseconds) of one pulse. Because Frequency and Period are reciprocals of each other, the following formulas can be used to convert a value specified in Hz to a Period value in milliseconds or microseconds: Converting Hz to millisecond period = (1/ Hz) * 1000. For example: 60Hz = (1 / 60) * 1000 = 17 milliseconds. Converting Hz to microsecond period = (1/ Hz) * 1000000. For example: 60Hz = (1 / 60) * 1000000 = 16667 microseconds. .DutyCycle (Real): The DutyCycle determines the percentage of time that the output is high versus low. 10% Duty Cycle would mean that the output is high for 10% of the Period (or cycle) and low for 90% of the Period. This can be any Real value between 0.0 and 100.0. 12-30 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 3e. Table Driven Outputs Table Driven Outputs are a method to control outputs at High-Speed based upon set points from a High-Speed counter, timer or axis position. Typically, controlling outputs from a set point in ladder would incur ‘jitter’ delays from one scan to the next. When controlling outputs at HighSpeed, the ladder scan variation may produce undesired changes in response from one scan to the next. Using table driven outputs will eliminate this ladder scan variation. There are 2 methods of controlling table driven outputs: Preset Tables or Programmable Limit Switch (PLS). The TDOPRESET instruction is used for Preset Tables and the TDOPLS instruction is used for PLS. Preset Tables Preset Tables will always run in order from first to last. This means that it must always be known whether the count will increment or decrement and at what point it will do this. If unexpected direction changes in count may occur, the Programmable Limit Switch function may be a better choice for that application. As mentioned above, the table will always run from first (top of table) to last (bottom of table). In order to restart the table from the top, the Reset Table & Acc function should be used as one of the steps in the table. There are 6 Preset functions to choose from in the table: Set: This function will turn the Table Driven Output ON. A Reset must be used to turn the output OFF. Reset: This function will turn the Table Driven Output OFF. Pulse ON: This function will turn the Table Driven Output ON for the specified “Pulse Time” (in microseconds). At the end of the specified Pulse Time, the output will turn OFF. Pulse OFF: If the output is ON, this function will turn the Table Driven Output OFF for the specified “Pulse Time” (in microseconds). At the end of the specified Pulse Time, the output will return to ON. Toggle: This function will set the Table Driven Output to the opposite state from what it is currently at. If the output was ON, this function will turn it OFF. If the output was OFF, this function will turn it ON. Reset Table & Acc: Performs a reset of the Master Register which sets its current count value to the Initial Reset Value specified in the Timer/Counter Function setup, and sets the current step in the Preset Table to Step 0. BRX User Manual, 2nd Edition 12-31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D 3e. Table Driven Outputs, continued When a Preset Table is configured, a structure becomes available for use in control and monitoring. The members of the structure are as follows: .EnableOutput (Bit): This Bit is automatically set ON when the Preset Table is first loaded, and automatically turned OFF when the Table Driven Output is deconfigured. The ladder logic program can manually turn this Bit OFF to stop the table from writing it’s state data to the Table Driven Output without having to use the TDODECFG instruction. While this bit is ON, the Preset Table updates the Table Driven Output. .OutputState (Bit, Read Only): This bit is ON when the Table Driven Output is ON. .StepNumber (Signed Byte): The zero-based step number from the table that is currently active. A step number of -1 indicates the Preset Table is either in Level Reset or is unconfigured. .InputValOffset (Signed DWord): The current count value from the Master Register can be adjusted by a fixed amount before the comparison in the step is performed by entering that offset value here. .ResetEdge (Bit): Turn this Bit ON to reset the Preset Table to Step 0, the PLC will automatically turn this bit back off. .ResetLevel (Bit): Turn this Bit ON to reset the Preset Table to Step 0. Leaving the Bit ON will hold the Table in Reset until this Bit is turned OFF. For more information on using the TDOPRESET instruction and the Preset Table function, reference the help file. Programmable Limit Switch (PLS) Unlike the Preset Table, the PLS (Programmable Limit Switch) will act upon the output whenever the High-Speed I/O Source Register is within the configured entry points no matter the direction it may have entered the range specified. The entry requires specifying the low range (ON when Greater Than or Equal to) and high range (and Less Than) fields. The On when Greater than or equal to field must always be a lower value than the and Less Than field. Multiple entries can be configured to control the output at different ranges but they cannot overlap each other. The PLS can control the output so that its default state is ON and the entries configured will turn the output OFF within those ranges. 12-32 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 3e. Table Driven Outputs, continued The same structure that is used for the Preset Table is used for the PLS Table with a few minor changes in behavior. The explanations are given below: .EnableOutput (Bit): This Bit is automatically set ON when the PLS Table is first loaded, and automatically turned OFF when the Table Driven Output is deconfigured. The ladder logic program can manually turn this Bit OFF to stop the table from writing it’s state data to the Table Driven Output without having to use a TDODECFG instruction. If this Bit is ON the PLS Table will update the Table Driven Output. .OutputState (Bit, Read Only): This bit is true when the Table Driven Output being controlled by the PLS is currently true. .StepNumber (Signed Byte): The zero-based step number from the table that is currently active. A step number of -1 indicates the PLS Table is between ON positions or is unconfigured. .InputValOffset (Signed DWord): The current count value from the Master Register can be adjusted by a fixed amount before the comparison in the step is performed by entering that offset value here. .ResetEdge and .ResetLevel: Not used with the PLS function. For more information on using the TDOPLS and PLS function, reference the Help file. BRX User Manual, 2nd Edition 12-33 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D BRX High-Speed Examples This section includes brief descriptions of how to implement some common motion control solutions. The information provided should give the user a good understanding of what basic steps are required to implement the desired function. Later in the chapter, we will present detailed examples that will guide you step by step, on how to read a quadrature encoder value and how to generate a trapezoid profile using High-Speed outputs. Get Position Using an Encoder To read the position of an encoder, follow these basic steps in the Do-more! Designer software: 1. From the Dashboard page – Select High-Speed I/O. 2. Counter/Timer Functions – Select Function 1. 3. Select Counter – Configure the counter for Quad Counter and select X0 and X1 as your inputs. 4. Optional – Setup scaling or enable rotary mode. 5. Download the configuration to the BRX CPU and set it to RUN. 6. While connected with the CPU, verify that the encoder counts are appearing in a DataView window. Use the address $HsCtrTmr1.acc to monitor the accumulated encoder pulses. Get Rate Using an Encoder To read the rate of an encoder, follow these basic steps in the Do-more! Designer software: 1. From the Dashboard page – Select High-Speed I/O. 2. Counter/Timer Functions – Select Function 1. 3. Select Counter – Configure the counter for Quad Counter and select X0 and X1 as your inputs. 4. Enable Scaling – Select Rate. 5. Enter the conversion parameters. 6. Download the configuration and verify the CPU is in RUN mode. 7. While connected with the CPU, verify the encoder rate values are appearing in a DataView window. Use the address $HsCtrTmr1.scaledvalue to monitor the rate value. Measure Timing Between Pulse Edges To measure the time between edges of a pulse, follow these basic steps in the Do-more! Designer software: 1. From the Dashboard page – Select High-Speed I/O. 2. Counter/Timer Functions – Select Function 2. 3. Select Timer – Keep the default device name, @HsCtrTmr2. Select Edge Timer function. For this test, use one of the encoder inputs, i.e. X0. Select appropriate options (Free-run is suggested for testing since it does not require any ladder programming to function). 12-34 4. Optionally, setup scaling if needed. 5. Download the configuration and verify the CPU is in RUN mode. 6. While connected with the CPU, verify that the pulse measurements are showing up in a DataView BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O window. Use the address $HsCtrTmr2.LastTime to monitor the previous amount of time between pulses. Pulse Train Output – Move to a Specific Position The following steps will explain what is needed for the BRX CPU to prompt a stepper motor, for example, to move an absolute number of steps: 1. From the Dashboard page – Select High-Speed I/O. 2. Axis/Pulse Outputs – Select Axis 1. 3. Axis 1 Configuration – Keep the default Device name, @Axis1. Select Pulse Output. Select the Output Type required by your controller. For this example, we are using Step/Direction with a SureStep stepper drive. Select Y0 for Step and Y1 for Direction. 4. Download the configuration to the CPU. 5. AXCONFIG ladder rung – Configure the AXCONFIG instruction for Device @AXIS1. Use the defaults for all the fields. The move instructions use the Accel/Decel and Min/Max frequencies configured in this instruction. 6. AXPOSTRAP ladder rung – Configure the AXPOSTRAP for Device @Axis1. For Move Type, select Single Move and Power Flow Enabled. For Target Type, select Relative and for Position Value use the default of 1000. For Linear vs Rotary, select Linear. 7. Download program and verify the CPU is in RUN mode. 8. Trigger the AXCONFIG ladder rung – When the AXCONFIG instruction is triggered, the MasterEnable and the EnableOutput heap items will be ON. The success bit will be ON. 9. Turn on the AXPOSTRAP ladder rung – Every time the rung is powered on and left on, the instruction will send out a pulse train that matches the target position value. The CurrentPosition will increase from 0 to 1000 the first time the rung is turned on. The target position will display 1000. AtPosition turns on when the target position is reached. If you turn the rung off and back on, the CurrentPosition will increase from 1000 to 2000. 10. A detailed example using the AXPOSTRAP will be provided later in this chapter. For detailed information of the instructions, review the Do-more! Designer Help topics. Pulse Train Output – To Home an Output The following steps will explain what is needed for the BRX CPU to prompt a stepper motor, for example, to find a Home position: 1. From the Dashboard page – Select High-Speed I/O. 2. Axis/Pulse Outputs – Select Axis 1. 3. Axis 1 Configuration – Keep the default Device name, @Axis1. Select Pulse Output. Select the Output Type required by your controller. For this example, we are using Step/Direction with a SureStep stepper drive. Select Y0 for Step and Y1 for Direction. 4. Download the configuration to the CPU. 5. AXCONFIG ladder rung – Configure the AXCONFIG instruction for Device @AXIS1. Use the defaults for all the fields. The move instructions use the Accel/Decel and Min/Max frequencies configured in this instruction. 6. AXHOME ladder rung – Configure the AXHOME for Device @Axis1. For this example, we BRX User Manual, 2nd Edition 12-35 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D use X2 as our Discrete Input Limit 1. Enter a value for Homing Velocity. Select the Discrete input and event type. Select the Homing Termination. For this example, we will use Decelerate to 0 after reaching input limit 1 and zero out the position value when Home is reached. Edge-triggered is selected for the input leg. 7. Download program and verify the CPU is in RUN mode. 8. Trigger the AXCONFIG ladder rung – When the AXCONFIG instruction is triggered, the MasterEnable and the EnableOutput heap items will be ON. The AXCONFIG success bit will be ON. 9. Trigger the AXHOME ladder rung – Turning on the input to the AXHOME rung, will trigger the HOME move. The input does not have to remain on for the HOME move to continue when the edge-triggered input is selected. Pulse outputs will be generated while the discrete input limit 1 is not reached. Once the discrete input limit 1 is reached, the pulse output will decelerate to 0, as configured for this example. During the HOME move, the CurrentPosition will increase. Once the HOME position is reached, the CurrentPosition is reset to 0. Output Pulse Width Modulated (PWM) Pulses To generate PWM outputs, follow these basic steps: 1. From the Dashboard page – Select High-Speed I/O. 2. PWM Outputs – Select PWM 1. 3. PWM 1 Configuration – Enable PWM. Keep the default Device name, @PWMOut1. Select output Y2, for example. 4. Download the program (no ladder instructions need to be added for this test) and verify the CPU is in Run. 5. Use Data View to control the PWM 1 output. Use heap items .EnableOutput, .PeriodScale, .Period and .DutyCycle. 6. $PWMOut1.DutyCycle – Specifies the percentage of one period where the output is ON, during the remaining portion the output will be OFF. This can be any Real value between 0.0 and 100.0. 7. $PWMOut1.PeriodScale – Selects the time base for the output pulses, OFF = microseconds (μs), ON = milliseconds (ms). 8. $PWMOut1.Period – Specifies the amount of time (in microseconds or milliseconds) for one complete pulse. This can be any positive constant value from 0–65535. NOTE: Remember, this value is NOT a frequency specified in Hz, this is the duration (in microseconds or milliseconds) of one pulse. Because Frequency and Period are reciprocals of each other, the following formulas can be used to convert a value specified in Hz to a Period value in milliseconds or microseconds: a. Converting Hz to millisecond period = (1/ Hz) * 1000. For example: 60Hz = (1 / 60) * 1000 = 17 milliseconds. b. Converting Hz to microsecond period = (1/ Hz) * 1000000. For example: 60Hz = (1 / 60) * 1000000 = 16667 microseconds. 9. $PWMOut1.EnableOutput - Set this ON to generate output pulses, set OFF to stop generating output pulses. Table Driven Output using a Preset Table 1. Configure a High-Speed input to read encoder values. See section on “Get Position using an Encoder”. 2. 12-36 From the Dashboard page – Select High-Speed I/O. BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 3. Table Driven Output – Select Table 1. 4. Table Driven Output Configuration – Enable Table Driven Output. a. This is used to trigger High-Speed outputs in response to High-Speed counters, timers and pulse outputs. b. Use ladder instructions TDOPRESET, TDOPLS and TDODECFG to setup and manage tables. 5. Select output Y3. 6. Download changes to the CPU. 7. Add a rung with the instruction TDOPRESET and a rung with the instruction TDODECFG. 8. Once the TDOPRESET is running, it takes over the discrete output assigned to Table1. 9. To release the discrete output from being controlled by Table 1, use TDODECFG. BRX User Manual, 2nd Edition 12-37 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a Quadrature Input This example walks through the steps required to get the counts from a quadrature encoder. Phase A of the encoder is wired to input X0 and Phase B of the encoder is wired to input X1. The Basic Steps 1. Wire the encoder and connect Do-more! Designer to the BRX CPU. 2. Configure a High-Speed Input as a quadrature counter. 3. Download the program changes to the CPU and place the CPU in Run. 4. Use DataView and Trend View to verify the encoder values are being read correctly by the BRX CPU. Equipment Used BRX MPU with DC inputs. A quadrature encoder (Open collector or Totem Pole) properly powered and connected to inputs X0 and X1 of the BRX. Launch Do-more! Designer. By default, the Tip of the Day will pop up. Close it. 12-38 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a Quadrature Input, continued The Select Project window will be displayed next. Select New Offline Project. Launch the Do-more! Designer Software. In the New Offline Project window select the BRX MPU model you are working with. Rename the project as Quad Encoder in the New Project Name field (bottom left). Press the OK button to accept the selections. BRX User Manual, 2nd Edition 12-39 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a Quadrature Input, continued The Dashboard page is displayed and the screen will look as follows: Mouse over the BRX MPU in the Dashboard BRX Onboard I/O view, orange blocks will appear around the various built-in MPU features. Select the inputs orange block (a). Select Configure counter/timer functions (b) to access the Setup BRX High-speed I/O page. 12-40 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a Quadrature Input, continued From the Setup BRX High-speed I/O page, select Function 1 under the Counter/Timer Functions section. Selecting (a) Counter from the Setup BRX Counter/Timer dialog box. The dialog box will fill in with counter parameters. For this example, we will keep the default (b) Device Name of HsCtrTmr1. Select (c) Quad Counter from the dropdown menu, leaving it at (d) 1X counting resolution and select input (e) X0 (Phase A) and input (f) X1 (Phase B). Click OK to return to the Dashboard screen. Write the changes to the PLC and verify you are in Run mode. At this point, we have configured inputs X0 and X1 for quadrature counter highspeed inputs. No ladder is needed to monitor the counts from the encoder. BRX User Manual, 2nd Edition 12-41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a Quadrature Input, continued Displaying Encoder Values via Data View Create a New Data View window. From the menu select Debug -> Data View and New. Alternately, you can use the Data icon (right) on the toolbar to open a new Data View window. The Data1 window is displayed. Start by typing $HsCtrTmr1 on row 1 under the Element column. Make this Data1 window wider by placing the mouse on the right edge of the window, left clicking and dragging to the right. As you can see at right under Status, the Heap items .AtResetValue, .EnableCapture, and “.Acc”. The value in parenthesis is the current value. As you turn your encoder, the value for “.Acc” will change. If you move the encoder in the clockwise direction the values will increase. When the encoder moves in the counterclockwise direction, the value decreases. (The reverse maybe true depending on the wiring of the encoder phase A and phase B). 12-42 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a Quadrature Input, continued It is possible to view one Heap item per Data View row. The available Heap items for the $HsCtrTmr1 can be found under the Project Browser -> Configuration -> Memory -> I/O -> Specialty -> $HsCtrTmr1 as shown at right. Displaying Encoder values using Trend View Trend View is a very powerful utility, one that can be used to troubleshoot the control system. We highly recommend you use this tool to the fullest. Create a new Trend View from the Debug Menu or the Trend icon (below, right) on the toolbar, as shown below. BRX User Manual, 2nd Edition 12-43 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a Quadrature Input, continued In Trend View, using a single pane, add the accumulated value of the high-speed counter, $HsCtrTmr1.Acc. As the encoder is turned, you can see the accumulated value changing on the Trend View pane. 52,984 52,984 44,153 44,153 35,323 35,323 26,492 26,492 17,661 17,661 SHsCtrTmr1.Acc 8,830 -0 08:17:49 12-44 8,830 08:17:56 08:18:03 08:18:09 BRX User Manual, 2nd Edition 08:18:16 08:18:23 08:18:29 08:18:36 08:18:43 -0 08:18:49 Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile This example walks through the steps required to use a BRX MPU to generate a pulsed output with a trapezoid profile using the built-in high-speed outputs. The Basic Steps 1. Gather and wire up the hardware (not covered here). 2. Launch the Do-more! Designer software and connect to a BRX MPU with DC sinking or sourcing outputs. 3. Configure Axis 1 to use Y0 for Step and Y1 for Direction. 4. Write the necessary ladder program to generate the trapezoid profile. 5. Download and run the program. 6. Show how Data View and Trend View can be used to monitor and control the profile. Equipment Needed A BRX MPU with DC sinking or sourcing outputs, i.e. BX-DM1E-10ED23-D. A stepper drive and motor properly powered and wired to the BRX MPU outputs. Alternately, the output activity can be monitored in Data View or in Trend View, encase a stepper or similar hardware is not available. Launch the Do-more! Designer Software. By default, the Tip of the Day will pop up. Close it. BRX User Manual, 2nd Edition 12-45 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued The Select Project window will be displayed next. Select New Offline Project. In the New Offline Project windows select the BRX MPU model you are working with. Rename the project as Trapezoid, in the New Project Name field. Press the OK button to accept the selections. 12-46 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued The Dashboard page is displayed and the screen will look as follows: Mouse over the BRX MPU in the Local BRX Onboard I/O view. Select (a) the outputs orange block. Select Configure high-speed outputs (b) to access the Setup BRX High-speed I/O page. BRX User Manual, 2nd Edition 12-47 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued From the Setup BRX High-speed I/O page, select Axis 1 under the Axis/Pulse Outputs section. The Axis/Pulse Output Configuration window comes up. Select (a) Pulse Output. Use the default device name, $Axis 1. For this exercise, select Pulse Output, Step/Direction, Y0 for Step and Y1 for Direction, as shown below. Press (b) OK to return to the Setup BRX High-Speed I/O window. Press OK again to return to the Dashboard screen. Save the project at this time. At this point, we have configured outputs Y0 and Y1 for Step and Direction high-speed outputs. Next, we will write the necessary ladder to generate a trapezoid profile with the configured highspeed outputs. 12-48 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued Ladder Program for Trapezoid Profile Start by opening the $Main code block (a), as shown below. We will add two rungs to the ladder diagram by selecting two instructions from the Instruction Toolbox in the (b) High-Speed/Axis section. The ladder will look like the one shown below. On rung 1 we will place the AXCONFIG instruction and on rung 2 we will place the AXPOSTRAP instruction. The following page discusses setting the instruction parameters when placing these instructions. BRX User Manual, 2nd Edition 12-49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued With the cursor on rung 1, Select AXCONFIG from the tool palette. AXCONFIG is needed to setup the runtime parameters for an Axis. An Axis has no default values and must be configured before it can be used. For this example, we will configure the AXCONFIG with the values as shown in the dialog box on the right. Since we have configured Axis 1 for Step/ Direction, change the AXCONFIG Axis Device field to @Axis 1. For the purpose of our example, leave all other fields at their default values. Move cursor to rung 2 and select AXPOSTRAP from the tool palette. AXPOSTRAP is used to move an Axis from its current position to a specified target position using the configured parameters to generate a trapezoid move profile. For the purpose of this example, change the (a) Axis Device to @Axis 1 and change the (b) Target Type to Relative, leaving the other parameters at their default values. You can change the (c) Position Value if your setup requires additional steps to approximate the trapezoid move. When you use the Relative target type, the profile will move the number of steps indicated by the (c) Position Value each time the AXPOSTRAP instruction is triggered. Write the program to the BRX CPU and verify it is in RUN mode. 12-50 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued Displaying and controlling the trapezoid profile move using Data View From the menu select a new Data View under the Debug -> Data View menu. Alternately, you can use the Data icon (shown on right) on the toolbar ribbon to open a new Data View window. The Data1 window is displayed (right). Start by typing C0 on row 1 and C3 on row 2, under the (a) Element column. Make the Data1 window wider by placing the mouse on the right edge of the window (b), left clicking and dragging to the right. Select (c) the yellow E icon in order to display (d) the Edits column. Be sure All Status On (toolbar ribbon) is selected. Under the Edits column (d), you will see ON and OFF buttons adjacent to C0 and C3. We will use these to trigger our two rungs of instructions. In Data View, to configure AXIS1 parameters, double-left click the ON button for C0 element. NOTE: The first time you use this feature, the program will ask you to confirm the writes. If you prefer check the box so that it will not ask you again. BRX User Manual, 2nd Edition 12-51 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued After triggering C0, the ladder will display the following status as shown below. In the AXCONFIG instruction, we see (a) .MasterEnable and (b) .EnableOutput are highlighted in blue and C1 is set to ON. These indicate that Axis1 is configured and ready to be used. The AXPOSTRAP instruction in Rung 2 shows Axis 1 parameters have been configured (d) (.MasterEnable is highlighted) and it is ready to start sending pulses (e) (.EnableOutput is highlighted). C0 can be turned off once the On Success bit (c), of the AXCONFIG turns on. We are now ready to initiate our trapezoid move. 12-52 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued Double-left click on the C3 ON button in Data View. The trapezoid move will begin. Status indicators on (a) the AXPOSTRAP instruction will provide feedback about the move. The following graphic shows its status after the move is complete. Notice (b) the Current Position is now 1000 and the (c) Target Position is 1000. The field device should have moved 1000 steps. BRX User Manual, 2nd Edition 12-53 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued Displaying $Axis1 Current and Target values using Trend View As mentioned before, Trend View is a very powerful utility, one that can be used to troubleshoot the control system. Open Trend View from the Debug Menu or the Trend icon (right) on the toolbar, as shown below. 12-54 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O Detailed Example: Configure and Test a High-Speed Pulse Output with a Trapezoid Profile, continued In Trend View, using a single pane, add $Axis1.CurrentPosition to a pane. Every time the AXPOSTRAP instruction is triggered, 1000 pulses are generated. In the Trend View snapshot that follows, we can see the instruction was triggered twice. It started at 0 counts and reached 1000 counts the first trigger. On the second trigger, it started at 1000 and reached 2000 counts. There are many settings available that allow the user to meet application needs. Please review the Do-more! Designer High-speed Instruction Help topics for detailed information. BRX User Manual, 2nd Edition 12-55 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D BRX High-speed Instructions In this section we will give an overview of the high-speed instructions available to the BRX Do-more! CPU. They will be presented in this section as in the Instruction Toolbox, in alphabetical order. 1. AXCAM – Axis Electronic Camming 2. AXCONFIG – Axis Configuration 3. AXFOLLOW – Axis Position Following with Offset 4. AXGEAR – Axis Electronic Gearing 5. AXHOME – Axis Perform Home Search 6. AXJOG – Axis Jog Mode 7. AXPOSSCRV – Axis Move to Position Using S-Curve 8. AXPOSTRAP – Axis Move to Position Using Trapezoid 9. AXRSTFAULT – Reset Axis Limit Fault 10. AXSETPROP – Set Axis Properties 11. AXVEL – Axis Set Velocity Mode 12. TDODECFG – Deconfigure Table Driven Output 13. TDOPLS – Load Programmable Limit Switch Table for Table Driven Output 14. TDOPRESET – Load Preset Table for Table Driven Output An expanded discussion of each of these instructions can be found in the Do-more! Designer online Help files under the High-Speed/Axis topic. 12-56 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXCAM The Axis Electronic Camming (AXCAM) instruction is used to establish a Master/Slave connection for an Axis so that its movement is synchronized to another Axis or to a HighSpeed Counter/Timer. The Slave Axis (Axis 1, below) position is derived from the Master position. Any time the Master Axis moves to a new position the Slave Axis will also move to a corresponding position as directed by the Cam Table. Pulse Outputs for a given Axis cannot be commanded until the AXCONFIG instruction has been configured and run successfully. An (a) Axis Device (the slave axis) and either a (b) Master Axis, High-speed Counter or Timer must be configured before the AXCAM instruction can be used. This is setup in the “Setup BRX High-speed I/O” dialog in the BRX Onboard I/O section of the System Configuration. This dialog box can be opened directly from the AXCAM instruction by clicking on the (c) Configure Axis... button and (d) Configure Master Register Device... button (see AXCAM graphic below). NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). After the Axis has been configured, the AXCAM instruction may now be used (For more details see the High-speed I/O Hardware Configuration section). BRX User Manual, 2nd Edition 12-57 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXCAM, continued Points and segments: A Cam Table describes a motion profile that clearly assigns a slave position for each master position of a specific master position range. Cam tables are entered as a series of up to 64 segments. All of the segments are the same size in that they are equal divisions of the total span of the Master Axis travel. A segment describes the distance traveled and the position of the axis. It is equal to the difference between the previous and current positions. Each segment is executed over a defined distance traveled for the Master Axis. When executing these segments, the profiling software in the controller will fit a smooth curve to the data with an updated velocity profile every millisecond. Curve Fitting The Cubic Interpolation method fits a cubic trajectory between each pair (segment) of cam table entries. All segment transitions are curved, even for a linear progression between the segments. The only exception is on the last 2 table segments. The last 2 segments will be a linear progression unless Rotary mode has been selected. In Rotary mode, there will be curves on the last position of the table to the first position of the table. Master Register: This is the Axis, High-Speed Counter or Timer that provides the position source value. This can be any of the Axes or High-Speed Counter/Timers. Non-Axis Master Filter Time: This parameter is only enabled if the Master Register is a High-Speed Counter/Timer. This value is the Filter Time Constant which specifies how often (in Seconds) the Slave’s position is calculated. This can be any constant value or any numeric location. Configure Master Register Device: This button will open the BRX High-Speed Input or Axis/Pulse Output dialog in the System Configuration. Linear vs. Rotary: This setting selects the behavior that will occur when the end of the table has been reached. • Linear: The first two and the last two table positions are used to calculate a linear trajectory (from 0 at the start Linear Mode of the table) and the CPU will continue to output pulses until the instruction is terminated. 0 12-58 BRX User Manual, 2nd Edition ....... Calculated from first and last two points and the extrapolated trajectory. ---- Actual Output pulse. All segements are curved except for first and last. Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXCAM, continued • Rotary: This selection will ‘loop’ the table to start at the beginning. The modulus of the Master Register is used as the table Master Value. Rotary Mode Master Position Offset: A pulse count value that is added to the Master Axis position 0 Table will loop back to start position but the transition before the associated Slave position value is from last position to first position will be curve fitted. calculated. This can be any constant value or any numeric location. If this value is a numeric location the value is read from that location only when the instruction is first enabled. Load Slave Curve Fitting Points from Data Block: The data for the curve is located in PLC memory. • Length from Starting Master Position: The total number of pulse counts the Master will move. • Number of Curve Fitting Points: The number of segments to divide the Length from Master Position into. There must be at least 3 curve fitting points in the table with a maximum of 64. • Slave Curve Fitting Table Starting Address: The beginning address in PLC memory where the curve data is stored. Fixed Curve Fitting Points: The data for the curve is in the instruction table. • Length from Starting Master Position: The total number of pulse counts the Master will move. • Number of Curve Fitting Points: The number of segments to divide the Length from Master Position into. There must be at least 3 curve fitting points in the table with a maximum of 64. Enable Relative Mode: If selected, the function is enabled. The Slave Axis’ current position is stored internally and that position becomes the new 0 for the Slave Axis. As the Master Axis moves, the Slave position values are now relative to this stored position. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will remain FALSE until the enable leg goes back OFF. Once the enable leg turns OFF, if the instruction’s device/parameters were valid, this bit will turn ON once the .CurrentVelocity reaches 0. • JMP to Stage: Similarly, the JMP will not occur until after the instruction is enabled, then disabled, and all the instruction device/parameters were valid and the .CurrentVelocity reaches 0. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction, with the devices specified or if the AXCAM move was interrupted before completion. • JMP to Stage: If there was a problem with the parameters configured in the instruction, with the devices specified or the AXCAM move was interrupted before completion, the PLC will jump to that stage. BRX User Manual, 2nd Edition 12-59 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXCAM, continued Example AXCAM In this example we will demonstrate the use of the AXCAM instruction in conjunction with the AXCONFIG instruction to create a circular path output using multiple axes. The radius of the circle (50000) is loaded into D10. The center position is: X=100000, Y=100000. The path followed is defined in the program SineCalculation. Axes 0,1 & 2 are defined with the AXCONFIG instruction. The AXCAM instruction creates the movement of the Axes to define the path traveled. The program SineCalculation is called to perform the necessary math calculations to create a circular path output. The SineCalculation is called for each segment in the camming table (61 segments). The following pages show the ladder program that defines this operation. (Ladder continued on next page.) 12-60 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXCAM, continued 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D (Ladder continued from previous page.) BRX User Manual, 2nd Edition 12-61 Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXCAM, continued Program: SineCalculation A program is written to perform a separate calculation to create a circular path output. 12-62 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXCONFIG The Axis Configuration (AXCONFIG) instruction configures the parameters for a specific Axis so that it may be used for all of the other AXIS commands. Pulse Outputs for a given AXIS cannot be commanded until the AXCONFIG instruction has been run successfully. When the AXCONFIG instruction has been successfully created and initiated, the .MasterEnable structure member for that AXIS will become true and the AXIS may be commanded by other Axis instructions. An (a, above and Axis 1 below) Axis Device must be configured before the AXCONFIG instruction can be used. This is setup in the Setup BRX High-speed I/O dialog found in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Axis… button (see AXCONFIG graphic above). After the Axis has been configured (see the High-speed I/O Hardware Configuration section for more details), the AXCONFIG instruction may now be used. NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in followingtype applications (AXCAM, AXFOLLOW or AXGEAR). BRX User Manual, 2nd Edition 12-63 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXCONFIG, continued Linear vs Rotary: This setting selects the behavior that will occur when the end of the table has been reached. • Linear: Linear actuators move forward or backward on a fixed linear path. The movement of linear actuators are defined in linear units such as inches or millimeters. Since linear actuators only move in two directions on a fixed path, linear actuators are defined as finite, meaning they have a set distance that they can travel in either direction before they must stop. • Rotary: Rotary actuators produce rotary motion, meaning that the actuator revolves on a circular path. Movement from this type of actuator is defined in rotary units, typically degrees. A rotary table doesn’t have a fixed distance it can travel; it can keep spinning in the same direction indefinitely. The count for a rotary input is kept within a defined range (Rotary Range Length). Once the count has exceeded the high limit of the specified Rotary Range Length, it will reset to 0. If the Axis position is decreasing (negative velocity value), when it falls below 0, it will go to the high value specified in the Rotary Range Length. Initial Output Position: The current count will be set to this value when the Axis is first enabled and any time the Axis is reset. This can be any constant value or any numeric location. Minimum Velocity (pulses/sec): The slowest frequency of output pulses that will be generated when the output is enabled. This can be any positive constant from 10 to 250000 or any numeric location with a value in that range. Maximum Velocity (pulses/sec): The fastest frequency of output pulses that will be generated when the output is enabled. This can be any positive constant from 10 to 250000 or any numeric location with a value in that range. Acceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping up from a slower pulse rate to a higher pulse rate. This can be any positive constant or any numeric location with a value in that range. Deceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping down from a faster pulse rate to a slower pulse rate. This can be any positive constant or any numeric location with a value in that range. Fault Deceleration Rate (pulses/sec2): Any time a Fault Limit is reached or the Axis .MasterEnable is turned OFF, the Axis will decelerate to 0 at this specified rate. A value of 0 will cause the Axis to immediately stop moving. This can be any positive constant or any numeric location with a value in that range. Encoder Feedback: Enable this option if an incremental encoder is being used to provide the speed reference feedback. The Axis structure contains a .FollowingError that indicates the difference in the commanded position and the encoder feedback. This can indicate a stalled motor, mechanical slippage or other problem in the application. 12-64 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXCONFIG, continued • High-speed Input Function 1/High-speed Input Function 2/High-speed Input Function 3: Choose one of these options for the encoder feedback. The High-speed Counters must be setup in the Setup BRX Counter/Timer section of the BRX Onboard I/O>High-speed I/O… section in the System Configuration. Click on the Configure High-speed Input… button to access this directly. • Position Based on: Encoder: This option will place the specified High-speed Input Function into the .CurrentPosition member of the Axis configured in this instruction. The difference in the specified High-speed Input Function and the actual pulse output count of the Axis configured in this instruction will be indicated in the .FollowingError. Pulse Output: This option will indicate the actual pulse output count of the Axis configured in this instruction into the .CurrentPosition member and the .FollowingError will indicate the difference between .CurrentPosition and the High-speed Input Function that has been specified. • Pulse Output/Encoder Scale: If the motor and the encoder have different pulse-per-revolution values, enter the scale value required to bring them into alignment. • Encoder Deadband (counts): Having some deadband value around the encoder current position can prevent the pulse output from generating alternating small pulses trying to get the input value to an exact number. This value is applied both above and below the encoder value. For example: A value of 2 will be a deadband of 2 above and 2 below for a span of 4 counts. Enable Positive/Clockwise Motion Fault-Limit: Enable this option to use a physical input that will cause the Axis to Fault (Stop) if the input becomes true or false (based on the setting below) when moving in the Clockwise or Positive direction. This is typically used as an over-travel limit switch. If a Fault-Limit is tripped, use the Axis Reset Fault (AXRSTFLT) instruction or re-trigger the Axis Config (AXCONFIG) instruction to clear the fault. Any attempt to move in the same direction that caused the fault will immediately generate another fault condition. Movement of the Axis in the opposite direction is permitted. Limit Input: This needs to be one of the onboard X discrete input elements. This is where the over travel limit switch would be wired to. Stop/fault when Limit is: Choose OFF to cause the Axis to fault (stop) when the specified input goes from True to False. Choose ON to cause the Axis to fault (stop) when the specified input goes from False to True. Enable Negative/Counter-Clockwise Motion Fault-Limit: Enable this option to use a physical input that will cause the Axis to Fault (Stop) if the input becomes true or false (based on the setting below) when moving in the Counter-Clockwise or Negative direction. This is typically used as an over-travel BRX User Manual, 2nd Edition 12-65 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXCONFIG, continued limit switch. If a Fault-Limit is tripped, use the Axis Reset Fault (AXRSTFLT) instruction or re-trigger the Axis Config (AXCONFIG) instruction to clear the fault. Any attempt to move in the same direction that caused the fault will immediately generate another fault condition. Movement of the Axis in the opposite direction is permitted. Limit Input: This needs to be one of the onboard “X” discrete input elements. This is where the over travel limit switch would be wired to. Stop/fault when Limit is: Choose OFF to cause the Axis to fault (stop) when the specified input goes from True to False. Choose ON to cause the Axis to fault (stop) when the specified input goes from False to True. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if the parameters configured in the instruction and proper devices were specified. • JMP to Stage: If the parameters configured in the instruction and proper devices were specified, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction or with the devices specified. • JMP to Stage: If there was a problem with the parameters configured in the instruction or with the devices specified, the PLC will jump to that stage. 12-66 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXFOLLOW The Axis Position Following with Offset (AXFOLLOW) instruction is used to establish a Master/Follower connection for an Axis so that the Follower’s movement is synchronized to the Master’s movement. The Master can be another Axis or a High-Speed Counter/Timer. Pulse Outputs for a given AXIS cannot be commanded until the AXCONFIG instruction has been configured and run successfully. Because the Follower Axis will need the ability to overtake the Master Axis during a Goto Relative Offset operation, ensure that the Maximum Velocity and Acceleration parameters of the Master and Follower Axes have been configured with enough capacity to allow this. The Follower Axis can be made more responsive by configuring it with higher Maximum Velocity or a faster Acceleration or both. If the instruction is enabled with the Goto Offset Signal OFF, the Axis will behave in a Velocityfollowing manner. As soon as the Goto Offset Signal turns ON, the Axis will now behave in a Position-following manner and will remain so until the instruction is terminated. If the instruction is enabled with the Goto Offset Signal ON, the Axis will behave in a Positionfollowing manner until the instruction is terminated. To help keep track of the Axes movement relative to each other, any time the Axis is in Position Following mode the Follower Axis associated structure member, .MstSlvCoordError, will contain the difference (in pulse counts) between the Master Axis position and the Follower Axis’ position. An (a) Axis Device (the slave axis) and either a (b) Master Axis, High-speed Counter or Timer must be configured before the AXFOLLOW instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (c) Configure Axis… button and (d) Configure Master Register Device... button. After the Axis has been configured (see the High-speed I/O Hardware Configuration section for more details), the AXFOLLOW instruction may now be used. BRX User Manual, 2nd Edition 12-67 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXFOLLOW, continued NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). Master Register: This is the Axis, High-Speed Counter or Timer that provides the position source value. This can be any of the Axes or HighSpeed Counter/Timers. Non-Axis Master Filter Time: This parameter is only enabled if the Master Register is a High-Speed Counter/ Timer. This value is the Filter Time Constant which specifies how often (in Seconds) the Slave’s position is calculated. This can be any constant value or any numeric location. Configure Master Register Device: This button will open the BRX High-Speed Input or Axis/ Pulse Output dialog in the System Configuration. Gear Ratio Multiplier: A multiplier that will be applied when the Follower’s position is calculated. This can be any constant value or any numeric location. Unlike the similar parameter in the Electronic Gearing (AXGEAR) instruction, this value cannot be adjusted while the instruction is enabled. Relative Offset Position: The Follower’s position value will be adjusted by this pulse count value each time the Goto Offset Signal turns ON. This can be any constant value or any numeric location. Relative Offset Velocity: The additional velocity the Follower Axis will use when moving to the Relative Offset Position. This value specifies how much faster (in pulses/second) the Follower Axis can move than the Master Axis when attempting to move to the Relative Offset Position. This value can be any constant between 0 and 250,000 or any numeric location containing a value in that range. Goto Offset Signal: Each time this Bit transitions from OFF to ON, the Follower Axis will attempt to move to the Relative Offset Position using the Relative Offset Velocity. If the Relative Offset Position is reached the instruction will turn this Bit OFF. This can be any Bit memory address. 12-68 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXFOLLOW, continued NOTE: If the Bit assigned to the Goto Offset Signal stays ON, it indicates the Follower Axis does not have the capacity to overtake the Master Axis. Make the Follower Axis more responsive by configuring it with higher Maximum Velocity or a faster Acceleration, or both. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will remain FALSE until the enable leg goes back OFF. Once the enable leg turns OFF, if the instruction’s device/parameters were valid, this bit will turn ON once the .CurrentVelocity reaches 0. • JMP to Stage: Similarly, the JMP will not occur until after the instruction is enabled, then disabled, and all the instruction’s device/parameters were valid and the .CurrentVelocity reaches 0. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction, with the devices specified or if the AXFOLLOW move was interrupted before completion. • JMP to Stage: If there was a problem with the parameters configured in the instruction, with the devices specified or the AXFOLLOW move was interrupted before completion, the PLC will jump to that stage. BRX User Manual, 2nd Edition 12-69 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXFOLLOW, continued Example AXFOLLOW ladder. Rung 1 configures Axis 1 parameters. Rung 2 configures Axis 2 parameters. Rung 3 uses the AXVEL instruction to set the velocity structure. Rung 4 sets the AXFOLLOW instruction that will describe the motion of both axes. 12-70 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXGEAR The Axis Electronic Gearing (AXGEAR) instruction is used to create a type of Master/Slave connection that will synchronize the movement of one axis relative to another axis or a HighSpeed Counter/Timer. Pulse Outputs for a given AXIS cannot be commanded until the AXCONFIG instruction has been configured and run successfully. AXGEAR always behaves in a Position-Following mode. The Slave axis position is derived from the Master position so that any time the position of the Master Axis changes, the position of the Slave Axis will move to a position that has been modified by the user-supplied gear ratio. When the move to position operation is enabled, the AXGEAR instruction will use the current values of the Gear Ratio, the Axis Maximum Velocity, Accel, Decel and the Master’s Target Position to calculate the move profile. Any changes to the Gear Ratio and Target Position will result in a trajectory change of the AXGEAR Axis. To help keep track of the Axes movement relative to each other, any time the Axis is in Electronic Gearing mode the Slave Axis associated structure member, .MstSlvCoordError, will contain the difference (in pulse counts) between the Master Axis position and the Slave Axis position. An (a) Axis Device (the slave axis) and either a (b) Master Axis, High-speed Counter or Timer must be configured before the AXGEAR instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (c) Configure Axis… button and (d) Configure Master Register Device... button. After the Axis has been configured (For more details, see the High-speed I/O Hardware Configuration section), the AXGEAR instruction may now be used. BRX User Manual, 2nd Edition 12-71 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXGEAR, continued NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in followingtype applications (AXCAM, AXFOLLOW or AXGEAR). Master Register: This is the Axis, High-Speed Counter or Timer that the Slave Axis will be electronically geared to. This can be any of the Axes or High-Speed Counter/ Timers. Non-Axis Master Filter Time: This parameter is only enabled if the Master Register is a High-Speed Counter/Timer. This value is the Filter Time Constant which specifies how often (in Seconds) the Slave’s position is calculated. This can be any constant value or any numeric location. Configure Master Register Device: This button will open the BRX High-Speed Input or Axis/ Pulse Output dialog in the System Configuration. Gear Ratio Multiplier: A multiplier that will be applied each time the Slave’s position is calculated. A value of 0 will cause the Slave Axis to stop. This can be any constant value or any numeric location. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will remain FALSE until the enable leg goes back OFF. Once the enable leg turns OFF, if the instruction’s device/parameters were valid, this bit will turn ON once the .CurrentVelocity reaches 0. • JMP to Stage: Similarly, the JMP will not occur until after the instruction is enabled, then disabled, and all the instruction’s device/parameters were valid and the .CurrentVelocity reaches 0. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction, with the devices specified or if the AXGEAR move was interrupted before completion. • JMP to Stage: If there was a problem with the parameters configured in the instruction, with the devices specified or the AXGEAR move was interrupted before completion, the PLC will jump to that stage. 12-72 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXGEAR, continued Example AXCAM ladder. This example demonstrates the usage of the AXGEAR instruction. Axes 0, 1& 2 are configured in the first scan with AXCONFIG. (Ladder continued on next page.) BRX User Manual, 2nd Edition 12-73 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXGEAR, continued In this section when C66 goes high AXCAM is executed. Axis 1 and Axis 2 will move proportionally depending on the data specified in gear ratio multiplier field of the AXGEAR instruction. Virtual Axis 0 position is the pointer used. As the Virtual Aixs 0 moves from position 0 to position 10000 the position of Axis 1 and Axis 2 will follow proportionally to the values in R0 and R1. Axis 2 rotation should be opposed to Axis 1. (Ladder continued from previous page.) 12-74 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXHOME The Axis Perform Home Search (AXHOME) instruction is used to perform the necessary steps to move the specified Axis to a known starting position. Pulse Outputs for a given AXIS cannot be commanded until the AXCONFIG instruction has been configured and run successfully. An (a) Axis Device must be configured before the AXHOME instruction can be used. This is setup in the “Setup BRX High-speed I/O” dialog that is in the “BRX Onboard I/O” section of the System Configuration. You can link directly with the (b) Configure Axis… button in the AXHOME instruction. BRX User Manual, 2nd Edition 12-75 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXHOME, continued After the Axis has been configured (see the High-speed I/O Hardware Configuration section for more details), the AXHOME instruction may now be used. NOTE: Axis 0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in following-type applications (AXFOLLOW or AXGEAR). Homing Velocity (Signed): The maximum velocity the Axis will ramp up to when moving toward Discrete Input Limit 1. The Axis will ramp up and down using the Axis current Acceleration and Deceleration settings. This can be any constant value from -250000 to -10, 0, and 10 to 250000 or any numeric location containing a value in that range. The sign of the value will indicate the direction of travel. Positive numbers will move the Axis clockwise, negative numbers will move the Axis counter-clockwise. 12-76 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXHOME, continued Discrete Input Limit 1: The Home Search operation requires at least one discrete input. • Discrete Input: The discrete input where the Home limit switch is connected. This must be one of the on-board discrete inputs. • Event: Selects which of the following conditions will indicate the Home switch has been reached: 1. Rising Edge 2. Falling Edge 3. Rising OR Falling Edge 4. High Level 5. Low Level Termination: Specifies what action to take after reaching the Home switch (Input Limit 1) • Position: Use the Axis current positioning configuration to move the Axis to an absolute pulse count relative to the position of Discrete Input Limit 1. Offset from Limit 1: When Discrete Input Limit 1 is reached, the Axis marks the position of the switch and will then move the Axis toward the specified Position. • Creep to Second Position: Move the Axis to a second discrete Input Limit switch. 1. 2. Creep Velocity (Signed): The maximum frequency the Axis will ramp up to when moving toward Discrete Input Limit 2. The Axis will ramp up and down using the Axis current Acceleration and Deceleration settings. This can be any constant value between -250000 to -10, 0, and 10 to 250000 or any numeric location containing a value in that range. The sign of the value will indicate the direction of travel: positive numbers will move the Axis clockwise, negative numbers will move the Axis counter-clockwise. Discrete Input Limit 2: Use a discrete input for Limit 2. This could be a second discrete input or the same input as Discrete Input Limit 1. Discrete Input: The discrete input where the Discrete Input Limit 2 switch is connected. This must be one of the on-board discrete inputs. Event: Selects which of the following conditions will indicate the Home switch has been reached: • Rising Edge • Falling Edge • Rising OR Falling Edge • High Level • Low Level 3. Decelerate to 0 Velocity: The Axis will decelerate from the Homing Velocity to 0. BRX User Manual, 2nd Edition 12-77 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXHOME, continued Zero Position At: Enable this option to have the Axis set its Current Position to 0 after the following step of the Home Search operation: • Limit 1: Set the Current Position to 0 when the Discrete Input Limit 1 switch is reached. Any additional movement of the Axis during the Termination phase will be reflected in the Axis Current Position value. • Home/When Done: Set the Current Position to 0 when all phases of the Home Search operation is complete. Input Leg: Specifies how the instruction will be enabled to run: • Edge Triggered: Each time the input logic transitions from OFF to ON this instruction will run to completion. This selection does not allow the Home Search operation to be interrupted once it has started except by manually turning OFF the .MasterEnable for the Axis, which will put the Axis into a fault condition that must be cleared before the Axis will be permitted to move. Use the AXRSTFAULT (Reset Axis Limit Fault) instruction to clear an Axis Fault. • Power Flow Enabled: When the Input logic transitions from OFF to ON the instruction will begin to execute and will continue executing as long as the input logic remains ON. This selection allows the Home Search operation to be interrupted by turning the input logic OFF. This is an error condition but it does not put the Axis into a Fault condition. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if the parameters configured in the instruction and proper devices were specified and the Home operation completes uninterrupted. • JMP to Stage: If the parameters configured in the instruction and proper devices were specified, the PLC will jump to that stage once the Home operation completes. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction, with the devices specified or if the Home operation was interrupted before completion. • JMP to Stage: If there was a problem with the parameters configured in the instruction, with the devices specified or the Home operation was interrupted before completion, the PLC will jump to that stage. 12-78 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXHOME, continued Examples of various AXHOME configurations are considered on the following pages. Termination at Position of Limit 1 Example 1: Termination at Position of Limit 1 (Axis moves back to Limit 1 Position) Accel Rate Decel Rate Limit 1 Start Decel Rate Accel Rate Homing Velocity $Axis1.CurrentPosition goes to here. The Axis decelerates, changes direction and goes back to $Axis.CurrentPosition = 0 (Not looking at Limit 1 anymore). Example 2: Termination Using Creep to Limit 2. The Axis decelerates, changes direction and goes back to the falling edge of Limit 2 and the $Axis.CurrentPosition goes to 0 Take note that Limit 2 is the same physical switch in this situation. It could be a different one if it would make better sense for the application. BRX User Manual, 2nd Edition 12-79 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXHOME, continued Example 3: Using Level and Edge Limits, Sharing the Same Input. The Axis decelerates, changes direction and goes back to the Falling Edge of Limit 2 and the $Axis.CurrentPosition goes to 0. Take note that Limit 2 is the same physical switch in this situation. It could be a different one if it would make better sense for the application. Example 4: Using Level and Edge Limits, Sharing the Same Input. This is the same setup as the prior example but the Input for limit 1 on ON at the time of enabling the AXHOME instruction. The first movement does not occur in this case and the Axis creeps back to the Falling Edge of the switch. 12-80 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXHOME, continued Example 5: Termination Decelerate to 0 Velocity. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D In this case, when the AXHOME operation is complete, the $Axis1.CurrentPosition will contain a negative value. Example 6: Termination Decelerate to 0 Velocity. In this case, when the AXHOME operation is complete, the $Axis1.CurrentPosition will go to a 0 value. BRX User Manual, 2nd Edition 12-81 Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXJOG The Axis Jog (AXJOG) instruction sets an Axis into a mode where its position can be manually adjusted by moving the Axis in the forward or reverse direction. Jogging is a simple velocity move that uses the Acceleration and Deceleration parameters specified in the Axis Configuration to ramp up to and ramp down from the Target Velocity specified in the AXJOG instruction or the Maximum Velocity specified in the Axis Configuration, whichever is lower. An (a) Axis Device must be configured before the AXJOG instruction can be used. This is done in the Setup BRX High-speed I/O dialog that is in the “BRX Onboard I/O” section of the System Configuration. You can open this dialog directly with the (b) Configure Axis… button. After the Axis has been configured (below) the AXJOG instruction may now be used (See the High-speed I/O Hardware Configuration section for more details). NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). 12-82 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXJOG, continued Zero Count at Completion: When this option is enabled the Current Position of the Axis will be set to 0 when the Enable/Reset input transitions from ON to OFF. If this option is not enabled, the Axis will retain the contents of the Current Position after the Jog is complete. Target Velocity: Specifies the speed that the Axis will output pulses when the Enable Leg of the AXJOG is ON and either the Forward or Reverse Leg is ON. If this value is higher than the Maximum Velocity specified in the Axis Configuration, the Axis Configuration value will be used. Forward and Reverse moves will use the Axis Configuration’s Acceleration and Deceleration values when ramping up to and ramping down from the Maximum Velocity allowed. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will remain FALSE until the enable leg goes back OFF. Once the enable leg turns OFF, if the instruction’s device/parameters were valid, this bit will turn ON once the .CurrentVelocity reaches 0. • JMP to Stage: Similarly, the JMP will not occur until after the instruction is enabled, then disabled, and all the instruction’s device/parameters were valid and the .CurrentVelocity reaches 0. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. NOTE: Because this instruction puts the Axis into an operational mode (as opposed to performing a single operation), On Success is defined as getting the Axis into Jog mode with no errors. This means that the On Success indication will turn ON after the Enable/Reset input logic transitions from ON to OFF and the Axis’ Current Velocity is at 0. When these conditions are met the Axis’ Mode is “Idle”. You should wait until the On Success indication turns ON before attempting to execute any other Axis instruction. Example Ladder Logic: BRX User Manual, 2nd Edition 12-83 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXPOSSCRV The Axis Move to Position Using S-Curve (AXPOSSCRV) instruction is used to move an Axis from its current position to a specified target position using the Axis configured parameters and the specified Jerk parameter which will yield an s-curve velocity profile. Pulse Outputs for a given Axis Device cannot be commanded until the AXCONFIG instruction has been configured and run successfully. An (a) Axis Device must be configured before the AXPOSSCRV instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. You can open this dialog directly with the (b) Configure Axis… button. After the Axis has been configured (see the High-speed I/O Hardware Configuration section for more details), the AXPOSSCRV instruction may now be used. NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the Master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). 12-84 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXPOSSCRV, continued Input Leg • Edge Triggered: The move to position operation will be performed each time the input transitions from OFF to ON. Once a move to position operation is in progress it can only be stopped by manually setting the axis .MasterEnable member to OFF, which will put the axis into a Fault state. • Power flow Enabled: The move to position operation will begin when the input transitions from OFF to ON and will continue to completion as long as the input remains ON. This selection has the benefit of being able to interrupt a move to position operation by setting the input state to OFF and NOT putting the Axis into a Fault state. Target Type • Absolute: Absolute moves are measured from the axis zero position. When an axis is initialized, its current position is set to 0. An absolute move to 10000 will generate 10000 pulses to move the axis forward 10000 pulses. A subsequent absolute move to -10000 will (Absolute) generate 20000 pulses to move the axis backward past 0 to the -10000 Position Value position. If you execute an absolute move with a Position Value that is the same as the Axis Current Position the axis will not move as the 0 Current Target Position Position absolute position is already reached. • Relative: Relative moves are measured from the Axis’ current position. When an axis is initialized, its current position is set to 0. A relative move to 10000 will generate 10000 pulses to move the axis forward 10000 pulses. A subsequent relative move of -10000 will generate 10000 pulses to move the axis backward to that 0 position. (Relative) • Zero-out Current Position Before Initial Move: Enable this option to have the axis set its Current Position value to 0 before any move operation. Position Value 0 Current Position Target Position • Position Value: The target position (pulse count) to move the axis to. This can be any constant value, or any numeric location with a value in that range. BRX User Manual, 2nd Edition 12-85 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXPOSSCRV, continued Linear vs. Rotary • Linear: The series of pulses will produce forward or backwards motion along a fixed linear path. If the Target Position value is a higher value than the Current Position value, the resulting move will be in the positive (increasing) direction. If the Target Position value is a lower value than the Current Position, the resulting move will be in the negative (decreasing) direction. • Rotary: The series of pulses will produce Clockwise or CounterClockwise motion along a fixed circular path either as an absolute position value or relative position as noted in the discussion below. Move to Absolute Target in Clockwise Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will always generate pulses in an increasing (positive) direction. So if the Target Position value is lower than the Current Position, the PLC will ‘roll over’ in the clockwise direction to achieve the position. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Move to Absolute Target in Counterclockwise Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will always generate pulses in a decreasing (negative) direction. So if the Target Position value is higher than the Current Position value, the PLC will ‘roll over’ in the Counter clockwise direction to achieve the position. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 220 pulses. 12-86 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXPOSSCRV, continued Move to Absolute Target in Shortest Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will calculate the shortest distance between the Target Position Value and the Current Position value and go in either Clockwise or Counter Clockwise direction to achieve the target. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Relative Rotary Target Type, so sign of Position Value parameter specifies direction: A positive Position Value will move the Axis in a Clockwise direction and a negative Position Value will move the Axis in a Counter Clockwise direction. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Jerk: The Jerk term specifies how quickly the Axis is allowed to achieve maximum Acceleration and Deceleration on its way to reaching maximum Velocity. This value is specified in pulses/ sec3. Supersede Default Properties: These parameters allow this AXPOSSCRV instruction to override the values specified in the AXCONFIG instruction. They only temporarily change the values in the AXCONFIG for this movement. To permanently change the parameters in the AXCONFIG, use the Set Axis Properties (AXSETPROP) instruction. • Maximum Velocity (pulses/sec): The fastest frequency of output pulses that will be generated during the move to position operation. This can be any positive constant from 10 to 250000, or any numeric location with a value in that range. • Acceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping up from a slower pulse rate to a higher pulse rate. This can be any positive constant or any numeric location with a value in that range. • Deceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping down from a higher pulse rate to a slower pulse rate. This can be any positive constant or any numeric location with a value in that range. BRX User Manual, 2nd Edition 12-87 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXPOSSCRV, continued On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. Example Usage: 12-88 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXPOSTRAP The Axis Move to Position Using Trapezoid (AXPOSTRAP) instruction is used to move an Axis from its current position to a specified target position using the Axis’ configured parameters which will yield a trapezoid velocity profile (linear acceleration and deceleration). Pulse Outputs for a given AXIS cannot be commanded until the AXCONFIG instruction has been configured and run successfully. An (a) Axis Device must be configured before the AXPOSTRAP instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Axis…” button. After the Axis has been configured (below), the AXPOSTRAP instruction may now be used (See the High-speed I/O Hardware Configuration section for more details). NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the Master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). BRX User Manual, 2nd Edition 12-89 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXPOSTRAP, continued Move Type • Single move: The axis will perform 1 move to the specified position. Edge Triggered: The move to position operation will be performed each time the input transitions from OFF to ON. Once a move to position operation is in progress it can only be stopped by manually setting the axis .MasterEnable member to OFF, which will put the axis into a Fault state. Power flow Enabled: The move to position operation will begin when the input transitions from OFF to ON and will continue to completion as long as the input remains ON. This selection has the benefit of being able to interrupt a move to position operation by setting the input state to OFF and NOT putting the axis into a Fault state. • Multi-move: The axis can perform multiple moves by changing the “Position Value” register and triggering the “Update Target Position” bit. • Trigger Target Position: Specify an internal bit for this field. Changing this bit from OFF to ON will result in the PLC changing its Target Position (without stopping) to the value loaded into the “Position Value” register. The PLC will automatically turn the “Update Target Position” bit back OFF after changing its target position. The .AtPosition bit member of the Axis structure can be monitored to ensure completion. Target Type • Absolute: Absolute moves are measured from the axis zero position. When an axis is initialized, its current position is set to 0. An absolute move to 10000 will generate 10000 pulses to move the Axis forward 10000 pulses. A subsequent absolute move to -10000 will generate 20000 pulses to move the Axis backward past 0 to the -10000 position. If you execute an absolute move with a Position Value that is the same as the axis Current Position the axis will not move as the absolute position is already reached. • Relative: Relative moves are measured from the axis current position. When an axis is initialized, its current position is set to 0. A relative move to 10000 will generate 10000 pulses to move the axis forward 10000 pulses. A subsequent relative move of -10000 will generate 10000 pulses to move the Axis backward to that 0 position. 12-90 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXPOSTRAP, continued • Zero Current Position Before Initial Move: Enable this option to have the Axis set its Current Position value to before any move operation. 0 Single Move: Current Position is set to 0 before the move to position operation begins. Multi-Move: Current Position is set to 0 before the first move to position but does not happen on subsequent OFF to ON transitions of the Trigger Target Position. • Position Value: The target position (pulse count) to move the Axis to. This can be any constant value, or any numeric location with a value in that range. Linear vs. Rotary: • Linear: The series of pulses will produce forward or backwards motion along a fixed linear path. If the Target Position value is a higher value than the Current Position value, the resulting move will be in the positive (increasing) direction. If the Target Position value is a lower value than the Current Position, the resulting move will be in the negative (decreasing) direction. • Rotary Move to Absolute Target in Clockwise Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will always generate pulses in an increasing (positive) direction. So if the Target Position value is lower than the Current Position, the PLC will ‘roll over’ in the clockwise direction to achieve the position. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Move to Absolute Target in Counterclockwise Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will always generate pulses in a decreasing (negative) direction. So if the Target Position value is higher than the Current Position value, the PLC will ‘roll over’ in the Counter clockwise direction to achieve the position. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 220 pulses. BRX User Manual, 2nd Edition 12-91 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXPOSTRAP, continued Move to Absolute Target in Shortest Direction: Taking into account the Rotary Range specified in the AXCONFIG and the Target Position Value, the PLC will calculate the shortest distance between the Target Position Value and the Current Position value and go in either Clockwise or Counter Clockwise direction to achieve the target. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Relative Rotary Target Type, so sign of Position Value parameter specifies direction: A positive Position Value will move the Axis in a Clockwise direction and a negative Position Value will move the Axis in a Counter Clockwise direction. If the Target Position Value specified exceeds the Rotary Range, the Axis will move to the modulus result. For example: If the Rotary Range is 0–359 (360 degrees) and a Target Position Value of 500 was specified, the Axis will output 140 pulses. Supersede Default Properties Selecting these parameters allows the AXPOSTRAP instruction to override the values specified in the AXCONFIG instruction. They only temporarily change the values in the AXCONFIG for this movement. To permanently change the parameters in the AXCONFIG, use the Set Axis Properties (AXSETPROP) instruction. • Maximum Velocity (pulses/sec): The fastest frequency of output pulses that will be generated during the move to position operation. This can be any positive constant from 10 to 250000, or any numeric location with a value in that range. • Acceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping up from a slower pulse rate to a higher pulse rate. This can be any positive constant or any numeric location with a value in that range. • Deceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping down from a higher pulse rate to a slower pulse rate. This can be any positive constant or any numeric location with a value in that range. 12-92 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXPOSTRAP, continued On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. Example Usage: BRX User Manual, 2nd Edition 12-93 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXRSTFAULT The Reset Axis Limit Fault (AXRSTFAULT) instruction is used to clear the fault in an axis that has either reached one of the configured Fault Limits while it was moving or has had its .MasterEnable manually reset. After the instruction has cleared the fault state in an axis fault, any attempt to move the Axis in the same direction that caused the fault will immediately generate another fault condition. Movement of the axis in the opposite direction that caused the fault is permitted. The AXCONFIG (Axis Configuration) instruction will also reset an Axis that is in a fault state. An (a) Axis Device must be configured before the AXRSTFAULT instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Axis… button. After the axis has been configured (see the High-speed I/O Hardware Configuration section for more details), the AXRSTFAULT instruction may now be used. NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the Master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). 12-94 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXRSTFAULT, continued On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUEwhen proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. Example Usage BRX User Manual, 2nd Edition 12-95 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXSETPROP The Set Axis Properties (AXSETPROP) instruction is used to make runtime changes to the configured parameters of an Axis. An (a) Axis Device must be configured before the AXSETPROP instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Axis… button. After the Axis has been configured (below) the AXSETPROP instruction may now be used (see the High-speed I/O Hardware Configuration section for more details). NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). 12-96 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXSETPROP, continued Position: The current count will be set to this value when this instruction is enabled. This can be any constant value or any numeric location. Minimum Velocity (pulses/sec): The slowest frequency of output pulses that will be generated when the output is enabled. This can be any positive constant from 10 to 250000 or any numeric location with a value in that range. Maximum Velocity (pulses per second): The fastest frequency of output pulses that will be generated when the output is enabled. This can be any positive constant from 10 to 250000 or any numeric location with a value in that range. Acceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping up from a slower pulse rate to a higher pulse rate. This can be any positive constant or any numeric location with a value in that range. Deceleration Rate (pulses/sec2): The rate at which the pulses will be generated when the axis is ramping down from a faster pulse rate to a slower pulse rate. This can be any positive constant or any numeric location with a value in that range. Fault Deceleration Rate (pulses/sec2): Any time a Fault Limit is reached or the Axis .MasterEnable is turned OFF, the axis will decelerate to a velocity of 0 pulses/sec at this specified rate. A value of 0 will cause the Axis to immediately stop moving. This can be any positive constant or any numeric location with a value in that range. Pulse Output/Encoder Scale: If the motor and the encoder have different pulse-per-revolution values, enter the scale value required to bring them into alignment. Encoder Deadband (counts): Having some deadband value around the encoder current position can prevent the pulse output from generating alternating small pulses trying to get the input value to an exact number. This value is applied both above and below the encoder value. For example: A value of 2 will be a deadband of 2 above and 2 below for a span of 4 counts. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. BRX User Manual, 2nd Edition 12-97 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXSETPROP, continued Example Usage 12-98 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O AXVEL The Axis Set Velocity Mode (AXVEL) instruction is used to put an axis into an operation mode where its movement is controlled by velocity rather than position. Pulse Outputs for a given axis cannot be commanded until the AXCONFIG instruction has been configured and run successfully. The ladder logic input to this instruction is an Enable/Reset, which means that when the Input logic turns ON the axis will ramp up to the axis structure’s .TargetVelocity value, and when the Input logic turns OFF the axis will ramp down to a velocity of 0 and the instruction will end. While the instruction is enabled, changing the axis associated structure member .TargetVelocity will dynamically change the output pulse frequency and will follow the specified Acceleration/Deceleration Mode of the instruction to achieve the speed change. An (a) Axis Device must be configured before the AXVEL instruction can be used. This is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Axis… button. After the axis has been configured (below), the AXVEL instruction may now be used (See the High-speed I/O Hardware Configuration section for more details). NOTE: Axis0 is a ‘virtual axis’ and will not generate pulses to physical outputs of the PLC. Axis0 can be used for generating pulse output profile register values to be used for Table Driven Outputs (TDOPRESET or TDOPLS) or as the Master for other axes in following-type applications (AXCAM, AXFOLLOW or AXGEAR). BRX User Manual, 2nd Edition 12-99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D AXVEL, continued Using Velocity Value in: This field indicates the proper axis structure member to use for the desired Velocity. Initialize .TargetVelocity (signed): Enable this option to set the velocity of the axis when this instruction is enabled. A non-zero value will cause the axis to begin moving at the specified velocity as soon as this instruction is enabled. This value can be any constant between -250000 to -10, 0, and 10 to 250000 or any numeric location containing a value in that range. The sign of the value will indicate the direction of travel: positive numbers will cause the axis to move clockwise, negative numbers will cause the axis to move counter-clockwise. Any value that is below the axis Configured Minimum Velocity will result in the Axis Minimum Velocity being used. Acceleration/Deceleration Mode: Specifies what level of Acceleration / Deceleration to use when the axis is changing to a new Target Velocity. The graphic will change with the selection to display what the velocity curve will look like for that selection. • Trapezoid Accel / Decel: The axis will ramp from the Current Velocity to the new Target Velocity value using the axis currently configured Acceleration and Deceleration values which results in a trapezoid velocity path. • S-Curve Accel / Decel: The axis will ramp from the Current Velocity to the new Target Velocity value using the axis currently configured Acceleration and Deceleration values in addition to the following Jerk parameter which results in an s-curve velocity path. • Apply Jerk to Accel / Decel (pulses / sec3): This selection is only available for S-Curve Accel / Decel. Whereas the Acceleration and Deceleration values specify how quickly the Axis is allowed to reach maximum velocity, the Jerk parameter specifies how quickly the Axis is allowed to achieve maximum Acceleration and Deceleration. This can be any positive constant greater than 0 or any numeric location with a value in that range. • None (Instantaneous): The axis will immediately begin moving at the specified Target Velocity value; there is no ramp up or ramp down to the new velocity. Supersede Acceleration Rate (pulses/sec2): When the axis is ramping up from a slower velocity to a higher velocity use the specified rate instead of the axis configured acceleration rate. This can be any positive constant or any numeric location with a value in that range. Supersede Deceleration Rate (pulses/sec2): When the axis is ramping down from a faster velocity to a slower velocity use the specified rate instead of the axis configured deceleration rate. This can be any positive constant or any numeric location with a value in that range. On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will remain FALSE until the enable leg goes back OFF. Once the enable leg turns OFF, if the instruction device/parameters were valid, this bit will turn ON once the .CurrentVelocity reaches 0. • JMP to Stage: Similarly, the JMP will not occur until after the instruction is enabled, then disabled, and all the instruction device/parameters were valid and the .CurrentVelocity reaches 0. AXVEL, continued On Error: 12-100 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. NOTE: Because this instruction puts the Axis into an operational model (as opposed to performing a single operation), On Success is defined as getting the Axis into Velocity mode with no errors. This means that the On Success indication will turn ON after the Enable/Reset input logic transitions from ON to OFF and the Axis’ Current Velocity is at 0. When these conditions are met the Axis’ Mode is “Idle”. You should wait until the On Success indication turns ON before attempting to execute any other Axis instruction. Example Usage BRX User Manual, 2nd Edition 12-101 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDODECFG Once a TDOPLS-Load Programmable Limit Switch Table for Table Driven Output or TDOPRESET-Load Preset Table for Table Driven Output has been enabled it will continue to control that output even if the input logic is no longer ON. Use the Deconfigure Table Driven Output (TDODECFG) instruction to stop the Preset Table or PLS table from controlling the Table Driven Output. This instruction is useful for situations when the application may require changing control of the Table Driven Output from one instruction, such as a TDOPRESET, to another. There is one item that must be configured externally to the instruction in order to use the TDODECFG function: (a )Table Driven Output Device. This item is setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (b) Configure Table Driven Outputs…” button. After the Table Driven Output has been configured (below), the TDODECFG instruction may now be used (see the High-speed I/O Hardware Configuration section for more details). 12-102 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDODECFG, continued On Success: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error: • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF.. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. Example Usage BRX User Manual, 2nd Edition 12-103 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPLS A Load Programmable Limit Switch Table for Table Driven Output (TDOPLS) contains a table with a series of start and stop positions similar to the cams on a shaft. These cam positions are compared to the current count value of the specified Master Register, which can be a Highspeed Counter, Timer or AXIS Current position value. When the count value falls between any of the positions in the table, the discrete output that is specified is turned ON or OFF according to the table configuration. Each table can have up to 64 cam positions. Each PLS table compares the count value of one Master Register counter and can drive one High-speed I/O discrete output. Once a PLS table has been enabled for a Table Driven Output it will continue to control that output even if the input logic is no longer ON. Use the De-configure Table Driven Output (TDODECFG) instruction to stop the PLS table from controlling the Table Driven Output. There are two items that must be configured externally to the instruction in order to use the PLS feature: (a) a Table Driven Output Device and (b) a Master Register. Both of these items are setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (c) Configure Table Driven Outputs… and (d) Configure Master Register Device… buttons. 12-104 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPLS, continued Refer to both graphics below. After the (b) Table Driven Output Device and (a) Master Register Device have been configured (see the High-speed I/O Hardware Configuration section for more details), the TDOPLS instruction may now be used. BRX User Manual, 2nd Edition 12-105 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPLS, continued Initialize .InputValOffset: A positive value in this field (a) means that the entries will act at a lower value than shown. A negative value means that the entries will act at a higher value than shown. For example: An offset of 500 is configured in the .InputValOffset field (a). The first entry (b, c) is configured to turn ON the output at 1000 and (d, e) turn OFF at 2000. When the table runs, the output will actually turn ON at a value of 500 and turn OFF at 1500. If the .InputValOffset was configured for -500, the first output would have turned ON at a value of 1500 and OFF at 2500. 12-106 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPLS, continued Source Register Scaling: The TDOPLS instruction can use the raw count value from the specified Master Register or, if scaling was enabled in the High-speed I/O setup, the scaled value to do its comparisons. • Raw Pulse Counts (No Scaling) – Select this option to enter the Preset Count values in the Table as raw count values. The image below shows (a) Raw Pulse Counts (No Scaling selected, indicating the Master Register scaling was not enabled. The (b) table entry shows that the values entered are based on raw counts. • Use Source Register Scaling – If the Master Register has been configured to scale the current count value you can use the scaled values in the table by selecting this option and entering values that are scaled the same as the Master Register. The image below shows (a) Use Source Register Scaling selected, indicating the Master Register scaling was enabled. The (b) table entry shows that the entries are based on the scaled values. BRX User Manual, 2nd Edition 12-107 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPLS, continued Load Raw PLS Table from Data Block (a): When enabled, the values used by the PLS Table come from the values stored in the specified memory range. This allows for more dynamic control of the PLS function. • Table Start Address (b): The beginning address in PLC memory where the PLS table data is stored. • Number of PLS Steps (c): The number of steps in the PLS table that are stored in PLC memory. A PLS Table can have up to 64 steps. • Table Data Block Range (d): Using the two values above, this shows the range of PLC memory that will be used as the PLS data table. With a starting address of D0 and a total of 2 steps, the memory range is D0 to D3. NOTE: The PLC TDO PLS Table Editor button is available only when the Do-more! Designer software is connected and Online with the BRX CPU. • PLC TDO PLS Table Editor button (e): Click this to open the PLS Table Editor. The editor allows you to edit the data values in the specified Data Block. The data configuration options on this dialog (Default Output State, value for “Greater Than or Equal”, value for “Less Than”) are the same as the main dialog. Detailed information of the PLC TDO PLS Table Editor dialog screen is discussed later in this section. 12-108 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPLS, continued Default Output State (a): The Default Output state determines the starting state of the Output when the PLS instruction is enabled and the state that the Output is in when the count is NOT within the Entry comparisons. If the Default Output State is OFF, the Output will be ON when the count is within the Entry comparison values. If the Default Output State is ON, the Output will be OFF when the count is within the Entry comparison values. Raw (or Scaled) PLS Count Steps Output ON when (b): A table of entries that determines the Output state when the TDOPLS is running. • The entries in the table (b) can be constants or variables. If variables are used, the instruction must be disabled and re-enabled after the variable value has been changed. The values in the entry table cannot be overlapping. • The values must be increasing with the Entry numbers. In other words, the values in (c) And Less Than must be larger than the value in (d) Greater Than or Equal to. Output On/Off when Greater Than or Equal to: The value that represents the lower edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647. And Less Than: The value that represents the upper edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647. If invalid entry values are used when specifying constant values, the Do-more! Designer programming software will indicate an error (below) and not allow the instruction configuration to be completed. BRX User Manual, 2nd Edition 12-109 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPLS, continued If variables are used and invalid entry values are specified, the “On Error” state will become true (Set Bit or JMP to Stage). If the Scaling was configured for the Master Register counter and the Use Source Register Scaling option was specified, the entry values will be the scaled values and no conversion will be necessary. Insert (e): Add an empty Step above the currently highlighted Step in the table. Remove (f): Delete the currently highlighted Step from the table. Import (g): Import the contents of the PLS Table from a CSV file. The format of the import file is two numbers per line, separated by a comma or whitespace, all numbers must be in ascending order, and a maximum of 64 lines. Please review CSV file formatting information later in this TDOPLS instruction section, under the section explaining the PLC TDO PLS Table Editor dialog. On Success (h): • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: If the parameters configured in the instruction and proper devices were specified, the PLC will jump to that stage. On Error (i): • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE if there was a problem with the parameters configured in the instruction or with the devices specified. • JMP to Stage: If there was a problem with the parameters configured in the instruction or with the devices specified, the PLC will jump to that stage. 12-110 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPLS, continued PLC TDO PLS Table Editor: Allows you to edit the data values in the specified Data Block. The data configuration options on this dialog (Default Output State, value for “Greater Than or Equal”, value for “Less Than”) are the same as the main dialog. NOTE: Initial values for Default Output State, PLS Table Start Address, and Number of PLS Entries come from the main instruction editor. If these values are changed while editing the table data with this dialog those values will be updated on the main instruction editor when this dialog is closed. NOTE: If the PLC TDO PLS Table Editor dialog is opened when the Number of PLS Entries is a variable (memory address), the value in that location is read and the data in that number of rows will be read from the PLC to prefill the table. The Also Write Table Length to PLC selection will be enabled and that variable location will be prefilled here so that when the table data is written back to the PLC this location will be updated as well. NOTE: A graph of the current PLS Table configuration is displayed at the bottom of the editor which shows each of the entries. Clicking on the graph will place the cursor on the table entry that contains that location. If incorrect data values are entered, i.e. overlapping data, a message will be displayed instead of the graph. • PLC TDO PLS Table Editor Dialog: Source Register Scaling (a): Same as the main dialog. The TDOPLS instruction can use the raw count value from the specified Master Register or, if scaling was enabled in the High-speed I/O setup, it can use the scaled value to do its comparisons. PLS Data Entry (b): Same as main dialog. Entries must be unique within the Table, the lower and upper positions of a step cannot overlap the other cam positions. The data has to be incremental. BRX User Manual, 2nd Edition 12-111 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPLS, continued Output On/Off when Greater Than or Equal to: The value that represents the lower edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647. And Less Than: The value that represents the upper edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647. Default Output State (c): Same as main dialog. Specifies the state of the first entry in the table. OFF (default): The output is OFF to start with. The first entry in the table will be a point which the output turns ON and subsequent entries will flip between OFF / ON / OFF / etc. ON: The output is ON to start with. The first entry in the table will be a point which the output turns OFF and subsequent entries will flip between ON / OFF / ON / etc. Read from PLC button (d): Overwrite the contents of the table with values from the PLC memory location specified in the Load Raw PLS Table from Data Block section. Confirmation is requested before reading the PLC data. In this example the starting data block is D0, D10 holds a value of 5, which indicates 10 DWords will be read: Write to PLC (e): Overwrite the contents of PLC memory at the location specified in the Load Raw PLS Table from Data Block section with the current contents of the table. Confirmation is requested before writing data to the PLC. In this example, there are 5 rows of data. A 5 is written o D10 and the 10 DWords of data is written to D0 to D9. Insert Row button (f): (Insert button in main dialog) add an empty Step above the currently highlighted Step in the table. Append Row (g): Add a new row after the current last step in the table. Delete Row button (h): (Remove button in main dialog) delete the currently highlighted Step from the table. Clear Table button (i): Will display a confirmation dialog explaining it will delete all rows and the table will end up with a single row with values of 0 for the Greater Than or Equal to and 0 for and Less Than. Import button (j): (Import button in main dialog) Import the contents of the PLS Table from a CSV file. The format of the import file is two numbers per line, separated by a comma or whitespace, all numbers must be in ascending order, and a maximum of 64 lines. 12-112 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPLS, continued NOTE: Any available text editor or an Excel worksheet can be used to create a CSV file. Just save the file as a .CSV file type. Example of how data should be formatted in the CSV file: a. Two integer values per row separated by comma (surrounded by any amount of white space) or just white space. b. You can also have empty rows. c. You can also use a line comment starting with two forward slashes: // This is a comment Example on how to format the data per line in the CSV file: a. Simple comma separated values 1 and 2. (See line one below.) b. Some white space before and/or after the comma is OK (see line two below). c. Whitespace before, between, and after is OK also (i.e. comma is optional, see line three below). d. Comment line (no data allowed). (see line four below.) BRX User Manual, 2nd Edition 12-113 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET A Load Preset Table for Table Driven Output (TDOPRESET) instruction contains a series of steps that are processed in the order they appear in the table. These steps compare the current count value of the specified Master Register, which can be a High-speed Counter, Timer or AXIS Current position value, to the Preset Count in the Step, and when the count values match, the step action is performed on the selected discrete output and the next step in the table becomes the active step. Each Preset Table can have up to 64 steps. Each Preset Table compares the count value of one Master Register counter and can drive one High-speed I/O discrete output. Once a Preset table has been enabled for a Table Driven Output, it will continue to control that output even if the input logic is no longer ON. Use the Deconfigure Table Driven Output (TDODECFG) instruction to stop the Preset table from controlling the Table Driven Output. There are two items that must be configured externally to the instruction in order to use the Preset feature: (a) A Table Driven Output Device and (b) a Master Register Device. Both of these items are setup in the Setup BRX High-speed I/O dialog that is in the BRX Onboard I/O section of the System Configuration. This dialog can be opened directly in the instruction from the (c) Configure Table Driven Outputs… and (d) Configure Master Register Device…buttons. 12-114 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued After the (a) Table Driven Output Device and (b) Master Register Device have been configured (see the High-speed I/O Hardware Configuration section for more details), the TDOPRESET instruction may now be used. BRX User Manual, 2nd Edition 12-115 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET, continued Initialize .InputValOffset: A positive value in this field means that the entries will act at a lower value than shown. A negative value means that the entries will act at a higher value than shown. For example: An offset of 500 is configured in the .InputValOffset field. The first entry is configured to SET the output at 1000. When the table runs, the output will actually SET at a value of 500. In the .InputValOffset was configured for -500, the first output would have SET at a value of 1500. Source Register Scaling: The TDOPRESET instruction can use the raw count value from the specified Master Register or, if scaling was enabled in the High-speed I/O setup, the scaled value to do its comparisons. • Raw Pulse Counts (No Scaling) (a): Select this option to enter the Preset Count values in the Table as raw count values. The image above shows (a) Raw Pulse Counts (No Scaling) selected, indicating the Master Register scaling was not enabled. The (b) Raw Preset Count Steps table entry shows that the values entered are based on raw counts. 12-116 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued • Use Source Register Scaling: If the Master Register has been configured to scale the current count value you can use the scaled values in the table by selecting this option and entering values that are scaled the same as the Master Register. The image below shows (a) Use Source Register Scaling selected, indicating the Master Register scaling was enabled. The (b) Scaled Preset Steps table entry shows that the entries are based on the scaled values. Load Raw Preset Table from Data Block (a): When enabled, the values used by the Preset BRX User Manual, 2nd Edition 12-117 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET, continued Table come from the values stored in the specified memory range. This allows for a more dynamic control of the Preset function. • Table Start Address (b): The beginning address in PLC memory where the Preset table data is stored. This must be a block of Signed DWords. • Number of Preset Steps (c): The number of steps in the Preset table that are stored in PLC memory. A Preset Table can have up to 64 steps. • Table Data Block Range (d): Using the two values above, this shows the range of PLC memory that will be used as the Preset data table. With a starting address of D0 and a total of 10 steps, the memory range is D0 to D19. Data formatting will be discussed in the PLC TDO Preset Table Editor section found later in this section. NOTE: The PLC TDO Preset Table Editor button is available only when the Do-more! Designer software is connected and Online with the BRX CPU. • PLC TDO Preset Table Editor button (e): Click to open the PLC TDO Preset Table Editor which allows you to edit the data values in the specified Data Block. The data configuration options on this dialog (Preset Count, Preset Function, Function Parameter) are the same as the main dialog. Detailed information of the PLC TDO Preset Table Editor dialog screen is discussed later in this section. Raw (or Scaled) Preset Count Entries Output xx when: This is the table of entries for Raw 12-118 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued (or Scaled) Preset Count Steps (a): This is the list of steps that determines the Table Driven Output state when the TDOPRESET is running. • Preset count: The pulse count values in the table can be constants or variables. If variables are used, the instruction must be disabled and re-enabled after the variable value has been changed. This can be any value in the range of -2,147,483,648 and 2,147,483,647. • Preset Function (b): Select the action to perform on the Table Driven Output when the Step is triggered. 1. 2. 3. 4. 5. 6. • Set: Turns ON the Table Driven Output. Reset: Turns OFF the Table Driven Output. Reset Table/Acc: Performs a reset of the Master Register which sets its current count value to the Initial Reset Value specified in the Timer/Counter Function setup, and sets the current step in the Preset Table to Step 0. Pulse On: Turns ON the Table Driven Output for the amount of time specified in the Function Parameter, which is the duration of the output pulse in microseconds (1 to 16,777,215). Pulse Off: Turns OFF the Table Driven Output for the amount of time specified in the Function Parameter, which is the duration of the output pulse in microseconds (1 to 16,777,215). Toggle: Inverts the state of the Table Driven Output. If the Table Driven Output is currently ON, it is turned OFF, or it is turned ON if it is currently turned OFF. Several things to consider when using this instruction: 1. Unlike the TDOPLS instruction, the values in the entry table do not have to be increasing with the Entry numbers. The table runs step by step in order of entry. Therefore, if the value in a higher entry is lower than a previous entry, the current count value must be decreasing in order for the step to be BRX User Manual, 2nd Edition 12-119 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET, continued 2. 3. completed. For example, if Step 0 is configured as Set at 500 and Step 1 is configured as Reset at 0, the Output will be Set ON when the current counts reach 500 or more and the Output will be Reset to OFF when the current counts decrease to 0 or less. In order for the table to run continuously, the final entry function must be to (X) Reset Count. After the step with the Reset Count function is complete, the table will start over at Step 0. When the TDOPRESET instruction is disabled and re-enabled, it will start over at Step 0. If the Scaling was configured for the Master Register counter and the “Use Source Register Scaling” option was specified, the Step values will be entered as scaled values and no conversion will be necessary. • Insert button (c): add an empty Step above the currently highlighted Step in the table. • Remove button (d): delete the currently highlighted Step from the table. • Import button (e): Import the contents of the Preset table from a CSV file. The format of the import file is two or three numbers per line, separated by a comma or whitespace, and a maximum of 64 lines. Please review the CSV file formatting information later in this TDOPRESET instruction section, under the section explaining the PLC TDO Preset Table Editor dialog. On Success (f): • Set Bit: The bit will become FALSE when the instruction is enabled and will become TRUE when instruction parameters are properly entered and the instruction completes successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Success bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When instruction parameters are properly entered and the instruction completes successfully, the PLC will jump to that stage. On Error (g): • Set Bit: The bit will become FALSE when the instruction is enabled and will become when proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully. The specified bit is enabled with a SET operation, not an OUT operation. The On Error bit will remain ON even if the instruction input logic goes OFF. • JMP to Stage: When proper instruction parameters are NOT properly entered or the instruction IS NOT completed successfully, the PLC will jump to that stage. NOTE: Initial values for Preset Table Start Address, and Number of Table Rows to be Read (or Number of Preset Steps) come from the main instruction editor. If these values are changed while editing the table data with this dialog, those values will be updated on the main instruction editor when this dialog is closed. NOTE: If the Number of Preset Steps is a variable (memory address), the value in that location is read and the data in that number of rows will be read from the PLC to prefill the table. The Also Write Table Length to PLC selection will be enabled and that variable location will be prefilled here so that when the table data is written back to the PLC this location will be updated as well. 12-120 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued PLC TDO Preset Table Editor • Source Register Scaling (a): Same as the main dialog. The TDOPRESET instruction can use the raw count value from the specified Master Register or, if scaling was enabled in the High-speed I/O setup, it can use the scaled value to do its comparisons. • Raw (or Scaled) Preset Count Steps (b): Same as main dialog. This is the list of steps that determines the Table Driven Output state when the TDOPRESET is running. 1. 2. Preset count: The PLC TDO Preset Table Editor is reading a block of D memory, it is editing the values that go into that block. The Preset Count in the PLC TDO Preset Table Editor can only be contant values. This value can be in the range of -2,147,483,648 and 2,147,483,647. Preset Functions: Select the action to perform on the Table Driven Output when the Step is triggered. • Set: Turns ON the Table Driven Output. • Reset: Turns OFF the Table Driven Output. • Reset Table/Acc: Performs a reset of the Master Register which sets its current count value to the Initial Reset Value specified in the Timer/ Counter Function setup, and sets the current step in the Preset Table to Step 0. BRX User Manual, 2nd Edition 12-121 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET, continued • 3. 4. 12-122 Pulse On: Turns ON the Table Driven Output for the amount of time specified in the Function Parameter, which is the duration of the output pulse in microseconds (1 to 16,777,215). • Pulse Off: Turns OFF the Table Driven Output for the amount of time specified in the Function Parameter, which is the duration of the output pulse in microseconds (1 to 16,777,215). • Toggle: Inverts the state of the Table Driven Output. If the Table Driven Output is currently ON, it is turned OFF, or it is turned ON if it is currently turned OFF. Read from PLC button (c): Overwrite the contents of the table with values from the PLC memory location specified in the Load Raw Preset Table from Data Block section. • Confirmation is requested before reading the PLC data. In this example the starting data block is D0, D30 is the memory address that stores the Number of Preset Steps. This has a value of 4. Eight DWords will be read from the PLC starting at D0: Write to PLC (d): overwrite the contents of PLC memory at the location specified in the Load Raw Preset Table from Data Block section with the current contents of the table. • Confirmation is requested before writing data to the PLC. The four rows of data are stored in D0 to D7 • Confirmation request before writing data to the PLC with the Also write Table Length to PLC enabled. In this example, there are 4 rows of data. A 4 is written to D30 and the 8 DWords of data is written to D0 to D7. BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued 5. Format of the Preset Data Read from PLC or Written to the PLC memory addresses: When using the PLC TDO Preset Table Editor, the data values in the specified memory locations must be formatted properly. Improperly formatted data will generate a warning message. The following example shows a range of D0 to D7, which corresponds to a starting Preset Data Table address of D0 and 4 steps. Each step is comprised of two DWords. Each Preset table entry consists of 2 signed DWord locations: • The first DWord location corresponds to the Preset Count where the specified command will take place. This can be any value between -2,147,483,648 and 2,147,483,647. • The second DWord location contains the Function Code for the command to be performed and the additional data required by a command code. • The upper BYTE (Byte 0) contains one of the following values to indicate the action: 0: Set 1: Reset 2: Pulse ON 3: Pulse OFF 4: Toggle 5: Reset Table & Acc • When using the Pulse ON or Pulse OFF command, the lower 3 BYTEs of the second DWord location will contain the amount of time (in microseconds) the pulse will be ON or OFF respectively. • Example: This shows the Preset Table filled in with the desired values: Line 1 Step 0: Preset Count of 500. Set = Code 0. Line 2 Step 1: Preset Count of 300. Reset = Code 1. Line 3 Step 2: Preset Count of 500. Pulse ON = Code 2. Function Parameter of 1,000,000. BRX User Manual, 2nd Edition 12-123 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D TDOPRESET, continued Line 4 Step 3: Preset Count of 1000. Reset Table/Acc = Code 5. • The following Data View shows the Native values for the Data Block range of D0 to D7 associated with our example: • The following Data View shows the second DWord of each step in BCD/HEX data type: D1 corresponds to SET (code 0) of Step 0. D3 corresponds to RESET (code 1) of Step 1. D5 corresponds to Pulse ON (code 2) of Step 2. D7 corresponds to Reset Table/Acc (code 5) of Step 3. • The upper Byte represents the Function Code. The lower three Bytes represent the Function Parameter value. 0Xuullllll. For Step 0, function code 0 (Set) is uu = 00. For Step 1, function code 1 (Reset) is uu = 01. For Step 2, function code 2 (Pulse ON) is uu = 02. Pulse ON has a function parameter of time in microseconds, which is llllll = 0F4240. Converting Hex 0F4240 to Decimal is 1,000,000. For Step 3, function code 5 (Reset Table/Acc) is uu = 05. If, for example, we want to change the Pulse ON to last 2,500,000 microseconds, D5 would have a BCD/HEX value = 0X022625A0. • 12-124 BRX User Manual, 2nd Edition Chapter 12: BRX Do-more! Onboard Motion Control and Highspeed I/O TDOPRESET, continued • Insert Row button (e): (Insert button in main dialog) add an empty Step above the currently highlighted Step in the table. • Append Row (f): Add a new row after the current last step in the table. • Delete Row button (g): (Remove button in main dialog) delete the currently highlighted Step from the table. • Clear Table button (h): Will display a confirmation dialog explaining it will delete all rows and the table will end up with a single row to Set at a Preset Value of 0. • Import button (i): (Import button in main dialog) Import the contents of the PLS Table from a CSV file. The format of the import file is two or three numbers per line, separated by a comma or whitespace, with a maximum of 64 lines. Below is an example of how data should be formatted in the CSV file. Column A holds the Preset Count. This can be any value between -2,147,483,648 and 2,147,483,647 Column B holds the Preset Function code. The following table shows the available function codes. Preset Function Codes 0 SET No function parameter needed 1 RESET No function parameter needed 2 PULSE ON Requires function parameter. Time in microseconds: 1 to 16,777,215 3 PULSE OFF Requires function parameter. Time in microseconds: 1 to 16,777,215 4 TOGGLE No function parameter needed 5 RESET TABLE & COUNT No function parameter needed Column C holds the Function Parameter, which is the amount of time (in microseconds) the pulse will be ON or OFF. This is required for the PULSE ON and PULSE OFF function codes. Column D holds the comments, which is indicated by the “//” before the text. BRX User Manual, 2nd Edition 12-125 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.6 Linearized : Yes Author : AutomationDirect Create Date : 2017:08:03 13:58:36-04:00 Modify Date : 2017:08:03 15:19:14-04:00 Subject : Do-more! BRX Micro PLC Unit (MPU) Has XFA : No Language : en-US Tagged PDF : Yes XMP Toolkit : Adobe XMP Core 5.4-c006 80.159825, 2016/09/16-03:31:08 Metadata Date : 2017:08:03 15:19:14-04:00 Creator Tool : Adobe InDesign CC 2017 (Windows) Instance ID : uuid:46ed8fd2-bf21-4d1f-bd5b-dcc2dc05336a Original Document ID : xmp.did:CD8117340C206811822ABDC16248B012 Document ID : xmp.id:c4326782-ac49-5346-9730-263c2840caab Rendition Class : proof:pdf Derived From Instance ID : xmp.iid:58cbdd1c-5766-c74e-80f9-313cba7638a4 Derived From Document ID : xmp.did:f0628330-3170-1340-8fff-37175cb9c4aa Derived From Original Document ID: xmp.did:CD8117340C206811822ABDC16248B012 Derived From Rendition Class : default History Action : converted History Parameters : from application/x-indesign to application/pdf History Software Agent : Adobe InDesign CC 2017 (Windows) History Changed : / History When : 2017:08:03 13:58:36-04:00 Format : application/pdf Title : BRX User Manual, 2nd Edition Description : Do-more! BRX Micro PLC Unit (MPU) Creator : AutomationDirect Producer : Adobe PDF Library 15.0 Trapped : False Page Layout : SinglePage Page Mode : UseOutlines Page Count : 125EXIF Metadata provided by EXIF.tools