Log in

View Full Version : Connecting encoders


TBots
07-04-2015, 18:22
We are trying to make a swerve drive but have encountered difficulties with wiring and programming the encoders. We could really use some guidance in getting the encoders working if anyone has any ideas.

We have some older electronics since this is only prototyping. We are using a cRIO and talon motor controllers(not SRX), and several magnetic absolute encoder(MA3).

The encoders are meant to be able to detect the angle at which the wheels are turned, and change that angle when the joystick is triggered.

How do we connect the encoders to the cRIO? Is it analog or digital? And does anyone know the max voltage of the encoders? Is it 5? Is there a way to know?

Thank you for any help you can supply us with, this is our first time attempting something like this, and are still a bit lost on how to make it happen.

If it is relevant, we are using labVIEW.

Mark McLeod
07-04-2015, 18:36
MA3's are generally analog in our FRC usage, although there are PWM output variations. Verify the model number and check the data sheet below.
They use 5v.
Check the data sheet for which wire is which. Colors may not be what you are accustomed to and the power/signal relative positions are reversed.

Read the data sheet (http://www.usdigital.com/assets/datasheets/MA3_datasheet.pdf?k=635549412619806250) for these types of details.

TBots
08-04-2015, 16:10
I just found out they are 10-bit analog. How do we connect these to the analog breakout bored on the cRIO?

Alan Anderson
08-04-2015, 16:24
I just found out they are 10-bit analog. How do we connect these to the analog breakout bored on the cRIO?

The cable that plugs in to the MA3-A10 connector has three wires. #1 is "5" and goes to 5v power (the center pin) on an Analog Input channel. #2 is "A" and goes to the SIG pin. #3 is "G" and goes to the - (ground) pin.

This is according to the US Digital data sheet.

Mark McLeod
08-04-2015, 17:39
10-bit just refers to the resolution you can expect on the analog input.
It doesn't have anything to do with how it gets physically connected.

0-5 voltage range of possible values (nominal on a cRIO)
10-bit = 1024 discrete possible translations of those voltage values

So 5v/1024 = .00488 volts per position, is the resolution that your code will receive from that analog input.
or 360 degrees/1024 = .35 degrees per tick is another way to look at 10-bit resolution.

TBots
10-04-2015, 16:03
So for programming the encoder, would I still use the get voltage vi?

I heard the programming is different from a PWM encoder.

Mark McLeod
10-04-2015, 22:54
An MA3 looks and acts like a potentiometer, so use an Analog Input Get Voltage.
Because it's a digital sensor masquerading as an analog sensor, I'd avoid using averaging or normalizing.