Jump to content
OMRON Forums

sjlee5

Members
  • Posts

    24
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sjlee5's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator Rare
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Hi, You can find codes below in "pp_proj.h" file. #define SetPtrVar(i, x) SetEnumPtrVar(i, x) #define SetPtrArrayVar(i, j, x) SetEnumPtrArrayVar(i, j, x) #define GetPtrVar(i) GetEnumPtrVar(i) #define GetPtrArrayVar(i, j) GetEnumPtrArrayVar(i, j) It has better performance to access M pointer variables in you code. Please check it !
  2. Hi, I think this is not bug. The source files in your PPMAC directory may be exist before you download the Project. Because at boot time PPMAC copies saved project to /var/ftp/usrflash. So if previously saved project contains C source file, then it will be copied to /var/ftp/usrflash. Maybe "Build & Download project" does not delete files already exist. Connect to your PPMAC with Putty. And change directory to /var/ftp/usrflash/Project/C\ Language with "cd" command. Then remove all files and directories inside this folder. After delete all files then "build & download" project again. cd /var/ftp/usrflash/Project/C\ Language/ rm -r * I think that you have many C source files and it takes long time to compile, not downloading project. I hope someone who is in charge of SW development can add exact replies.
  3. Hi, Did you checked my suggested filter values? In the previous thread, you attached some configuration file. and there the Sys.ServoPeriod is "0.442742110000000022". I think this is the factory setting. I tested again and this is the result of moving test and the dithering status of not moving. I cannot find any problems. I think you did not tuned servo or not properly set the filter values. Please check again. PowerPmac10.zip
  4. Hi, In my case, ptr PointerTest->Sys.Fdata[L0] Above code does not work and got an error when build and download. But below does work correctly without any error messages. ptr PointerTest->* PointerTest->Sys.Fdata[L0] Is there anyone who could explain differences between two codes ?
  5. Hi, mshaver. I'm using the same system configuration with steppers. If you are using the default Sys.Servoperiod, belows may be the same. This is my setup. close // Motor1 Stepper Axis Setup Gate1[4].Chan[0].EncCtrl=8; // Internal Pulse & Direction Gate1[4].Chan[0].OutputMode=3; Motor[1].DacBias=0; Motor[1].pDac=Gate1[4].Chan[0].Pwm[2].a; Motor[1].pLimits=0; // Disable Limits Motor[1].pAmpFault=0; // Disable Amp Faults Motor[1].Servo.Kp = 10; Motor[1].Servo.Kvfb = 0; Motor[1].Servo.Kvff = 15; Motor[1].Servo.Ki = 0; Motor[1].Servo.SwZvInt = 0; Motor[1].Servo.Kaff = 0; Motor[1].Servo.OutDbOn = 0.5; Motor[1].Servo.OutDbOff = 0.5; Motor[1].Servo.OutDbSeed = 1; // Motor2 Stepper Axis Setup Gate1[4].Chan[1].EncCtrl=8; // Internal Pulse & Direction Gate1[4].Chan[1].OutputMode=3; Motor[2].DacBias=0; Motor[2].pDac=Gate1[4].Chan[1].Pwm[2].a; Motor[2].pLimits=0; // Disable Limits Motor[2].pAmpFault=0; // Disable Amp Faults Motor[2].Servo.Kp = 10; Motor[2].Servo.Kvfb = 0; Motor[2].Servo.Kvff = 15; Motor[2].Servo.Ki = 0; Motor[2].Servo.SwZvInt = 0; Motor[2].Servo.Kaff = 0; Motor[2].Servo.OutDbOn = 0.5; Motor[2].Servo.OutDbOff = 0.5; Motor[2].Servo.OutDbSeed = 1; // Motor3 Stepper Axis Setup Gate1[4].Chan[2].EncCtrl=8; // Internal Pulse & Direction Gate1[4].Chan[2].OutputMode=3; Motor[3].DacBias=0; Motor[3].pDac=Gate1[4].Chan[2].Pwm[2].a; Motor[3].pLimits=0; // Disable Limits Motor[3].pAmpFault=0; // Disable Amp Faults Motor[3].Servo.Kp = 10; Motor[3].Servo.Kvfb = 0; Motor[3].Servo.Kvff = 15; Motor[3].Servo.Ki = 0; Motor[3].Servo.SwZvInt = 0; Motor[3].Servo.Kaff = 0; Motor[3].Servo.OutDbOn = 0.5; Motor[3].Servo.OutDbOff = 0.5; Motor[3].Servo.OutDbSeed = 1; // Motor4 Stepper Axis Setup Gate1[4].Chan[3].EncCtrl=8; // Internal Pulse & Direction Gate1[4].Chan[3].OutputMode=3; Motor[4].DacBias=0; Motor[4].pDac=Gate1[4].Chan[3].Pwm[2].a; Motor[4].pLimits=0; // Disable Limits Motor[4].pAmpFault=0; // Disable Amp Faults Motor[4].Servo.Kp = 10; Motor[4].Servo.Kvfb = 0; Motor[4].Servo.Kvff = 15; Motor[4].Servo.Ki = 0; Motor[4].Servo.SwZvInt = 0; Motor[4].Servo.Kaff = 0; Motor[4].Servo.OutDbOn = 0.5; Motor[4].Servo.OutDbOff = 0.5; Motor[4].Servo.OutDbSeed = 1; Please refer to the settings above. I'm sure this settings would be fine.
  6. How about using deadband gains? Motor[xx].Servo.OutDbOn = 0.5 Motor[xx].Servo.OutDbOff = 0.5 Motor[xx].Servo.OutDbSeed = 1 It would be helpful to remove chattering while not moving when use stepper pulse & direction.
  7. I suggest you to use "Motor[x].MasterPos". And there are reserved bits(bit2,3) in "Motor[x].MasterCtrl". If you use reserved bit 3 then you can control using or not. My code is like this. double dPrevDesPos, dCurrDesPos, dDeltaPos; double user_written_servo_routine_2(struct MotorData *Mptr) { if (Mptr->MasterCtrl&0x08) { dCurrDesPos = *((double *)pushm+10); // if use Sys.Ddata[10] dDeltaPos = dCurrDesPos - dPrevDesPos; Mptr->MasterPos += dDeltaPos; dPrevDesPos = dCurrDesPos; } else { dPrevDesPos = *((double *)pushm+10); } return pshm->ServoCtrl(Mptr); } I don't know there would be other problems. Please refer to my code.
  8. Hi, dzrong. As a default you cannot save P-variables with "SAVE" command. Before you save variables, you must modify some files. Please refer to this thread. http://forums.deltatau.com/showthread.php?tid=159&highlight=pp_save.tpl
  9. Hi, "UserAlgo.CFunc=1" enables that the function can be called from background routines. If you do not set "UserAlgo.CFunc=1", you can access CfromScript from Realtime Interrupt ( RTI PLCs, RTICPLCs, kinematics, etc... ). And, as I know it's better to insert "UserAlgo.CFunc=1" in "global_definitions.pmh". Lastly, If you want to set "UserAlgo.CFunc=1", you should declare "double CfromScript(..)" in usrcode.c and usrcode.h and export Symbol. You cannot set "UserAlgo.CFunc=1" before declaring "CfromScript" function. I succeeded in the way described above.
  10. Hi, Then where is the source code and what file should I rewrite. Could you tell me more in details ? Thank in advance.
  11. Hi, All. I was struggling with the same problem. At first, I imported C# library in VS2010 C++ compiler. But there was some problems with memory leakage. And it cannot be used with older version of VS compiler lik VC++6.0. So, I decided to make library on my own. It is written in C++. and you can compile with all versions of C++ compiler from VC++6.0 to VS2010. But, it's the begining step, and I will add more functions. Up to now, there are simple functions talking to PPMAC. Here's the list of API functions. UINT WINAPI DTKPowerPmacOpen(DWORD dwIPAddress, INT nPortNo, UINT uMode); UINT WINAPI DTKPowerPmacClose(UINT uDeviceID); UINT WINAPI DTKConnect(UINT uDeviceID); UINT WINAPI DTKDisconnect(UINT uDeviceID); UINT WINAPI DTKIsConnected(UINT uDeviceID, PBOOL pConnected); UINT WINAPI DTKGetResponseA(UINT uDeviceID, LPSTR lpCommand, LPSTR lpResponse, INT nLength); UINT WINAPI DTKGetResponseW(UINT uDeviceID, LPWSTR lpwCommand, LPWSTR lpwResponse, INT nLength); UINT WINAPI DTKSendCommandA(UINT uDeviceID, LPSTR lpCommand); UINT WINAPI DTKSendCommandW(UINT uDeviceID, LPWSTR lpwCommand); UINT WINAPI DTKSetReceiveA(UINT uDeviceID, PRECEIVE_PROC_A lpReveiveProc); UINT WINAPI DTKSetReceiveW(UINT uDeviceID, PRECEIVE_PROC_W lpwReveiveProc); ( DTK is just abbreviation of DeltaTau Korea... ) I hope it may be helps to you. If you have any question about API, please do not hesitate to reply. PowerPMAC2010Example.zip
  12. Hi, Raghav I suggest to use synchronous M-variables. You can add synchronous M-variables at the front of the every single line. This is example. M100->* OPEN PROG 1 CLEAR ... M100==1 X 10 M100==2 X 5 Y 20 ... CLOSE Then you can monitor "M100" variable in you GUI. I hope this may be help to you.
  13. If your command is correct, please test code below. if you want to use system command with argument in terminal (on-line command), as I know, you should use with cx or cpx command. p1=500 cx system"ethercat -m0 -p0 -t int16 download 0x607D 0 %d", p1 try it, and please check again.
  14. Hi, kycho. You can use pmac variables with the system command. Did you try like this? p1=500 system"ethercat -m0 -p0 -t int16 download 0x607D 0 %d", p1 please check the code above.
  15. Hi, andyf. As I said before... there's no compile action in terminal. And you can check your subprogram in terminal. if you list your subprog in terminal, there's response like below. list subprog testsub return; n10000: L1=L0+2 return As you see, "testsubinside" tag is changed to "n10000". so you can use like this. cx R0=3; call testsub.01; P1=R1; This is all I know about subprogram call in terminal. Anyone who know more about this subject, please tell us in more detail. Thanks.
×
×
  • Create New...