kmonroe023 Posted August 11, 2015 Share Posted August 11, 2015 I'm trying to implement cascading servo loops per the user manual. I'm trying to control the height of a tool over a surface using a sensor w/ a 0-10V signal into an ACC28E card. Once "following" is enabled the Z axis needs to maintain the gap between the sensor and the surface. I'm a bit confused by what the manual is telling me though: I've setup motor 0 to process the analog input from the 28EMotor 2 is the Z axis (real motor)In the manual EncTable[4] is setup to process the servo cmd from motor 0. Motor 4 is setup to be the secondary axis W, to Z in the CS. There's no motor setup listed in the manual for motor 4, should this be a setup as a virtual motor also? Or should motor 0 be setup as axis W since that is the sensor "motor" and EncTable[4] is only used to process the outer loop? In the present state, if I try to run a motion program I get a CS not ready message since motor 4 is not configured. Link to comment Share on other sites More sharing options...
Omron Forums Support Posted August 11, 2015 Share Posted August 11, 2015 Hi, If you are using Motor 0 to process the outer loop's feedback (i.e. the analog feedback), you should use EncTable[0] for the ACC-28E like on page 322 of the manual: EncTable[0].type=1 // Single-register read EncTable[0].pEnc=Acc28E[0].AdcSdata[0].a // Source data address EncTable[0].index1=0 // No left shift EncTable[0].index2=16 // Right shift 16 bits EncTable[0].ScaleFactor=1.0 // Result units are LSBs Motor[0].ServoCtrl=1 // Activate motor Motor[0].PhaseCtrl=0 // No commutation by PMAC Motor[0].pEnc=EncTable[0].a // Use result of ECT entry 0 Motor[0].pEnc2=EncTable[0].a // Use result of ECT entry 0 Then, I recommend using the 0D compensation table method to couple the loops as described on page 323 of the User Manual. I will repost the code here, but modified to use motor 2 as the target, rather than 3 as in the manual: Sys.CompMotor=1 CompTable[0].Source[0]=0 // Use Motor 0 data for source CompTable[0].Ctrl=3 // Use source motor’s servo command CompTable[0].Nx[0]=0 // No data zones in 1st dimension CompTable[0].Nx[1]=0 // No data zones in 2nd dimension CompTable[0].Nx[2]=0 // No data zones in 3rd dimension CompTable[0].Data[0]=0 // Initialize single data point CompTable[0].OutCtrl=0 // No integration of result CompTable[0].Target[0]=Motor[2].CompDesPos.a // #2 desired pos CompTable[0].Sf[0]=1.0 // Unity scale factor (when active) In order to answer your question about motor 4, we need to know more about what you intend. Does motor 4 represent a physical motor? I currently do not see how it is related to the cascaded loops at all. If it represents a physical motor, you need to set it up to engage its amplifier properly. The System Setup software should be suitable for that task. In order for you to run a program in your coordinate system, then, all motors associated with the axes in the coordinate system (i.e. Z and W in your case) must be in closed-loop mode. You can close the loop with #2j/#4j/ for motors 2 and 4. I suggest using the code on page 325 to "slew" the process of engaging the outer loop when you are ready in the motion program. Let me know if you have further questions or need of clarification. Link to comment Share on other sites More sharing options...
kmonroe023 Posted August 12, 2015 Author Share Posted August 12, 2015 Thanks for the reply Charles, I will try the comp table method. I think there may be a typo in the manual for the ECT method cascading loop example (page 322-323). The example starts by setting Motor[0] as the outer loop motor, but later assigns axis W to motor 4. See cut text below. Coordinate System Setup To assign all of the motors to axes in C.S. 1, with units of millimeters, the following definitions can be used. &1 // Address C.S. 1 #1->10000X // X-axis positioning in millimeters #2->10000Y // Y-axis positioning in millimeters #3->10000Z // Z-axis positioning in millimeters #4->4000W // Vertical gap (W) in millimeters Coupling the Loops with Position Following To couple the outer and inner loops using the position-following technique, the outer loop’s servo command value must first be processed through the encoder conversion table. Because this application has a limited movement of the inner loop from the outer-loop command, the value will not be integrated. The ECT entry will look something like this: EncTable[4].type = 11 // Floating-point read EncTable[4].pEnc = Motor[0].IqCmd.a // #0 servo cmd as source EncTable[4].index1 = 0 // No left shift EncTable[4].index2 = 0 // No right shift EncTable[4].index3 = 0 // No limiting EncTable[4].index4 = 0 // No integration EncTable[4].index5 = 0 // No pre-scaling EncTable[4].ScaleFactor = 1/256 // Scale to +/-32K range Link to comment Share on other sites More sharing options...
Recommended Posts