Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rotary buffer
#1
Hi,

I am trying to use rotary buffer in my application to move axes. But the problem is that axes are not moving at all. All axes are homed and enabled.
Please, advise, what is wrong.

The following lines of source code are how I am trying to do that:


&1a
Define rotary BUFFER_SIZE
open rotary
Coord[1].MaxFeedrate = FEEDRATE
Coord[1].Tm = -SPEED
x-283.000 Y202.000 Z305.000 V90.000 U-84.000
x-285.000 Y202.000 Z305.000 V93.000 U-84.000
x-287.000 Y202.000 Z305.000 V96.000 U-84.000
x-289.000 Y202.000 Z305.000 V99.000 U-84.000
x-290.000 Y202.000 Z305.000 V100.000 U-84.000
x-289.000 Y202.000 Z305.000 V99.000 U-84.000
x-287.000 Y202.000 Z305.000 V96.000 U-84.000
x-285.000 Y202.000 Z305.000 V93.000 U-84.000
x-283.000 Y202.000 Z305.000 V90.000 U-84.000
close
&1b0r
Reply
#2
Maybe a Clear Rotary command needs to be issued so that pre-existing lines in the buffer are not being unexpectedly executed.

Is BUFFER_SIZE greater than 2048?
Reply
#3
Also check for any motors in the CS not in closed loop.
Reply
#4
Thank you for replies!
1) The buffer size is 4096. And may be greater.
2) All motors are in closed loop. But to get feedback I need them to be in closed loop.
It looks like it moves, but very very slowly.
Reply
#5
Are the following set up correctly:

Linear mode

Coord[1].Ta, Coord[1].Td and Coord[1].Ts
(Set time in acceleration, deceleration, and S-curve accel)

Motor[x].MaxSpeed

Frax
(Use Frax command to choose which axes are used in vector feederate calculations)
Reply
#6
A "feedrate" value is a commanded vector speed of your "feedrate axes". The intent of this functionality is to get a constant tool-tip speed in 2D or 3D Cartesian space without the user having to compute the individual axis speeds. PMAC does this by first computing the vector distance of the feedrate axes by Pythagorean theorem, then dividing by feedrate to get the move time.

By default, the "feedrate axes" are X, Y, and Z. It is possible to change this with the FRAX command, but very few people do (and I don't think you have changed this). The idea of a constant vector feedrate regardless of direction does not make geometric sense with more than 3 dimensions.

In your example, your vector distance is zero. Since you also have "non-feedrate" axes (U and V), it instead computes the move time by dividing the commanded distance of each non-feedrate axis by the saved parameter Coord[x].AltFeedrate, and taking the largest of these times. The resulting motor speeds are then compared to Motor[x].MaxSpeed for each motor, with the move time extended if any of these limits are exceeded.

So you first need to check your value of Coord[x].AltFeedrate, then the values of Motor[x].MaxSpeed as Greg said.
Reply
#7
More precisely, if the time for any of the non-feedrate axes, as calculated by (AxisDistance/AltFeedrate), is greater than the time calculated for the combined vector feedrate axes (VectorDistance/Feedrate), it will use this longer time, and the actual vector feedrate used for the move will be less than what was commanded.
Reply
#8
Thank you for support!
I am going to check all you said here.
Reply
#9
I know this might be obvious, but have you actually defined axis definitions in coordinate system 1?

For example:

&1
#1->X
#2->Y
#3->Z
#4->V
#5->U
Reply
#10
I know this maybe a little off topic, however I’ve seen this issue several times in the forum and it’s happened to me many times.
Is/could there be a way to determine the limiting parameter in a motion move?
Reply
#11
The best way to figure out what is going on is to plot the desired velocity profile through data gathering.

There are many different limiting factors that could occur at different stages in the calculations. I don't think it would be feasible to flag all of them.
Reply
#12
Hi,

I am facing a new problem using rotary buffer: the rotary buffer stops running after first line was executed.
Please, advise how to fix this problem.

Here is my source code:

CS defined as below:

&1
#1->x
#2->0 //position follower of #1
#3->xx
#4->0 //position follower of #3
#5->y
#6->yy
#7->z
#8->zz
#9->u
#10->uu
//#11->a //not used in current configuration
//#12->aa //not used in current configuration
//#13->b //not used in current configuration
//#14->bb //not used in current configuration
#15->v
#16->vv

Then in my application written on C#:

//buffer initialization
cmds.Add("&1a");
cmds.Add("&1 delete rotary");
cmds.Add("&1 define rotary " + ROT_BUF_SIZE); // ROT_BUF_SIZE = 4096
cmds.Add("&1open rotary linear abs close");
cmds.Add("&1b0r");

SendCommands(rotComm, cmds, out res);

//buffer filling
cmds.Add("&1open rotary X92028 Y1089221 Z1631730 U-500011 V173488 close");
cmds.Add("&1open rotary X92087 Y1089385 Z1636252 U-500125 V172850 close"); //at this line the execution stops
cmds.Add("&1open rotary X92152 Y1089550 Z1640774 U-500238 V172212 close");
cmds.Add("&1open rotary X92221 Y1089714 Z1645296 U-500352 V171575 close");
cmds.Add("&1open rotary X92296 Y1089878 Z1649817 U-500465 V170937 close");
cmds.Add("&1open rotary X92376 Y1090042 Z1654338 U-500579 V170300 close");
cmds.Add("&1open rotary X92461 Y1090206 Z1658858 U-500692 V169662 close");
cmds.Add("&1open rotary X92552 Y1090370 Z1663377 U-500806 V169025 close");
cmds.Add("&1open rotary X92648 Y1090533 Z1667895 U-500920 V168387 close");
cmds.Add("&1open rotary X92749 Y1090697 Z1672411 U-501034 V167750 close");
cmds.Add("&1open rotary X92855 Y1090860 Z1676927 U-501147 V167112 close");
cmds.Add("&1open rotary X92966 Y1091024 Z1681440 U-501261 V166475 close");
cmds.Add("&1open rotary X93083 Y1091187 Z1685953 U-501375 V165837 close");
cmds.Add("&1open rotary X93205 Y1091350 Z1690463 U-501490 V165200 close");
cmds.Add("&1open rotary X93332 Y1091513 Z1694971 U-501604 V164563 close");
cmds.Add("&1open rotary X93464 Y1091676 Z1699478 U-501718 V163925 close");

SendCommands(rotComm, cmds, out res);
Reply
#13
Check motor status and CS status- more than likely this is the cause - the program is being aborted or maybe stopped by a feed hold.
Reply
#14
I see in CS1 Error Status "RunTimeError". What to check?
Reply
#15
(06-26-2015, 01:02 AM)kandauru Wrote: I see in CS1 Error Status "RunTimeError". What to check?

Check the Error Status to determine what caused the RunTimeError

Coord[x].ErrorStatus

Power PMAC Software Reference Manual - Page 667
Reply
#16
Under the topic "Constraints on Linear/Circle Moves" I have read the following:
With very short moves, user must be careful not to overwhelm Power PMAC real-time calculation capabilities (run-time error would result and program would halt).
It looks like it is my case, isn't it?
Reply
#17
Not necessarily. Short in this case refers to time, not distance. If your moves are close to one servo cycle in time then it could be. You should calculate how much time each move is taking on average.

Another test is to run at %10 federate override and see if the problem goes away. If not then it is really something else like I mentioned in the e-mails. If so increase the federate override until it comes back just to know at what value the trouble starts.
Reply
#18
In firmware versions older than V1.6, if calculation of moves from the rotary motion program "caught up" with the loading of the buffer, program execution would stop with an error. That is, if the program went to calculate the next move from the buffer and that move wasn't there, that would be an error.

Starting in V1.6, which was released in February 2014, if this happened, the program would go into a suspended mode, effectively dwelling until the next move was loaded. Often, this is still undesirable, especially if you wanted the moves to be blended on the fly.

I think the key is to make sure your program loading stays well ahead of your move calculation. This means you want to load multiple program lines before you even start program execution. When you issue the "b0r" command and then start loading, PPMAC will calculate the first move as soon as you load it, then see that the buffer is empty. Even with the newer firmware, it would not blend the first move into the second.

It is more efficient in loading the program if you execute a single "open rotary" command, then send a whole set of program lines, followed by a single "close" command.
Reply
#19
Finally, I see that rotary buffer is working, but not exactly what I wish. Axes move from point to point with a small stop, not smoothly.
You can see it here: https://drive.google.com/open?id=0B6Q9gP...3l6OVl0VGs .

Below you can find a motion program and parameters:
&1
Coord[1].FeedTime = 1000 //sec
Coord[1].SegMoveTime = 0
Coord[1].AltFeedRate = 300 //mu/s
Coord[1].MaxFeedRate = 300 //mu/s
Coord[1].Ta=1
Coord[1].Td=0
Coord[1].Ts=5
Coord[1].Tm=-5
Coord[1].NoBlend=0


&1
#1->1865x
#2->1865xx
#3->1865y
#4->1865yy
#5->1865z
#6->1865zz
#7->680.9714v
#8->324.8089u
#9->680.9714vv
#10->324.8089uu

open prog 1
Ldata.coord=1
frax(X,Y,Z)
linear
abs
F20
cmd "&1a"
cmd "&1 delete rotary"
cmd "&1 define rotary 600000"
cmd "&1 open rotary abs linear close"
cmd "&1b0r"
while (RunProg == 1)
{
cmd "&1 open rotary X-207Y308Z573V186U-249 X-207Y309Z573V186U-249 X-208Y311Z573V186U-249 X-208Y312Z573V185U-249 X-209Y314Z573V185U-249 X-209Y315Z573V185U-249 X-210Y317Z572V184U-249 X-211Y318Z572V184U-249 X-211Y320Z572V184U-249 X-212Y322Z572V183U-249 X-212Y323Z572V183U-249 X-213Y325Z572V183U-249 X-214Y326Z572V182U-249 X-214Y328Z572V182U-249 X-215Y329Z572V182U-249 X-215Y331Z571V181U-249 close"

Sendallcmds

cmd "&1 open rotary X-215Y330Z570V180U-249 X-214Y329Z571V181U-249 X-213Y327Z571V181U-249 X-213Y326Z571V181U-249 X-212Y324Z571V182U-249 X-212Y323Z571V182U-249 X-211Y321Z571V182U-249 X-210Y320Z571V183U-249 X-210Y318Z571V183U-249 X-209Y316Z571V183U-249 X-209Y315Z571V184U-249 X-208Y313Z571V184U-249 X-207Y312Z572V184U-249 X-207Y310Z572V185U-249 X-206Y309Z572V185U-249 X-206Y307Z572V185U-249 close"

Sendallcmds
}
close

BTW, way frax(X,Y,Z,U,V) is not acceptable with projpp? I am getting the following error:
Error : ( error #31) invalid data : frax(z,y,z,v,u).

So, my main question is how to make it moves smoothly?
Thank you in advance!
Reply
#20
It is hard to guess what is happening, basically because that code, as shown, should not even run. Two motion programs cannot run at the same time in the same coordinate system, even if one is a rotary program. Perhaps the first thing is to correct for that. Also, you could email the project to support AT deltatau DOT com, and then we can look for the issue(s).

Why are you using a rotary program? There are only two standard reasons: one is if a host is computing trajectories on the fly, and two is if the program is too large for a normal motion program buffer.
Reply
#21
Thank you for your reply, Gregs.

The following part is defined in 0-coordinate_system.pmh
&1
Coord[1].FeedTime = 1000 //sec
Coord[1].SegMoveTime = 0
Coord[1].AltFeedRate = 300 //mu/s
Coord[1].MaxFeedRate = 300 //mu/s
Coord[1].Ta=1
Coord[1].Td=0
Coord[1].Ts=5
Coord[1].Tm=-5
Coord[1].NoBlend=0

#1->1865x
#2->1865xx
#3->1865y
#4->1865yy
#5->1865z
#6->1865zz
#7->680.9714v
#8->324.8089u
#9->680.9714vv
#10->324.8089uu

Motion program 1:

open prog 1
frax(X,Y,Z)
F20
cmd "&1a"
cmd "&1 delete rotary"
cmd "&1 define rotary 600000"
cmd "&1 open rotary abs linear close"
cmd "&1b0r"
while (RunProg == 1) //RunProg - global variable
{
cmd "&1 open rotary X-207Y308Z573V186U-249 X-207Y309Z573V186U-249 X-208Y311Z573V186U-249 X-208Y312Z573V185U-249 X-209Y314Z573V185U-249 X-209Y315Z573V185U-249 X-210Y317Z572V184U-249 X-211Y318Z572V184U-249 X-211Y320Z572V184U-249 X-212Y322Z572V183U-249 X-212Y323Z572V183U-249 X-213Y325Z572V183U-249 X-214Y326Z572V182U-249 X-214Y328Z572V182U-249 X-215Y329Z572V182U-249 X-215Y331Z571V181U-249 close"

Sendallcmds

cmd "&1 open rotary X-215Y330Z570V180U-249 X-214Y329Z571V181U-249 X-213Y327Z571V181U-249 X-213Y326Z571V181U-249 X-212Y324Z571V182U-249 X-212Y323Z571V182U-249 X-211Y321Z571V182U-249 X-210Y320Z571V183U-249 X-210Y318Z571V183U-249 X-209Y316Z571V183U-249 X-209Y315Z571V184U-249 X-208Y313Z571V184U-249 X-207Y312Z572V184U-249 X-207Y310Z572V185U-249 X-206Y309Z572V185U-249 X-206Y307Z572V185U-249 close"

Sendallcmds
}
close

So, there is only one motion program. This is a small example that was implemented as a motion program and didn't work in the past.
In a real application trajectory will be computed on the fly, that's why I need a rotary buffer.
If you see something wrong, please, tell me.
Reply
#22
The motion program processes the text to the rotary buffer too slow to keep the buffer executing continuously. What is your intention with the above code?
Reply
#23
Guys,

could you give me a small example of rotary buffer? How to do it in right way.
Reply
#24
You can simply start an Ethernet SSH connection (with a program like ‘putty’) log on to the Power PMAC start a GPASCII instance and send the following code:
&1
a
Coord[1].FeedTime = 1000 //sec
Coord[1].SegMoveTime = 0
Coord[1].AltFeedRate = 300 //mu/s
Coord[1].MaxFeedRate = 300 //mu/s
Coord[1].Ta=1
Coord[1].Td=0
Coord[1].Ts=5
Coord[1].Tm=-5
Coord[1].NoBlend=0
#1->1865x
#3->1865y
#5->1865z
#7->680.9714v
#8->324.8089u
enable
delete rotary
define rotary 600000
open rotary abs linear close
b0r
open rotary
X-207Y308Z573V186U-249
X-207Y309Z573V186U-249
X-208Y311Z573V186U-249
X-208Y312Z573V185U-249
X-209Y314Z573V185U-249
X-209Y315Z573V185U-249
X-210Y317Z572V184U-249
X-211Y318Z572V184U-249
X-211Y320Z572V184U-249
X-212Y322Z572V183U-249
X-212Y323Z572V183U-249
X-213Y325Z572V183U-249
X-214Y326Z572V182U-249
X-214Y328Z572V182U-249
X-215Y329Z572V182U-249
X-215Y331Z571V181U-249
Close

The connection should be fast enough to keep the rotary buffer alive until the end.
Reply
#25
The general idea for implementing rotary buffer is using two separate GPASCII instances.
First instance is in charge of setup and querying variables, while the second instance is only in charge of feeding data into the rotary buffer.

Here are the steps each GPASCII instance should take:


Attached Files Image(s)
   
Reply
#26
Thank you, Steve!
I will check it and let you know a result.
Reply
#27
Hi Steve,

I have implemented the rotary buffer according to what you had described but the result was same.
I have seen all my points in the buffer (using list Rotary command) before I sent the command &1b0r. So, if all points were
in the buffer, then I think the problem is in ta, ts, td parameters. Or maybe I should go for lookahead feature?
Reply
#28
Additional questions:
in my system I have 12 axes. I define all my axes in CS1 when my application is started.
While the application is running CS1 definition is not changed.Is it OK? Or I should define axes in CS
before each simple movement (or complex trajectory movement)?
Reply
#29
Here is a video where you can see my problem: https://drive.google.com/file/d/0B6Q9gPk...sp=sharing.
On second video you can see what I want to have when it moves from point to point: https://drive.google.com/file/d/0B6Q9gPk...sp=sharing
Reply
#30
Send me some plots of the motion in position/velocity vs time.
Reply
#31
(07-20-2015, 08:42 AM)steve.milici Wrote: Send me some plots of the motion in position/velocity vs time.

Attached are plots of XX,ZZ,VV.


Attached Files Image(s)
           
Reply
#32
And here are my points:

XX4240YY-3065ZZ256UU-175VV-90
XX4240YY-3065ZZ256UU-175VV-90
XX4240YY-3065ZZ257UU-175VV-89
XX4239YY-3065ZZ258UU-175VV-88
XX4239YY-3065ZZ259UU-175VV-87
XX4238YY-3065ZZ260UU-175VV-86
XX4238YY-3065ZZ261UU-175VV-85
XX4237YY-3065ZZ261UU-175VV-84
XX4237YY-3065ZZ262UU-175VV-83
XX4236YY-3065ZZ263UU-175VV-82
XX4236YY-3065ZZ264UU-175VV-81
XX4235YY-3065ZZ265UU-175VV-80
XX4235YY-3065ZZ266UU-175VV-79
XX4234YY-3065ZZ266UU-175VV-78
XX4234YY-3065ZZ267UU-175VV-77
XX4233YY-3065ZZ268UU-175VV-76

XX4233YY-3065ZZ268UU-175VV-76
XX4233YY-3065ZZ267UU-175VV-77
XX4234YY-3065ZZ266UU-175VV-78
XX4234YY-3065ZZ265UU-175VV-79
XX4235YY-3065ZZ264UU-175VV-80
XX4235YY-3065ZZ263UU-175VV-81
XX4236YY-3065ZZ263UU-175VV-82
XX4236YY-3065ZZ262UU-175VV-83
XX4237YY-3065ZZ261UU-175VV-84
XX4237YY-3065ZZ260UU-175VV-84
XX4238YY-3065ZZ259UU-175VV-85
XX4238YY-3065ZZ258UU-175VV-86
XX4238YY-3065ZZ258UU-175VV-87
XX4239YY-3065ZZ257UU-175VV-88
XX4239YY-3065ZZ256UU-175VV-89
XX4240YY-3065ZZ255UU-175VV-90
Reply
#33
for these points what is the CS definition?
Reply
#34
&1
Coord[1].FeedTime = 1000 //sec
Coord[1].SegMoveTime = 0
Coord[1].AltFeedRate = 300 //mu/s
Coord[1].MaxFeedRate = 300 //mu/s
Coord[1].Ta=10
Coord[1].Td=0
Coord[1].Ts=50
Coord[1].Tm=-200
Coord[1].NoBlend=0


#1->533.3432x
#2->0 //position follower
#3->533.3432xx
#4->0 //position follower
#5->799.9702y
#6->799.9702yy
#7->2719.5545z //Ua
#8->2719.5545zz //Ub
#9->2777.957u // Ba
#10->2777.957uu // Bb
//#11->0//a
//#12->0//aa
//#13->0//b
//#14->0//bb
#15->1927.0626v
#16->1927.0626vv
Reply
#35
Thank you, Brad!

The " key" was in your last sentence. I have lost my decimal points somehow.
Now it looks very smoothly.

Regards,

Konstantin.

;Subject: RE: Rotary buffer execution

In the case that this is ABS programming I do not see any problem. This is the proper velocity profile for the XX axis. I have #1 as XX



You see that it must move and stop since you have programmed the same absolute positions one after the other. If we look at the profile you programmed below, but just the XX data to make it easier to see you have.

XX4240 // move to new position
XX4240 // wait at position
XX4240 // wait at position
XX4239 // move to new position
XX4239 // wait at position
XX4238 // wait at position
XX4238 // move to new position
XX4237 // move to new position
XX4237 // wait at position
XX4236 // move to new position
XX4236 // wait at position

And if you look at the velocity profile that is exactly what is happening.

It looks like you want a smooth sweep from XX4240 to XX4233 then back to XX4240. So either you need more decimal points as the duplicate numbers were not suppose to be duplicates or you need to rethink the profile.



Best Regards,
Brad Pedersen
Reply
#36
The problem was in decimal points of positions.
Reply
#37
Hi,

what is a common way to set Coord[x].Ta, Coord[x].Td, Coord[x].Ts parameters?
I mean, how to calculate it? I have a speed and a distance in my case.
It used to be all 0 while using rotary buffer in my application, but we started to face a problem and I played a little with those parameters - it helped. So, I want to know how some basic principles of setting it. Please, advise.
Reply
#38
(07-23-2017, 05:28 AM)kandauru Wrote: Hi,

what is a common way to set Coord[x].Ta, Coord[x].Td, Coord[x].Ts parameters?
I mean, how to calculate it? I have a speed and a distance in my case.
It used to be all 0 while using rotary buffer in my application, but we started to face a problem and I played a little with those parameters - it helped. So, I want to know how some basic principles of setting it. Please, advise.

Here I assume you just need some basic guidelines on how to calc the accel parameters. If you have Velocity and Distance all that is needed is Time.
Longer Time = lower Accel, Short time = high accel rate.
So you adjust Velocity, Distance and Time to get the move with a given accel rate.
Once you know desired rate, often some near max accel rate for your mechanical system then you can calculate the parameters TA,D,S for the move(s).

Basic Accel Calc could be one of these:
#1 Accel = Velocity/Time
#2 Accel = 2Distance/Time*Time

Example: move 50,000 cnts in .5 sec to a velocity of 200,000 cnts/sec
#1 Accel = 200,000 / .5 = 400,000 cnts/sec-sec
#2 Accel = (2*50,000) / (.5*.5) = 400,000 cnts/sec-sec

So to go from 0 to 200,000 cnts/sec in 50,000 cnts distance in .5 sec will result in an accel rate of 400,000 cnts/sec-sec.

To get this you would set your TA = 500 (msec)
TD is same just decel rate at end of move.
TS is S-curve, if you want 100% s-curve then set TA=0 and TS=250 (1/2 time)
note with S-curve the accel rate in middle will be 2x your calc accel rate

You can see now by simply adjusting any of the move parameters the accel rate of TA,TD,TS are affected.

See the attached doc for a overview of all these motion calcs and a older turbo motion program example. Hope this helps...


Attached Files
.pdf   Formulas used in calculations.pdf (Size: 256.64 KB / Downloads: 36)
Reply
#39
Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)