View Single Post
  #4   Spotlight this post!  
Unread 11-02-2009, 15:08
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Help with the camera

The subVI called something like Servo Tracking State Machine, has values on the front panel to control how the gimbal moves.

The Upper Limit and Lower Limit are servo angles limiting the setpoints read by the other loop. In other words, if you don't want the gimbal to look down, you'd change the lower limit Y from 40 to 85 or so. If you don't want it to look up, you'd change the upper limit Y from 130 to 100 or something.

In case I misunderstood the question, let me give info on the other values on the panel which are not parameters. First are the Proportional numbers. These control how much the servo moves and which direction it moves when it isn't centered. To make the servo more responsive, lower the number, to slow it down and avoid oscillation, raise it. The Search Speed number determines how quickly the gimbal will move when not following a target. If set too high for a slow frame rate, you will get a blurry image or will complete skip past a target.

Finally, the attachment shows the code that does the search. It is run when the current frame doesn't have a recognizable target, and the recent frames didn't either. After some time, the servo control gives up and decides to look around in the (searching) state. The small code snippet there implements a squished spiral, which may not be the best way of doing it for this competition, but the math is cool and it works well for a bench test.

Feel free to change this searching math to whatever seems right. The default code takes 85, 85 which is the center spot of the servo, and adds the offset of the spiral in increments of .2 radians for 100 steps, then it stops and changes states to Search-Begin which centers the servos again.

If you just want the spiral to be bigger, increase the 100 to do more steps before stopping. If you want it to go faster, increase the 0.2. Or like I said, maybe you just want to do a pan from one side to the other.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Picture 5.png
Views:	41
Size:	22.1 KB
ID:	7402  
Reply With Quote