Host Engineering Forum

General Category => General Discussion => Topic started by: scottsutton on August 12, 2019, 12:47:34 PM

Title: AXFOLLOW instruction with offset
Post by: scottsutton on August 12, 2019, 12:47:34 PM
I am using the AXFOLLOW instruction to sync a servo puncher to a product coming down a conveyor belt. The conveyor belt has an encoder on it and is configured as the Master Axis. The product has a target position where the punch occurs and 90% of the time the target is very accurate. However, once in a while the part gets molded slightly off causing the punch location to have to move on the part. The puncher servo is in continuous motion once it starts to punch a new part and it uses the Gear Ratio Multiplier to space the punches correctly.

I can sense when punch target moves slightly and I would like to send an offset location into the slave axis while its in motion to correct the punch location. Is that what the offset function does in the AXFOLLOW command? If so, does it offset the Master Register location so the slave updates?

Please explain.

Thank you,
Scott Sutton
Title: Re: AXFOLLOW instruction with offset
Post by: Greg on August 12, 2019, 01:47:16 PM
This is indeed what the Offset Position is for. You set the Offset Position and then turn the Goto Offset Signal on. The thing you must remember is, if you are using the AXFOLLOW instruction, it is a requirement that your following axis be faster than your Master Register. In other words, that axis must have a faster Maximum Velocity and Accel/Decel rates. Otherwise, it cannot go to the offset you tell it to go to.

To answer your question, no it does not offset the Master Register location at all; that remains exactly what it is. It merely offsets its own CurrentPosition.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 12, 2019, 03:05:41 PM
Greg,
Thank you!

A couple of more details if you will.

1. Do I apply the offset once and with the goto offset bit? Or, do I hold the bit on while the offset is in place and removing the bit returns to the Slave to the non-offset position?

2. Can I use a D register for the offset value and can I use a negative or position offset value?

Thanks again, this will lower our current scrap rate by a significant margin!

Scott


Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 12, 2019, 05:00:40 PM
Greg,
Thank you!

A couple of more details if you will.

1. Do I apply the offset once and with the goto offset bit? Or, do I hold the bit on while the offset is in place and removing the bit returns to the Slave to the non-offset position?

2. Can I use a D register for the offset value and can I use a negative or position offset value?

Thanks again, this will lower our current scrap rate by a significant margin!

Scott

Set the relative offset and velocity, then set the Goto Offset bit. When the axis is at the new offset, the instruction will clear the bit.

Offset value can be negative or positive.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 10:31:07 AM
Is there an example program using the AXFOLLOW with an offset available to look at? I am not getting the expected results when I use this feature. The slave axis bogs down with either a positive or negative offset. Even as small as 1 step of offset. I am setting the goto bit and letting the AXFOLLOW reset it as instructed. Also, my excel/decel and maximum velocity on the slave are more than adequate to gain-lose steps to meet the offset target.

Thanks,
Scott
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 10:35:59 AM
Is there an example program using the AXFOLLOW with an offset available to look at? I am not getting the expected results when I use this feature. The slave axis bogs down with either a positive or negative offset. Even as small as 1 step of offset. I am setting the goto bit and letting the AXFOLLOW reset it as instructed. Also, my excel/decel and maximum velocity on the slave are more than adequate to gain-lose steps to meet the offset target.

Thanks,
Scott

Please define "bogs down".

What is the accel/decel/max velocity settings of the master?

What is the accel/devel/max velocity settings of the slave?

What is your offset velocity set to?

What velocity is the master running at?

Is the master velocity changing at the time you adjust the slave?

Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 10:45:35 AM
...and what is the scale factor between the master and slave?
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 10:52:06 AM
Bogs down: The slave slows way down no matter what the offset is set to

What is the accel/decel/max velocity settings of the master?
The Master is an encoder input on X0 ($BeltPulsesPerf) configured as an up counter
It operates at 1600 pulses per second at max speed

What is the accel/devel/max velocity settings of the slave?
Max Velocity = 250000
Accel = 900000000
Decel = 900000000

What is your offset velocity set to?
0

Is the master velocity changing at the time you adjust the slave?
no





Gear Ratio
-8.4
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 10:57:56 AM
-8.4

Is this the gear ratio, and did you see my previous post?

Not sure how I feel about a negative gear ratio or whether it was even tested and should be allowed.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 11:04:22 AM
Yes, Ratio. No, did not see at first. See Reply above
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 11:06:26 AM
The Negative Ratio is to reverse the direction of the slave. I could modify the servo config and set for positive if this is the issue.

Thanks
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 11:15:57 AM
The Negative Ratio is to reverse the direction of the slave. I could modify the servo config and set for positive if this is the issue.

Thanks

I'm not sure if the negative is a problem or not.

The offset velocity must be set to a non-zero value. That defines the max relative velocity between the master and slave. I'm following a car down the road...it's the master, I'm the slave. If I want to pass, I have to go faster than him. The offset velocity is how much faster than the master that the slave is allowed to go to get to the new offset.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 11:26:42 AM
Quote
The offset velocity must be set to a non-zero value

Direct from the help file on the AXFOLLOW instruction:

Relative Offset Velocity is the additional velocity the Follower Axis will use when moving to the Relative Offset Position. This value specifies how much faster ( in pulses / second) the Follower Axis can move than the Master Axis when attempting to move to the Relative Offset Position. A value of 0 will cause the Follower Axis to move at the Axis's maximum Velocity to get to the specified offset position. This value can be any constant between 0 and 250,000 or any numeric location containing a value in that range.

 
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 11:33:17 AM
Quote
The offset velocity must be set to a non-zero value

Direct from the help file on the AXFOLLOW instruction:

Relative Offset Velocity is the additional velocity the Follower Axis will use when moving to the Relative Offset Position. This value specifies how much faster ( in pulses / second) the Follower Axis can move than the Master Axis when attempting to move to the Relative Offset Position. A value of 0 will cause the Follower Axis to move at the Axis's maximum Velocity to get to the specified offset position. This value can be any constant between 0 and 250,000 or any numeric location containing a value in that range.

My bad. I've slept since that work was done.

The issue may be due to the negative ratio. I'll have one of the guys here check that out. I do not remember explicitly testing that so it may well be breaking some math.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 13, 2019, 11:37:27 AM
Ok Thanks,
Once working correctly this will help us tremendously!
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 13, 2019, 12:04:55 PM
Ok Thanks,
Once working correctly this will help us tremendously!

We've done a bit of testing and the negative ratio is working fine for us. I really didn't know any specific reason it would fail, but some of the following math is tricky and I don't personally remember testing it, although others probably did.

I glossed over the fact that your master was a counter input rather than another axis. That's another wrinkle, especially at lower speeds. Did you specify a filter on the master?

Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 14, 2019, 06:11:30 AM
Maybe this:

If I could write an offset to the Master Counter this would accomplish the same thing:

$BeltPulsesPerf.Acc = $BeltPulsesPerf.Acc -100
$BeltPulsesPerf.Acc = $BeltPulsesPerf.Acc +100

I tried and could not gain access to the register for manipulation.



Title: Re: AXFOLLOW instruction with offset
Post by: Greg on August 14, 2019, 10:20:12 AM
You can already do that.

You can write whatever value you want the $BeltPulsesPerf.Acc to be into $BeltPulsesPerf.ResetValue, and then use the $BeltPulsesPerf.ResetEdge bit to set it to whatever you want whenever you want (e.g. on the fly). I'm not sure why you want to do this as I believe you can solve your following and offset issues without doing this, but, I just thought I'd mention this.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 14, 2019, 02:22:55 PM
Actually, this would be the register that I would want to access on the fly and modify. This is the Reg that the slave is following, not the Acc. Is this possible?


$BeltPulsesPerf.CurrentPosition = $BeltPulsesPerf.CurrentPosition - X
$BeltPulsesPerf.CurrentPosition = $BeltPulsesPerf.CurrentPosition +X
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 14, 2019, 02:31:43 PM
Actually, this would be the register that I would want to access on the fly and modify. This is the Reg that the slave is following, not the Acc. Is this possible?


$BeltPulsesPerf.CurrentPosition = $BeltPulsesPerf.CurrentPosition - X
$BeltPulsesPerf.CurrentPosition = $BeltPulsesPerf.CurrentPosition +X

Then you just need to use AXFOLLOW. It's working fine for us. Are you sure there isn't something else going on with yours?
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 14, 2019, 04:16:16 PM
So you have verified on your end that the Master can be a counter instead of an axis?

The docs say this can be.

Scott
Title: Re: AXFOLLOW instruction with offset
Post by: Greg on August 14, 2019, 04:25:06 PM
So you have verified on your end that the Master can be a counter instead of an axis?

The docs say this can be.

Scott

Yes.
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 14, 2019, 04:26:40 PM
So you have verified on your end that the Master can be a counter instead of an axis?

The docs say this can be.

Scott

Absolutely. The only question I had was whether the gear ratio could be negative, and it can. We tested settings close to yours with no issues.
Title: Re: AXFOLLOW instruction with offset
Post by: scottsutton on August 20, 2019, 06:40:13 AM
Just now getting back to this after several days of successful implementation of the AXFOLLOW instruction. Two things that I discovered and I wanted to share.

First, setting a value of zero in the RELATIVE OFFSET VELOCITY causes the offset not to work at all in my setup. Maybe BC I am using a negative gear ratio? Per the Help File, setting it to zero will cause the Follower axis to move at it's maximum velocity to achieve the offset position.

So, instead of setting it to zero I set it at the slave axis maximum velocity (23500 in my case) too see if a setting of zero did in fact set the velocity to the maximum rate. After that the axis would react wildly. It would overshoot and then stall and have very erratic motion. It did not dawn on me that the correction velocity is the RELATIVE velocity even though it states it plainly.

Once I realized what I had done wrong and I set the offset velocity to 1500 the system stabilized and is working exactly like I desire. Our scrap rate went down dramatically!

I am a huge fan of the BRX line of PLCs! Being able to do relatively complex motion control  within the PLC environment is a giant plus in my book. Thanks for all the new development in this line of PLCs!

Scott
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 20, 2019, 08:05:42 AM
Glad it's working! Not sure why the zero offset velocity is bad, but like you said, it could be due to the negative ratio. We'll confirm that and see it anything needs fixing.
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 20, 2019, 10:11:24 AM
Did a bit more testing and everything appears to be working as expected. I'm inclined to believe that the faster maximum velocity you are getting with zero is causing you issues somehow. By limiting to 1500, you are avoiding that.
Title: Re: AXFOLLOW instruction with offset
Post by: Controls Guy on August 20, 2019, 11:22:45 AM
But I thought that number was a delta from the master max velocity to the offset move velocity?  Wouldn't the 1500 be faster?
Title: Re: AXFOLLOW instruction with offset
Post by: BobO on August 20, 2019, 11:27:28 AM
But I thought that number was a delta from the master max velocity to the offset move velocity?  Wouldn't the 1500 be faster?

Zero means move as fast as the slave axis will allow, SlaveMaxVel - MasterVel. 1500 means MasterVel + 1500.
Title: Re: AXFOLLOW instruction with offset
Post by: Controls Guy on August 20, 2019, 02:25:33 PM
Ah OK, it's a delta from the master current velocity, not the master max velocity, I hadn't caught that (and also the fact that there's a special interpretation for 0 value independent of master axis velocity)