kmonroe023 Posted April 24, 2013 Posted April 24, 2013 I am using the position compare output on a Acc24E3 card to turn an output on and off at a specific point on a closed 2D profile. We're performing contour following and want the output to turn on then off at the same point; on when the profile is started and then off when the profile is completed. There should be as little overlap or gap between the start/stop points as possible, hence the need for using the hardware position compare output. We want a perfectly closed shape. A script PLC monitors coordinate system sync variables programmed into the shape program to set Gate3.Chan[j].CompA and .CompB registers. This is to make sure the output comes on when starting the shape and not as the tooling moves through a transitional point to get to the part position. To do this CompA and CompB are set to zero prior to starting the part program and only set when the sync variables indicate the tooling is close to our desired start position. According to the user manual the EQU output should not change state if both Comp registers are equal. This part seems to work fine, the EQU output toggles and comes on as expected at the start of the profile. Now for my problem: After the EQU output toggles, the Comp registers are again set to zero. Like the start point, the script PLC monitors the coordinate system sync variable to set the Comp registers for the off point. Again the thinking is that we don't want the output to toggle as the motors move through a compare position while the tooling moves around the profile. But...I'm actually seeing the EQU output toggle when both Comp registers are zero! It seems to occur as Gate3.Chan[j].ServoCapt goes from a negative to positive value. I've made sure there are no PLCs forcing the EQU signal on or off. Only the state of the Comp registers should be controlling the EQU output. I used the plot utility to capture pertinent data, then I imported it into an Excel spreadsheet, see the attached image for a screen cap of the position where the signal toggles with both Comp registers at zero. As you can see both Chan0 comp registers are zero when the Equ output toggles off, but the ServoCapt position goes from a negative to positive value. What could be causing the output toggle in this state? If both Comp registers are zero, the output shouldn't toggle, but the output is toggling when when the motor position moves through servoCapture zero. Motor[6].ActPosition is on Chan[0] and .HomePos was non-zero (-30 when this data was taken). I can upload or send you the complete Excel and project file if that helps. I'm running firmware 1.5.8.0. Thanks for the help. kmonroe
Sina.Sattari Posted April 24, 2013 Posted April 24, 2013 kmonroe, Please use the Acc24E3.Chan[j].EquOutMask=0 to prevent any output from the EQU circuitry when no output is expected.
kmonroe023 Posted April 25, 2013 Author Posted April 25, 2013 This will work if I want the output off, but I would like to also keep the output on. Setting the EquOutMask=0 turns off the output. If I leave the mask as is (3 in my case), the output still turns off when ServoCapt runs through 0. I was hoping having compA and compB equal would keep the output from toggling, either from 1 to 0, or 0 to 1. So far these are the two problems that are preventing me from implementing this: 1. The EQU output toggles when the CompA and CompB registers are equal. The manual specifically states that for a Pmac3 style IC the EQU output should not toggle if CompA and CompB are equal. If I set the CompA and CompB registers to values larger than our work envelope I can get around this problem. The output won't toggle because the motors will not travel far enough to reach the Comp values. 2. I can only get the output to toggle when the motor is traveling in the positive direction. If the motor is traveling in the negative direction, the EQU output will not toggle, even though the encoder position value in ServoCapt matches or passes one of the values in CompA or CompB. It's entirely possible I have a card or motor setting that is causing the above issues, I'm just perplexed as what I could be doing wrong. The users manual basically says that the EQU output will toggle when the encoder value matches or passes one of the Comp register values. Motor travel direction should not matter. Update: I also tried changing the value of the Gate3.Chan[j].EncCtrl value. Since the EQU channel is setup as a PFM motor, EncCtrl is set to 8 for Internal Pulse and Direction CW. If I set EncCtrl equal to 12 (CCW), then the output would not toggle on either the positive going or negative going direction. If I change it back to 8, the output would again toggle in only the positive going direction. kmonroe, Please use the Acc24E3.Chan[j].EquOutMask=0 to prevent any output from the EQU circuitry when no output is expected.
curtwilson Posted May 1, 2013 Posted May 1, 2013 I have been looking into this. I have not been able to duplicate the issue of direction sensitivity. As far as edge suppression when CompA=CompB, on my system it is suppressed virtually all the time, but I do occasionally see an edge. We are continuing to investigate.
kmonroe023 Posted May 2, 2013 Author Posted May 2, 2013 Thanks for the info Curt. On my system, edge suppression failed to function when running a continuous series of circle/linear moves (our part profile) with segmentation and look ahead enabled. With CompA=CompB, it always toggled in the positive direction. Regarding not seeing the position reversal problem; do you have the PFM motor setup similar to my project? Would it be possible for you to post your motor setup and Acc24E3 card setup if applicable? Thanks, kmonroe
kmonroe023 Posted May 6, 2013 Author Posted May 6, 2013 Bump.... Just wondering if there has been any progress with this. Thanks.
curtwilson Posted May 7, 2013 Posted May 7, 2013 I have not been able to get the toggling to fail in the negative direction (or the positive) with either a real encoder or using the internal pulse train (with the decode in either direction). We have had no other reports of this. I have occasionally been able to duplicate the issue of having the EQU bit toggle when CompA and CompB are the same value as the counter passes this value. This is something we will have to live with for at least the time being, since it would take a year to get a new revision of the IC into the field. You could continue to set CompA and CompB to values outside of the range of travel; but it might be easier to do the following: Gate3[0].Chan[0].EquOutPol = Gate3[0].Chan[0].Equ // To maintain the current output value Gate3[0].Chan[0].EquOutMask = 0 // Detach output from internal EQU states
kmonroe023 Posted May 8, 2013 Author Posted May 8, 2013 Curt Could you post your motor setup that uses the internal counter as feedback. I'd like to compare it to my setup and see if I have something setup wrong. Also, the Gate3 card setup might be helpful as well. I've tried everything I can think of to get it to toggle in the negative direction and no luck so far. Thanks, kmonroe
curtwilson Posted May 8, 2013 Posted May 8, 2013 Because this is purely a hardware function in the IC, I worked interactively directly with the IC registers to make sure that nothing else got in my way. Sys.WpKey=$AAAAAAAA // To enable writing to IC setup registers Gate3[0].Chan[0].EncCtrl=8 // Use internal PFM into encoder counter Gate3[0].Chan[0].TimerMode=0 // 1/T sub-count extension (so can read TimerA as position) Gate3[0].Chan[0].PackOutMode=0 // So PFM command comes from unpacked Phase D register Gate3[0].Chan[0].EquOut=1 // Output uses this channel's state only Gate3[0].EncClockDiv=5 // 3.125 MHz (default) Gate3[0].PfmClockDiv=5 // 3.125 MHz (default) In the IDE watch window I put: Gate3[0].Chan[0].TimerA // Present position with 12 bits of fractional count Gate3[0].Chan[0].CompA // Specified compare edge position A (w/ 12 bits of fraction) Gate3[0].Chan[0].CompB // Specified compare edge position B (w/ 12 bits of fraction) Gate3[0].Chan[0].Equ // Channel internal compare state Gate3[0].Chan[0].EquOut // Channel compare output I set values of CompA and CompB to one side of the value of TimerA. For now, at least, I kept CompAdd at 0. I made sure no active motor was using this IC channel - in my case by setting Motor[1].ServoCtrl to 0. Next I wrote positive and negative values to Gate3[0].Chan[0].Pfm. I watched the TimerA value as it passed CompA and CompB, and saw that the Equ value toggled as it passed each in both directions. This worked with EncCtrl=12 as well as 8, so TimerA moved in the opposite direction from PFM. I changed EncCtrl to 3 and 7 and moved the motor/encoder by hand. All this worked. With EncCtrl set to 8, I used the standard settings for a "stepper motor" setup, and was able to jog the motor back and forth past CompA and CompB. I suggest working manually with the IC registers directly first.
kmonroe023 Posted May 9, 2013 Author Posted May 9, 2013 Thanks for the information Curt. I will give all this a try.
kmonroe023 Posted May 29, 2013 Author Posted May 29, 2013 I've been experimenting some more with this. I am still having issues with toggling the EQU output when the motor is moving in the negative going direction, but only under certain circumstances. I can get the output to toggle in both directions if the Gate3 Comp registers are setup prior to running the motion program, or if I setup the Comp registers by hand and run the motors from the command line. However, if the Comp registers are updated while the motion program is running the output will not toggle in the negative going direction. Toggling in the positive going direction works as expected, and seems unaffected by updating the Comp registers while a motion program is running. This behavior is very reproducible, I've even seen this happen while running 'cpx' programs from the command line. It just seems like I am running into an issue baked into the PMAC3 IC. Thoughts??? Regards, Kmonroe
Sina.Sattari Posted June 27, 2014 Posted June 27, 2014 Update: Please check the following post: http://forums.deltatau.com/showthread.php?tid=727&pid=6809#pid6809
Recommended Posts