View Single Post
  #4   Spotlight this post!  
Unread 10-02-2009, 16:38
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: Still can't get the camera to track

Thought so. And glad to hear that the vision works.

The first thing is to determine the feedback, it could be an encoder, or it could be a pot.

The vision loop currently calls the State Machine subVI that has about five states that should be simplified if it is a 1D rotary mount. The search should pan from current location to one of the motor limits, then pan to the other, probably back and forth until it locks on. Because the camera can't take good images when it is moving really fast, you probably still want to limit the velocity as it is currently doing.

Once located, it will update the setpoint of the encoder/pot based on the pixel to encoder scaling needed. The 15 and -13 proportional numerics on the panel are what to divide the pixel difference by in order to get the amount to move the servo or other motor. That was assuming it was mapping to degrees for the servo. To map to other encoder ranges you will need to change this number to tune it. In fact, since a motor and encoder don't have PID built in where a Servo does, you will probably want to put a PID into the loop to control the motor. You may also want to remove the deadband and the smoothing.

Greg McKaskle

The loop that updates the servo should change to take an en
Reply With Quote