Quadrature - missing counts

Questions about using encoders with the Roboclaw product line
Post Reply
Knoedler
Posts: 2
Joined: Mon Aug 05, 2019 9:07 am
Quadrature - missing counts

Post by Knoedler »

I am using the Roboclaw 2x7a with a pair of small geared motors and a pair of TMCS-28 encoders in a PID position control mode.

I can slowly move the shaft by hand and see counts missing. The problem seems to be worse with the latest firmware 4.1.33, but I can't see how to switch to an earlier firmware to verify this.

Attached is a scope trace of a situation where the Roboclaw registered no change, but the scope clearly shows multiple counts. It appears the filtering is aggressive enough to remove real counts.

I see the same behavior in the Basicmicro Motion Studio and the python interface from Linux. I see this on multiple encoders and Roboclaws, so it is not isolated to a particular encoder or Roboclaw.

Is there a way to disable the filtering or a different firmware version I should use?

Of note, I am in the SoCal area and can bring it by if that would be helpful.

Thanks.
Attachments
Scope Trace
Scope Trace
scope.jpg (181.28 KiB) Viewed 5198 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Quadrature - missing counts

Post by Basicmicro Support »

Filtering would not explain this. The filter is only a couple clock cycles(at 30mhz) wide. The encoders on Roboclaw are able to read up to 9.6million encoder edges per second.

The signals look fine though the signals appear to be out of phase more or less than the standard 90 degrees(possibly because you spun the encoder by hand?). I recommend setting the Roboclaw back to factory defaults and testing again. The encoder pins default to quadrature mode.

Make sure you have a common ground to the encoder. Are you powering the encoder from the Roboclaw 5v? Show a picture of your wiring. Maybe I will see the problem.

Are all the encoders you tested the same brand of the encoder?

Is it reading any encoder counts or none at all? If it is reading some, how are you determining it is missing counts?

Run the motor at a constant speed and take another scope trace at that constant speed. That should show the 90-degree phase shift between the 2 signal lines more clearly and eliminate that as a possible problem.

Sure, you can come in. Note the address on the website is our mailing address, not our warehouse address(where I am located). I'll give you the address if/when you are ready to stop in. Please email me at support@basicmicro.com for that information.
Knoedler
Posts: 2
Joined: Mon Aug 05, 2019 9:07 am
Re: Quadrature - missing counts

Post by Knoedler »

Thank you for the fast response.

Yes, the encoders are powered from the Roboclaw 5V. Yes, the encoders are all the same brand.

I am seeing encoder counts on faster or longer moves. In this particular case I moved it slowly by hand to see the counts on the scope and none were recorded on the M1 encoder output via python or via the Motion Studio. Wiring pictures attached.

Resetting the Roboclaw back to factory defaults resolves the count issue. I can move it slowly by hand and see the counts.

The issue is related to the deadzone. As soon as I specify a deadzone the problem returns. It appears that the deadzone setting somehow applies a filter so that slow moves are not counted. I had a deadzone setting of three on the trace shown and the trace shown resulted in no change on the encoder count.
Attachments
wire2.jpg
wire2.jpg (123.73 KiB) Viewed 5193 times
wire1.jpg
wire1.jpg (189.12 KiB) Viewed 5193 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Quadrature - missing counts

Post by Basicmicro Support »

I will take a look at it. Thanks.

Post Reply