PLUS+1 Hardware > Controllers
Quad Encoder distance reading has too high error
gregbosma:
I've written an MC024-120 program for a quadrature encoder to track the feeding of a hose. Any ideas why the amount of error in one direction is different from the error in the opposite direction?
To test it, I've put together a prototype, fed out 20 feet of hose, and brought it back to the zero point. While testing, we noticed the measurement on Service Tool is short by half an inch while feeding out-- fairly acceptable. After retracting the hose back to the zero point, the Service Tool showed the hose was still sticking out by 6 inches! :o
Attached is my counting method on the programming side-- essentially adding QuadCount to the current total count, with a method of zeroing. To convert this count into a distance, I'm using a "Scale" function that references known values (# of pulses at 10 feet).
For hardware, the encoder is on an idler wheel that rides along the hose. The encoder reads 250 pulses per revolution, at approximately 5.125 inches per revolution. The hose can travel at anywhere between 0 and 3 ft/s using a motorized feed system.
Any ideas why the amount of error in one direction is different from the error in the opposite direction?
FluidPowerTom:
Could the mechanism be slipping on the retract? I'd recommend testing this by uncoupling the encoder and turning it's shaft 20 or whatever turns in one direction and back, and then try it for the other direction. That way you'll know for sure it isn't the mechanism.
Is this issue consistent after multiple tests?
Could something be triggering your zero or calibration routine? Maybe have either of those routines set a latch so that you'll know if they're going true for even one cycle.
gregbosma:
@FluidPowerTom, thanks for the suggestions!
Slipping is definitely a possibility-- the encoder's in an awkward spot so I'll see if I can get a mirror or camera pointed at the right angle and catch that.
The issue is somewhat consistent after multiple tests-- it seems there's always some unacceptable amount of error between 3 and 6 inches after retracting back to the zero point. With that wide of a range, I'd suspect an intermittent fault-- some counts not registering properly (due to speed?), or slipping as you mentioned.
While I'm checking for slipping, I've updated the service tool with the latches you suggested. With the amounts of error I'm getting, the probability of this being a root cause is low but I won't ignore it!
G30RG3:
Hi,
I've seen you've set your pinconfig.range to 1. I'm not sure, but I think I had a similar issue a while back and solved it by setting the value to 0. If you don't need the voltage elsewhere in your program, I would suggest to try with the standard range, even if the voltage goes outside the 5V.
b.r. G30RG3
gregbosma:
@G30RG3
I can try changing the range, but I'm unsure it'll help... I'll post again with the results.
I've read my encoder signal on a DAQ and saw a square wave with some overshoot/oscillation on each rising edge. I'm worried the oscillation will cause extra counts if my digital thresholds are too low.
Navigation
[0] Message Index
[#] Next page
Go to full version