leandro.martins Posted May 22 Posted May 22 Your rticplc is been used to write into Sys.Fdata[100], which is being decoded by EncTable[4]. However any of the motors are pointing to EncTable[4]. Motor[1] and Motor[2] use EncTable[1] and EncTable[2], but those are not defined in your global definitions. Quote
David Jan Posted May 22 Posted May 22 My current one just has motor 1 coupled to motor 3 speed, so only motor 1 is pointing to EncTable [4] in my global variable file via the position following function. The encTable used by motor 1 and motor 2 is in the config file, see the image for details Quote
leandro.martins Posted May 22 Posted May 22 (edited) Completely missed those lines, sorry for that. Is the Sys.Fdata[100] being updated correctly? It might be useful to check the processed position by EncTable[4] looking into EncTable[4].prevEnc. The value from EncTable[4].prevEnc multiplied by EncTable[4].ScaleFactor should be the same of observed in Motor[1].MasterPos. Edited May 22 by leandro.martins Quote
David Jan Posted May 22 Posted May 22 Ok, I can look at Sys.Fdata[100] through the watch interface. Then at runtime look at EncTable[4].prevEnc vs EncTable[4].ScaleFactor Give you feedback later! Quote
David Jan Posted May 22 Posted May 22 I re-run the project and monitor these parameters and found that at #3j+, Motor[3].Iqcmd has a value but Sys.Fdata[100] has no value, is there a problem with the cplc program? Fdata[100] has no value, is there a problem with the cplc programme? It looks like the value of pushm[100] in cplc is not assigned. Quote
leandro.martins Posted May 22 Posted May 22 Check if the CPLC is running querying the UserAlgo.RtiCplc. If it's not running, use the command "enable rticplc". You can also add that in pp_startup.txt to make sure that it runs everytime that you restart the controller. Quote
David Jan Posted May 23 Posted May 23 By the parameter UserAlgo.RtiCplc it means that rticplc is not enabled at all, but I added enable rticplc in pp_startup.txt at the beginning, and also this time I typed enable rticplc in cmd, but UserAlgo.RtiCplc is still 0 instead of 1. Quote
David Jan Posted May 23 Posted May 23 I am strictly following the user manual when using rticplc, but as I observe my rticplc folder versus MoMo's, there is only one file (rticplc.c) in my folder, while MoMo's has many files, including some required for compilation. Is this due to the different versions of our IDEs? My version is 4.5.2.9. Quote
leandro.martins Posted May 23 Posted May 23 Make sure that the rticplc is configured to be compiled. In Properties, the Build Action should be "Compile". Then Build and Download your project. Quote
David Jan Posted May 23 Posted May 23 My Build Action is "Content". After changing it to "Compile", it works fine. To further understand PMAC, if I don't implement the speed bias from Entable, can I implement it from other places? For example, pDac, is it possible to change it directly from the command? Quote
leandro.martins Posted May 23 Posted May 23 (edited) It's not clear to me what is your question. With the implementation that MoMo provided is possible to change the Mtr2VelOffset from the terminal, since it's declared as a global variable. However, if your question is wether it's possible to do something similar to this: Motor[2].pDac= Motor[1].IqCmd.a + Mtr2VelOffset then the answer is no. It's important to understand that the ".a" suffix means that you are getting the memory address of that structure element. And the "p" from Motor[2].pDac means that this element is a pointer, that represents the address where the Motor[2].IqCmd will be written. Besides the fact that as MoMo explained, you have to get a position offset to close the loop. I think that is the main reason for using the Enctable. Edited May 23 by leandro.martins Quote
David Jan Posted May 24 Posted May 24 Sorry, maybe I didn't express myself clearly, my question is whether it's possible to add the positional offset in another way? Right now MoMo's thinking is to use Enctable for this. Is there any other way to do it? PMAC being the most powerful motion controller, this should not be the only way to implement it. Quote
DaveBarnett Posted May 24 Posted May 24 You might be able to achieve what you want with "Position Following" Search for Position Following (Electronic Gearing) in the User's Manual. Quote
David Jan Posted May 24 Posted May 24 The Position Following function doesn't work for my idea, my idea is to bias the speed when the target position of motor 1 and motor 2 are the same. The speed of motor 1 is 50, the speed of motor 2 is the speed of motor 1 + bias, and motor 2 is coupled to the speed of motor 1. When the bias is 50, it takes 2s for motor 1 to move from 0 to 100, and motor 2 stops after only 1s of movement, because the speed of motor 2 is 100, and it only needs to move for 1s before it arrives at the position. Quote
MoMo Posted May 24 Posted May 24 I think you can see all the data changes in this process. Why is it not working? I think you should be able to find out why. 1 Quote
DaveBarnett Posted May 24 Posted May 24 (edited) So, ... you desire something like shown in this plot below? Where the area under the two curves (the position traveled...) is the same. (?) This can be achieved with a motion program, where the movetime TM is specified...then, PMAC automatically selects the feedrate. I created the plot above with the following motion program: open prog VelOffset linear INC TM (Q1) // Q1 is 1000 in CS1, 2000 in CS2 TA 50 TS 0 if (Ldata.coord == 2) Gather.Enable = 2 //start gather X(p1) dwell 50 if (Ldata.coord == 2) Gather.Enable = 0 //stop gather close Then.... in the terminal: &1 Q1 = 1000 &2 Q1 = 2000 &1 #1->X //set CS definitions... &2 #2->X P1 = 2000 // set move length &1 b VelOffset r ; &2 b VelOffset r // run the program simultaneously in both CS's Edited May 24 by DaveBarnett 1 Quote
David Jan Posted May 25 Posted May 25 17 hours ago, MoMo said: I think you can see all the data changes in this process. Why is it not working? I think you should be able to find out why. Okay, I'll try to analyse the changes in the data during this process and find out why. Quote
David Jan Posted May 25 Posted May 25 16 hours ago, DaveBarnett said: So, ... you desire something like shown in this plot below? Where the area under the two curves (the position traveled...) is the same. (?) This can be achieved with a motion program, where the movetime TM is specified...then, PMAC automatically selects the feedrate. I created the plot above with the following motion program: open prog VelOffset linear INC TM (Q1) // Q1 is 1000 in CS1, 2000 in CS2 TA 50 TS 0 if (Ldata.coord == 2) Gather.Enable = 2 //start gather X(p1) dwell 50 if (Ldata.coord == 2) Gather.Enable = 0 //stop gather close Then.... in the terminal: &1 Q1 = 1000 &2 Q1 = 2000 &1 #1->X //set CS definitions... &2 #2->X P1 = 2000 // set move length &1 b VelOffset r ; &2 b VelOffset r // run the program simultaneously in both CS's This method is indeed feasible, but I want to use PLC to implement it. I want to implement and package it in the form of functional modules Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.