Go to Post FRC2010 - The flying purses :P - Bharat Nain [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 16-02-2013, 21:54
twiggzee twiggzee is offline
Registered User
FRC #3502 (Octo-(PI)-Rates)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Tallahassee, FL
Posts: 55
twiggzee is an unknown quantity at this point
Magnetic Encoder Help

We have an AS5130 magnetic encoder from ASM. We're trying to get some readings off of it so we can determine our shooter angle. i'm having trouble getting any response from it.

here's what we've done so far.

wiring is as follows (per an email from an ASM representative)
5V to Digital I/O 5V
GND to Digital I/O (-)
Vout to Digital I/O Signal

Programming:

1. We used the Encoder class, meant for quadrature encoders. We know this is not a quadrature but we tried it anyways. We called the digital I/O channel that it was plugged into and an unused channel as well because it required 2 channels in the constructor. We were unable to read any values.
2. Some CD posts suggested using the Counter class. We tried that as well and were not able to get any readings either.
3. We also tried the PWM class since it should be a PWM signal coming out of the sensor. This classes constructor calls for a pin on the PWM channels on the digital sidecar as opposed to the digitial I/O channels. So we moved the connection as required to a PWM channel. This time we didn't just get no readings, we got an diamond shaped error icon in the output field of the SmartDashboard as if the output was not a number/correct format or something????
4. Lastly, we also read on CD as well as some FIRST forums that a low pass filter could be used to convert it to an analog signal read from the analog breakout. When we did that we found out pretty quickly (and luckily before damaging anything) that it was making the transistor on the breakout module heat up enough to burn your finger within a couple of seconds.
__________________
Wendy
Team 3502
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2013, 22:00
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Magnetic Encoder Help

Firstly, my guess is that you did not call the start() method in Encoder or Counter. Second, how are you using an encoder to measure your shooter angle? Encoders are meant for things that rotate more than 360 degrees, and not really for positional measurements.
__________________
All opinions are my own.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2013, 22:03
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Magnetic Encoder Help

Quote:
Originally Posted by twiggzee View Post
This time we didn't just get no readings, we got an diamond shaped error icon in the output field of the SmartDashboard as if the output was not a number/correct format or something????
4. Lastly, we also read on CD as well as some FIRST forums that a low pass filter could be used to convert it to an analog signal read from the analog breakout. When we did that we found out pretty quickly (and luckily before damaging anything) that it was making the transistor on the breakout module heat up enough to burn your finger within a couple of seconds.
The "diamond shaped error icon" is the infinity symbol. You probably called getPeriod() when it was reading zero.

You probably shorted the connection on the analog breakout. Make sure the PWM is in the correct orientation.
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2013, 22:50
twiggzee twiggzee is offline
Registered User
FRC #3502 (Octo-(PI)-Rates)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Tallahassee, FL
Posts: 55
twiggzee is an unknown quantity at this point
Re: Magnetic Encoder Help

We did call the .start() and .reset() methods in the initialize() section of the command both when we used the Encoder and Counter classes.

We have a magnet mounted to the end of the shaft on which the shooter table pivots and the encoder board mounted right next to the magnet. An ASM representative told us that these specific encoders are meant to give a reading every 1.4 degrees which makes it applicable for our position sensing.

the diamond infinity error showed for both .getRaw() and .getVoltage() methods in the PWM class. if that means i was reading 0 then that's no good either. =/

we can check the wiring on the low pass filter tomorrow but my electrical guy says he's pretty sure he did it right.

any other ideas?
__________________
Wendy
Team 3502
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2013, 23:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
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 Help

Quote:
Originally Posted by twiggzee View Post
We did call the .start() and .reset() methods in the initialize() section of the command both when we used the Encoder and Counter classes.

the diamond infinity error showed for both .getRaw() and .getVoltage() methods in the PWM class. if that means i was reading 0 then that's no good either. =/
I'm looking at the datasheet for AS5130 and I don't see any square wave quadrature signals like what the WPILib Encoder class is expecting.

Quote:
we can check the wiring on the low pass filter tomorrow but my electrical guy says he's pretty sure he did it right.
Can you post a quick hand-sketch of the filter circuit you used and how you have the AS5130 wired to the cRIO analog input? Include pin numbers of the 5130 and component values of the filter.




Last edited by Ether : 17-02-2013 at 00:04.
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 10:13.

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