My team has succesfully gotten an Axis Camera tracking. It returns to us normalized x,y cordinates, and distance away. The programmer in charge of the camera wants to know what Values she exports to PID.
What values do I need for the PID fuction?
What would I export from the camera in order to use azmith control.
PID control is used to keep a value in a certain range (eg speed, position ect…) you would probably want to use the x difference and y difference values separately (difference being between the observed position and desired position) then you can use the output to control the x and y motors respectively, be careful because unless metered the PID can “wind up” if its in an extreme value too long causing it to want to over shoot and possibility “oscillate” more info here
For azimuth control, use the X value from the vision processing.
Is your shooter on a rotating turret, or will you need to turn the entire robot in order to aim? If the former, is the camera on the turret as well, or fixed to the robot base?
If the camera moves with the turret, and the turret rotation is controlled by a single motor, the situation is pretty straightforward. The x value from the vision control tells you the horizontal distance and direction to where you want the turret to point. Use it as the feedback or “process variable” input to the PID. The setpoint would just be 0, as that represents the center of the video image. Given appropriate PID gains, the output will drive the motor until the target is centered.
Watch out for the amount of time it takes the vision processing to do its job, though. If your turret moves too quickly, it will overshoot the target before you find out that it was correctly pointed a half second ago. If you have some sort of physical feedback on the turret position itself, it can be a lot more effective to use the vision x value to decide how far to move the turret then compute a specific setpoint as a delta from its current location, and use PID to drive the turret so the feedback gets to that setpoint.