View Single Post
  #14   Spotlight this post!  
Unread 02-02-2014, 16:48
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Thread scheduler for PID period control ?

When you create a task and put it in a loop with a delay, the delay is subject to the resolution of the system clock (which is 10ms). So a request to delay for 20ms would have considerable variation. The system is waiting for two clock ticks which could happen in a little over 10ms or a little under 30ms.

The PID class does not use delays, instead it uses the timer OS libraries (last I looked). These fire in the context of the tick timer interrupt routine and are more periodic. The first PID timer callback may run at a variable time after enabling but it will run very periodically afterwards. Does that make sense?

The operating system does have a higher resolution timer (the auxiliary timer) for custom purposes. It is not used by the base OS. And perhaps NI built a service on top of the the auxiliary timer. Plus there is normally a third timer only used for timestamps. But the base timers work as described above.

The periodicity of the messages from the DS is dependent on many things. Ethernet is not strictly deterministic. The teleop loops start after a semaphore is given once the code on the cRIO processes an incoming message and the data is available.

HTH
__________________
Fast, cheap or working - pick any two!

Last edited by wireties : 02-02-2014 at 16:53.
Reply With Quote