Go to Post Dave Lavery, Lou Rosanio and Karthik are all Woodie Flowers winners this year. So mentors it seems like if ya want the WFA it might be a good idea to put on a kilt :) - Kyle [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 29-01-2010, 19:02
sparrowkc sparrowkc is offline
Registered User
AKA: Mark
FRC #1986 (Team Titanium)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Lees Summit
Posts: 114
sparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to behold
I've Got The Magnetic Encoders Working Over SPI

I just spent a day and half trying to figure out how to access the AS5030 magnetic encoders included in the kit over SPI. I finaly got it working and figured I could save others some time by posting my code here. As far as I can tell, there isn't an example for this out there anywhere. This isn't official, this is just the result of one person's research and tinkering, so don't trust it too far.

http://www.mediafire.com/file/nmtgyo...EncoderCode.vi

Please tell me what I did wrong and what could be improved.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2010, 18:02
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: I've Got The Magnetic Encoders Working Over SPI

Nice, is there a particular reason how it worked out to be that "11111" is sent through the SPI?
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2010, 23:16
sparrowkc sparrowkc is offline
Registered User
AKA: Mark
FRC #1986 (Team Titanium)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Lees Summit
Posts: 114
sparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to behold
Re: I've Got The Magnetic Encoders Working Over SPI

Thats 11111 binary. The command you send to initiate a read is 00000, but because of the way the breakout board provides a 4 wire interface, commands sent to the encoder are inverted.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2010, 03:36
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I've Got The Magnetic Encoders Working Over SPI

Quote:
Originally Posted by sparrowkc View Post
Please tell me what I did wrong and what could be improved.
You're correct... there is no official example for using this sensor over SPI.

From looking at your code it looks like you are accessing it correctly. Well done! You could clean it up a bit by choosing Most Significant Bit First in the Advanced Config VI... then you wouldn't have to reverse the data you get back (don't forget to change the output command too). I would also make subVIs out of the Open and Get parts of the functionality to make it easier to include in user code and remain encapsulated.

-Joe
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2010, 09:29
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,357
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: I've Got The Magnetic Encoders Working Over SPI

For years with the IFI controller there were constant moans about the hardware SPI being tied up. Now that we have SPI there has been little talk about it. Good work. The AS5030 Is ok but there are better solutions out there. Avago makes a absolute magnetic encoder that is inexpensive and would be a good choice for some robo applications. Melix makes a good chip that comes on a demo board. It has some advantages over the Astria micro chip. Using spi can have advantages over the analog types.
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2010, 13:32
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: I've Got The Magnetic Encoders Working Over SPI

Nicely done! I really want to figure out someway to use the absolute encoders and accelerometer in the kit this year just to get the experience of using serial sensors now that we have them and they were free. Congratulations on the bus hacking!
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2011, 22:15
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 36
StephenNutt is an unknown quantity at this point
Re: I've Got The Magnetic Encoders Working Over SPI

Do you still have this code? I am interested in using the encoder this year and would like to use SPI.

Thanks

Steve

Quote:
Originally Posted by sparrowkc View Post
I just spent a day and half trying to figure out how to access the AS5030 magnetic encoders included in the kit over SPI. I finaly got it working and figured I could save others some time by posting my code here. As far as I can tell, there isn't an example for this out there anywhere. This isn't official, this is just the result of one person's research and tinkering, so don't trust it too far.

http://www.mediafire.com/file/nmtgyo...EncoderCode.vi

Please tell me what I did wrong and what could be improved.
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2011, 20:04
sparrowkc sparrowkc is offline
Registered User
AKA: Mark
FRC #1986 (Team Titanium)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Lees Summit
Posts: 114
sparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to beholdsparrowkc is a splendid one to behold
Re: I've Got The Magnetic Encoders Working Over SPI

Here's that file again. Hope it helps!

http://mit.edu/mspatz/www/MagEncoderCode.vi
__________________
Reply With Quote
  #9   Spotlight this post!  
Unread 28-11-2011, 05:04
Ranjith Ranjith is offline
Registered User
no team
 
Join Date: Nov 2011
Location: Indai
Posts: 1
Ranjith is an unknown quantity at this point
Re: I've Got The Magnetic Encoders Working Over SPI

Hi Techies,
Just I am checking the feasibility of using AS5030 with standard CPU SPI interface to our new design.

From my understanding the FET logic like Adapter board implementation is the way to interface AS5030 in Read/Write mode with standard SPI interface from CPU. I have documented my understanding. Please correct me if anything wrong...

And also can I get the code in viewable in text editor format (MagEncoderCode.vi), looks like it is Labview file and not able to open in text editor.

Thanks
Ranjith
Attached Files
File Type: pdf AS5030_SPI_Interface_Understanding.pdf (159.1 KB, 90 views)
Reply With Quote
  #10   Spotlight this post!  
Unread 28-01-2012, 16:07
brettreardon123's Avatar
brettreardon123 brettreardon123 is offline
Registered User
FRC #1212
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Arizona
Posts: 14
brettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these parts
Re: I've Got The Magnetic Encoders Working Over SPI

I'm going to try and resurrect this thread. I went and found these sensors, and we're going to try to use them this year for shaft encoding. When I open the VI you posted above, Labview cannot find most of the dependencies that are necessary. Does anyone know if this VI should still work in this year's copy of Labview, or is there an old dependency that was removed this year?

Thanks in advance!
__________________
Brett
Reply With Quote
  #11   Spotlight this post!  
Unread 28-01-2012, 16:17
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,557
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: I've Got The Magnetic Encoders Working Over SPI

Quote:
Originally Posted by brettreardon123 View Post
I'm going to try and resurrect this thread. I went and found these sensors, and we're going to try to use them this year for shaft encoding. When I open the VI you posted above, Labview cannot find most of the dependencies that are necessary. Does anyone know if this VI should still work in this year's copy of Labview, or is there an old dependency that was removed this year?

Thanks in advance!
The location it is looking for the files is the 2009 location. You should be able to find them all in C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\Rock Robotics\WPI
Reply With Quote
  #12   Spotlight this post!  
Unread 28-01-2012, 17:27
brettreardon123's Avatar
brettreardon123 brettreardon123 is offline
Registered User
FRC #1212
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Arizona
Posts: 14
brettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these partsbrettreardon123 is infamous around these parts
Re: I've Got The Magnetic Encoders Working Over SPI

Thank you! I was able to find all of the files except the first couple, "DigitalModule.ctl" "ConfigureAdvancedOptions.ctl" and "DIOChannel.ctl"

Do you know where I can find these?

Thanks again!
__________________
Brett
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
I've Been Working on the Robot Lyrics ipdude General Forum 1 25-01-2006 12:36
Aha! I've got the first page of the manual! IMDWalrus Rumor Mill 13 10-01-2004 00:51
forget the hampsters, i've got a better idea... archiver 2001 13 23-06-2002 23:43


All times are GMT -5. The time now is 08:51.

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