Go to Post As we were lying the robot down to work on it "CAD me like one of your french robots" - 1uan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-11-2014, 12:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: Swerve questions (Languages, CAN)

Quote:
Originally Posted by Jared View Post
Your encoder will need to be used with the FPGA or with interrupts in order for it to work properly. Your user code which runs on the CPU would need to run impractically fast to decode the encoder PWM.

You have a few options to try to decode this signal

You can do what Ether recommended, and try to use interrupts. This is likely more difficult than it sounds to get everything working properly. Also, interrupts and less commonly used features are likely the last priority of the roboRIO development team and beta testers, so you may encounter strange, hard to diagnose issues with interrupts.

You could also attempt to read the encoder on a separate device, like an arduino or basic stamp. There are likely software libraries that exist for reading an encoder like this already. If not, you could likely write your own using the "pulseIn()" function on the arduino. You can connect the arduino to the roboRIO through a serial connection very easily.
Hi Jared,

Good suggestion. The arduino (or other microcontroller) could certainly decode the PWM pulse width. (Complexity and cost should be factored into any final decision.)

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.

FTR, I wasn't recommending using interrupts (on the RIO). I was trying to discourage that idea.



Last edited by Ether : 28-11-2014 at 14:12.
  #2   Spotlight this post!  
Unread 28-11-2014, 16:22
bharrison6 bharrison6 is offline
Registered User
FRC #3843
 
Join Date: Jan 2014
Location: Murray Ky
Posts: 37
bharrison6 is on a distinguished road
Re: Swerve questions (Languages, CAN)

we haven't got the encoders in yet perhaps we will just get the analog encoder instead which should reduce complexity significantly. thanks for all the responses I'll give you an update once we get the encoders In and get this thing running. we are currently making a wooden prototype Of our new pod as we speak

Thanks Bryant
Closed Thread


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 23:45.

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