Go to Post How easy will it be for a driver to control 5-6 different motions at once? Most drivers only have two hands. - Kevin Sevcik [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-02-2007, 23:44
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
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   Spotlight this post!  
Unread 18-02-2007, 21:17
Ken Streeter's Avatar
Ken Streeter Ken Streeter is offline
Let the MAYHEM begin!
FRC #1519 (Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Team: Milford, NH; Me: Bedford, NH
Posts: 468
Ken Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond repute
Re: How Can I aim at the Vision Target Faster but without overshooting?

Quote:
Originally Posted by Alan Anderson View Post
Wow. I've been going from the official IFI documentation which says the Victor deadband is 117-137. I never gave it a second thought. But that would perfectly explain the asymmetric PID response I wrestled with a week ago.
Add our voice of experience to testify that the "true neutral" we have seen on the Victors is at 132, rather than 127. We repeated this test with many Victors from the last three years and have found all of them to have a true neutral of 132 rather than 127. Similarly, the "deadband" range is actually 125 to 138 (an average of ~132) rather than 117-137 as described by IFI's documentation.

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
__________________
Ken Streeter - Team 1519 - Mechanical Mayhem (Milford Area Youth Homeschoolers Enriching Minds)
2015 NE District Winners with 195 & 2067, 125 & 1786, 230 & 4908, and 95 & 1307
2013 World Finalists & Archimedes Division Winners with 33 & 469
2013 & 2012 North Carolina Regional Winners with teams 435 & 4828 and 1311 & 2642
2011, 2010, 2006 Granite State Regional Winners with teams 175 & 176, 1073 & 1058, and 1276 & 133
Team 1519 Video Gallery - including Chairman's Video, and the infamous "Speed Racer!"

Last edited by Ken Streeter : 18-02-2007 at 21:18. Reason: Fixed typos...
  #3   Spotlight this post!  
Unread 19-02-2007, 21:00
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
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   Spotlight this post!  
Unread 18-02-2006, 20:55
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: How Can I aim at the Vision Target Faster but without overshooting?

Quote:
Originally Posted by NextPerception
The code makes the robot overshoot and oscillate back and forth. it takes ten or more seconds to get it to center and this is not very good.

I know there is a way to use a linear or even quadratic formula to increase the speed and to reduce the amount of overshoot instead of what i have i just don't know how to go about programming it. Any help would be vary much appreciated.
Here's a piece of code from the camera software (tracking.c) that implements a simple proportional controller:

-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);
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 20:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi