Go to Post Being a mentor doesn't have an age requirement. As long as you are positively influencing someone you could be called a mentor and a role model. - EricLeifermann [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 27-01-2007, 10:14
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Moving bot once targeted on the light

Hey, I have this piece of code
Code:
if( Get_Tracking_State() == CAMERA_ON_TARGET )
{
    Switch3_LED = 1;
    pwm10 = pwm08 = 135;
}
else
{
    Switch3_LED = 0;
    pwm10 = pwm08 = 127;
}
Really, it's just the code from the Process_Data_From_Master_uP() in user_routines.c that checks if the camera has targeted the light. pwm10 and pwm08 are the pwms that the wheels are connected to. I was hoping to get very slow movement by setting it to 135.

Once I found that didn't work. I tried controlling a small motor I setup to it that I had earlier controlled with a potentiometer. That to didn't work.

Any reason why this isn't working?

Thanks,
Jedd
Team 1551
  #2   Spotlight this post!  
Unread 27-01-2007, 11:24
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Moving bot once targeted on the light

Did you try setting the motor to 255? or 0?.. maybe 135 is just to close to neutral
  #3   Spotlight this post!  
Unread 27-01-2007, 11:26
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Moving bot once targeted on the light

Max is right. 135 is still within the deadband of the speed controller. I wouldn't try 255 on the first run, but a little more (say, 150) should definitely be enough to get the robot moving. See this page: http://www.ifirobotics.com/victor-88...r-robots.shtml
Quote:
The Victor 884 has a deadband with respect to the PWM signal, which is approximately 117 to 137 (127 center). Any PWM signal within the deadband results in no output (neutral).
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #4   Spotlight this post!  
Unread 27-01-2007, 11:38
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Moving bot once targeted on the light

Thanks.I should of mentioned two other things also.

1.) When I tried the motor I had set it to 255. But that didn't anything obviously

2.) When the camera picks up the light, it will slowly (but jumply, and jitterly) tilt upwards. As it does this, the red light blinks, instead of steadily staying on. So I suspect that it only is locked on momentarily to light, not giving enough time change the values of the pwms(?).

Sorry I didn't mention this in the first post.
  #5   Spotlight this post!  
Unread 27-01-2007, 13:59
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Moving bot once targeted on the light

Ok, I fixed problem 2! I'm still unsure of how to actually move the robot now though.
  #6   Spotlight this post!  
Unread 27-01-2007, 19:52
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Moving bot once targeted on the light

Is your default_routine() call uncommented? If so, something might be mapped to those PWMs, and you might be getting interference between your code and the mapping in default_routine().
__________________
  #7   Spotlight this post!  
Unread 27-01-2007, 22:46
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Moving bot once targeted on the light

Nope, it commented out...
  #8   Spotlight this post!  
Unread 27-01-2007, 23:42
abrockhoff abrockhoff is offline
Team 11 Programming Captain
AKA: Alex Brockhoff
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: New Jersey
Posts: 16
abrockhoff will become famous soon enough
Send a message via AIM to abrockhoff
Re: Moving bot once targeted on the light

make sure that there is no other drive code in that is setting your motors to joystick inputs later on in the code. you would have to comment those out.


just to make sure you realize this code will drive forward until the camera loses sight of the target. just don't want you to smash into anyone. :-D
  #9   Spotlight this post!  
Unread 29-01-2007, 01:58
Idaman323 Idaman323 is offline
In Theory, Our Robot Would Own.
FRC #1706
Team Role: Driver
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Wentzville, MO
Posts: 116
Idaman323 is an unknown quantity at this point
Re: Moving bot once targeted on the light

Question.

This code goes into the user_routines.c file of the workspace. Does this go into the same section where the mapping of the pwm's to the joysticks go? And if so, dont you just fix the problem by setting the pwms from the camera imput, AFTER the pwm mapping of the joysticks? Or is it more complicated than this? We are stuck on this same issue.
__________________
TEAM 1706
2007 Judges Award, St. Louis (For our amazing ability to have bad luck)
2005 Rookie Inspiration Award, St. Louis
  #10   Spotlight this post!  
Unread 29-01-2007, 02:08
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Re: Moving bot once targeted on the light

Try something other than 255... I believe 255 is a special value.

Try like 180, which is in the middle, way out of the deadband and not the maximum

Or, you could try 250, and see if the Victor light becomes red

(FYI: The Victor light is the most accurate source if you are stuck with a PWM value problem... that one light tells you a lot of info. If it is flashing orange, it's a 3-pin PWM cable problem, or it's set to a special value that disables it (like if your robot is detached). If it's completely off once you run the code, the motors are running slowly or half-speed. If it's solid orange, they are inside the deadband or completely stopped. If it's bright red or green, it's running full power in forward or reverse.)
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...
  #11   Spotlight this post!  
Unread 30-01-2007, 12:33
pheadxdll pheadxdll is offline
Registered User
AKA: Alex
FRC #1225 (Amperage Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: North Carolina
Posts: 168
pheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud of
Re: Moving bot once targeted on the light

I found that CAMERA_ON_TARGET state goes on and off too much to do any good. I've tried this state and it works realiby:

Code:
if( Get_Tracking_State() == SEARCHING)
{
    pwm10 = pwm08 = 127;
}
else
{
    pwm10 = pwm08 = 135; // 135 is nothing unless its a really geared down motor :)
}
The SEARCHING state works great and I was able to keep a spike on with relay output.
__________________
Amperage Robotics Team 1225
Site under-going revamp. :/
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
Keepers in Teleoperated mode burkey_turkey Rules/Strategy 47 05-03-2007 12:56
camera trouble,cant tell the green-light from regular white light Nimmy Programming 26 14-01-2007 14:53
How will the Balls Change once FIRST Paints them Mr.G General Forum 28 24-01-2006 23:07
Moving the Nats. Date? roboTICKS-236 General Forum 4 19-03-2003 22:49
ONCE AGAIN, EVERYONE TELL ME THE ANSWER! =) archiver 2001 2 24-06-2002 02:42


All times are GMT -5. The time now is 03:55.

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