View unanswered posts | View active topics It is currently Wed Aug 27, 2014 9:32 pm






Reply to topic  [ 2 posts ] 
Servos not working? 
Author Message
Rookie

Joined: Wed Feb 17, 2010 10:55 am
Posts: 1
Post Servos not working?
Hi everyone!

Our team is trying to make use of a servo, but we are failing terribly. We can't tell if it is a hardware problem or software problem, nor can we find any solutions online, leaving us awfully confused.

Setup
We have a daisy chain with the Servo Controller for TETRIX going to S1 of the NXT, and then the Motor Controller for TETRIX connected to that. We have a DC motor attached in Motor 1 ofthe motor controller, and a servo in Channel 1 of the servo controller. Finally, we have a touch sensor attached to S2 of the NXT.

Code
Code:
#pragma config(Hubs,  S1, HTServo,  HTMotor,  none,     none)
#pragma config(Sensor, S2,     touch,               sensorTouch)
#pragma config(Motor,  mtr_S1_C2_1,     motorD,        tmotorNormal, openLoop)
#pragma config(Motor,  mtr_S1_C2_2,     motorE,        tmotorNormal, openLoop)
#pragma config(Servo,  srvo_S1_C1_1,    lol,                  tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  while(1 == 1)   //Loop forever
  {
    if(SensorValue[touch] == 1)   //If the touch sensor is pressed...
    {
      motor[motorD] = 25;         //...spin Motor D at 25% power...
      servo[lol] = 255;        //...and turn Servo 1 fully clockwise.
    }
    else                          //Else, the touch sensor isn't pressed...
    {
      motor[motorD] = 0;          //...turn Motor D off...
      servo[lol] = 0;          //...and turn Servo 1 fully counter-clockwise.
    }
  }
}


Problem
When the touch sensor is pressed, only the motor spins. The servo does absolutely nothing. In the Servo Control window in ROBOTC, the target value updates, and the "position" of the servo instantaneously jumps to the target value (this also happens when no servo is connected at all). We have tried using the standard setup, with the daisy chain beginning with the motor controller, but the results are identical. We think the servo is fine as when we plug it in to the servo controller it gives a little jolt. And the code we are using is slightly modified from the sample code that comes with ROBOTC. All of our flowcharting skills have failed at isolating the problem, so if anyone has insight, 'twould be highly appreciated.

Thanks a bunch!


Wed Feb 17, 2010 11:20 am
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 137
Post Re: Servos not working?
From your description, it certainly sounds like a possible hardware issue.

Some questions that come to mind:
Have you made sure the servo is plugged into the servo controller in slot 1 with the yellow wire facing up towards the comm ports?
Have you verified with a volt meter that the servo controller has power? (if you've daisy chained the power through to the motor controller, then I assume this isn't your problem.)
Have you tried switching out the servo with another?
Have you tried switching out the servo controller with another?


Wed Feb 17, 2010 2:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.