View Single Post
  #10   Spotlight this post!  
Unread 31-01-2013, 13:24
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 52
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
Re: Velocity PID Programming: Terms dependent on time

Quote:
Originally Posted by Ether View Post
1) how many layers of code are wrapped around each of these timers
Generally 2 layers + the hardware or whatever the black box routines require. WPILib -> ChipObject (FPGA timer), WPILib -> NI (PPC timer), and WPILib -> vxWorks. All of the WPILib routines are short enough to be inlined for free, but the code structure doesn't allow it.

Quote:
Originally Posted by Ether View Post
2) can each one be used in a critical section
WPILib uses these routines outside of critical regions, so I assume they are either lock-free or have their own independent locks.

Quote:
Originally Posted by Ether View Post
3) how long does each take to execute, and

4) is there anybody who has authoritative answers to these questions
Testing may be the best way to answer these questions, but I'm also curious about the recommended/official way to handle time. It looks like the FPGA clock is preferred since the other ways of grabbing a timestamp aren't used by WPILib except in Vision. I'll collect some data on our cRIOs tomorrow.