Does anyone know how to zero/reset the NEO encoder in LabVIEW?
I haven’t been able to find it in the API. This post talks about it, but doesn’t say what it’s called or where it is.
Does anyone know how to zero/reset the NEO encoder in LabVIEW?
I haven’t been able to find it in the API. This post talks about it, but doesn’t say what it’s called or where it is.
In Java/C++ the way to do it is setPosition(0)
on the CANEncoder
object; it really is a bit confusing. I assume that a parallel SetPosition
VI (or whatever the terminology is) exists.
Ah! That’s probably it. There is a Set Sensor Position VI (Spark MAX Set Sensor Position.vi):
I was looking for a reset VI similar to the WPI_EncoderReset.vi. I’ll circle back to confirm after I test it.
Thanks!
Our test bed isn’t complete yet, so I haven’t had a chance to confirm and circle back. However, a post in another thread inadvertently addressed my question. @Johnynho’s image below shows the Set Sensor Position VI set to zero with a good way of using a Boolean global variable to reset the encoders.
Circling back. Setting sensor position to 0 is the way to do it.
Although, I’m still unclear how to tell which CAN ID is which Motor reference (Motors[][0], [1], [2], …) Is there a convention? Because right now with our code, it seems the “leader” controllers are [0] and [1], regardless of CAN ID.
That’s the convention for the Drive vi’s: left,right,left,right with the first motors on a side being the leader.
Hah, love a call-back!
That’s good to know. Thanks Mark!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.