In this video we’ll use the simple move
command to move this carriage from one end of the slide to the other and back again using
button presses. We’ll also take a look at how position limits and sensor limits work
and what the difference is between absolute and relative positioning. We’ll cover S-Curves
using Jerk and Registration in separate videos. In this demo we have a Productivity 2000 with
an HSO module. The HSO module sends pulses to a Stepper drive which controls a stepper
motor to move the carriage up and down this slide.
We have two Pushbuttons wired to the HSO inputs and we’ll use those to control the action
of the slide. We also have two Proximity sensors wired to two more HSO inputs which we will
use for hard position limits. I’ve already selected the CPU, gone into
the hardware configuration and auto discovered the hardware and configured it. Here is how
everything is setup for this demo. Check out the HSO configuration video if you need a
refresher on how to configure all of this. Well, since we’ve already setup the hardware,
all we have to do now is write the ladder code.
We’ll use the forward button that was defined in the hardware configuration that I did before
we started this video to enable a Simple Move command.
We want to use the channel that was also defined in the hardware configuration.
Let’s use absolute addressing and rather than filling all of these blanks, I’m simply
going to say I want to use a structure and call that structure Forward.
We’ll cover Jerk in a separate video so we can spend some time understanding exactly
what this is and how to use it. We want the carriage to stop immediately if there is an
error or we terminate the move early … and we’ll cover registration in a separate video
on the Registration command. We’ll fill the values for position, velocity,
acceleration, etc. in the Dataview. Could we put static values in here if we wanted
to? Sure, but we would have to turn off the structure mode to do that and we would be
stuck with those values and we wouldn’t be able to change them in the program.
We can add a comments to the rung, which I would normally do – I like lots of comments
– but since we are so limited on screen real-estate in these videos we’ll skip that so we can
get more ladder code on the screen. I’m going to exit the Simple Move command
just so I can modify the tags we just created. We will want our position, velocity and acceleration
tags to be floats so we can use fractional numbers. Now that the tags are all defined
the way we want them, we go back into the Simple Mov command so we can add all of these
tags to a Dataview. This saves me so much time – I don’t have to create my own dataview
– the productivity suite does it for me. For the reverse direction it’s the exact
same thing except we want to control that direction with the Reverse button we defined
back in the HSO configuration and create a new structure that we’ll call Reverse. Don’t
forget to modify the tags so we can use fractional numbers. And let’s go back and add these
tags to the same dataview as the forward direction so we can watch the forward and reverse processes
at the same time. We also want to be able to force the HSO modules
channel position to zero. Since the module keeps track of position from the time it is
turned on, the only way to reset the position independently is with the Set Position Command.
You can also set the position as part of the HOME command. We just tell it to set the position
to zero when this instruction is enabled. And we’ll enable it with a contact we’ll
control from the dataview since I don’t have anymore buttons connected.
Great. Let’s download this to the processor and give it a try.
I’m going to reach over and flip the switch to put the CPU in run mode and then bring
up the dataview. I’ve already deleted the stuff we don’t need and re-arranged things
a little so don’t be surprised if mine looks different than yours …
I’m also going to add the positive and negative direction limit tags which we defined in the
hardware configuration so we can modify those. We have a 24 inch slide, so let’s make our
positive direction limit 23 inches and the negative direction limit 1 inch.
We’ll move to 20 inches in the positive direction at the max rate of 15 inches per
second and we’ll accelerate and accelerate and decelerate at twice that rate.
For the reverse direction, well target 2 inches as our destination and use the same velocity
and acceleration as the positive direction. Let’s also add the Carriage Zero contact
and the real time position and velocity tags to our dataview.
We’ll do Homing in a separate video, so for this demo we’ll stop the CPU and just
manually move the carriage to zero using the HS Module Testing tool. Now we put the processor
back in Run mode and toggle this contact to set that carriage position to zero. There
is a whole video on how to use that test tool if you want to learn more about that.
Putting the processor in Stop Mode cleared all of our tags, so let’s write those back
to the processor. If I press the FWD button, the carriage ramps
up to velocity, moves down the slide, decelerates and lands right at the 20 inch mark we specified.
If we hold down the reverse button, same thing. Ramps up to speed, heads down the slide, ramps
down and stops at the 2 inches we specified. What happens if I push the Forward button
but let go before it finishes? Well look – the motion stops immediately. Why? Because we
told it to. You can see that over here. If we had checked this button, then it would
have decelerated to a stop at the max rate specified in the hardware setup.
I don’t like holding the button down, so let’s seal the contact with the in progress
bit. Now the button will start the command, but the in progress bit will keep it running.
We call that sealing a contact. Let’s do the same thing for the reverse
direction. Send that to the controller. Let’s turn
on monitoring so we can see the status of the contacts. Notice that we don’t need
to update the tags because we did a run time transfer.
And sure enough, if I temporarily push the button that contact turns on then back off,
and the in progress bit keeps the command running to completeion. Perfect.
What happens if we tell the carriage to go aoutside of the range limits we set? Our slide
is 24 inches long, and we had specified a position limit of 23 inches. So let’s move
that position limit out to 30 inches – way beyond the end of the slide. And let’s specify
a target distance of 29 inches. Again, way beyond the end of the slide. When we hit the
forward button, the carriage stops abruptly before hitting the end of the slide – why?
Because I added some Proximity sensors to the slide to act as hard limits to detect
end of travel using this adjustable sliding tab. We defined those INPUTS here in the hardware
configuration and then enabled them here for this channel. These are true physical limit
switches read directly by the high speed modules inputs. These limits down here are programmable
limits which are best for those times when you need to programmatically setup temporary
limits. And as we saw before, the carriage stopped immediately because the move instruction
told it to. We could have also told it to ramp down at the maximum acceleration rate
if we wanted to. While we are here, let’s enable Relative
Move in the forward direction only, send that down to the controller and see what that does.
Let’s modify the forward target distance to 5 inches. And while we’re at it we’ll
get the position limit back in bounds from the change we made in the last example. The
reverse direction is still absolute, so let’s send the carriage back to the absolute 2 inch
mark. Now when I push the forward button the carriage moves 5 inches away. If I push the
button again it moves another 5 inches. Push it again it moves another 5 inches. So in
relative mode, we are not going to the absolute 5 inch mark on the slide, we are moving 5
inches away from where we are. It’s a relative 5 inches.
That’s all for this video. We’ll cover S-Curves using Jerk and Registration in separate
videos. Also be sure to check out this video on how to use these status words to debug
your motion application, it will save you a lot of time.
If you need any help please contact AutomationDirect’s free award winning support team during regular
business hours. They will be happy to help. And don’t forget the forums. There are lots
of folks there that love to share their years of experience. Just don’t post any questions
for AutomationDirect’s support team there; they don’t monitor the forums on a regular
In this video we’ll pick up where the Simple Move video left off and take a look at how
we can use Jerk to smooth out our and save wear and tear on our machines. We’re using
the exact same setup as that video so check that out if you need to see how we set this
up. What is Jerk? Well … given the absolute
position, velocity is how fast the position is changing over time. And acceleration is
how fast velocity is changing over time. Jerk controls how fast acceleration changes over
time. So instead of immediately accelerating at a constant rate, jerk smooths out the acceleration.
The smaller the jerk value is the more smoothing you get.
Let’s put a small value in for Jerk to give us the maximum effect.
And let’s plot the carriage position and velocity on a graph in the data view. Looks
Like the carriage position is currently at 20 and the velocity is zero. Let’s put a
glass of water on the carriage so we can see the effect jerk has. Run the carriage in the
reverse direction with no jerk. You can see the water jiggle at the abrupt start and stop
of the motion. Wait for the water to settle down. Now run the forward direction which
does have jerk. You can see the water doesn’t move at all. And on the graph you can see
why: In this direction we have no Jerk and sure enough the position changes linearly
and the velocity changes linearly and the position changes abruptly. In this direction
we DO have Jerk and you can see how it smooths out the positioning so the carriage doesn’t
start abruptly or hit its final position abruptly. The way it does that is by changing the velocity
from a simple line to a nice smooth curve. Because we used a small value for Jerk we
got maximum smoothing, but it took so long to ramp up the velocity never got up to the
15 inches per second before it had to start ramping down so it took a long time for the
carriage to get to it’s destination. So let’s try a larger value for Jerk – how
about 50? Now when we run the carriage in the reverse direction where we have NO jerk–
same abrupt result. Wait for the water to settle. Now run it in the forward direction
with Jerk set to 50. The velocity did reach the 15 inches per second but the water still
didn’t jiggle did it? The key take away is, Using jerk is a great
way to ease wear and tear on your machine because you can use it to minimize or even
eliminate abrupt changes in position. There is no science to this, it just takes some
experimenting to find the right value for your application. The good news it’s real
easy to do with the Productivity Series controllers. Jerk (physics) In physics, jerk, also known
as jolt, surge, or lurch, is the rate of change of acceleration; that is, the derivative of
acceleration with respect to time, and as such the second derivative of velocity, or
the third derivative of position. Evalutaing the destructive nature of a system