Resetting Encoder

Is there a way to reset an encoder to 0 or some other value when in position mode? For example, if an arm is not in its home position when the robot boots up. We’re using Labview.

Thanks.

1 Like

Yes, there is.
There’s an input on the “enable” VI to set the position, if you’re in position mode.

There is currently a small bug in this: The first time it is called after a Jaguar is booted up, this parameter doesn’t work. You can get around this by calling it twice the first time.

Could a de-bounced switch that is connected to the index pin work too?

[quote=“Luminary Micro RDK”]

The index pulse can be used to reset the position counter; this causes the position counter to
maintain the absolute encoder position. Otherwise, the position counter maintains the relative
position and is never reset.

[/quote]

Index switch for Jaguar encoder.png


Index switch for Jaguar encoder.png

I believe so, but I’ve never tried it.

Now that you mention it, that makes much more sense as a use for an index than another channel on an encoder.

Then the question becomes: are both edges of the index pin counted?

If not, then the switch can be connected like my schematic.
If yes, then the switch will have to be connected through a monostable oscillator (a one-shot)

Justin,
From what document or post did you pull the Luminary Micro TDK quote?
Thanks.

Your best bet is to do it with software rather then custom circuit.

enable(0);
enable(0);

or in java
enableControl(0);
enableControl(0);

Gary, it’s in the RDK-BDC Firmware Development Package
USER’S GUIDE. (RDK-BDC stands for Reference Design Kit - Brushed DC motor)

You can get it from the Firmware Development Package here:
http://www.luminarymicro.com/products/rdk_bdc.html

Look under “software updates”
(It looks like they’ve updated it since November)

We discovered the behaviour of the index pulse accidentally.
One of the encoders on our robot was wired up to include the index wire, and the consequence was that we were only recording positions in the range -1.0, 1.0] revolutions, i.e. phase wrapping. For a sufficently fast turning mechanism the signal can look similar to noise.

We’re not 100% certain of this, but our experience with using an indexed encoder with the Jaguar closed-loop control has been pretty bad. We’re very likely going to disconnect the index pin tomorrow. The basic issue here is that it doesn’t seem that a scheme where the encoder count is reset by the index works very well, the PID control seems to get really confused by the wrapping that happens when you go from 0 to full-count (for one revolution) and then back to zero – this proably holds in either direction of rotation.

Has anyone gotten this to work? I think if you were to use some type of switch connected to the index pin you might be OK, as long as you either aren’t using closed-loop control, or only reset the index once (not once per
revolution). What I’m wondering is if anyone has gotten closed-loop control with a real index encoder to work.

Just to follow up, I can confirm that using an idexed encoder with the closed-loop position control does not work well at all, as of Jaguar firmware version 92. Disconnecting the index pin and just having things start up in the zero position gets around this problem, but we only came to this very late in our first competition this season.