Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Magnetic Encoder Wiring and Programming (http://www.chiefdelphi.com/forums/showthread.php?t=133276)

Gabriel Mendes 21-01-2015 13:47

Magnetic Encoder Wiring and Programming
 
Hi Everyone, does someone knows how to wire the Magnetic encoder in the Sidecar or in the roboRIO and does someone knows how to program a magnetic encoder in labview?
The Magnetic Encoder number is AS5145B, Eval Kit.
Thanks, Go #1382

TFleig78 21-01-2015 14:53

Re: Magnetic Encoder Wiring and Programming
 
Last year, we used this sensor and it worked reliably. To wire it, we used a low pass filter to average the PWM signal. There are instructions to build the filter on page 18 of the datasheet here:

http://ams.com/eng/Products/Position...ensors/AS5145B

Do note that when used in this way, the sensor outputs a value proportional to it's absolute position, so it can be used like a potentiometer. For us this was perfect as we were not counting number of rotations, but rather what angle the shaft was within a rotation.

The pinouts are on page 4. +5v is pin 16, and Gnd is pin 7. We wired these to the digital sidecar last year, but I think you can wire them right to the DIO on the RoboRio.

Ether 21-01-2015 15:05

Re: Magnetic Encoder Wiring and Programming
 
Quote:

Originally Posted by TFleig78 (Post 1431643)
we used a low pass filter to average the PWM signal

Or you can use the FPGA to measure the pulse width? WPILib counter object semi-period mode.

http://www.chiefdelphi.com/forums/sh...32&postcount=5



TFleig78 21-01-2015 20:19

Re: Magnetic Encoder Wiring and Programming
 
You can also use it like a normal ecoder with A and B channels.
This article is very helpful:

http://wpilib.screenstepslive.com/s/...control-system

Joe Ross 23-01-2015 15:23

Re: Magnetic Encoder Wiring and Programming
 
Quote:

Originally Posted by Ether (Post 1431654)
Or you can use the FPGA to measure the pulse width? WPILib counter object semi-period mode.

http://www.chiefdelphi.com/forums/sh...32&postcount=5

Semi-period mode is not ideal for this sensor, because the data sheet recommends using the duty cycle. When there is motion, you could get out of sync values if you're trying to measure the duty cycle in semi-period mode. You could measure just the high or low pulse and use other methods to calibrate out the 5% frequency tolerance.

Ether 23-01-2015 15:35

Re: Magnetic Encoder Wiring and Programming
 
Quote:

Originally Posted by Joe Ross (Post 1432854)
Semi-period mode is not ideal for this sensor, because the data sheet recommends using the duty cycle.

Good catch (paragraph 8.2 of the AS5145B datasheet).


The same holds true for the US Digital MA3:

Quote:

Originally Posted by Ether (Post 1410408)
Decoding PWM duty cycle (which is the datasheet-recommended way to decode the PWM signal for the MA3) would require measuring both the pulse width and the period (or the associated non-pulse width) for the same cycle. I don't think the 2014 FPGA is programmed to do that.

Quote:

Originally Posted by Ether (Post 1410396)
I've heard the FPGA sampling frequency will be bumped up from ~153KHz (in 2014) to ~1MHz (in 2015). Maybe the FPGA will be programmed in 2015 to read duty cycle (detect and report consecutive rising-to-falling and falling-to-rising edge pairs). If so, you could decode the PWM quite accurately using that.

Do you know if there are any plans to add duty cycle decoding to FPGA?




All times are GMT -5. The time now is 23:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi