View Single Post
  #4   Spotlight this post!  
Unread 21-03-2016, 15:32
boz336 boz336 is offline
Electrical Engineer/Mentor
FRC #1599 (CircuiTree)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Richmond
Posts: 13
boz336 is an unknown quantity at this point
Re: Teleop Subroutine for semi-autonomous shooting

Following up on this thread...

It seems like a PID loop would be useful to control motors for this type of thing. Since we're reading joystick inputs in the Teleop vi, it seems like we would want to use an "auto target" button input from the joystick to:

1) Disable the normal controls for driving and shooter elevation
2) Output the Boolean state of the "auto target" button to a Robot Global Data variable that can then be read into a Periodic Task vi PID control loop.
3) Run a PID loop to move the robot (Tank drive and shooter elevation) so that the shooter is pointed at the target.
(There is a lot more to step 3 than meets the eye, but this is the gist)

Does this seem reasonable? My understanding is that a PID controller needs to be running in a while loop... and that while loops should not be run inside the Teleop vi. Based on another forum post, it sounds like it will be difficult to close a loop around the camera target inputs. The vision processing loop is processing data consistently under 200ms. This may not be fast enough.

Another related question would be: Is it better to read joystick inputs inside the Periodic Task vi than in the Teleop vi?
Reply With Quote