http://plc-kita.blogspot.com/ Creating motion with stepper motors | PLC.com

Wednesday, February 17, 2010

Creating motion with stepper motors



Last time we covered stepper motors and how they are used with a plc
to control motion. We simply send pulses out the plc and into the
stepper motor driver. The driver converts those pulses into motion
through the motor. 1 pulse = 1 degree of motion, for example.

Creating motion with stepper motors is arguably the most popular form
of creating motion in a controlled way. The trouble is that there is
no verification that the motion actually occurred. Huh? In other words,
just because we told the motor to turn 5 times doesn't necessarily
mean the motor actually did what we asked it to.

How can that be? If we send out enough pulses through the plc to have
the motor turn 5 times we should expect the motor to do so. Right?
Well, sometimes our expectations aren't always met...

What would happen if there was a jam in the motion system? The motor
tries to move but can't. Not good. That can (probably will...) cause a
problem for our machine.

Let's say we're applying labels to various sized boxes. This morning
we're making product A which has a large box. Our plc program has the
stepper rotate 10 times so we know the box is in the proper position
and the label can be applied.

Things are going great. The boxes are moving down the conveyor and the
labels are being applied as expected. Time for lunch and we change our
products. We now use a product that weighs twice as much as the previous
one but the box size is the same. So we use the same plc program and
we expect things to work out great. Correct?

Not so much... the extra weight of the product is causing stalling of
the stepper motor and eventually labels are being misapplied and
general chaos sets in. A bad day at the office... for sure.

The problem here is that the system is an 'open loop' system. There
are no checks performed to verify that what we wanted done actually
got done. We told the stepper motor to move but we didn't verify that
it had actually done so. We have performed a 'one way' type of
communication.

In many simple applications or those where there are checks via
sensors, for example, a one way type of communication would be fine.
However, in the example above without any checks it's obviously not a
good situation.

In that case we need a 'two way' type of communication system. Instead
of being an 'open loop' system we need to close the loop by generating
some feedback about what events have occurred. But how?

The answer is quite simple. We need to do an action and verify the
action resulted in whatever it was we wanted. If we tell the stepper
motor to turn 5 times we need to verify it did. An easy way to do this
is with our old friend... the encoder. (Remember how they worked from
a few issues back?)

So, let's return to our great 'moving the box' application. We move
light weight boxes down the conveyor by sending out 5 pulses to the
stepper motor. We previously had no idea if the motor actually moved
but we knew we asked it to move.

If we now add an encoder to the system we can easily verify if the
movement of the motor actually happened. The encoder will give back a
pulse to the plc for every x-degrees the motor shaft rotates. So, if
we tell the motor shaft to rotate 5 times, and each revolution is
10 pulses from the encoder, the plc can look for 50 pulses. (i.e.
10pulses x 5rotations = 50)

If the plc 'sees' 50 pulses come from the encoder it knows the shaft
has rotated the proper number of rotations. If it doesn't see that the
rotation has actually happened as expected (i.e. less than 50 pulses
have come back) it can react accordingly. Of course, that reaction will
have to be programmed into the plc program.

Now, we have added feedback to the system and closed the control loop.
We therefore refer to this type of system as a 'closed loop' system.
The control loop is closed because we can do something and then verify
that it was actually done.

A closed loop system can be created in many ways. The key point is that
we need feedback on the action. How we react to the feedback is going
to be dependant upon the system.

Next time we'll see a motor with 'built-in' feedback to make our
closed loop system of motion control 'a pleasure' to use.

Related Post



No comments:

Post a Comment