|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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)
|
|
#2
|
|||||
|
|||||
|
Re: Finding servo location?
that works
|
|
#3
|
||||||
|
||||||
|
Re: Finding servo location?
Code:
printf("Servo Location is... %d\r", (int)pwm01)
|
|
#4
|
||||
|
||||
|
Re: Finding servo location?
Quote:
|
|
#5
|
|||
|
|||
|
Re: Finding servo location?
Quote:
|
|
#6
|
|||||
|
|||||
|
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
|
|||
|
|||
|
Re: Finding servo location?
Quote:
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? |
|
#8
|
|||||
|
|||||
|
Re: Finding servo location?
Quote:
|
|
#9
|
|||
|
|||
|
Re: Finding servo location?
alright its attached
its down where it is commented out for the aim up code Last edited by rodgadashruba : 26-02-2006 at 20:29. |
|
#10
|
||||
|
||||
|
Re: Finding servo location?
Quote:
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;
|
|
#11
|
|||
|
|||
|
Re: Finding servo location?
I thought that was it but shooter is declared..
i will try it out tho |
|
#12
|
|||
|
|||
|
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.. |
|
#13
|
||||
|
||||
|
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.
|
|
#14
|
|||
|
|||
|
Re: Finding servo location?
Quote:
|
|
#15
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |