Jump to content
OMRON Forums

How to change the motor speed


aoligei

Recommended Posts

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.

Link to comment
Share on other sites

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

211.png

212.png

Link to comment
Share on other sites

Posted (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 by leandro.martins
Link to comment
Share on other sites

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.

 

303.png

Link to comment
Share on other sites

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.

401.png

402.png

Link to comment
Share on other sites

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.

403.png

404.png

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Posted (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 by leandro.martins
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 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.

Link to comment
Share on other sites

Posted (edited)

So,  ...  you desire something like shown in this plot below?

velDemo.PNG.10c550006f1097e1600e4779f1a9b8ed.PNG

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 by DaveBarnett
  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

16 hours ago, DaveBarnett said:

So,  ...  you desire something like shown in this plot below?

velDemo.PNG.10c550006f1097e1600e4779f1a9b8ed.PNG

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...