Go to Post Just because you can doesn't mean you should. - pfreivald [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 18-02-2006, 14:33
NextPerception NextPerception is offline
Sleep-Deprived
AKA: Matt
FRC #0437 (Richardson Robotics)
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2005
Location: Richardson, TX
Posts: 69
NextPerception has a spectacular aura aboutNextPerception has a spectacular aura aboutNextPerception has a spectacular aura about
Send a message via AIM to NextPerception
How Can I aim at the Vision Target Faster but without overshooting?

We are using the camera so that the robot goes into a loop and moves the drive wheels until the camera tells us that it is centered. this lets us aim the robot at the light. I can get it to work but I can't get it to do it very fast. this is what i have so far right know.
Code:
  if  (aiming == 1 | p1_sw_trig == 1)
  {
    aiming = 1;
    Switch1_LED = 1;        // aiming light turns on when aiming
	if (p4_sw_trig == 1)
	{
      Switch1_LED = 0;
	  printf("override button pressed");
      aiming = 0;
    }
	else if (T_Packet_Data.confidence < 5)
    {
      Switch1_LED = 0;
	  printf("lost light lock");
      aiming = 0;
    }
    if (PAN_SERVO > PAN_CENTER_PWM_DEFAULT + 20)
    {
      pwm03 = 127 - aim_gain;
      pwm04 = 127 + aim_gain;
    } 
    else if (PAN_SERVO < PAN_CENTER_PWM_DEFAULT - 20)
    {
      pwm03 = 127 + aim_gain;
      pwm04 = 127 - aim_gain;
    } 
    else if (PAN_SERVO < PAN_CENTER_PWM_DEFAULT + 21 & PAN_SERVO > PAN_CENTER_PWM_DEFAULT)
    {
      pwm03 = 127 + aim_soft_gain;
      pwm04 = 127 - aim_soft_gain;
    }
    else if (PAN_SERVO > PAN_CENTER_PWM_DEFAULT - 21 & PAN_SERVO < PAN_CENTER_PWM_DEFAULT)
    {
      pwm03 = 127 - aim_soft_gain;
      pwm04 = 127 + aim_soft_gain;
    } 
    else 
    {
      Switch1_LED = 0;
	  printf("TARGET ACQUIRED");
      aiming = 0;
    }
  }
note that
aim_gain = 22 and aim_soft_gain = 15

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.
__________________
What is this S - L - E - E - P you speak of?
Battlebots - My Robotics Website

 


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