Jump to content
OMRON Forums

mbalentine

Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by mbalentine

  1. If your PLC has the line of code as shown in your email, I don't think that is acceptable to PMAC. M6000->Y:$078F07,0,8 = $40 In my example I put the physical address as pseudo code to make the associations easier to see. You will need to define the Mvar outside the PLC, I usually do this in a seperate file, but you can also place the definitions in the same file as the PLC - but outside of the PLC itself. Commands outside a PROG (motion) or PLC buffer will execute immediately (Software manual divides commands into two categories, those that will execute immediately [On-LINE] either from terminal window or from a file download, and those that are buffered to PMAC for execution as a program [PROGRAM COMMANDS].) In general the immediate execution is used to configure PMAC for your application. The buffered commands are those that PMAC executes in 'real time' when running the user application. There is some 'bleed over' in that most Ivars can have their values changed in a motion or plc program, and a COMMAND"...." statement can be used inside a program to execute certain "ON-LINE" commands. ;BEGIN FILE******************** ; start file with comments ; and revision notes M6000->Y:$078F07,0,8 ;execute definition statement immediately ; other Mvar definitions as needed OPEN PLC1 CLEAR ;this is actually a combination of immediate commands that directs PMAC to not try to execute but rather buffer the following instructions. ; these instructions will be buffered to PLC1 and executed later when the program is active M6000=$40 ; other commands Disable PLC1 ;turns itself off ; CLOSE ; turn OFF buffering ;END OF FILE******************* As mentioned above I generally break my projects into three *.pmc download files: 1) Immediate commands for: a) DEFINE USER BUFFER command and any other buffer commands for linearization, etc. Any PMAC features that require a specific buffer. b) AXIS definition statements (including coordinate systems) c) I variable setup for axis in use (reset PMAC & do a dummy configuration BACKUP of the Ivars only and then use this file as a template to build your *.pmc download file. It will have default values and functional comments for each variable) d) M variable definitions 2) PLC & PLCC programs 3) Motion programs
  2. For inversion control I would recommend setting to all 1's. You can then invert in the PLC or Motion programs using XOR. This will be more clear for documentation. I would generally avoid the mix & match usage or some poor sap (the original programmer) will pull their hair out 6 months later. M1005->Y:$078F01,4,1 ; an input bit ; you can buffer to another bit M2005=M1005^1 ; M2005 is now inverted from actual input IF (M2005 = 0) ; true if input bit =1 ;or use invert logic at each point of usage (my preference) IF (M1005^1 = 0) ; true if input bit =1 Steve points out that you can cheat the system (new to me) and use bits that are part of an Output byte as inputs (!) by leaving them off and then reading their state. Steve knows. .... the rest of us are mere mortals.
  3. The set-up may appear at first to be a bit tedious - not to worry, it IS a bit tedious (also a byte tedious in this case, but I digress). I'll cite the manual pages for better explanation, there are really only 3~4 pages needed to understand a basic setup. The configuration options allow more flexibility than you're likely to find in other products, and although we are writing bits & bytes, this allows the programmer (you) to have exactly what you want without designing your own hardware. You are correct that the bits must be defined as inputs or outputs in consecutive blocks of 8. If you need only 6 inputs, you must define 8. Input and Output definition is handled as a byte. 0) Your post indicates general purpose I/O, so we'll not worry about latching the data as would be required for position feedback data. If you are using Opto22 boards (or equivalent) you'll want to remove jumper E5 (see page 7, 51, 52) so that pin #48 on the 50 pin headers (two of them) do not carry a signal. I would recommend removal unless you have a specific need for the OCLK signal. 1) Decide where you want to place this board in memory so that it does not conflict with whatever else you have in your system. Page 10 shows the options for setting SW1-1,2,3,4. Note that SW1-5,6 should always be ON. In the upper RH part of the table, we can select Y:$078F00 - Y:$078F07 as our memory footprint by setting SW1 = 111100 Note the table tells us the IO bits are in the lower 8 bits of the first 6 addresses (078F00 - 078F05) The other two addresses are where the confusion begins. 3) Direction Control is done in blocks of 8 bits (pp 11). Since each of the first 6 addresses hold 8 IO bits, we are using 1 bit in the control register to control whether these blocks of 8bits (byte) are used as inputs or outputs. So we're associating the first 6 bits (0-5) of the control register with definition of the 6 I/O bytes (addresses 078F00,0,8 - 078F05,0,8) We'll set your board up for 16 inputs + 8 outputs + 24inputs 078F00,0,8 - inputs bit0=1 078F01,0,8 - inputs bit1=1 078F02,0,8 - outputs bit2=0 078F03,0,8 - inputs bit3=1 078F04,0,8 - inputs bit4=1 078F05,0,8 - inputs bit5=1 So we need to write to the control register Y:$078F07,0,8 = 0011|1011 ($3B) We'll do the actual write later 4) Inversion Control is done in setup register1, which exists at each address. Unlike direction control which is byte based, inversion control is done bit by bit. Defining this is a three step process: - First, write 01 to bits 6&7 of the control register to select the Inversion Control function Y:$078F07,0,8 = 0100|0000 ($40) see table pp11 - Second, write the inversion definition to the data area of each address. A '0' means invert, a '1' does not invert 078F00,0,8 = 1111|1111 ($FF) do not invert inputs 0-7 078F01,0,8 = 1111|0000 ($F0) invert inputs 8-11 078F02,0,8 = 1111|0011 ($F3) invert outputs 18&19 do not invert 16,17,20-23 078F03,0,8 = 1010|0101 ($A5) you can invert individual bits in any pattern desired 078F04,0,8 = 0000|0000 ($00) 078F05,0,8 = 1000|0001 ($81) - Third, turn off this configuration mode by setting bits 6,7 back to zero Y:$078F07,0,8 = 0000|0000 ($00) - In general, inversion set to 1 will give expected results of Input high=1 and 1=Output conducting 5) Read Control - I think most people leave this at 0 for reading of the pin state rather than the register. If you want to change it the procedure is the same as Inversion control, except you write Y:$078F07,0,8 = 1000|0000 ($80) as the first step. You could write all zeros to be certain of the configuration if you like. Be sure to clear bits 6,7 when done 6) Define an M-variable to each of the IO addresses. See example on pp13. 7) Use a 'run once & done' PLC to configure the card on start-up. Be sure to return bits 6,7 of the control register to zero, and bits 0-5 for In/Out configuration determined in section 3 above. Your PLC will be something like this (using Mvars to write to the addresses) OPEN PLC1 CLEAR ;pseudo code, Mvars will need to be defined to point to the addresses shown ;set inversion control Y:$078F07,0,8 = $40 ;turn ON inversion setup function ;inversion data Y:$078F00,0,8 = $FF ;inputs Y:$078F01,0,8 = $F0 ;inputs Y:$078F02,0,8 = $F3 ;outputs Y:$078F03,0,8 = $A5 ;inputs Y:$078F04,0,8 = $00 ;inputs Y:$078F05,0,8 = $81 ;inputs Y:$078F07,0,8 = $00 ;turn OFF inversion setup function Y:$078F00,0,8 = $FF ;write actual data to inputs to initialize as inputs Y:$078F01,0,8 = $F0 Y:$078F02,0,8 = $0C ; clear outputs to OFF state using complement of inversion setup data Y:$078F03,0,8 = $A5 Y:$078F04,0,8 = $00 Y:$078F05,0,8 = $81 Y:$078F07,0,8 = $3B ;set direction control bits DISABLE PLC1 CLOSE All in all it's probably easier to read the manual
  4. By default the "Gather Period" is set to 10 This means that every ten servo interrupts, the data is captured. If you want to gather more often, you can do two things: 1) Reduce the Gather period setting in the PMAC Plot software 2) Decrease the servo interrupt time (requires substantial review of I-vars and retune) Gathering more often will result in more data, so you may want to define a larger buffer with the "Define Gather" command. All data is captured & stored in real time on the PMAC, and is then downloaded after for graphing / analysis. This allows very high speed & accurate data, but you must be sure to provide a large enough memory buffer. If you are gathering multiple data points, you might consider breaking them up into smaller grougs - for instance gather data for only one motor at a time.
  5. Reset with $$$*** Make sure encoder connections are correct Set the addressing on your 24E2(A) for whatever motors it represents (careful to observe that addressing for the servo IC begins at 2. 0&1 are reserved for 'on board' systems. This means I72xx correlates to Motor #1. See the 24E2 manual - Hardware Setup) Enable motor by setting Ixx00=1 (Only Motor #1 is enabled after reset) The Encoder Conversion Table for motors #1 thru 8 are configured by default for quadrature decode. If you are checking Motor #9 or greater, you will need to make the appropriate entry to the encoder conversion table starting at I8000. Manually rotate motor/encoder Should see counts from the encoder as x4 quadrature ccw+ If there are no counts: Check connections, cable, plug, etc. Check for power to encoder at pins 7&8 (assume terminal block connections) Check board configuration for Single ended / differential encoder signals Verify the Encoder Conversion Table for the correct entries Refer to the 24E2 manual Refer to the Software Reference for ECT settings (I8000) I am assuming that you are using Acc 24E2 cards in the local rack. If you have a MACRO system you will need to alter a number of I-vars from the default. If you are using MACRO, the addressing is covered in the manuals, but you may need some help to know which variables to consider. This is NOT an adequate setup to actually run a motor, only to confirm encoder counts. Best Regards
  6. I generally would not recommend setting all the I variables to zero. The $$$*** will set them to factory default. Default for the M-vars is ->* =0, and the P & Q-vars will also be cleared to zero. In addition, the UNDEFINE ALL is unnecessary. The I vars controlling encoder decode recognize '0' as the setup for pulse & direction decode. When you issue I0..8192=0, PMAC is simply decoding using the zero format per your instruction. Default value for decode is I7mn0=7 for CCW quadrature. Generally easier to start from the factory defaults instead of clearing to zero.
  7. Not sure if I correctly understand your question, but I think you are controlling the PID gains from a PLCC. (?) It is true that PMAC does not support real time editing of programs. Also, any edits are tempory until a 'SAVE' command is issued. So if you make an edit and reboot PMAC, the edits will be gone if you have not used SAVE. (this can be a very good safety net) To change in real time do not 'hard code' the values in the software, but instead use variables. You can then change the variables in real time without having to edit the software. In your question you refer to both PLC and PLCC - they are different so be sure you are refering to the correct one when updating. The "open plc16 clear" command should be at the top of your text file so that you can make your edits to the current file, then when you download, the program buffer is opened, cleared, and the following code entered. These commands do not clear the screen, they execute in the PMAC. What you see onscreen in the editor is an independent copy of what is in the PMAC. Edits do not mean anything until the file is downloaded. Not sure this is what you're asking, apologies if I'm misreading your question.
  8. This covers basic setup, but you might be asking for something more detailed. MACRO is pretty much the same on all controllers so this should apply directly to a Brick. From the HomePage: Support-> Documentation-> Manuals-> MACRO Control System-> MACRO Peripherals-> ACC-82M Might also be something in the Tech Notes section (?)
  9. Kira, OK, I do have one machine that I use this method so here is a code snippet. I leave the soft OT active and disable Ixx14 by setting to zero. I do disable the Hard OT for homing. My earlier comments about bit17 were confusing. Note that I am using the amplifier fault bit. *********************** I224=$228001 ;Disable limits I214=0 I424=$228001 I414=0 ; HOME 2,4 ; I224=$208001 ;Enable limits I214=-42333 I424=$208001 I414=-42333 ************************ I would suggest you try using I124=$128001 for home and then set to $108001 after complete. You could also use I124=$120001 for home if you want to disable the soft OT. You do not need to zero Ixx13 or Ixx14 in this case. If you are able to use an amp fault signal then the most significant digit will be either $0 or $8 depending on the fault polarity I think your: I7102=3 I7103=2 should be : I7012=3 I7013=2 I7102 & I7103 are clock control registers for the second Gate IC that you likely do not have in your system; I7012 & I7013 are the homing configuration registers for the first axis. Hope this helps Regarding the graph: I think your I7012 & I7013 may still be at default values which would be "Home to Marker" The graph shows moving (-10cnt/ms) in the negative direction, at the marker an abrupt change to -2000 (you need to move I126/16= +2000 from here to get to zero), and settling at zero/Home. Exactly what you have configured. You're very close to having this complete.
  10. Kira, I'm sorry - in my earlier post I referred to Ixx24 bit7 & I should have said Ixx24 bit17 I think you should review the setting of I124 = $920001 $9 = 1001 bit23=1 amp fault polarity set as needed for your amp _________bit20=1 amp fault function is turned off (are you sure you want to do this?) $2 = 0010 bit17=1 ignore OT limits This is why you do not see the OT status change in PWin when you operate the switch $0 = 0000 bit15=0 disable soft overtravel function $0 $0 $1 Bit 15&17 set as they are disables all overtravel protection (soft & hard) which is often ok for a rotary axis. Although you are reading the switch operation with M121, it is not being used as an OverTravel by PMAC. Since the OT function is disabled, you could use these inputs as general purpose inputs. Bit 20 disables the amplifier fault which is generally not a good idea. If you enable this function, you will need to verify bit 23 for correct polarity. If your amplifier does not have a fault output, then leave disabled. I would consider I124 = $108001 The most significant hex digit will change to either $8 or $0 if you use the amplifier fault function. With the soft overtravels enabled by bit15=1, you will need to set I113 & I114 to appropriate values. Generally these should be set to a value just before the hard OT switches are reached. You can set these to zero to disable soft OT temporarily while setting up. Since the LIM inputs are disabled I think the Home function is reading the input as always true (no overtravel fault) & homing to the marker. Your graph indicates this. Review the I124 configuration and see if this helps.
  11. The diagram you are looking at from the manual does not explicitly show this, but you should also connect pins 3&4 of the header to the 0v side of the power supply. (If you are using a seperate supply, this is definately true. If you are powering the flags off the same supply as the Clipper then you may not need this connection. I would highly recommend a dedicated supply for the controller and seperate supply for any "field connected" hardware such as I/O) I would also connect pin 2 to the +V of the supply; but it is only required if using the flags for channels 3 or 4. If not using flags for channel 3 or 4 you can leave it unconnected, but Do Not connect pin2 to 0v or ground. Also be sure Ixx24 & Ixx25 are set correctly. In particular Ixx24 bit7 should be zero so that the OT inputs are recognized.
  12. I would like to implement servo control using a low pressure pneumatic actuator. There are various companies offering valves to 'complete' systems. I am inclined to use a Textron R-DDV valve at this time with a standard pneumatic cylinder. Obviously similar to a hydraulic system but using much lower pressure (100 psi) & a compressible fluid. I am looking for advice on how best to model for a compressible fluid (high compliance coupling with varying spring rate depending on position) & any other associated pitfalls. Anyone out there have experience with this? Thank You
  13. ACC-28E is 16 bit A/D and can be either 2 or 4 channels of +-10v input. If you can accept lower quality feedback, the ACC-59E is 8 each of A/D + D/A unipolar or bipolar 20v but is only 12 bit. Usually limited to general purpose analog. Either way you just bring the A/D value into the Encoder Conversion Table where you can shift, filter, etc and then point Ixx03 & Ixx04 to the result. Since you will need to add a seperate board for your feedback it may be worthwhile to note that the 24E2A board has 2 analog outputs per channel. If you can forego the overtravel, home, etc inputs, you can drive two analog servo axis per channel. Again, just point Ixx02 to one of the 'unused' D/A locations. You can find the addresses in the 24E2A manual.
  14. Using PcommServer to replace PTalk and rewriting to .NET 3.5 I don't understand the usage of DPRGetShort(). It uses an integer value for 'address' as opposed to an 'offset' value. No variable to identify X/Y memory bank. How is 'address' used to specify which bank the 16bit short is in ?? Also, is there an updated manual for PCommServer ? Mine is dated Feb '06 and is not very thorough or complete. The only other related manual I can find is PComm32 from April '05. Thanks
  15. Yes, I agree - the result does not seem to be where I would expect. With I8008/bit19=0 the X value at I8010 should be a filtered result from the exponential, but is instead a highly varying value that makes no sense in the context of the raw data (potentiometer) going into the filter. My thought is that where I expect to see result data I am instead seeing intermediate data from the tracking algorithm(??) That is why I am wondering if the address extending beyond 4 bytes is inadvertantly triggering the tracking filter by placing a (non-zero) value in byte5(bit16). Bit19 alone should be the switch but maybe it is sensitive to a non-zero value anywhere in byte5 bit16-19 (?) Your second comment may be the answer though; unfortunately I'll have to wait until I have access to a machine to try this. I might have checked this initially but it's been a while back & I'm not sure - The ECT entry references all 24 bits at X:$10781 but the ADC data is only in the lower 12. Modbus protocol transfers 16bits, which leaves the upper 8 bits of the source data unknown. I am assuming it to be zeros but that may be the problem. Whatever it is, I wouldn't expect it to be dynamic so I still am wondering. Filter coefficients are very slow & the result data I see varys so wildly I don't see how it could be comming out of the Exp filter, even if the higher order bits are random. Per your suggestion I could ensure using only the valid 16 bits in the X word transferred by Modbus with the following ECT entry: I8008 = $690781 ;X/Y data at $010781 is not fractional I8009 = $010018 ;data is 16 bits wide starting at bit24 (bit0 of X) I8010 = $D0350A ;start Exponential I8011 = $000005 I8012 = $00068E I'll give this a try in the comming weeks when I have access. Thank You
  16. I agree that it would be best to drop the PTalk & upgrade to pcommserver if possible. I have recently moved an application from VB6 to .NET & it was not as easy as I had hoped. The attached file describes a profiler that will identify areas needing updates before processing through the MS utility. There are other products on the market; this one would process my small application without purcha$$$e. Just reading through the documentation might be helpful if you're already familiar with .NET I ended up rewriting rather than migrating. (sometimes the hard way is easier for dummies like me) 10 steps to migrate existing code to VB.doc
  17. Using an Acc-65-ETH I want to filter ADC1 as follows: (Modbus config shown at bottom) I8008=$D10781 ;ECT Entry 8 Y:$003509 = $D10781 ;begin exponential filter on ADC1 located at X$:010781 I8009=$000005 ;ECT Entry 9 Y:$00350A = $000005 I8010=$00068E ;ECT Entry A Y:$00350B = $00068E Bit 19 = 0 should give Exponential filter, but I get a tracking filter instead. I think this may be because my source address extends into byte 5 (bit 16=1). I know this is not supposed to happen; that the filter selection is supposed to be limited to bit 19 only, but it seems to be sensitive to any value in the entire byte. (0=Exp, otherwise=Tracking) I know the filter algorithms have worked correctly for many years, and indeed I have used the Exponential successfully in other applications - where the source address was limited to 4 bytes. I am curious regarding the mode selection behavior for the $D filter method. As a workaround I code the filter in PLC0 (thereby confirming expected source location as well). This is not a current issue anymore, but am still curious if I am doing something wrong. Hardware is an 8 axis GEO Brick ;DEFINE UBUFFER 1024 ;define 48 bit address space $010400-$0107FF inclusive for user ;I67=$010700 ;Beginning of ModBus Buffer ; ; Modbus Global socket configuration... ; WL:$10700,$100000000000 ;X=Socket0 Mode1, Server TCP PMAC ascii IP=0.0.0.0 WL:$10701,$000000000000 ;IP=0.0.0.0 ;WL:$10702 RESERVED WL:$10703,$200000000000 ;X=Socket1 Mode2, Server TCP PMAC interrupt ascii IP add=0.0.0.0 WL:$10704,$000000000000 ;IP=0.0.0.0 ;WL:$10705 RESERVED WL:$10706,$400000000002 ;X=Socket2 Mode4, ClientModbus/TCP-IP IP add=Server WL:$10707,$0000C0065E32 ;IP=192.006.094.050 ;WL:$10708 RESERVED WL:$10709,$000000000202 ;X=Socket3 Mode0, not active WL:$1070A,$000000000000 ;IP=0.0.0.0 ;WL:$1070B RESERVED ; ; Global Timers... WL:$1070C,$000001010101 ;All socket timers = 1*5ms ; ; socket 2 commands WL:$10710,$170000040000 ;X=timer0 Func=$17 ModBusRef=$0 Y count=4 PMACref=0 [READ Inputs] ; Func$17=23d ReadWrite multiple registers x 120 words [REQUIRES 2 ENTRIES] WL:$10711,$000004040004 ;X=timer0 Func=$0 ModBusRef=$4 Y count=4 PMACref=4 [WRITE Outputs] ;each count = X or Y 16bit ;$10780 - Digital Inputs X:0-15 Y:0-7(16-23) ;$10781 - Analog Inputs X:0-11 #1 Y:0-11 #2 ;$10782 - Digital Outputs X:0-15 Y:0-7(16-23) ;$10783 - Analog Outputs X:0-11 #1 Y:0-11 #2 M1900->X:$010781,0,12 ;ADC#1 raw M1901->Y:$010781,0,12 ;ADC#2 raw M1902->X:$00350B,0,12 ;Filtered ADC#1 see ECT for exp filter definition
  18. You simply specify the end point for each arc you want to define. It is assumed the start point is the current location. You can calculate this from angle, arc length, radius, or any other criteria you want to consider. This value can be calculated outside the motion program in a PLC, placed in a variable, and used in the motion program: X(P100) Y(P101) Or you can embed the calculations in the motion program X(5.2*sin(P233/M108)) Y(..some other expression..) Or you can call another motion program as a subroutine to make the calculations in 'real time' Or..... (with PMAC there are multiple ways of doing things. Some better than others in a given application; sometimes just equal alternatives) See the PMAC Users Manual - it has a section on using the various move definitions including Circle1 and Circle2 In your code you are defining the center location. You can also define the radius and let PMAC find the center. If you define both and they do not agree, Users Manual says PMAC will make up the differrence linearly through the move. This would result in a segment of an Archimedes Spiral. (??)
  19. mbalentine

    pcomm32

    What version of .net is supported in PcommServerPro2 v4.2 ? Can it be used in 3.5, or do I need to target an earlier version ?
×
×
  • Create New...