Dynamic Position is very similar to the Absolute positioning of the Trapezoid instruction we
looked at in a previous video.
You tell the carriage what position to go to and it does.
The main difference is this instruction gets triggered a little differently and you can
change your mind mid instruction.
That is, you can tell it to go to position A, and while it is enroute to that position,
you can change the destination to position B and it will abort A and immediately head
towards B.
Dynamic Position even works if you have already passed the destination: For example, If we
specify a new destination that the carriage has already passed, back here for example,
Dynamic Position will ramp down.
Reverse direction and head back and try and find that new destination via the configuration
profile.
Exactly what you would expect it to do.
Let’s do an example.
We’re going to use the same config block that we used in all of the previous videos
– see those for an explanation on that.
On the next rung I have the Dynamic Position Block.
I’ve already put it in here to save us some time, so let’s go take a look at it.
All we do is select the module we want to talk to - of course we only have one in this
system.
Do we want to zero out the position when we first call this routine?
We do for this example.
And we give it the register we want to use for the target position.
These little reminders are telling us that once this instruction is enabled, you have
to set the dot gotoposition bit to start the move.
We’ll see that in just a second.
This instruction will clear that bit when the move begins and once it does, you can
go set it again to change the destination.
We’ll enable that instruction with X7, and we’ll suspend it with X6.
So just like those notes in the instruction said … once we enable this instruction,
nothing happens.
You actually have to set this gotoposition bit on our device to get things to move.
We’ll use the rising edge of X0 to do that in our example.
To help us with this, I’ve added a few more instructions here.
Any time X1 gets set, we are going to change our destination register to 0.
X2 will change it to 100,000.
X3 will change it to 200,000.
And X4 will change it to 400,000.
That way I can very quickly change directions while this thing is running.
So let’s accept all of these changes.
Save it to the disk and write it to the PLC.
So, let’s see .. D0 is currently set at 200,00.
Let me change that.
I’ll flip X4 and D0 got changed to 400,000.
Perfect.
So when we run this example, what’s going to happen is the position will get cleared
out via our config, so the carriage will be starting from position 0.
I’ve already setup the destination register with 400,000.
And I’ve enabled the instruction.
To get things moving, all I have to do is flip X0.
Before we do that, let’s come up with a plan here.
We’re going to head towards 400,000.
When the carriage starts moving, I’m going to quickly flip X2 to put 100,000 in our destination
register.
After I’ve done that, I’m going to flip X0 again to kick off that new target.
So what we should see is the carriage heads towards 400,000.
While it is enroute I’ll change the destination, set X0 and we should see the carriage ramp
down and then ramp back up and head back towards 100.
Let’s try it.
Here we go..
I’m going to kick it off with X0.
Change the destination, kick X0 again, watch the carriage change its mind and head back.
I’m going to change the destination to zero.
Kick that off, and try it again.
Change our destination to 400,000.
Kick it off.
Change it.
And back it goes.
So again, with the Dynamic position command you can change the position at any time, even
while the carriage is moving.
The Dynamic Velocity command allows you to ramp to a specified frequency AND it allows
you to change that frequency at any time dynamically.
The good news is you don’t need to toggle a bit with this one though.
All you have to do is change the frequency and it will follow.
We’ll, That’s all there is to implementing motion using the DYNP and DYNV instructions.
Be sure to check out the other videos in this series for more on using motion.
And as always, please send us any comments you may have, we appreciate the feedback.
Spend Less.
Do-more.
From AutomationDirect.