Encoder mystery
T Chap
Posts: 4,223
I have an encoder on a motor, using the Prop encoder object. I have used the same encoder on many systems, same motor, same Prop main board and never a failure. All of a sudden this one project is acting strange. The motor is a brushless DC, running from a driver that the Prop controls via PWM and PID. The code tells the motor to run from 0(set at boot) to a preset destination. In this problem, on boot the motor runs the right distance, and maybe runs several cycles ok but then starts running shorter than it should by about an 1/8" (in the real world for the object being moved), it incrementally starts getting worse by the same amount. I sent someone to the site today and he ruled out mechanical slipping which would be easy to detect. I sent out a new Prop main board and new encoder. There is a CAT5 that carries the info from the encoder back to the main board, less than 10' but I have run up to 50' easy. We tried several CAT5 cables, then tried a shielded CAT5. So basically everything in terms of electronics has been replaced. This appears to be noise on the encoder lines, making the Prop think the motor has run farther than it has in fact. There are no caps on the encoder lines, and I am thinking that maybe some caps might help knock down noise if this is in fact the problem. Can anyone offer any other advise on what to look for on this? I am not near the project, and having to do this with someone that does not have a scope or a lot of experience with electronics. Thanks
Comments
- Is the encoder a 3.3V device or 5V?
- Is the encoder wired directly to the Propeller inputs or is there any thing else inline (resistors, etc)
- What kind of outputs are on the encoder? Does it have something like an internal Schmitt trigger to condition the output pulses? If not a 74HC14 using a pair of inverters back to back on each of the encoder channels can clean up the signals.
With some more details we may be able to help.
Robert
My advice would be to scope the encoder outputs, ideally with a logic analyser than can store lots of pulses.
I have seen encoders fail - not talking the cheap ones but name brand German ones, and even after a relatively low number of cycles (1000's).
Robert
Also what sort of frequency is put out when you are moving at top speed? The 1 kohm resistor helps form an RC lowpass filter, reducing the upper speed. You'd have to have a high speed for this to start becoming a problem, so I don't think its the likely cause. Just mentioning it in case.
How far is the encoder from the prop?