Jump to content
OMRON Forums

moha_sa

Members
  • Posts

    20
  • Joined

  • Last visited

Recent Profile Visitors

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

moha_sa's Achievements

Apprentice

Apprentice (3/14)

  • Reacting Well Rare
  • Dedicated Rare
  • First Post
  • Collaborator Rare
  • Week One Done

Recent Badges

1

Reputation

  1. I have written a c program on pmac IDE which accesses the windows server to read desired inputs to a motor and update it on the shared memory. Does anyone know where should I place my c program to benefit from real-time interrupt property without any need to use a while loop? Should I place it under background C program folder or realtime CPLC (.rticplc) folder or in the real-time routines folder? Thanks.
  2. if it is not possible to use fprintf, what tools are available by which we can record the actual and desired motor positions based on time into a text file so that we can use it for postprocessing?
  3. Anyone knows how to record data into a text file from PMAC IDE for example from a background C program to be used for post processing in other softwares like MATLAB for visualization? I tried "fprintf" but it does not seem generating any text file anywhere in the program folder on windows.
  4. Absolutely. Thank you very much Steve.
  5. I would like to learn how the desired trajectory is coded as part of the jog command. Any idea how to get access to the jog source code on PMAC? Thanks.
  6. I aim to update the desired position of Motor#n in a user-defined servoCtrl externally via a background C program. Unfortunately, as soon as I enable motor by Motor[n].ServoCtrl=1 command in terminal, the desired value of Motor[n].DesPos on watch window resets to zero. How can I avoid it? My goal is to update the value of Motor[n].DesPos in user-defined servo from a background C program.
  7. Thank you very much Eric. The answer is Yes or no. For now we just use a motor#n address which is not connected to any physical motor to be safe. Our goal is to call the user-defined servo routine from a c program on the IDE. I tried out your flag check idea (Mptr->ClosedLoop or Mptr->AmpEna), but still after enabling motor ( #nj/ ) from terminal the sevoCtrl routine starts and never gets stop; I actually confirmed that by printing a command on the unsolicited window from the servoCtrl function below. I am still looking for a stop command such that I can call it from terminal and be able to stop servoCtrl routine below, in other words what is the opposite command to (#nj/) . Any idea would be greatly appreciated. double PIDmodel_user_servo(struct MotorData *Mptr) { servoout = 0; //In this loop it is asked to stop sending message to unsolicited window once motor amplifier was disabled // Motor[n].ServoCtrl = 0 from terminal, but it does not seem to work as it keeps printing the message on the unsolicited //window forever until we reset the whole system. if (Mptr->AmpEna) { servoout = 0; MyCharArray[0]= 'H'; Send(1,&MyCharArray); } //use_return return servoout; }
  8. We have constructed a user-defined servo C program algorithm in the realtime routines folder. After build and downloaded and enabled a motor using ( #nj/ ) command from terminal where n is the motor number, the servo algorithm starts running. However, I do not know how to stop the algorithm afterwards and it keeps running forever. I know how to stop the motor or how to kill the amplifier, but no idea about the algorithm itself. Any comment would be appreciated.
  9. Hi, I am receiving this error "implicit declaration of function 'malloc' " when using servoData = (char *)malloc(CHAR_BUF_SIZE_3*sizeof(unsigned char)); in a user-defined ServoCtrl algorithm in the Realtime Routines folder in the IDE. My goal is to use sprintf and send commands to be able to print a float variable to the unsolicited message window and monitor its value as below: char *servoData; servoData = (char *)malloc(CHAR_BUF_SIZE_3*sizeof(unsigned char)); sprintf(servoData,"desired position is %f \n", 230.5); Send(SEND1_PORT,servoData); Any idea how I can still use "malloc" without the error to run the "Send" command? Thanks.
  10. Anyone knows how to directly call a motor's servo-control routine in the Realtime Routine folder from the background C program? We would rather not to use jogging command, but its servo subroutine to expedite our process. Thanks.
  11. I tried older MATLAB versions like 2020b and 2017b to generate [put simulink model name here]_MATLAB_definitions.pmh, but it did not work and still gives the same error as noted in the first message. We do not have license for older versions like 2016a. Any idea how we can solve this dependency file problem to take care of tunable gains in the matlab generated c-code? Thanks.
  12. Thanks Eric for your suggestion. Back to your comment we installed MATLAB 2020b on our windows 10. Still we are receiving the same error as before and do not see that the *..._MATLAB_definitions.pmh* file is being created. Please see attachments which shows the content of ppmactarget folder and our model files inside the *stepMDL__traj_ppmac* folder. Any idea how we can create *..._MATLAB_definitions.pmh* based on the manual? Thanks a lot. ppmacTarget folder.pdf no _MATLAB_definitions.pmh file is created.pdf
  13. Thanks a lot Eric. Can you please take a look at the attachment files that I created. To answer your excellent question: most of the times, i am not able to run jog commands like #6j=0 right after running the MATLAB-defined trajectory/servo algorithm command, for example *sinTraj_flag()* here. I do not know why. That seems reasonable that the following error signal window can read the desired position which is 10 encoder counts for the programmed step input by MATLAB/Simulink embedder code, but the actual position of the motor still does not change that means the DAQ signal is not active and I probably miss compiling some sort of Deltatau servo algorithm. I am not quite sure why though. Any idea welcome. matlab defined servo trajectory.pdf simulink step input trajectory for c code generation to pmac IDE.pdf
  14. I tried to change the type of servo algorithm for a motor on real-time routine folder at IDE 3.1.2.2 Then to deploy this change to PMAC I chose “build and download all files”. However, when I confirm it by using command "motor[6].Ctrl", I do not see that servo algorithm type has been updated. I am wondering what I am missing in deployment aside from “build and download all files”? Should I execute "save" and then "$$$" or "$$$***" after “build and download all files” to make the change effective?
×
×
  • Create New...