Beckhoff KL5111 incremental encoder program

Join Date
Nov 2011
Location
Ireland
Posts
182
hello

could anyone tell me how to set up the KL5111 module on the Beckhoff plc to display a speed value from an encoder.

I believer the KL5111 will only accept an incremental encoder signal

if someone has some sample program or some explanation on how to do it, it would be a great help.

thanks in advance
 
Ok i see, so it is a HSC module then? i suppose essentially for an incremental encoder you are only measuring pulses

http://www.beckhoff.com/english.asp?bus_terminal/kl5111.htm

is there any sample program that would give you a speed output from the card?. the encoder would give you so many pulses per revolution. how would i program the Beckhoff PLC to give me an RPM value for so many pulses per rev?

thanks
 
Speed = space / time

Then you need the desired units, but at the end you need to:

r_rpmVar := ((r_last_read_pulses-r_previous_read_pulses)*r_pulses_to_revolution_factor)/r_milliseconds_between_reads;
r_previous_read_pulses := r_last_read_pulses;

Notes:
There are plenty of methods to read time and they depend on the kind of controller you have.
One that will work in all the controllers would be to use a TON and reading the ET output field (this would be the r_milliseconds_between_reads in the function).
Probably you won't need to make this calculation in each plc cycle step.
Be aware that the pulses counter can overflow, this would give you a bad calculation.
Also you should think about 0 values (divide by 0).

What I would recommend is to create a function block to deal with all those details.

Hope this helps.
 
hello joan,

do you know of any sample program that would show me how it would work?

i have a program that i am using however i think it is designed for an absolute encoder. i can send it on if you think you could put me right

i am not entirely sure where i connect the pulses into the KL5111 card. in the attached image could anyone tell me where i map the actual signals form the encoder?

thanks

beckhoff kl5111.jpg
 
hello, yes thanks, yes i found this document some time ago and thought i was sorted. however i am still not clear.

i did notice the "feature register" part and this is why i wondered must you activate the KL5111 or something like that. but to be honest i am not even sure where the feature register is?

when i tap a wire into terminal A i get a "1" appearing on the program. if i increase the rate at which i tap the wire off the A terminal i still only get "1". (i am trying to simulate a stream of pulses by doing this).

this indicates to me that the KL5111 is reading the pulses however the program i have dose not totalise the pulses or give a frequency of the pulse rate.

i am just not sure how i would go about getting a program that will read the pulse train from the encoder and give an RPM output.....
 
I am not sure you can make the module count by just "tapping" one of the inputs. This is a quadrature encoder input module, not just a counter; it must have a proper quadrature signal (i.e. two pulse trains with phase offset 90 degrees) detected on both A and B channels in order to count.
 
use %IW25 as i can see on the screen.
so counterinput AT %IW25 :WORD; in the global VAR list or use nEncodercount.inputs.standard.test as on the screen.(easier to get with F2 when asking for a variable.)
check if Control register is set proper.
module can be used in several different ways.
 
can anyone suggest a suitable encoder for the KL5111 module?

ideally i would like an Avago Technologies encoder as the fitting on the back of my motor is of this type. however these are 5V supply. I think i will run into common ground problems with this as my card puts out a 24V supply.

i was thinking more about it and am wondering now if the KL5111 measures frequency, therefore in PLC control would you get some large number like 17000Hz
 

Similar Topics

Hello I am having trouble setting up my encoder program to read and give an RPM value from a pulse train from an encoder. I have today found...
Replies
0
Views
1,565
Hello i am having 3 problems in mapping singals from my program to the physical i/o modules of the PLC. i can mapp digital i/o no problem its...
Replies
8
Views
3,240
Hello dose anyone know how to configure the KL5111 from Beckhoff. see http://www.beckhoff.com/english.asp?bus_terminal/kl5111.htm particularly...
Replies
3
Views
3,073
I'm trying to integrate a Beckhoff IPC with a Controllogix PLC. There is some documentation, on the Beckhoff website, on how to do a PLC-PLC comms...
Replies
0
Views
65
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,047
Back
Top Bottom