Go to Post Tell them your newfound passion for FIRST as a program, and let them know all you're doing is getting more involved to broaden your FIRST horizon - Dorienne [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-2009, 15:44
Stefano Stefano is offline
Registered User
FRC #1996
 
Join Date: Jan 2009
Location: Italy
Posts: 2
Stefano is an unknown quantity at this point
Make servos faster

Hey guys, our robot successfully tracks the target, but when it drives towards it in autonomous, if the speed is high, the robot is likely to lose its target, because the servos do not move fast enough to keep the target in the camera vision.
Is there any method to improve the servos' speed?

Thanks.
  #2   Spotlight this post!  
Unread 27-01-2009, 15:55
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Make servos faster

I'm most familiar with the LV code, so that is what I'll describe. The same stuff is often happening in the C++ example code too.

The servo control VI has proportional constants on its panel. I believe the LV ones are a dividing proportion, so smaller number will lead to bigger delta per pixel away from center. I'd keep the robot still, on blocks or unplugged in order to isolate the servos. Then decide on a repeatable movement, perhaps automated, perhaps approximated by a distance and tempo.

Lower the proportion number and you should see the servo speed up with small changes, and then become unstable as the servo overshoots and starts a feedback. The other thing you can do to speed it up is to turn off the smoothing, and perhaps the deadband. The smoothing will introduce a small lag, and the deadband will allow a small uncorrected error, but I wouldn't expect either the slow the servo. On the other hand, doesn't take long to test.

Beyond that, it is a function of the servo HW.

Greg McKaskle
  #3   Spotlight this post!  
Unread 27-01-2009, 15:59
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: Make servos faster

The servos from the kit do there full rotation in something like a half a secound. So my guess is whats limiting you is the speed of your tracking code, not the servo itself.
  #4   Spotlight this post!  
Unread 27-01-2009, 17:00
CDH Jeff's Avatar
CDH Jeff CDH Jeff is offline
Registered User
FRC #2450 (Raiderbots)
Team Role: Electrical
 
Join Date: Feb 2008
Rookie Year: 2008
Location: St. Paul
Posts: 35
CDH Jeff is an unknown quantity at this point
Re: Make servos faster

this site may have the servos you want, im not really sure what some of the stuff means, but you could probably find what you need/want. http://servocity.com/html/servos___accessories.html
__________________
"why are 'standard' and 'metric' different?! metric should be the standard!"
  #5   Spotlight this post!  
Unread 27-01-2009, 17:49
Stefano Stefano is offline
Registered User
FRC #1996
 
Join Date: Jan 2009
Location: Italy
Posts: 2
Stefano is an unknown quantity at this point
Re: Make servos faster

Jetweb, I agree, but how can I set the speed of the servos in C++?
In the CProgrammingReference.chm file I see that the Servo class implements a speed controller, but I don't know how to interface that, partially because of the lack of documentation.
  #6   Spotlight this post!  
Unread 27-01-2009, 18:01
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: Make servos faster

As far as i know there is no speed control for the servos, they will get to where you tell them to go as fast as mechanically possible.

The sad truth is whats slowing you down is the camera. you have to optomize your tracking code as much as you can but even then the image analyzation is still really slow in relitave term.

We moved the camera to the far back of the robot in toder to give it a better perspective and more time to react to changes.

sorry i cant be of more help, maybe someone else has a good idea.

Last edited by Jetweb : 27-01-2009 at 18:06. Reason: spelling
  #7   Spotlight this post!  
Unread 27-01-2009, 18:29
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Make servos faster

This is not neccesarily true--one can program a servo to work at a certain speed. For example, if you wanted a servo to move to the position represented by 1.0 from the position represented by -1.0. You could do this by
  1. Setting the servo to 1.0
  2. Using a loop to set the servo to -0.9, then -0.8, etc

If you're using the second method, you should be able to move your servos faster by increasing the amount they move per cycle.

Another thing to keep in mind is that if the you're getting a low frame rate due to processing delay, it's pretty easy for the target to leave the frame, since the system can't update the servos. Something you might want to try is predictive tracking--say, if the 10 previous frames have involved the target moving in a given direction, you can make an assumption and move your camera before processing based on an estimation of the movement speed.
__________________
Get yer robot source code here!
  #8   Spotlight this post!  
Unread 06-02-2009, 08:56
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: Make servos faster

Quote:
Originally Posted by Greg McKaskle View Post
I'm most familiar with the LV code, so that is what I'll describe. The same stuff is often happening in the C++ example code too.

The servo control VI has proportional constants on its panel. I believe the LV ones are a dividing proportion, so smaller number will lead to bigger delta per pixel away from center. I'd keep the robot still, on blocks or unplugged in order to isolate the servos. Then decide on a repeatable movement, perhaps automated, perhaps approximated by a distance and tempo.

Lower the proportion number and you should see the servo speed up with small changes, and then become unstable as the servo overshoots and starts a feedback. The other thing you can do to speed it up is to turn off the smoothing, and perhaps the deadband. The smoothing will introduce a small lag, and the deadband will allow a small uncorrected error, but I wouldn't expect either the slow the servo. On the other hand, doesn't take long to test.

Beyond that, it is a function of the servo HW.

Greg McKaskle

Could you explain more specificly how to do those changes in the VI (searched for "Servo Control.vi", but realized it was "Set Position.VI")? Some images of the explanation would really help.
Plus, how diffrent is Set Position.vi compared to the servo control loop in the Two Color Servo Camera Example?

Thanks.
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
  #9   Spotlight this post!  
Unread 06-02-2009, 09:59
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: Make servos faster

Greg,

I want to echo Nir's question. When I open the front panel, I set a PWMDevRef with min's, max's, angular range and transforms, but no proportionality constant. I'm not sure we can can make changes there.

I can see how to add a proportionality constant to the set position vi, but then we would be writing to a library VI, which would be overriden with an update.
__________________
Jon Mittelman

Senior Judge Advisor New England & Israel 2014-2015
Infinite Loop Mentor 2011-2015
TechnoTicks Mentor 2000-2011
Championship Chairman's Award 2009 Team236 TechnoTicks
Judge 2010-2015 Championships
Senior Judge Advisor New England District Championship 2014-2015
Judge Advisor Tel Aviv Regional 2007-2015
Judge Advisor Pine Tree Regional 2013
Maine Regional Planning Committee
New England District Planning Committee
Lead Inspector Microsoft Tel Aviv Regional 2006-2008
Judge & Lead Inspector GM/Technion Tel Aviv Regional 2006
Judge UTC Hartford Regional 2006
  #10   Spotlight this post!  
Unread 06-02-2009, 12:41
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,587
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Make servos faster

Greg's changes were in the Gimbal Control VIs in the camera examples. (The OP's question was really how to search for the target faster, not how to make servos faster, so that is what Greg answered).

If you are using the servo commands directly (and applying a big enough change), you can't make the physical system any faster.
  #11   Spotlight this post!  
Unread 06-02-2009, 12:49
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Make servos faster

I'm sorry for the cofusion, but I wasn't referring to the Set Angle subVI. I was really referring to the control VI for the servos. It is called Servo Tracking State Machine.

It is an example of taking the current image results, combining it with info from previous results and robot state to determine how best to control the servo based gimbal.

The proportional values are on that panel.

The difference between set position and set angle is that one is integer degrees I believe, and the other is float -1 to 1 I think.

Greg McKaskle
  #12   Spotlight this post!  
Unread 09-02-2009, 20:11
Kaushal.K's Avatar
Kaushal.K Kaushal.K is offline
Scouting & Things
AKA: kkaboose
FRC #1241 (THEORY 6)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Toronto, ON, Canada
Posts: 42
Kaushal.K is an unknown quantity at this point
Re: Make servos faster

I was wondering if somebody could post a print screen or give me the relative location of the Proportional constants (in LV) that the camera servo's are using... also based on our programming teams understanding, the camera servo speeds up after every loop that the camera does not obtain a target, I was wondering if our understanding is correct.

We tried changing the numbers for some values which seem to be the proportional constants but we did not see any noticable difference in the speed of the servo. (there was one for the X servo and another for the Y servo... they were linked to a multiply function which was located in the middle loop of the Servo Tracking State Machine.

EDIT: Thanks for the help guys...
__________________
FRC Volunteer Coordinator (2015 - Present)
FRC Robot Inspector (2012 - Present)
FRC 1241 - Alumni & Mentor (2007-Present)

Last edited by Kaushal.K : 09-02-2009 at 23:17. Reason: Don't want to waste another post to say thanks
  #13   Spotlight this post!  
Unread 09-02-2009, 20:40
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Make servos faster

The control is called Proportional (div) which means that it is the divisor version. It is located on the Servo Tracking State Machine.vi. The default values are 15 for X and -13 for Y. If you make the numbers larger, the P term will actually be reduced. If you make them smaller, the P term will actually be larger. Feel free to type in fractions too.

If you negate the numbers, the servos will move the opposite direction for a given error -- useful for upside down gimbals and such.

Greg McKaskle
  #14   Spotlight this post!  
Unread 10-02-2009, 07:16
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: Make servos faster

I'm currently using a mechnical method of timing the time it takes for the servo to reach from one side to the other by measuring the time from the moment the joystick button was pressed and untill the camera touched a microswitch located at the edge of the camera's servo opposite side.

I know there are the data sheets, but you can't always trust things to work the way they say it should work, right?

If there is another way to check this, please advise.

Thanks,
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
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
2 Motors is Faster?! =Martin=Taylor= Technical Discussion 43 06-01-2009 19:14
pic: Faster Than A Speeding Bullet Athleticgirl389 Extra Discussion 10 04-03-2008 17:55
When a Robot Does Rounds Patients Get Faster Discharge JohnBoucher Math and Science 0 16-07-2007 08:03
One Side Drives Faster than the Other. Craig1989 Technical Discussion 18 12-02-2007 12:19
Which is faster? Gary Bonner Programming 4 27-02-2005 00:51


All times are GMT -5. The time now is 21:53.

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