I am the only programmer on our team, and I have very limited experience. We have no programming mentors, either, and I am having a lot of problems with the camera.
We’re using LabView. I have 3 sample programs- 1 from NI, and 2 from teams. However, I still can’t manage to get one of them to work. We want our camera fixed to the robot- no servos. The entire robot will pivot as it searches for the target, then it goes forward and follows it.
Can anybody help with this? Even in the sample programs, I am having a difficult time understanding the code. Does anyone have a sample program with a LOT of comments that might help?
Even without a gimbal mount, I’d still recommend opening the Two Color Example. The servo control on the panel will update to show the new servo setpoint, but it will work fine without it.
If that example doesn’t show video and a good mask, then the problem is either with communications with the camera or camera setup.
Presumably that will work fine, and the next step will be integrating the vision portion of the example into the framework and replacing the gimbal setpoint with an encoder or pot setpoint and changing the loop to control a motor instead of a servo.
Post again with more specific questions/issues. I haven’t explained how the example works yet, but if your are going to use it I’ll be happy to answer more about it.
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
I might be wrong, but I think Jill wants to turn the whole robot instead of a turret. If so, you could just take the servo positions it calculates, subtract the ange that the program thinks is center, and turn your robot in the direction of the sign. If it’s negative, turn right. If it’s positive, turn left. You could use a set speed to turn at, or you could scale the degrees to motor speeds. Have a deadband so that once the value gets close to zero, the robot will stop turning.
Just a couple of thoughts off the top of my head, trying to think of the easiest way to do it.
this is what i have, but i need to attach an encoder because, the code resets itself and it keeps tearing my cables apart. how do i attach an encoder to this?.. http://tinypic.com/view.php?pic=25uu1qs&s=5