|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: How Can I aim at the Vision Target Faster but without overshooting?
WAIT! Does that mean all of my pwm values centers are 132 and not 127? That makes thigns very different!
|
|
#2
|
|||||
|
|||||
|
Re: How Can I aim at the Vision Target Faster but without overshooting?
Quote:
For PID control, the difference in a "center point" of 132 vs. 127 makes a huge difference. We have confirmed this with many victors from the last few years. For software control, we are certain that you do NOT want to run the IFI "calibration" procedure, but instead should simply use a center point of 132, with a "deadband" of 6-7 units. A past thread from Mike Betts which provides a graph of some detailed tests he ran to confirm this is in this post from 2005. We don't know whether the source of the error (132 vs 127) is due to the PWM signals being generated that way by the RC, or if the problem is in the Victor itself. We don't have an oscilloscope to track down the source of the issue, but our empirical studies are quite conclusive that 132 is the appropriate center point for PID control loops. --ken Last edited by Ken Streeter : 18-02-2007 at 21:18. Reason: Fixed typos... |
|
#3
|
|||
|
|||
|
Re: How Can I aim at the Vision Target Faster but without overshooting?
Ok, about encoders. They are physical Things? Or is it just code? I think an encoder would suit me very well since I am usnig a forkilft apparatus and I want to stop the forklift at 4 positions. 3 for the different layers of the SPIDER and one for starting position. I think I could write the code for it, but is an encoder an actual thing that I have to put on the motor? Does it come with the kitofparts?
might be a silly question, but I'm running outta time and i would like to know since my metallic sensor doesn't function. If all else fails I can use a limit switch (I have two I think) for the bottom and top positions, but I dont think i'd be able to use more for the other 2 positions of the forklift since theres no place to but them...maybe...I think encoder would be easier...right? Thanks |
|
#4
|
||||
|
||||
|
Re: How Can I aim at the Vision Target Faster but without overshooting?
Quote:
-Kevin Code:
static unsigned char pan_servo_position;
int temp_pan_servo;
int servo_step;
int pan_error;
// save the current pan servo PWM value into a local
// integer variable so that we can detect and correct
// underflow and overflow conditions before we update
// the pan servo PWM value with a new value
temp_pan_servo = (int)pan_servo_position;
// calculate how many image pixels we're away from the
// vertical center line.
pan_error = (int)T_Packet_Data.mx - (int)Tracking_Config_Data.Pan_Target_Pixel;
// Are we too far to the left or right of the vertical
// center line? If so, calculate how far we should step
// the pan servo to reduce the error.
if(pan_error > (int)Tracking_Config_Data.Pan_Allowable_Error)
{
// calculate how far we need to step the pan servo
servo_step = pan_error / (int)Tracking_Config_Data.Pan_Gain;
// Due to rounding error in the division calculation above,
// the step may be calculated as zero, which will make it
// impossible to converge on the target when x_error is
// smaller than X_GAIN. To get around this problem, we just
// test for the zero case and set the step size to one.
if(servo_step == 0)
{
servo_step = 1;
}
}
else if(pan_error < -1 * (int)Tracking_Config_Data.Pan_Allowable_Error)
{
// calculate how far we need to step the pan servo
servo_step = pan_error / (int)Tracking_Config_Data.Pan_Gain;
// Due to rounding error in the division calculation above,
// the step may be calculated as zero, which will make it
// impossible to converge on the target when x_error is
// smaller than X_GAIN. To get around this problem, we just
// test for the zero case and set the step size to one.
if(servo_step == 0)
{
servo_step = -1;
}
}
else
{
// if we've fallen through to here, it means that we're
// neither too far to the left or too far to the right
// of the vertical center line of the image and don't
// need to move the servo
servo_step = 0;
}
// add the step to the current servo position, taking into
// account the direction set by the user in tracking.h
temp_pan_servo += ((int)Tracking_Config_Data.Pan_Rotation_Sign * servo_step);
// check the pan servo PWM value for under/overflow
if(temp_pan_servo < (int)Tracking_Config_Data.Pan_Min_PWM)
{
temp_pan_servo = (int)Tracking_Config_Data.Pan_Min_PWM;
}
else if(temp_pan_servo > (int)Tracking_Config_Data.Pan_Max_PWM)
{
temp_pan_servo = (int)Tracking_Config_Data.Pan_Max_PWM;
}
pan_servo_position = (unsigned char)temp_pan_servo;
// update pan servo PWM value
Set_Pan_Servo_Position(pan_servo_position);
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Durability of Vision Target | geeknerd99 | General Forum | 13 | 11-02-2006 14:15 |
| Vision Target Assembly | platt | Kit & Additional Hardware | 4 | 26-01-2006 17:34 |
| Vision Target power supply | AUWarEagle#1 | Electrical | 3 | 18-01-2006 22:17 |
| Question concerning vision target | Otrobotics | General Forum | 17 | 15-01-2006 15:59 |