View Single Post
  #32   Spotlight this post!  
Unread 14-12-2010, 23:03
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Mecanum - use of gyro

Quote:
Originally Posted by Jon236 View Post
Greg,

I'm curious....why does the PID.vi itself use a regular while loop, rather than a timed loop?
In this case, the While loop is actually not used to loop the PID function (if it were, the PID function would never get new inputs). It is instead simply for its shift registers. Note that the loop is set to end on the first iteration, and none of the shift registers are initialized (meaning they retain their values between calls).
It is also a reentrant VI, storing the shift register data separately for each instance.

The other way to accomplish this is to use feedback nodes (found in the structures palette). However, shift registers often create cleaner and more readable code, and so are more commonly used.
__________________
-- Marshal Horn
Reply With Quote