View unanswered posts | View active topics It is currently Fri Sep 19, 2014 6:11 pm






Reply to topic  [ 6 posts ] 
Servo won't work, but no error on NXT or in RobotC 
Author Message
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Servo won't work, but no error on NXT or in RobotC
For some reason, our servos won't work. I wired them correctly, and I tested them on my RC aircraft radio, but they still won't work.
Here is my code:

Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Motor,  motorA,          Arm1,          tmotorNormal, PIDControl)
#pragma config(Motor,  motorB,          Arm2,          tmotorNormal, PIDControl)
#pragma config(Motor,  motorC,          Arm3,          tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorNormal, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorNormal, openLoop)
#pragma config(Servo,  servo1,          wrist1,               tServoNormal)
#pragma config(Servo,  servo2,          wrist2,               tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

void startup()
{
  nxtDisplayCenteredTextLine(3, "Begin test mode?");
  while(nNxtButtonPressed == -1)
  {
    wait1Msec(1);
  }
  return;
}

void Servotest() <--this part won't work
{
  eraseDisplay();
  nxtDisplayCenteredTextLine(3, "Press square button");
  nxtDisplayCenteredTextLine(4, "to test system");
  while(nNxtButtonPressed == -1)
  {
    wait1Msec(1);
  }
  eraseDisplay();
  nxtDisplayCenteredTextLine(3, "IMMA FIRIN MAH...");
  servo[wrist1] = 255;
  servo[wrist2] = 0;
  ClearTimer(T1);
  while(time100[T1] < 10)
  {
    //do nothing
  }
  eraseDisplay();
  nxtDisplayCenteredBigTextLine(4, "...LAZAR!!!");
  servo[wrist1] = 128;
  servo[wrist2] = 128;
  wait10Msec(100);
  return;
}

void NXTtest()
{
  eraseDisplay();
  nxtDisplayCenteredTextLine(3, "So I heard you like");
  wait10Msec(100);
  eraseDisplay();
  nxtDisplayCenteredBigTextLine(4, "Never mind...");
  PlaySoundFile("! Startup.rso");
  wait10Msec(100);
  motor[Arm1] = 100;
  motor[Arm2] = 100;
  motor[Arm3] = 100;
  wait10Msec(50);
  motor[Arm1] = -100;
  motor[Arm2] = -100;
  motor[Arm3] = -100;
  wait10Msec(50);
  motor[Arm1] = 0;
  motor[Arm2] = 0;
  motor[Arm3] = 0;
  return;
}

task main()
{
  startup();
  Servotest();
  NXTtest();
}

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Sat Nov 22, 2008 5:32 pm
Profile WWW
Rookie

Joined: Sat Nov 22, 2008 7:14 pm
Posts: 12
Location: NJ
Post Re: Servo won't work, but no error on NXT or in RobotC
Do they work at all? Or just not with RobotC?

_________________
Ethan Spitz
Team 464 Programmer


Sat Nov 22, 2008 7:20 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 603
Post Re: Servo won't work, but no error on NXT or in RobotC
The code checks out fine. It drives my servo controller here.

Make sure you have 1.46, latest firmware loaded and your servo controller is wired and connected properly.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Nov 24, 2008 11:01 am
Profile
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: Servo won't work, but no error on NXT or in RobotC
Everything checks out, but the servos won't listen to the controler.

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Mon Nov 24, 2008 5:51 pm
Profile WWW
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: Servo won't work, but no error on NXT or in RobotC
Do you think it might be the controler? Everything on this side is up to date.
How can I test to see if my controler is faulty?

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Mon Nov 24, 2008 6:36 pm
Profile WWW
Novice

Joined: Mon Oct 13, 2008 6:29 pm
Posts: 75
Location: Florida, USA
Post Re: Servo won't work, but no error on NXT or in RobotC
make sure all your wires are in correctly, we had a problem where the servo variables would change, but the servos themselves would not move. this happened when the wires were reversed

_________________
PHUHS Robotics
Team 516 FTW

Daytona Robofest Winning Alliance Captain
Daytona Robofest Inspire Award


Tue Nov 25, 2008 12:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.