Go to Post Duct tape is like the Force - it has a dark side and a light side and it holds the universe together. - Jnadke [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 Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 15-04-2014, 07:40
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: using interrupts in FRC

In '08, for the introduction of the cRIO, some AEs built an ambitious robot named NItro. It had three omni wheels with encoders and they decided to use NI Soft Motion and interrupts to calculate the Jacobian for the motor control values for path planning.

I came on late to help them finish the project and found that they weren't acknowledging the interrupts but were still running fine. I also found that they were running over 15k interrupt handlers per second, but again, running fine. At the booth, they ran the robot all day long in its wooden pen going through battery after battery.

This was with LV, so I cannot comment on the C++ handlers, and this was before the FRC FPGA was complete, so it is not apples to apples.

Anyway, interrupts are in the product and should work. If you have issues, please provide details so that we can improve them or their documentation.

Greg McKaskle
  #17   Spotlight this post!  
Unread 15-04-2014, 09:25
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: using interrupts in FRC

Quote:
Originally Posted by Alan Anderson View Post
.....you wouldn't have needed to do any special programming. The FPGA lets you define a digital input pin as an encoder reset signal.
Alan,

Would you provide more information about how to do this? Links to docs would be great. C++

Thanks.

-Hugh
  #18   Spotlight this post!  
Unread 15-04-2014, 10:59
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: using interrupts in FRC

Quote:
Originally Posted by Alan Anderson View Post
.....you wouldn't have needed to do any special programming. The FPGA lets you define a digital input pin as an encoder reset signal.
Quote:
Originally Posted by Hugh Meyer View Post
Would you provide more information about how to do this? Links to docs would be great. C++
It's obvious and straightforward in LabVIEW. The External Reset input terminal, and its associated polarity select, are at the top of the Encoder Open function icon.

In Java, some of the Encoder constructors accept a third Digital Input to specify the index signal.

In C++, it looks like the reset/index feature is not exposed in the Encoder class. That's unfortunate. I don't know enough about the low-level resource interface to the FPGA to be comfortable trying to suggest adding a new constructor that includes it.
  #19   Spotlight this post!  
Unread 15-04-2014, 11:12
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,188
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: using interrupts in FRC

Quote:
Originally Posted by Alan Anderson View Post
It's obvious and straightforward in LabVIEW. The External Reset input terminal, and its associated polarity select, are at the top of the Encoder Open function icon.

In Java, some of the Encoder constructors accept a third Digital Input to specify the index signal.

In C++, it looks like the reset/index feature is not exposed in the Encoder class. That's unfortunate. I don't know enough about the low-level resource interface to the FPGA to be comfortable trying to suggest adding a new constructor that includes it.
Is this edge triggered or will it clamp to 0 whenever the input is active? The former seems better as you can travel over the sensor and be fine (so long as you don't go past the sensor. )
  #20   Spotlight this post!  
Unread 15-04-2014, 11:24
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: using interrupts in FRC

Quote:
Originally Posted by Tom Bottiglieri View Post
Is this edge triggered or will it clamp to 0 whenever the input is active?
The LabVIEW help suggests that the External Reset is level sensitive, meaning it should continuously zero the encoder value as long as it is active. I can't verify that with complete certainty using the documentation I have access to.
  #21   Spotlight this post!  
Unread 15-04-2014, 11:49
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: using interrupts in FRC

Alan – Thanks for pointing out this feature. We were attempting to use an index pulse in C++ this past season but could not find how to reset the encoder count with an index pulse. We didn’t think to look in Java and Labview.

Hey Greg, how about exposing the index function in C++ for us C++ users?

-Hugh
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 02:38.

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