Encoder Pins linked to LCNC
I have read TOO much and finally asking for help. I do not like wasting people's time, but I need help hooking encoders up to LCNC. I am having problems with linking the correct pins from the ethercat module to LinuxCNC.
File Attachment:File Name: kmb1.hal
File Size:8 KB
File Attachment:File Name: hurcokmb1.ini
File Size:2 KB
File Attachment:File Name: HAL-kmb1.txt
File Size:9 KB
File Attachment:File Name: INI-hurcokmb1.txt
File Size:3 KB
File Attachment:File Name: HAL-PINS-ENCODER.txt
File Size:2 KB
I Have attached INI and HAL files (original and text version) if someone can point me in the correct direction I would appreciate the help. I have also attached a text file with the Encoder Pins listed as shown in HAL CONFIGURATION. Plus text files of the HAL and INI.
I have most all of the I/O functions working, but stuck on hooking the encoder pins up and working. I know there are other issues with my HAL code, but getting each thing working along and along is my objective. Plus feel free to correct me on anything I have wrong.
Have standard 200pr Omron Incremental Encoder attached to a Beckhoff EL5151 module. Have the hardware for all 3 axis, but simply concetrating on 1 axis to get working.
While in HAL CONFIGURATION, can see the module is enabled while pins is "shown". When in HAL OSCILLOSCOPE, cannot see any change when rotating the encoder shaft. Just trying to get the encoders working before bolting to the servo motors.
I do not have the beckhoff EL5151 PIN's correctly attached to LCNC, and is one of the main problems.
So that everyone can understand what I am doing or hooking up, I have a older Servomate Amp with 3 Electro-Craft DC Brush Servos, using the Analog +/-10V input. Removing the old 5V encoders, and installing the newer 24V encoders to work with my setup. The amps and servos are working fine, and already tuned. The computer went out and I am simply re-trofitting the computer and re-using the existing amps/servos. I have a full Beckhoff Ethercat setup with EL4132 for the Analog out to the Amps, will deal with those pins after getting the encoder working.
I know this will be easy for Andy (andypugh), Jon Elson, Pete Wallace, Chris Radek, Chris Morley, or John Thornton...
Plus many others that I have not named. Thanks to all of you for all the hard work that you do.
First, let me apologize for not mentioning you in my previous post. I know you are on here all the time dealing with people like me, and I am glad for the help. I am definitely ready to get the machine running again.
Ok, I see what you are saying about hardware counting. I was under the impression the Beckhoff module was similar to a Pico or Mesa card and was simply a gateway for the encoder to attach to the computer.... and the computer doing the software counting. But this makes sense of why I am having such a problem, as I have focused totally on software counting.
I went back and pulled the beckhoff manual for the EL5151 and it states the following:
Incremental Encoder Interface EL5151
The EL5151 EtherCAT Terminal is an interface with 24 V inputs for the direct connection of incremental encoders. A 32 bit counter with a quadrature decoder and a 32 bit latch for the zero pulse can be read, set or enabled. The measurement of period and frequency is possible. The gate input allows the locking of the counter, selectively with a high or low level. The latch input is similarly configurable and evaluates high or low levels. From FW 02 the EL5151 supports distributed clocks, i.e. the input data can be synchronously acquired with other data that are similarly connected, distributed to distributed clock terminals. The universal system accuracy is around < 100 ns. With a moving axis, the micro-increment functionality offers 256 times higher axis position resolution than physically provided by the encoder. The EL5151 can also be used as a single-channel 32/16 bit counter on channel A, in which case the signal level on channel B defines the count direction.
After going back and reading the above, I see that it has a 32 bit counter and quadrature decoder. I read this nearly a year ago, but it did not click at all. I am not a programmer, nor a servo specialist. I have gotten to where I am at by reading, then reading some more, and then even more.... I will have to read and get this figured out now that you have pointed out what to do.
I am going to approach this just like you stated: "You need to let your Beckoff hardware do the encoder counting. All you should need to connect in hal should be your encoder scale and position feedback from the Ethercat."
I will work on this tonight and get back with you. Once again, thanks for getting back with me so quick.
Ok one other thing on a tangent while talking about encoders.... I have several EtherCAT amps and drives that have absolute encoders. I know LCNC will not work with absolute encoders, but I assume this will not be a issue as the encoder is not feeding directly back to LCNC using software encoding, as you would be feeding scale and position feedback back from the amp using hardware encoding... I would simply close the loop between the amp and servo, then feedback from the amp to LCNC.
I still have not had time to work on the other Beckhoff module, but will get there... just not enough time.
CORBETT wrote: Ok one other thing on a tangent while talking about encoders.... I have several EtherCAT amps and drives that have absolute encoders. I know LCNC will not work with absolute encoders,....
That is not true, Linuxcnc does work with absolute encoders very nicely, i did a retrofit over 2 years ago using Mesa 7i74 to interface them to Linuxcnc.
You need some hardware for any kind of encoders to work with Linuxcnc, from parallel port to Mesa cards for incremental encoders, absolute encoders or resolvers.
PCW wrote: If the drives report the absolute position over Ethercat you should be fine.
Note that there are 1 turn absolute (mainly for commutation) and multiturn absolute
encoders, Multiturn encoders allow machine startup without homing.
As LinuxCNC can be configured to store the shutdown position it is possible to also have absolute homing with single-turn absolute encoders and resolvers.
This isn't implemented in any of the existing encoder modules, but is built-in to the Hostmot2 resolver driver.
However, for any true absolute encoders (Fanuc, BiSS, SSI, EtherCAT) you can set up the INI file for absolute encoders.
Though this is one of an increasingly large list of very useful features that are only available in the development branch.
Thanks for getting back with me. I am glad to hear that the absolute encoders are not a problem. I know things change, and at some point over the last few years it must have been implemented as years and years ago only incremental encoders would work (or at least that is what I remember and could be completely wrong). I am probably thinking about when it was EMC as I still have a few EMC and EMC2 disc laying around. Plus I keep a folder of everything that I thought needed to be saved over the years and I may have been reading a older manual. I caught myself accidentally reading a older manual last week. I have my folders separated by new and old, but sometimes mess up.
I did not want to pursue this until I finish up my current set-up, but this makes me want to start the ball rolling quicker. My thinking was worse case I would simply add a incremental encoder to each axis, but since absolute will work it will save a lot of time and extra money.
It will be good if It works out to eliminate homing each time you fire up the controls. (that is the whole reasoning of absolute encoders). I knew if you could get absolute to work it was a added benefit. I am just glad they will work in the first place as that makes me feel a lot better about the money that I have spent so far.
I am sure this is not the last time you will hear from me... but thanks for all the help as it is much appreciated.