Go to Post Some may call it an obsession and they may be right, but I call it a huge learning experience. - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2015, 13:47
Gabriel Mendes Gabriel Mendes is offline
Registered User
FRC #1382
 
Join Date: Jan 2015
Location: Brazil
Posts: 6
Gabriel Mendes is an unknown quantity at this point
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
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2015, 14:53
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2015, 15:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Magnetic Encoder Wiring and Programming

Quote:
Originally Posted by TFleig78 View Post
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


Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2015, 20:19
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
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
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2015, 15:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,573
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Magnetic Encoder Wiring and Programming

Quote:
Originally Posted by Ether View Post
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 23-01-2015, 15:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Magnetic Encoder Wiring and Programming

Quote:
Originally Posted by Joe Ross View Post
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 View Post
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 View Post
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?



Last edited by Ether : 24-01-2015 at 09:32.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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