Go to Post Temp wiring is always bad but it is made worse when dealing with a $1000 part. You wouldn't try to lash a makeshift power source to your PC. - Al Skierkiewicz [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 23-02-2006, 21:30
ForgottenSalad's Avatar
ForgottenSalad ForgottenSalad is offline
In search of a home...
AKA: Michael Wessler
no team
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Bethlehem, NH
Posts: 136
ForgottenSalad will become famous soon enoughForgottenSalad will become famous soon enough
Send a message via AIM to ForgottenSalad
Finding servo location?

Just as a quick question, seeing as I never got to test my code, would getting the location of the servo be as simple as
Code:
printf("Servo Location is... %d\r", pwm01)
or would I have to do something more to find where it is betweeen 0 and 255...?
  #2   Spotlight this post!  
Unread 23-02-2006, 21:38
bush's Avatar
bush bush is offline
Registered User
AKA: Aaron
FRC #0710 (Pine Crest School)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Fort Lauderdale, Florida
Posts: 42
bush has a spectacular aura aboutbush has a spectacular aura about
Send a message via AIM to bush
Re: Finding servo location?

that works
  #3   Spotlight this post!  
Unread 23-02-2006, 22:10
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,588
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: Finding servo location?

Code:
printf("Servo Location is... %d\r", (int)pwm01)
  #4   Spotlight this post!  
Unread 24-02-2006, 16:21
JJG13's Avatar
JJG13 JJG13 is offline
Yoda
AKA: Joshua Graffman
None #0180 (SPAM)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Martin County, Florida
Posts: 105
JJG13 has a spectacular aura aboutJJG13 has a spectacular aura aboutJJG13 has a spectacular aura about
Re: Finding servo location?

Quote:
Originally Posted by ForgottenSalad
Just as a quick question, seeing as I never got to test my code, would getting the location of the servo be as simple as
Code:
printf("Servo Location is... %d\r", pwm01)
or would I have to do something more to find where it is betweeen 0 and 255...?
First of all what are you trying to do? If you are setting a value to pwm01 and then printing it out later, this should work. However, you can't physically read the current position of the servo motor. Neither the hardware or software support this.
__________________
Behold the power of SPAM.
  #5   Spotlight this post!  
Unread 26-02-2006, 19:18
rodgadashruba rodgadashruba is offline
Registered User
FRC #0611
 
Join Date: Jan 2006
Location: McLean
Posts: 17
rodgadashruba is an unknown quantity at this point
Re: Finding servo location?

Quote:
Originally Posted by JJG13
However, you can't physically read the current position of the servo motor. Neither the hardware or software support this.
wait so there is no way to tell where the camera, like to read what position the tilt servo is at?
  #6   Spotlight this post!  
Unread 26-02-2006, 19:20
bush's Avatar
bush bush is offline
Registered User
AKA: Aaron
FRC #0710 (Pine Crest School)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Fort Lauderdale, Florida
Posts: 42
bush has a spectacular aura aboutbush has a spectacular aura about
Send a message via AIM to bush
Re: Finding servo location?

You can. Just read the value of the PWM - in Kevin's code, the position is in the variable TILT_SERVO and PAN_SERVO
  #7   Spotlight this post!  
Unread 26-02-2006, 19:21
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Finding servo location?

If you are using the onboard motor control (PWM) to move the camera servos, you can put that printf right after the line that modifies that outputs value (make sure it is before the PutData !!)

If you are using the servo controller on the camera, you will have to ask the camera for what the current servo value is.
  #8   Spotlight this post!  
Unread 26-02-2006, 19:47
rodgadashruba rodgadashruba is offline
Registered User
FRC #0611
 
Join Date: Jan 2006
Location: McLean
Posts: 17
rodgadashruba is an unknown quantity at this point
Re: Finding servo location?

Quote:
Originally Posted by bush
You can. Just read the value of the PWM - in Kevin's code, the position is in the variable TILT_SERVO and PAN_SERVO
well i tried that in user routines, in the default code funtion. the code compiles just fine but when i add int he comman

int testTest = PAN_SERVO ;
or
static int testTest = PAN_SERVO;

i get syntax errors
is there a way to access these varible outside of tracking.c?
  #9   Spotlight this post!  
Unread 26-02-2006, 20:05
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Finding servo location?

Quote:
Originally Posted by rodgadashruba
well i tried that in user routines, in the default code funtion. the code compiles just fine but when i add int he comman

int testTest = PAN_SERVO ;
or
static int testTest = PAN_SERVO;

i get syntax errors
is there a way to access these varible outside of tracking.c?
Paste the whole file where you put this line of code.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #10   Spotlight this post!  
Unread 26-02-2006, 20:24
rodgadashruba rodgadashruba is offline
Registered User
FRC #0611
 
Join Date: Jan 2006
Location: McLean
Posts: 17
rodgadashruba is an unknown quantity at this point
Re: Finding servo location?

alright its attached
its down where it is commented out for the aim up code
Attached Files
File Type: txt user routines.txt (18.0 KB, 21 views)

Last edited by rodgadashruba : 26-02-2006 at 20:29.
  #11   Spotlight this post!  
Unread 26-02-2006, 20:44
ForgottenSalad's Avatar
ForgottenSalad ForgottenSalad is offline
In search of a home...
AKA: Michael Wessler
no team
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Bethlehem, NH
Posts: 136
ForgottenSalad will become famous soon enoughForgottenSalad will become famous soon enough
Send a message via AIM to ForgottenSalad
Re: Finding servo location?

Quote:
Originally Posted by rodgadashruba
alright its attached
its down where it is commented out for the aim up code
Don't you have to declare the variable andrew OUTSIDE the routine?

That might be it, then again, I could be wrong.

(code trimmed out to point out lines in question)

Code:
void Default_Routine(void)
{
int shooter;
// aim up code... WOOT
// ok so find the value of pwm1 to line up the robot.. should be easy enough
static int Andrew = PAN_SERVO;
  #12   Spotlight this post!  
Unread 26-02-2006, 20:48
rodgadashruba rodgadashruba is offline
Registered User
FRC #0611
 
Join Date: Jan 2006
Location: McLean
Posts: 17
rodgadashruba is an unknown quantity at this point
Re: Finding servo location?

I thought that was it but shooter is declared..
i will try it out tho
  #13   Spotlight this post!  
Unread 26-02-2006, 20:55
rodgadashruba rodgadashruba is offline
Registered User
FRC #0611
 
Join Date: Jan 2006
Location: McLean
Posts: 17
rodgadashruba is an unknown quantity at this point
Re: Finding servo location?

wow alright.. so turns out i fail at remembering basic C...
had to declare Andrew at the top of default routines..
  #14   Spotlight this post!  
Unread 26-02-2006, 21:31
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Finding servo location?

Keep in mind this tells you where the servo is being commanded to go, not where it is, in most case they're synonomous, but if you're caught on something, or doing a lot of tracking this value could introduce lag which creates oscillations, making it worse, feedback loops, a constantly increasing error, all kinds of bad stuff. Just remember thats where it's trying to be and 98% of the time it should be there.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #15   Spotlight this post!  
Unread 26-02-2006, 21:45
ForgottenSalad's Avatar
ForgottenSalad ForgottenSalad is offline
In search of a home...
AKA: Michael Wessler
no team
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Bethlehem, NH
Posts: 136
ForgottenSalad will become famous soon enoughForgottenSalad will become famous soon enough
Send a message via AIM to ForgottenSalad
Re: Finding servo location?

Just out of curiosity, is there a better way, then?
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
Finding the *final* Servo Center values? Andrew Blair Programming 2 22-01-2006 18:02
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33
Servo command confusion?!?!?!?! [527]phil Programming 9 15-07-2005 20:10
Servo Compact Design Problems!!! Dominator_Legen Electrical 22 07-04-2005 18:15
Servo Help Dominator_Legen Motors 3 11-03-2005 19:50


All times are GMT -5. The time now is 22:59.

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