View Single Post
  #5   Spotlight this post!  
Unread 30-01-2011, 14:20
Acarid Acarid is offline
<3 Nested Clusters
FRC #2521
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Eugene, Oregon
Posts: 10
Acarid is an unknown quantity at this point
Re: PID need someone to look it over.

I think I have a basic understanding of what it's doing, although the details are beyond me. I think the code can be cleaned up a little, if nothing else.

Near the end, you are using case structures to decide which wire to use. Take a look at this block, it might be more suited for this.
http://zone.ni.com/reference/en-XX/h.../glang/select/

Also the giant case structure in the middle... I'd be tempted to put the buttons into a boolean array, then convert that array to a number, then put that number into a single case structure which can select the constant. This was used pretty elegantly in the example line following code.

Also it seems a little messy to run the process value into the setpoint as a method of making it not move. I'm not sure I understand the goal, but perhaps removing the first case and instead making one around that PID would be better.

Hope this helps... My confidence is a little shot by Alan's reply...
Reply With Quote