
csandl_bauco (Customer) asked a question.
Hi guys, I am using a rotary encoder to determine the linear position of a moveable saw system. The system is moved via a rack and pinon, with the encoder being coupled to the pinion shaft.
I am using a Click Ethernet PLC to collect high speed inputs from the A, B and Z outputs of the encoder.
Initially, I was only collecting A and B signals and calculating the linear position from them. However, I did not get a repeatable position reading. I'm assuming this was due to some noise or pulse miscounts (I'm aware of the possibility of gear backlash in the system, but the errors do not seem consistent enough for this to be the case).
My next strategy is to use the Z pulse to determine total encoder revolutions and add the A and B pulses occurring before the first Z pulse and after the last one to calculate the final position. This way, I am only using the high resolution counting for two small portions of the movement and hopefully reducing errors. See my notes in the pic.
Does this make sense? How would I best implement this in ladder logic? Thanks in advance.
If you think you might be 're getting noise, I would work on that first. If you have access to a scope I'd take a look at the encoder output.
What count difference are you seeing? How fast are you moving to your location? Is it repeatable at a slower speed? What's your encoder PPR?
I haven't used a Click for any high speed applications myself. Part of your idea (while good) relies on being able to capture a count on your Z pulse. That doesn't look like a hardware function so it will be scan time reliant which might be an issue.
There is a difference of less than 100 counts. I am moving slowly enough not to exceed the 100kHz limit of the Click. The PPR is 2000.
Did you use the High Speed input configuration menu, or are you trying to do it all with ladder logic?
The scan time is too long to use ladder logic for encoder positioning, but an Ethernet Click has a built in High Speed Input encoder reader that will put the position directly into a DD Word.
Yes, that is what I am using.
Then in the configuration menu, where you set the "reset counter to" parameter for the Z input, put in a DD word, and also check the "call interrupt routine" box. (DD3)
write an interrupt routine that simply sets a bit (C1)
In the main routine, use the following logic
+1 Adisharr
How quickly are the pulses coming into the click?
Regards,
Garry
High Speed Counters Part 1
– High-Speed Count Mode Video
– Interval Measurement Mode Video
– Duration Measurement Mode Video
– Frequency Measurement Mode Video
High Speed Counters Part 2
– External Interrupt Mode Video
– Pulse Catch Mode Video
– Filter Pulse Mode Video
– Frequency Measurement and High-Speed Count Mode Video
About 7.69 encoder turns (15384 counts) per second.
You could use an absolute multiturn encoder with an EtherNet/IP output instead of an incremental encoder. Normally, absolute encoders take far too many inputs on a PLC as each bit of the encoder takes a digital input, however the newer ones with network capability are able to read the encoder position over the network and do not take any PLC inputs. Just make sure you get a multiturn model and not single turn, as the multiturn will tell you both what revolution you are at and the pulse count within that revolution.
This one for example has 262,144 counts per revolution and 4096 revolutions of resolution:
https://www.sick.com/us/en/encoders/absolute-encoders/afsafm60-ethernetip/afm60a-s6ib018x12/p/p378656?ff_data=JmZmX2lkPXAzNzg2NTYmZmZfbWFzdGVySWQ9cDM3ODY1NiZmZl90aXRsZT1BRk02MEEtUzZJQjAxOHgxMiZmZl9xdWVyeT0mZmZfcG9zPTUmZmZfb3JpZ1Bvcz01JmZmX3BhZ2U9MSZmZl9wYWdlU2l6ZT0yNCZmZl9vcmlnUGFnZVNpemU9MjQmZmZfc2ltaT05Mi4w
That is just one example. You are able get the encoders with male or female shafts and various shaft sizes. There are also many other big name companies who make such encoders. That Sick one is probably on the more expensive side given its extremely high resolution compared to some competitor options or even other models from Sick.
Also, I really wish Automation Direct had a decent encoder selection. They have fallen many years behind just about every competitor on the market in this area. Servos as well.
Unfortunately, to the best of my knowledge, the CLICK does not support Ethernet/IP devices. Though, it can be configured as an Ethernet/IP device itself, so that it can communicate with an AB PLC.
Ah yes, I am looking now and see that the Click only supports being an adapter. That is an unfortunate limitation.