encoders and plcs

OK THIS SHOULD BE A SIMPLE ONE FOR YOU GUYS. SAY I JUST WANT TO ROTATE A MOTOR 45 DEGREES THEN STOP THEN 45 MORE THEN STOP AND SO ON, USING A ENCODER HOW WOULD I DO THIS.

AS YOU CAN TELL I HAVE NO EXPRENCE WITH ENCODERS AND WHAT TO EXPERIMENT
THANKS
 
An encoder has pulses per revolution...ie 500, 1000, 1024 etc. A revolution (if direct coupled) would be 360 degrees, therefore you want to move it 1/8 of a revolution...lets say the PPR is 1024, then you would move it 128 pulses for 45 degree motor shaft rotation.

THE precise HOW is application specific...ie what type motor (servo, stepper or ?). What controller, many servo and stepper motors have intelligent controllers that dont necessarily need a plc.

If using a plc you can connect the encoder to a HSC (high speed counter) and work from there. I can not offer more details on this because this subject is too application/device(s) specific.

You may want to check out http://www.mrplc.com for downloads, I believe there are a few there that may be informative
 
ready961,

Sorry for my original terse response. I was in a very onry mood yesterday.
SAY I JUST WANT TO ROTATE A MOTOR 45 DEGREES THEN STOP THEN 45 MORE THEN STOP AND SO ON, USING A ENCODER HOW WOULD I DO THIS.
If I was in onry mode again I would just say you can't do it with an encoder. An encoder doesn't move anything!

But, there are several ways to move a shaft, the most common way being with a motor. That said, there are several different kinds of motors which you could use depending on the speed with which you want to move the shaft, the load on the shaft and the precision with which you need to make your move.

Discounting that, you can use the encoder in three modes, feedback or open/verification, rotary switch.

In a feedback system (commonly used with servo motors), whatever is controlling the motor is continously looking at the encoder signal and making corrections to the motor output to follow a motion profile.

In open/verificaiton mode (commonly used with stepper motors) whatever is controlling the motor tells it to follow a certain motion profile. Then, after the motion is finished, it checks the encoder signal to see if the motor is where it is supposed to be; if not, it commands a make-up move and checks again. There is usually some range of closeness +/- 3 or 4 counts where the motor is considered to be "in position" so as not to drive the controller crazy.

In rotary switch mode (perhaps used with DC motors), the electronics look at the encoder for a particular position and then turn the motor off so the encoder performs the same duty as a cam on a shaft. Here you would have to know the dynamics of the stopping system so the switching position could be set before the stopping point the right amount.

IN general The above systems are given in decreasing accuracy and cost.

Now, you're still waiting for me to answer your question.

Every encoder has an associated value called ppr (pulses per revolution). This is usually the number of little windows in the disk everyone is talking about. All encoderer systems are really counter systems that count the pulses coming out which are generated by a light beam passing through those windows. Let's say your encoder has 500 ppr. So when you have counted 500 pulses, your encoder has turned 360 deg. So now to know when you have gone 45 degrees, you have to convert to counts 45*(500/360)=62.5. So with this scheme, you can't get EXACTLY 45 degrees because you can't count half a pulse (you really can but let's not get into that now) but you can get close. When your encoder count is at 62 or 63 you are just about 45 deg. You can know 90 deg. exactly because 62.5*2=125 etc.

Maybe you need more resolution, you could run your encoder through a 1:8 gear system so for every 45 deg. of shaft motion, the encoder turns a full revolution; then you get 45 degrees for every 500 counts.

The bottom line is, you always need to know the relationship between counts and degrees or position or however you system is set up. Some nicer controllers let you plug in that conversion and from then on program in your prefered units of degrees, or inches or meters or whatever. How you use that information depends on the issues I mentinoed above.

Hope this helps.
 
IM BASICALY PLAYING WITH A BUNCH OF LEFT OVER JUNK. IM USING A ALLEN BRADLEY 150 PLC , DC ROTARY MOTOR, AND SAY A 500 PPR ENCODER. WHAT WOULD MY LATTER LOGIC LOOK LIKE? WOULD I JUST USE AN UP-COUNTER?

YOUR INFO SO FAR HAS BEEN GREAT! THANKS
 
You may have some trouble if you're limited to the hardware you listed.

The first potential pitfall could be the voltage level. A lot of encoders work at the 5 volt level. The SLC150 probably wants 24 volt inputs. If the encoder is rated for the same voltage level as the SLC, then you can just wire the encoder signal(s) to one (or two) of the inputs.

That brings up the next pitfall. Many encoders are capable of indicating direction by the use of channels A and B that Ron talked about in his explanation. Your PLC isn't going to have the ability to know which channel is leading unless you write code to do it.

Third problem: You're going to be severely limited in how fast the encoder can turn and still have the PLC detect the pulses from the encoder. The PLC repeats a sequence of operations over and over. It reads the signals from its input modules, then executes the ladder program, then sends the results of program execution to its output modules. That sequence takes some time. In a SLC150, that time might be 20 milliseconds or more. The result of that is that each pulse from the encoder needs to be on (and off) for longer than the scan time in order to be reliably detected. If we use a 20 millisecond scan time, that means that your 500 PPR encoder can't be rotating faster than:

500 Pulses per rev * .04 seconds per pulse = 20 seconds per rev) = 0.05 revs per second = 3 RPM

The .04 seconds per pulse is 20 milliseconds on time, 20 milliseconds off time.

That's why you usually use a High Speed Counter module to get an encoder signal into a PLC. HSCs have their own dedicated signal processor so they can handle higher pulse frequencies.
 

Similar Topics

Hi.We have an S7-300 PLC and also incremantal encoder.How can I connect them each other.Which programming material must I use to convert to analog...
Replies
1
Views
4,905
I was wondering if 5032-8IOLM12DR are suitable for encoders devices. I'm concern about the RPI and loosing encoder counts using this type of...
Replies
1
Views
115
I'm thinking to have a 5032-8IOLM12DR and encoders plug in to them. I'm concern about the RPI and loosing encoder counts using this type of...
Replies
0
Views
87
First time poster here so long story short i built my own trainer at work so i could toy around with various things and test things and learn...
Replies
25
Views
2,156
Good Morning , We have a large machine with a number of shafts , and I would like to monitor those to make sure they are constantly...
Replies
6
Views
2,129
Back
Top Bottom