Encoder count off with Actobotics encoder

General discussion of using Roboclaw motor controllers
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Encoder count off with Actobotics encoder

Post by robof »

I'm using these Actobotics motors with encoders with both 2x7A and 2x15A Roboclaws.
--https://www.servocity.com/116-rpm-premi ... -w-encoder
Direct link to encoder details
--https://www.servocity.com/files/index/d ... 455566016/

The problem is, the encoder count is not matching the motor position.

For example start at encoder position 0, move forward 4000 pulses, then move backwards 4000 pulses, I will not be close to starting position, I will almost always be several degrees off. Just to be clear, I am using IONStudio and when i move slider up in PWM tab the motor speed is + and encoder count is +, when I move it down motor speed is - and encoder count is -, so I believe all is hooked up correctly and that it's simply a problem with the count. I can repeat this a few times and eventually my motor will be a full 360+ degrees out of sync. I've tried 4 different motors and 2 Roboclaws, all getting the same results.

I contacted ServoCity and they say a resistor isn't needed with their encoders; I tried a 1k and a 2.4k resistor anyhow just to try without any luck.

Any thoughts on what the problem could be?
Last edited by robof on Thu Aug 03, 2017 5:53 am, edited 2 times in total.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Encoder count off with Actobotics encoder

Post by Basicmicro Support »

Quadrature encoders dont need resistors because the Roboclaw I/Os are already 5v tolerant. Only Analog Potentiometer based ones do to reduce the voltage to the supported range(eg 0 to 2v signal range) of voltage but does not apply to your encoders.

I suspect the problem is in the encoders themselves. We have found on many of these motors with the hall effect encoders(eg the black disk on the back) that there is a poorly designed snubber circuit for the dc motor. This is not specific to actobotics motors but to all these types of motors apparently. This circuit introduces a large amount of noise on the 5v power line and the encoder signals. The only fix, unfortunately is to remove the snubber cap(or caps) from the encoder pcbs that are affected by this problem. We have tried other methods of filtering out the noise but have found no alternative currently.

If you have an oscilloscope you can look at the encoder lines to confirm this is the problem. The noise is so bad that false pulses are detected and some pulses are lost. Normal encoders should have a clean square way. On the affected motors the encoders produce as much as +- 3v of noise on the encoder lines and the 5v power line(which isnt good for the Roboclaw either). You will see the problem only if you are running the motors. If you just turn the motors by hand the encoder pulses will look fine.

To find the cap or caps(some motors have two caps) use a multimeter to check for continuity between the motor power leads and each side of each cap on the encoder PCB. Only the snubber caps will have any continuity to the motor power leads.
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Encoder count off with Actobotics encoder

Post by robof »

Can you take a look at this waveform from this encoder and let me know your thoughts? I'm new to this so not entirely sure how to interpret it.
Attachments
SDS1202X-E11.png
SDS1202X-E11.png (20.52 KiB) Viewed 10009 times
SDS1202X-E12.png
SDS1202X-E12.png (20 KiB) Viewed 10009 times
SDS1202X-E13.png
SDS1202X-E13.png (45.98 KiB) Viewed 10009 times
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Encoder count off with Actobotics encoder

Post by robof »

Just added a another picture as I wasn't sure what is needed to help diagnose this issue.

I did not try removing the cap as suggested as I will be sending these motors back if it's indeed a problem with the encoders.
Attachments
SDS1202X-E5.png
SDS1202X-E5.png (16.51 KiB) Viewed 10009 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Encoder count off with Actobotics encoder

Post by Basicmicro Support »

Zoom the graph out so we can see multiple quadrature pulses. If this is zoomed out Id say there is more wrong with this encoder than what I was talking about. I dont see anything that looks like a square pulse train.
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Encoder count off with Actobotics encoder

Post by robof »

More images are available at the link below if you don't mind taking a look. I hope I've captured something useful. The images may not be in any particular order.
http://imgur.com/a/DS0Po

Actobotics/ServoCity is basically saying that they see a slight drift with an Arduino, but that the problem is much more pronounced with the RoboClaw.
Attachments
SDS1202X-E7.png
SDS1202X-E7.png (34.96 KiB) Viewed 9954 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Encoder count off with Actobotics encoder

Post by Basicmicro Support »

You can see a lot of spikes on each high and low period of the quadrature encoder in your last pictures. This is happening because the 20khz PWM pulses driving the motor are coupling into the encoder PCB through the bad snubber circuits.

If you remove the snubber caps that are built into the encoder PCBs the problem will go away.

Unfortunately I have tested these kinds of motors from many manufacturers and they all are basically copies of each other and have the same bad snubber circuits on them.

As for an arduino not seeing them as much, an arduino is bit banging/using interrupts to read encoder pulses. The roboclaw is using a hardware quadrature decoder. The arduino can read maybe a couple thousand quadrature pulses per second so it is its own low pass filter and barely sees the 20khz noise caused by the bad snubber design on these motors pcbs. The Roboclaw is designed to see millions of pulses per second and easily sees those noise pulses.
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Encoder count off with Actobotics encoder

Post by robof »

Thanks a lot for your very detailed and extremely helpful responses. The features roboclaw offers initially drew me to them and the customer service I have seen will keep me a loyal fan; so keep up the good work. :D

I still need to work this encoder issue out with ServoCity/Actobotics since I don't want to modify the circuit and void any sort of warranty, but I think you have given me enough info to make this a lot easier to discuss with them.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Encoder count off with Actobotics encoder [Solved]

Post by Basicmicro Support »

Check how long there warranty on their motors are. It may already be fairly short. I've bought a number of them from Servo City and the one time I had to get one replaced they were more than happy to. This one was DOA IIRC so I hadn't done the mod on it.

I replied to your other post(I think it was you). Already built in optical encoders is going to be hard to find. I recommend US Digital or AMT after market encoders but these do need motors with both the front and rear shafts(at least if you want it easy to install them).

Also, just so I'm clear, this snubber cap problem is not a Servo City specific problem. It appears all I've tried from different places(I've tried a lot of different ones) have this same issue.
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Encoder count off with Actobotics encoder [Solved]

Post by robof »

Yeah I understand the problem isn't specific to this company, I just want to make sure I don't 'damage' the encoders on the motors in the event I need to send these back for a refund/replacement. I'm happy with the price/performance of the motors, so I may return these and get the non-encoder version and buy some of the after market encoders you have suggested to install. These servo city motors have the shaft out both ends so I'm assuming that wouldn't be too difficult.

Post Reply