el5151 reseting counts

More
16 May 2025 22:30 #328598 by Philip Lydin
el5151 reseting counts was created by Philip Lydin
Im hooking up a spindle encoder on my lathe to a el5151. The abz inputs goes to the el5151 but in halshow i see how it every turn resets the encoder counts and position. Im guessing this would create problems when using sync motion? It also doesnt have a velocity pin so is it okay to use the software encoder counter to get the velocity. When i do this i get a very noisy signal where it goes to 20 the 500 then 1000 then 200 etc. Just all over the place. Is it bad too use a lowpass filter to smooth it?

Please Log in or Create an account to join the conversation.

More
16 May 2025 23:16 #328599 by Philip Lydin
Replied by Philip Lydin on topic el5151 reseting counts
 
Attachments:

Please Log in or Create an account to join the conversation.

More
17 May 2025 11:14 #328619 by Hakan
Replied by Hakan on topic el5151 reseting counts
Yes that would be a problem. Linuxcnc asks the encoder to reset the counter to zero and count continuously up/down from there. I don't know any details of this encoder so I guess it is reading the manual to find how that can be done. Luckily Beckhoff has ok manuals.
For velocity you can try the ddt hal function, generate velocity as the derivative of the position. Taking the encoder pin values is limited by the servo loop time and EtherCAT cycle time, anything faster than some hundred Hz will fail.
The following user(s) said Thank You: CORBETT

Please Log in or Create an account to join the conversation.

More
17 May 2025 17:57 #328643 by PCW
Replied by PCW on topic el5151 reseting counts
Yes, it seems like some encoder option is not set correctly.
Clearing the count on every index really makes no sense for
general encoder use.
The following user(s) said Thank You: CORBETT

Please Log in or Create an account to join the conversation.

More
17 May 2025 22:54 - 17 May 2025 23:12 #328660 by CORBETT
Replied by CORBETT on topic el5151 reseting counts
@ Philip Lydin

You may have already done this, but you need to setup the EL5151 itself.  If you bought the terminal used, then I would do a factory reset to clear whatever someone did before you and then set it up.  Like Dominik Braun (DB1981) said years ago, you never know what someone has done before you.

If you don’t have Twincat, then you can do it from the command line (CoE).  Make sure to put the correct terminal number for the -p.  I have -p1 below as that would put it right behind the EK1100.  After the command, wait a few seconds, then power cycle the Beckhoff hardware.  (there are 2 hyphens before type)

sudo ethercat download -p1 0x1011 0x01 0x64616F6C --type uint32

The above will put it in quadrature.  If you want “counter mode”, then do the following command.  Don’t forget to wait and power cycle again after the new command.

sudo ethercat download -p1 0x8000 0x03 --type bool 1

If it’s already in counter mode with C reset, then you should be able to find out before doing the above commands with
sudo ethercat upload -p1 0x8000 0x01 - -type bool
If it’s in counter mode with C reset, then you should get something like  
0x01 1

Just don’t forget to put the correct terminal location for the -p as you don’t want to “brick” one of your other terminals.  Twincat is totally safe to do anything with the terminals, but you can permanently brick one doing CoE.  Even though Twincat is free, I still do CoE most of the time.


Like Hakan stated, Beckhoff’s manuals have everything, just a matter of finding the answer.


Hope it helps,
Robert
Last edit: 17 May 2025 23:12 by CORBETT.
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

Time to create page: 0.100 seconds
Powered by Kunena Forum