Armabot 240 Encoder Programming

Our team recently bought the Armabot Turret 240. We were looking to use the built in encoder but can’t seem to find any documentation. We are using a Talon SRX and connecting the encoder to the TalonSRX.

Anyone that has used the turret and has sucessfully programmed the encoder please let me know :slight_smile:

Preferably in C++ please!

I don’t use C++, however we used the analog encoder option, and used the configSelectedFeedbackSensor, so I would look at the phoenix api docs.

We used the analog encoder for that turret and got useful values, it was wired into the RoboRio’s analog ports. I would suggest looking into the AnalogEncoder.h in the documentations.

We imported the AnalogEncoder.h and AnalogPotentiometer.h so I could create the AnalogInput ID to construct the encoder. After that we just read the values with GetDistance() and got values.
There is probably a better way but it did work.

Note: if you receive values but they are not changing, check the wires are connected the right way.

1 Like

Precursor: I do not recommend using the provided encoder. It gave us problems to no end. If you have the capacity to 3D print and a CTRE Mag Encoder available I would highly recommend printing a Mag Encoder housing with the provided Solidmodels on the website: These were created by my team after giving up on the provided encoder. However the below instructions should apply both.

Answer: I am not familiar with the way its done in C++ (we use Java) but from looking at the examples it seems like you would configure the sensor for the Talon like so as seen here:

/* choose the sensor and sensor direction */
				FeedbackDevice::CTRE_MagEncoder_Absolute, kPIDLoopIdx,

And then access it like any other TalonSRX Sensor. I would recommend looking at the example below as it should provide a solid base to learn from.

1 Like

I did found a problem with the provided encoder during basic testing, when rotating the turret past 180 degrees in any direction, the original 0 position gets a -1 offset, it continues and at one point I got -6 when it should have been 0. This would be a tedious problem to deal with, but my team mentioned the turret should only turn between a set range (never past 180) so the analog encoder would do fine for us now.
To the original problem, it seems to be the digital encoder which I have no experience with. But if it connects to the talonSRX I expect some documentation about encoders in their API like several others responded. Sorry if my reply on analog encoder caused some confusion.

There is some good advice in this thread. The CTRE Mag encoder is a great option to stay in known control system. There is a new code example in the encoder datasheet on the product page for the digital encoder. This is still very new but I thought it would be good to pass on.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.